-
Notifications
You must be signed in to change notification settings - Fork 142
How to add activated ability (action)
Michael Speth edited this page Oct 18, 2017
·
1 revision
(Version 0.1.2)
R2-F2 is used as example
- New Action is created - R2F2Action.
- In "AttachToShip" we subscribe to Host's AfterGenerateAvailableActionsList event.
- In "R2F2AddAction" we create new instance of our new action and call host's "AddAvailableAction" to add our action to list of available actions. If ship is stressed or this action was already performed by ship, it will not be added to list of available actions.
R2F2Action:
- Initialized (name is set).
- In "ActionTake":
- Changes agility of player's current ship.
- Subscribes to Phases.OnEndPhaseStart to remove effect in the end phase.
- Assigns token "buff" to show that effect is active.
- When everything is done, Phases.CurrentSubPhase.CallBack) is called.
- "GetActionPriority" is used to set priority of action for AI.
- When on end of phase "R2F2DecreaseAgility" is called:
- Host's agility is changed back
- Token "buff" is removed
- This method is unsubscribed