Triggers
Triggers are certain events which cause code to run Sigils, Special Abilities and other Trigger Receivers that may not be tied to cards. They are the backbone of sigil code, allowing a modder to make their sigil easily react to certain changes taking place on the board and in the game in general.
Triggers are virtual methods inside of the TriggerReciever class, which Ability, SpecialCardBehaviour, and NonCardTriggerReciever all inherit from. Each trigger has a corresponding additional virtual method typically prefixed with 'RespondsTo', used to doubly inform a Trigger Receiver if it should really react to different situation. Any ability that uses a Trigger method must include an override of the corresponding RespondsTo method which returns true when the desired parameters for activation are met.
(For example, a card which only responds to other cards dying when it itself is on 1 HP would only return true in RespondsToOtherCardDie after a check to see if the base creature's health equals one.)
List of Triggers[edit | edit source]
Note that triggers are listed in the order that they appear in the Trigger enum.
Please also note that this list is currently incomplete
Trigger Method | 'RespondsTo' Method | Description | Arguments | Notes |
---|---|---|---|---|
OnUpkeep | RespondsToUpkeep | Activates at the start of each user's turn during combat. The opponent and the player both have separate upkeeps. Opponent upkeep triggers shortly before any cards on the opponent side of the board, while player upkeep triggers immediately after the player regains control (aka, immediately after the opponent's cards have stopped attacking).
While this means that player upkeep does technically occur at the start of the player's turn, it does not occur based on the turn bell, and as such may appear to happen at the end of the round. |
||
OnDrawn | RespondsToDrawn | Triggers when the effect bearer is added to the player's hand. |
| |
OnPlayFromHand | RespondsToPlayFromHand | Activates when the card bearing the effect is about to be placed into a slot, but shortly before it actually lands. Only activates on cards actually played from the player's hand, meaning cards created on the board do not trigger this. | ||
OnResolveOnBoard | RespondsToResolveOnBoard | Activates when the card bearing the trigger receiver is placed onto the board. | ||
OnOtherCardResolve | RespondsToOtherCardResolve | Triggers when another card is placed onto the board for the first time. |
| |
OnSacrifice | RespondsToSacrifice | Triggers when the card bearing the effect is sacrificed, just before it dies. | ||
OnSlotTargetedForAttack | RespondsToSlotTargetedForAttack | Triggers shortly before any card attempting to strike a slot actually strikes said slot. |
| |
OnCardGettingAttacked | RespondsToCardGettingAttacked | |||
OnTakeDamage | RespondsToTakeDamage | Triggers when the card bearing the effect suffers damage. Does not trigger if said damage was negated by the Armored sigil. | ||
OnDealDamage | RespondsToDealDamage | Triggers when the card bearing the effect deals damage to another card. Does not trigger if said damage was negated by the Armored sigil. | ||
OnAttackEnded | RespondsToAttackEnded | Triggers for each card on a specific side of the board after that side's turn in combat has ended. For example, after all four cards on the player's side of the board have completed their attack sequence, they will each run OnAttackEnded in the order in which they attacked. |
| |
OnOtherCardDie | RespondsToOtherCardDie | Triggers each time a card on the board perishes. |
| |
OnDie | RespondsToDie | Triggers when the card bearing the trigger receiver perishes. | ||
OnTurnEnd | RespondsToTurnEnd | Triggers at the end of each turn, including both the end of the player's turn and the end of the opponent's turn. | ||
OnOtherCardDrawn | RespondsToOtherCardDrawn | Triggers when any card is added to the player's hand. |
| |
OnPreDeathAnimation | RespondsToPreDeathAnimation | Activates shortly before the card bearing the effect is about to die, but before any animation has been played.
Cards do not need special death animations (like the Leaping Trap) for this to trigger. |
||
OnOtherCardAssignedToSlot | RespondsToOtherCardAssignedToSlot | Activates whenever another card on the board moves to a new slot, including both when it is initially played, and when moved by effects such as Sprinter. |
| |
OnOtherCardPreDeath | RespondsToOtherCardPreDeath | |||
OnActivatedAbility | RespondsToActivatedAbility | |||
OnOtherCardDealtDamage | RespondsToOtherCardDealtDamage | Triggers when any card on the board (including the effect bearer if it is a card) suffers damage. Does not trigger if said damage was negated by the Armored sigil. | ||
OnDealDamageDirectly | RespondsToDealDamageDirectly |