Triggers

From Inscryption Modding Wiki
Revision as of 10:09, 10 February 2022 by 108.162.250.27 (talk) (added)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

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 shortly before any cards attack during a combat phase. Player upkeep triggers shortly after the turn bell is rung, and opponent upkeep triggers after all player cards have finished their attack, but shortly before any enemy cards attack.
OnDrawn RespondsToDrawn Triggers when the effect bearer is added to the player's hand.
  • Used by sigils such as Amorphous to add random sigils to the bearer on draw.
  • Is not exclusive to cards drawn from decks, cards added directly to the hand from various effects also trigger this, which is why the Amoeba re-randomises each time it is re-added to the hand with effects like Undying.
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
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.
  • Used by sigils such as Burrower to allow their bearers to move into the way of oncoming attacks.
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.
  • Does not activate if the card dies before the end of the combat phase.
OnOtherCardDie RespondsToOtherCardDie
  • This does not respond to cards that are still in the player's hand perishing, however cards dying in the hand causes far more issues than just this, and should be avoided anyways.
OnDie RespondsToDie
OnTurnEnd RespondsToTurnEnd
OnOtherCardDrawn RespondsToOtherCardDrawn Triggers when any card is added to the player's hand.
  • Is not exclusive to cards drawn from decks, cards added directly to the hand from various effects also trigger this.
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.
  • Does not activate if, for some reason, the slot the card moves to is the same as it's starting slot.
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