-
Notifications
You must be signed in to change notification settings - Fork 142
How to add triggered ability
Michael Speth edited this page Oct 18, 2017
·
1 revision
(Version 0.1.2)
R2-D2 is used as example
- In "AttachToShip" we subscribe to Host's OnMovementExecuted event
- "R2D2PlanRegenShield" - we check are conditions are correct (maneuver color is green, shields are not at maximum value) and register trigger.
- Trigger has name "R2-D2: Regen Shield", owner of decision is set to ship's owner, EventHandler is set.
- When Triggers.ResolveTriggers is called, if this trigger is only one was registered for player, then it will be automaticaly resolved. Otherwise, window "Select order of triggers" will be shown.
- "R2D2RegenShield" is called - Host tries to regenerate 1 shield, gives feedback if success. When everything is done, "Triggers.FinishTrigger" is called.