Skip to content

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

  1. In "AttachToShip" we subscribe to Host's OnMovementExecuted event
  2. "R2D2PlanRegenShield" - we check are conditions are correct (maneuver color is green, shields are not at maximum value) and register trigger.
  3. Trigger has name "R2-D2: Regen Shield", owner of decision is set to ship's owner, EventHandler is set.
  4. 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.
  5. "R2D2RegenShield" is called - Host tries to regenerate 1 shield, gives feedback if success. When everything is done, "Triggers.FinishTrigger" is called.