-
Notifications
You must be signed in to change notification settings - Fork 142
Abilities
Sandrem edited this page Dec 25, 2017
·
6 revisions
(For version 0.3.2)
Use "GenericAbility" class to create new ability.
Pilots and Upgrades can be assigned list of abilities. Usually they have only one ability. Exceptions:
- Pilots like Thweek and IG-88 pilots with IG-2000 title that gain second ability.
- HotAC campaign pilots that gain new abilities during progression.
Ability has two mandatory methods:
- ActivateAbility This method is called to activate ability when match is started. Usually it subscribes to some events.
- DeactivateAbility This method is called to deactivate ability when ship is destroyed or match is ended. Usually it unsubscribes from previously subscribed events.
Public properties:
- Name - is generated automatically, "'s ability".
- IsAppliesConditionCard - is checked by Thweek's ability.
- HostShip - if ability is attached to ship, return this ship. If ability is attached to upgrade, returns ship where this upgrade is installed.
- HostUpgrade - if ability is attached to upgrade, return this upgrade. IF ability is attached to ship, returns null.
- HostReal - object, GenericShip for ability of ship or GenericUpgrade for ability of upgrade.
Protected properties:
- IsAbilityUsed - by default don't used, can be used to prevent second use of ability.
Protected methods:
- RegisterAbilityTrigger - more simple way to register Triggers. Don't use is this trigger must be resolved by opponent.
- Parameter "EventHandler eventHandler": Value of "Sender" is "HostReal". When everything is done, call "Triggers.FinishTrigger();" to finish Trigger.
- AskToUseAbility - more simple way to handle "Decision Subphase".
- Parameter "EventHandler useAbility" has delegate that is called if player answers "Yes". When everything is done, call "DecisionSubPhase.ConfirmDecision();" to finish "Decision Subphase" and call callback.
- Parameter "Func useByDefault" is used for AI to determine what decision will be chosen. If ability always will be used by AI, you can use delegate "AlwaysUseByDefault", if never - "NeverUseByDefault".
- Parameter "Action callback" has defaut value Triggers.FinishTrigger, should be changed if decision doesn't finish Trigger.
- SelectTargetForAbility - more simple wat to handle "Select Ship Subphase"
- Parameter "System.Action selectTargetAction" has delegate that is called when player selected ship. Use "TargetShip" to get this ship. When everything is done, call "SelectShipSubPhase.FinishSelection();" to finish "Select Ship Subphase" and call callback.
- Parameter "Action callback" has defaut value Triggers.FinishTrigger, should be changed if decision doesn't finish Trigger.