Triggers

From Inscryption Modding Wiki
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[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.
  • 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 Triggers when another card is placed onto the board for the first time.
  • Used by sigils such as Guardian to move to new cards as they are played on the board.
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 Triggers each time a card on the board perishes.
  • 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 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.
  • 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