# Drawstep AI pack (Magic) — part 9 of 15: Triggers & conditions > TriggerDef, every trigger event with one line each, and every condition. Pack index: https://drawstep.xyz/wiki/mtg/pack.md · previous: https://drawstep.xyz/wiki/mtg/pack/statics-replacements-2.md · next: https://drawstep.xyz/wiki/mtg/pack/values-costs.md · everything in one document: https://drawstep.xyz/wiki/drawstep-mtg-ai-pack.md. Generated from Drawstep's card schema; field names and discriminators are exact. ## Triggers (`TriggerDef`) Used as `{ kind: "triggered", trigger: {…}, effects: […] }`. | Field | Type | Required | Description | |---|---|---|---| | `causedBy` | `"opponent"` | no | CR 701.9a, 603.2: the event was caused by a spell or ability an opponent of this ability's controller controls ("a spell or ability an opponent controls causes you to discard", "… destroys a noncreature permanent you control"); costs and game rules cause nothing. Player selector causeController is that spell's or ability's controller | | `cycleOrDiscard` | `boolean` | no | CR 702.29c: render a discards trigger as cycle or discard; cycling discards once, so no separate cycled event is listened to | | `oneOrMore` | `boolean` | no | CR 603.2c, 510.2: one trigger per simultaneous entry, departure, death, zone change, exile, discard, mill, sacrifice, token creation, counter placement, tap, attack, or block event. triggering selects the whole matching group; triggeringCount records its size. Combat damage to players groups separately per damaged player; for isDealtDamage, simultaneous combat damage received by the subject is one trigger with the total amount (first strike and regular damage are separate events). That is the default for every isDealtDamage trigger that has no other / by and whose effects don't read triggeringOther: a creature blocked by two creatures triggers once (Boros Reckoner, Wrathful Raptors). Set oneOrMore: false to keep one trigger per damage source. For dealsDamage / dealsCombatDamage, "one or more deal damage" groups the simultaneous damage of the matching sources (Francisco, Fowl Marauder) | | `oneOrMoreRecipients` | `boolean` | no | CR 603.2c, 120.2b: dealsDamage / dealsCombatDamage — "deals damage to one or more ": one trigger per damage event of each matching source, however many recipients that event dealt damage to (Red Terror, Briarbridge Patrol). The source is still singular ("a red source you control") | | `perPlayer` | `boolean` | no | CR 603.2c, 508.1: group matching attackers by attacked player, unblocked attackers by attacking player; for discards, sacrificed and tokenCreated group by the acting player (a player discards one or more cards) | | `acrossPlayers` | `boolean` | no | CR 603.2c: with oneOrMore on dealsCombatDamageToPlayer or milled, triggeringPlayer includes every player affected by the simultaneous event | | `damageTo` | `"you" \| "opponent" \| "any" \| "playerOrBattle" \| "playerOrPlaneswalker" \| "enchantedPlayer" \| "grantor"` | no | CR 603.1, 120.1: damage recipient must be a player with this relation to the ability controller (any: any player); playerOrBattle / playerOrPlaneswalker also accept damage dealt to a battle / planeswalker. grantor: the player who controlled the effect that granted this ability ("the player who cast Hellish Rebuke"), fixed as the grant resolved (CR 611.2c). Relations are to this ability's controller, not to the damage source | | `abilityEvent` | `"enters" \| "leaves" \| "dies" \| "attacks" \| "attacksAlone" \| "enlists" \| "blocks" \| "becomesBlocked" \| "dealsCombatDamage" \| "dealsCombatDamageToPlayer" \| "dealsDamage" \| "isDealtDamage" \| "damagePrevented" \| "castSpell" \| "state" \| "upkeep" \| "drawStep" \| "precombatMain" \| "postcombatMain" \| "mainPhase" \| "beginCombat" \| "declareAttackersStep" \| "endStep" \| "cleanupStep" \| "landfall" \| "crimeCommitted" \| "expend" \| "lifeGained" \| "lifeLost" \| "playerLost" \| "discards" \| "milled" \| "sacrificed" \| "destroyed" \| "becomesTapped" \| "becomesUntapped" \| "controlLost" \| "countersPlaced" \| "countersRemoved" \| "becomesTarget" \| "chapter" \| "cycled" \| "foretold" \| "plotted" \| "scried" \| "surveilled" \| "proliferated" \| "transformed" \| "specializes" \| "conjured" \| "sought" \| "turnedFaceUp" \| "drawsCard" \| "revealedFirstDraw" \| "tokenCreated" \| "mutates" \| "becomesDay" \| "becomesNight" \| "dayNightChanges" \| "copiedSpell" \| "becameMonarch" \| "lostGame" \| "ringTempted" \| "tookInitiative" \| "ventured" \| "completedDungeon" \| "designated" \| "endCombat" \| "unblocked" \| "exiled" \| "countered" \| "phasedIn" \| "speedIncreased" \| "reachedMaxSpeed" \| "explored" \| "connived" \| "evolves" \| "fights" \| "amassed" \| "investigated" \| "collectedEvidence" \| "discovered" \| "giftGiven" \| "paired" \| "becameSaddled" \| "becameCrewed" \| "levelGained" \| "solved" \| "roomUnlocked" \| "doorUnlocked" \| "zoneChange" \| "coinFlipped" \| "dieRolled" \| "clashed" \| "diceRolled" \| "youAttack" \| "visited" \| "attractionOpened" \| "cranked" \| "contraptionAssembled" \| "stickerPlaced" \| "facedDilemma" \| "setInMotion" \| "tappedForMana" \| "manaProduced" \| "activatesAbility" \| "abilityTriggered" \| "landPlayed" \| "phasedOut" \| "shufflesLibrary" \| "searchesLibrary" \| "crews" \| "saddles" \| "lifePaid" \| "attached" \| "unattached"` | no | CR 603.2: abilityTriggered only — the event that caused the triggered ability, which must concern the ability's source ("a creature entering … causes a triggered ability of that creature to trigger": enters) | | `event` | `"enters" \| "leaves" \| "dies" \| "attacks" \| "attacksAlone" \| "enlists" \| "blocks" \| "becomesBlocked" \| "dealsCombatDamage" \| "dealsCombatDamageToPlayer" \| "dealsDamage" \| "isDealtDamage" \| "damagePrevented" \| "castSpell" \| "state" \| "upkeep" \| "drawStep" \| "precombatMain" \| "postcombatMain" \| "mainPhase" \| "beginCombat" \| "declareAttackersStep" \| "endStep" \| "cleanupStep" \| "landfall" \| "crimeCommitted" \| "expend" \| "lifeGained" \| "lifeLost" \| "playerLost" \| "discards" \| "milled" \| "sacrificed" \| "destroyed" \| "becomesTapped" \| "becomesUntapped" \| "controlLost" \| "countersPlaced" \| "countersRemoved" \| "becomesTarget" \| "chapter" \| "cycled" \| "foretold" \| "plotted" \| "scried" \| "surveilled" \| "proliferated" \| "transformed" \| "specializes" \| "conjured" \| "sought" \| "turnedFaceUp" \| "drawsCard" \| "revealedFirstDraw" \| "tokenCreated" \| "mutates" \| "becomesDay" \| "becomesNight" \| "dayNightChanges" \| "copiedSpell" \| "becameMonarch" \| "lostGame" \| "ringTempted" \| "tookInitiative" \| "ventured" \| "completedDungeon" \| "designated" \| "endCombat" \| "unblocked" \| "exiled" \| "countered" \| "phasedIn" \| "speedIncreased" \| "reachedMaxSpeed" \| "explored" \| "connived" \| "evolves" \| "fights" \| "amassed" \| "investigated" \| "collectedEvidence" \| "discovered" \| "giftGiven" \| "paired" \| "becameSaddled" \| "becameCrewed" \| "levelGained" \| "solved" \| "roomUnlocked" \| "doorUnlocked" \| "zoneChange" \| "coinFlipped" \| "dieRolled" \| "clashed" \| "diceRolled" \| "youAttack" \| "visited" \| "attractionOpened" \| "cranked" \| "contraptionAssembled" \| "stickerPlaced" \| "facedDilemma" \| "setInMotion" \| "tappedForMana" \| "manaProduced" \| "activatesAbility" \| "abilityTriggered" \| "landPlayed" \| "phasedOut" \| "shufflesLibrary" \| "searchesLibrary" \| "crews" \| "saddles" \| "lifePaid" \| "attached" \| "unattached"` | yes | Which event is counted | | `by` | `"you" \| "opponent" \| "any" \| "notYou" \| "hostController" \| "enchantedPlayer" \| "chosenPlayer"` | no | Whose action/step: you, an opponent, anyone, the enchanted permanent's current controller, the enchanted player, or the player chosen as the source entered (CR 303.4, 503.1, 603.2b, 607.2d) | | `together` | `boolean` | no | CR 805.4d: a step trigger worded for the players whose turn it is together — "at the beginning of your opponents' end step, they …" (by: opponent). With shared team turns it triggers once for the active team and triggeringPlayer ("they") is every player of it: counts add up and a cost they may pay is paid by the team together from all their permanents. Otherwise it reads like each opponent's step | | `filter` | `ObjectFilter` | no | Which object the event concerns (self: true for "when ~") | | `damageKind` | `"combat" \| "noncombat"` | no | CR 603.2, 120.1: constrain a damage event to combat or noncombat damage | | `damagedPlayer` | `"you" \| "opponent" \| "any" \| "notYou"` | no | Legacy alias of damageTo for dealsDamage / isDealtDamage (older custom cards): the damaged player must have this relation to the ability's controller; permanent damage does not match. New cards use damageTo | | `targets` | `ObjectFilter` | no | For castSpell / activatesAbility: the spell or ability targets at least one matching object; triggers once regardless of how many targets match (CR 603.2, 601.2c, 602.2b). With targetsPlayer, either suffices | | `targetsOnly` | `ObjectFilter` | no | CR 601.2c, 602.2b, 115.1: castSpell / activatesAbility — "a spell that targets only ": it has one or more targets, none a player or stack object, all the same object, which matches this filter ("targets only Zada", "targets only a single creature you control"). Choosing that object for each instance of "target" still qualifies | | `targetsPlayer` | `"you" \| "opponent" \| "any" \| "notYou"` | no | CR 115.1, 601.2c: castSpell / activatesAbility — the spell or ability targets at least one player with this relation to this ability's controller ("a spell that targets you or a creature you control": you, with targets; either suffices) | | `minTargets` | `number` | no | CR 115.1, 601.2c: castSpell — the spell has at least this many targets, counting each instance of the word target ("a spell with one or more targets"); value triggering targets reads how many | | `spellOrdinal` | `number` | no | CR 601.2i, 603.2: this player's Nth spell matching filter this turn; checked when cast, including spells cast before this source entered | | `totalSpells` | `boolean` | no | CR 601.2i, 603.2: spellOrdinal counts every player's spells this turn ("the fourth spell of a turn is cast", "the first noncreature spell of a turn is cast") | | `threshold` | `number` | no | CR 700.14: expend N triggers when a mana payment to cast a spell crosses N mana spent casting spells this turn | | `other` | `ObjectFilter` | no | The other object of the event must match — for blocks the creature blocked, for becomesBlocked the blocking creature, for dealsDamage the permanent dealt damage, for isDealtDamage the damage's source, for explored the card revealed ("explores a land card", CR 701.44a) ("whenever ~ becomes blocked by a creature"). The ability triggers once per matching object; target mode triggeringOther is that object | | `chapter` | `number` | no | Saga chapter number this trigger belongs to (`event: "chapter"`) | | `finalChapter` | `boolean` | no | CR 714.2c: a chapter trigger on the final chapter of a Saga that `filter` matches ("the final chapter ability of a Saga you control triggers") | | `minAmount` | `number` | no | CR 120.4: minimum damage actually dealt in this event after prevention and replacement | | `excess` | `boolean` | no | CR 120.4a: isDealtDamage with damageKind noncombat — only a permanent dealt excess damage (beyond lethal) in this event; triggerAmount is the excess ("is dealt excess noncombat damage, amass Orcs X, where X is that excess damage") | | `minCount` | `number` | no | CR 603.2c: with oneOrMore, the simultaneous event must include at least this many matching objects ("When four or more creatures attack you") | | `targetPlayer` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "replacedPlayer" \| "damageSourceController" \| "causeController" \| "affectedController" \| "affectedOwner" \| "triggeringController" \| "triggeringOwner" \| "triggeringOtherController" \| "triggeringOtherOwner" \| "current" \| "previousPlayer" \| "mostLife" \| "leastLife" \| "mostCardsInHand" \| "fewestCardsInHand" \| "enchantedPlayer" \| "yourTeam" \| "chosenPlayer" \| "playerToYourLeft" \| "playerToYourRight" \| "attackedPlayers" \| "attackingOpponents" \| "attackedBySourceThisTurn" \| "attackedBySourceLastCombat" \| object` | no | CR 603.2e, 115.1: becomesTarget for a player — the selected player becomes the target of a spell or ability ("When the chosen player … becomes the target of a spell or ability") | | `targetPermanent` | `boolean` | no | CR 110.1, 603.2e: becomesTarget only for an object on the battlefield; excludes graveyard cards and spells | | `targetedBy` | `"spell" \| "ability"` | no | CR 115.1, 603.2e: kind of stack object newly targeting the subject; other can filter that object's source | | `equipOnly` | `boolean` | no | CR 702.6: only an attachment made by resolving an equip ability | | `damageAbilityOnly` | `boolean` | no | For activatesAbility, require a damage instruction in the announced ability. For dealsDamage, require damage dealt directly by a resolving activated ability of that source | | `counter` | `string` | no | CR 122.1: counter kind required for a countersPlaced / countersRemoved trigger | | `eachCounter` | `boolean` | no | CR 603.2c, 122.6: trigger once for each counter placed / removed, rather than once per batch | | `lastCounter` | `boolean` | no | CR 122.1, 702.62a: countersRemoved — only a removal that left none of counter on the object ("When the last time counter is removed from this card") | | `placedBy` | `"you" \| "opponent" \| "any" \| "notYou"` | no | CR 122.1, 609.4: countersPlaced — the player who put the counters (controller of the spell or ability that put them), relative to this ability's controller; may differ from the permanent's controller | | `permanentOrPlayer` | `boolean` | no | CR 122.1, 110.1: countersPlaced "on a permanent or player" — counters put on a player qualify, and an object only while it is a permanent (not a card in exile or on the stack). With oneOrMore, each permanent or player given counters in one simultaneous event triggers once | | `performedBy` | `"you" \| "opponent" \| "any" \| "notYou"` | no | CR 603.2, 608.2: the player who performed the action, relative to this ability's controller — becomesTapped: who tapped it (the controller of the spell or ability whose effect tapped it, otherwise the player tapping it for a cost or an attack: "Whenever you tap an untapped creature an opponent controls"); turnedFaceUp: who turned it face up ("Whenever you turn a permanent face up"). May differ from the permanent's controller | | `ownLibrary` | `boolean` | no | CR 701.23: searchesLibrary only when the searching player searches their own library, including failing to find | | `level` | `number` | no | CR 716.2: Class level just reached for levelGained | | `thisDoor` | `boolean` | no | CR 709.5: for doorUnlocked, "When you unlock this door" — only the unlocking of the half printing this ability | | `designation` | `string` | no | For event = designated: which designation | | `from` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | CR 603.6: for zoneChange or enters, origin zone (omit for any origin); for castSpell, the zone the spell was cast from | | `notTo` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | CR 603.6c, 700.4: exclude this destination from leaves; notTo graveyard means without dying | | `fromZones` | `("battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command")[]` | no | CR 603.6, 603.2c: any of these origin zones qualifies for the same zone-change trigger; oneOrMore batches across all origins (Laelia) | | `to` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | For event = zoneChange: destination zone | | `notFrom` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | CR 603.6a: exclude this origin zone for enters, castSpell or zoneChange (paradox, Disa the Restless) | | `resolutionGroup` | `string` | no | CR 608.2: event alternatives of one printed ability share this resolution counter | | `condition` | `ConditionDef` | no | A ConditionDef that must hold | | `eventCondition` | `ConditionDef` | no | Restriction checked only when the event occurs, such as during your turn or while you control a Dinosaur (CR 603.2); not an intervening if | | `firstEachTurn` | `boolean` | no | Triggers only the first time each turn (valiant) | | `onceEachTurnGroup` | `string` | no | CR 603.2: shared limiter for event alternatives of the same printed ability | | `onceEachTurn` | `boolean` | no | CR 101.1, 603.2: this ability triggers only once each turn, regardless of extra trigger effects | | `onceEachCombat` | `boolean` | no | This ability can trigger once in each combat phase, including additional combats | | `maxTriggersPerTurn` | `number` | no | CR 101.1, 603.2: caps the number of times this ability triggers each turn, including additional triggers | | `exceptFirstInDrawStep` | `boolean` | no | drawsCard: "except the first one they draw in each of their draw steps" (Orcish Bowmasters) — the first card the active player draws in their draw step doesn't trigger it | | `highestNatural` | `boolean` | no | CR 706.2, 603.2: dieRolled — the die's natural result (before modifiers) was its highest, a d20's 20 ("Whenever you roll a die's highest natural result"); ignored rolls don't count | | `exceptAttackDeclaration` | `boolean` | no | CR 508.1f, 603.2: becomesTapped — a creature tapped because it is being declared as an attacker doesn't trigger it ("if it isn't being declared as an attacker") | | `payment` | `{ for?: "spell" \| "ability"; source?: ObjectFilter; notOwnAbility?: boolean }` | no | CR 118.3, 601.2h, 602.2b: the event was a payment — for sacrificed, "to pay a cost"; lifePaid always is | | `onlyOnce` | `boolean` | no | "This ability triggers only once.": triggers once for this object across turns and controllers; a zone change makes a new object that can trigger again (CR 400.7) | | `oncePerBattle` | `boolean` | no | Campaign: triggers once per physical card instance across turns and zone changes | | `manaTypes` | `string[] \| "chosen"` | no | CR 106.1b, 605.1b: for tappedForMana or manaProduced, the actual production includes a listed mana type, or this source's chosen color | | `abilityKind` | `"nonMana" \| "loyalty" \| "boast" \| "exhaust" \| "ninjutsu" \| "powerUp" \| "crew" \| "saddle" \| "cycling" \| "outlast" \| "embalm" \| "eternalize"` | no | CR 602.2, 605.1a, 606.3: for activatesAbility, the kind of activated ability: nonMana ("that isn't a mana ability"), loyalty, or a keyword ability's activation (boast, exhaust, ninjutsu, powerUp, crew, saddle, cycling) | | `stickerKind` | `"name" \| "art" \| "ability" \| "pt"` | no | CR 123.3 (Unfinity): for stickerPlaced, only a sticker of this kind ("put an ability sticker on a creature") | Events (`event`): - `enters` — An object entered the battlefield (`filter.self` for “when ~ enters”). - `leaves` — An object left the battlefield. - `dies` — A creature was put into a graveyard from the battlefield. - `attacks` — A creature was declared as an attacker. - `attacksAlone` — A creature attacked alone. - `enlists` — Whenever a creature enlists another creature (CR 702.154). - `blocks` — A creature was declared as a blocker. - `becomesBlocked` — An attacking creature became blocked. - `dealsCombatDamage` — An object dealt combat damage. - `dealsCombatDamageToPlayer` — An object dealt combat damage to a player. - `dealsDamage` — An object dealt damage (any kind). - `isDealtDamage` — An object was dealt damage. - `damagePrevented` — Whenever damage that would be dealt to you is prevented — once per prevention effect for simultaneous damage (CR 615.13). - `castSpell` — A player cast a spell (`by`, `filter`, `from` / `notFrom`). - `state` — A state trigger (CR 603.8): triggers whenever `eventCondition` is true and the ability isn't already on the stack ("when you control no Islands, sacrifice ~"). Requires `eventCondition`. - `upkeep` — Beginning of an upkeep step (`by: you` for yours). - `drawStep` — Beginning of a draw step. - `precombatMain` — Beginning of a precombat main phase. - `postcombatMain` — Beginning of a postcombat main phase. - `mainPhase` — At the beginning of a main phase (either one; `by` scopes it to whose turn). - `beginCombat` — Beginning of combat. - `declareAttackersStep` — At the beginning of the declare-attackers step ("at the beginning of the declare attackers step on each opponent's turn"). - `endStep` — Beginning of an end step. - `cleanupStep` — At the beginning of the cleanup step. - `landfall` — A land entered under a player's control. - `crimeCommitted` — Whenever a player commits a crime: targets an opponent, their permanents or cards in their graveyard with a spell, ability activation or trigger (CR 700.13). - `expend` — Whenever you expend N — spend your Nth total mana on spells this turn (`threshold`, CR 700.14). - `lifeGained` — A player gained life. - `lifeLost` — A player lost life. - `playerLost` — Whenever a player (`by`) loses the game, for any reason, seen after they have left a game that goes on (CR 104.3, 800.4a): "whenever a player / an opponent loses the game". A subject read through the source ("when enchanted player loses the game") is `lostGame`. - `discards` — A player discarded a card. - `milled` — Whenever a card is milled (CR 701.17; `oneOrMore` treats a simultaneous mill as one event). - `sacrificed` — A player sacrificed a permanent. - `destroyed` — Whenever a permanent is destroyed — by an effect or by lethal damage (CR 701.8a, 704.5g) — looking back at it on the battlefield; `causedBy: "opponent"` for "a spell or ability an opponent controls destroys …" (its controller is the selector `causeController`). - `becomesTapped` — An object became tapped. - `becomesUntapped` — An object became untapped. - `controlLost` — Whenever control of the object changes away from its controller ("when you lose control of ~"). - `countersPlaced` — Counters were put on an object. - `countersRemoved` — Whenever counters are removed from a permanent (`who` = its controller; `counter` narrows the kind). - `becomesTarget` — An object became the target of a spell or ability. - `chapter` — A Saga's chapter ability (`chapter: N`). - `cycled` — This card was cycled. - `foretold` — Whenever a card is foretold (exiled face down with foretell). - `plotted` — When a card becomes plotted — exiled by the plot special action (CR 702.170a); the card sees it from exile (`filter: { self: true }`). - `scried` — Whenever a player scries (after the scry, even of an empty library; scry 0 doesn't trigger). - `surveilled` — Whenever a player surveils. - `proliferated` — Whenever a player proliferates (even if nothing was chosen). - `transformed` — An object transformed. - `specializes` — Whenever a permanent specializes (Alchemy). - `conjured` — Whenever a player (`by`) conjures cards (Alchemy; a spellbook draft is not conjuring). `oneOrMore` triggers once per conjure; `filter` narrows the cards. - `sought` — Whenever a player (`by`) seeks cards (Alchemy); `oneOrMore` triggers once per seek. - `turnedFaceUp` — An object was turned face up. - `drawsCard` — A player drew a card. - `revealedFirstDraw` — Whenever the controller reveals the first card they draw each turn under a `revealFirstDraw` rule (CR 701.20a; Primitive Etchings, Inquisitor Eisenhorn); the triggering object is the revealed card. - `tokenCreated` — A token was created. - `mutates` — Whenever this creature mutates (a mutating spell merges with it). - `becomesDay` — Whenever it becomes day. - `becomesNight` — Whenever it becomes night. - `dayNightChanges` — Whenever day becomes night or night becomes day. - `copiedSpell` — Whenever a player copies a spell. - `becameMonarch` — Whenever a player becomes the monarch. - `lostGame` — When a player read through the source (`by`: enchanted / the chosen player) loses the game — as they lose, before they leave, so the Curse still sees who it enchants (CR 104.3, 800.4a). Any other subject is `playerLost`. - `ringTempted` — Whenever the Ring tempts a player. - `tookInitiative` — Whenever a player takes the initiative. - `ventured` — Whenever a player ventures into the dungeon. - `completedDungeon` — Whenever a player completes a dungeon. - `designated` — An object gained a designation (`designation`: goaded, exerted, …). - `endCombat` — At end of combat (the end-of-combat step). - `unblocked` — Whenever an attacking creature becomes unblocked (no blockers were declared for it). - `exiled` — Whenever an object is put into exile (from any zone; `from` narrows it). - `countered` — Whenever a spell is countered. - `phasedIn` — Whenever a permanent phases in. - `speedIncreased` — Whenever a player's speed increases (Start your engines!). - `reachedMaxSpeed` — Whenever a player reaches max speed. - `explored` — Whenever a creature explores. - `connived` — Whenever a creature connives. - `evolves` — Whenever a creature evolves — its evolve ability resolved and put +1/+1 counters on it (CR 702.100d). - `fights` — Whenever a creature fights another (`other` narrows the opponent, CR 701.14); each fighter is its own event. - `amassed` — Whenever a player amasses. - `investigated` — Whenever a player (`by`) investigates — once per investigation ("investigate twice" is two events, CR 701.16a). - `collectedEvidence` — Whenever a player (`by`) collects evidence — exiles cards with the needed total mana value from their graveyard (CR 701.59a); not when they couldn't or declined. - `discovered` — Whenever a player (`by`) discovers N (CR 701.57a); `triggerAmount` is N, also when no card was found. - `giftGiven` — Whenever a player (`by`) gives a gift they promised (CR 702.174a); the triggering player is the giver. - `paired` — Whenever a creature becomes paired (soulbond). - `becameSaddled` — Whenever a Mount becomes saddled. - `becameCrewed` — Whenever a Vehicle becomes crewed — one of its crew abilities resolved, even if it already was a creature (CR 702.122b); `triggerAmount` is the number of creatures tapped to crew it. - `levelGained` — Whenever a Class gains a level (`level` = the level reached). - `solved` — Whenever a Case becomes solved. - `roomUnlocked` — Whenever a Room becomes fully unlocked. - `doorUnlocked` — Whenever a door of a Room is unlocked (`thisDoor` for the half printing the ability). - `zoneChange` — Any zone change, narrowed with `from` / `to`. - `coinFlipped` — Whenever a player flips a coin. - `dieRolled` — Whenever a player rolls a die (once per die). - `clashed` — Whenever a player (`by`) clashes — both players of a clash do, whoever began it (CR 701.30); `triggerAmount` is 1 when that player won ("whenever you clash and win"). - `diceRolled` — Whenever a player rolls one or more dice (once per roll instruction). - `youAttack` — A player attacked with one or more creatures (once per combat). - `visited` — An Attraction was visited (“Visit —”). - `attractionOpened` — Whenever a player opens an Attraction. - `cranked` — Whenever a Contraption is cranked. - `contraptionAssembled` — Whenever a player assembles a Contraption. - `stickerPlaced` — Whenever a sticker is put on a permanent. - `facedDilemma` — Whenever a player faces a villainous choice. - `setInMotion` — When a scheme is set in motion (Archenemy). - `tappedForMana` — Whenever a permanent is tapped for mana (a {T} mana ability, CR 605.1b). - `manaProduced` — Whenever an ability produces mana, land abilities without {T} included (CR 106.3, 605.1b; `manaTypes` filters the mana made). - `activatesAbility` — Whenever a player activates an ability (`abilityKind` narrows it: nonMana, loyalty, boast, …). - `abilityTriggered` — Whenever a triggered ability of a matching source (`filter`) is put on the stack because of `abilityEvent` — an event that concerns that source ("a creature entering under an opponent's control causes a triggered ability of that creature to trigger", CR 603.2); `triggeringOther` is that ability, so `copyAbility` can copy it. - `landPlayed` — Whenever a player plays a land. - `phasedOut` — Whenever a permanent phases out. - `shufflesLibrary` — Whenever a player shuffles their library. - `searchesLibrary` — Whenever a player searches a library, even if nothing is found (CR 701.23; `ownLibrary`: their own). - `crews` — Whenever a creature crews a Vehicle. - `saddles` — Whenever a creature saddles a Mount. - `lifePaid` — Whenever a player pays life. - `attached` — Whenever an Aura, Equipment or Fortification becomes attached to a permanent. - `unattached` — Whenever an Aura, Equipment or Fortification becomes unattached from a permanent (CR 701.3), looking back at the former host. Conventions: "When ~ enters" = `{ event: "enters", filter: { self: true } }`; "Whenever a creature you control dies" = `{ event: "dies", filter: { types: ["Creature"], controller: "you" } }`; "At the beginning of your upkeep" = `{ event: "upkeep", by: "you" }`; "Whenever you cast a noncreature spell" = `{ event: "castSpell", by: "you", filter: { notTypes: ["Creature"] } }`; Saga chapters = `{ event: "chapter", chapter: 2 }`; landfall = `{ event: "landfall", by: "you" }`. ## Conditions (`ConditionDef`, discriminator `kind`) Used by `if` effects, `trigger.condition` (intervening if), static `condition` ("as long as"), activated `onlyIf`, replacement `unless`. - `native` — A predicate evaluated by the engine. Engine-implemented node: `id` names an implementation the game module registers; cards contain no code, and an id the running engine doesn't know rejects the card. `text` is the printed clause shown wherever the card is described. Fields: `id`: string — Registry id of an implementation this engine ships ("magic.keepOnePerTypeSacrificeRest"); the native page of each kind lists every id that exists. Never invent one; `params?`: object — Parameters the registered implementation validates and reads; each registered id documents its own; `text?`: string — The printed clause this condition stands for. - `kicked` — Kicker was paid when the source, or the triggering spell, was cast (CR 702.33). Fields: `of?`: "triggering" — Which variant of the value is read; `kicker?`: string — CR 702.33b, 702.33f: "if it was kicked with its {1}{U} kicker" on a card with two kicker costs — the printed mana cost of the linked kicker ability; true only when that cost was paid. - `bargained` — CR 702.166, 601.2b: the source or triggering spell was bargained; remembers the actual casting choice after the spell leaves the stack. Fields: `of?`: "triggering" — Which variant of the value is read. - `costPaidMatches` — CR 601.2h, 602.2b, 608.2h: exactly one object was sacrificed / discarded to pay this spell's or ability's cost and its characteristics immediately before the payment match the filter ("if the sacrificed creature was a Human", "if the discarded card was a creature card"). Fields: `cost`: "sacrifice" | "discard" | "returnToHand" — Which cost component: the sacrificed object, the discarded card, or the permanent returned to its owner's hand (as it last existed on the battlefield); `noun?`: "creature" | "permanent" | "artifact" | "card" | "land" — The printed noun ("the sacrificed permanent", "the discarded card", "that land"); `filter`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `thisWay?`: "passive" | "active" — The printed "this way" wording of the same test: passive "if a Saproling was sacrificed this way", active "if you sacrificed a Klingon this way". - `choseOption` — CR 101.4, 608.2d: all selected players chose this option; empty selection is false. Without who reads the local/source choice; default key option. Fields: `option`: string — The named option chosen — as the source entered, in a vote or in a secret choice ("if Khans was chosen"); `key?`: string — Storage key of a noted value or choice (defaults to the choice's kind); `who?`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — Which player(s) — a player selector (default `you`). - `guessedRight` — CR 608.2c-d: the player of an earlier `guess` in this resolution guessed right ("If they guessed right, remove Gollum from combat. Otherwise, …"). Fields: `key?`: string — The guess's key; default "guess". - `triggeringOtherInZone` — CR 603.4, 400.7: the event's other object remains in this zone with the same identity; a leave-and-return does not qualify. Fields: `zone`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — A zone name (battlefield, hand, graveyard, library, exile, stack, command). - `triggeringMatches` — The triggering object matches this filter, using last known information (CR 608.2h). Fields: `filter`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `atEvent?`: boolean — CR 603.10a, 608.2h: use characteristics immediately before the triggering event, including counters on a departing permanent; `batch?`: "any" — CR 603.2c, 603.4: a one-or-more trigger — at least one object of the simultaneous event matches ("if one or more of them entered from a graveyard"). - `triggeringAbilityKind` — CR 603.4, 605.1a: the activated ability that triggered an activatesAbility trigger is of this kind ("if it isn't a mana ability" is nonMana). Fields: `abilityKind`: "nonMana" | "loyalty" | "boast" | "exhaust" | "ninjutsu" | "powerUp" | "crew" | "saddle" | "cycling" | "outlast" | "embalm" | "eternalize" — The kind of activated ability (nonMana, loyalty, boast, exhaust, ninjutsu, powerUp, crew, saddle, cycling). - `compare` — e.g. “1 is at least 1”. Fields: `a`: ValueDef — The first operand; `op`: ">=" | "<=" | "==" | "!=" | ">" | "<" — Comparison of `a` with `b`; `b`: ValueDef — The second operand. - `controls` — e.g. “you control a permanent”. Fields: `who?`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — Which player(s) — a player selector (default `you`); `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `min?`: number — Minimum number of selections / required amount. - `playerIs` — CR 102.2-3, 109.5: the selected player is you or your opponent (teammates are not opponents); requires a nonempty selection, all matching. Fields: `who`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — Which player(s) — a player selector (default `you`); `is`: "you" | "opponent" — The phase / time of day being tested. - `isYourTurn` — e.g. “it's your turn”. No fields. - `isDefendingPlayer` — CR 506.2: the player (default you) is the defending player of the triggering attacking creature ("if you're the defending player"). Fields: `who?`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — Which player(s) — a player selector (default `you`). - `attackedThisStep` — CR 508.1, 508.6: you were declared attacked this declare attackers step; attacking your planeswalker or battle does not count. No fields. - `fullParty` — CR 700.8: you control four distinct creatures filling the Cleric, Rogue, Warrior and Wizard roles. No fields. - `sourceTapped` — e.g. “~ is tapped”. No fields. - `sourceAttacking` — e.g. “~ is attacking”. No fields. - `sourceInZone` — CR 113.6, 400.7, 603.4: the same source incarnation remains in the specified zone, optionally owned by a selected player. Fields: `zone`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — A zone name (battlefield, hand, graveyard, library, exile, stack, command); `owner?`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — Whose zone the source must be in. - `resolutionOrdinal` — CR 608.2: this is the Nth actual resolution of this ability this turn; includes this resolution and excludes countered abilities. Fields: `ordinal`: number — Which occurrence (1 = first, 2 = second …). - `dayNight` — It is currently day / night / neither (CR 730.1). Fields: `is`: "day" | "night" | "neither" — Day, night, or neither. - `hasDesignation` — The source has this designation (monstrous, renowned, saddled, …). Fields: `designation`: string — A designation name (monarch, monstrous, renowned, saddled, suspected, prepared …). - `sourceThisTurn` — The source attacked / entered / blocked / attacked or blocked / dealt combat damage this turn (or this combat). Fields: `did`: "attacked" | "entered" | "blocked" | "attackedOrBlocked" | "dealtCombatDamage" | "exerted" — What the source did this turn; `combat?`: boolean — Only this combat phase counts (CR 506.1): "if this creature attacked or blocked this combat". - `sourceAbilityActivatedThisTurn` — Checks whether the specified ability of this object was activated this turn. The activation counts even if the ability was countered. Fields: `index`: number — Zero-based index of the source's activated ability. - `sourceDealtDamage` — The source has dealt damage since it entered its current zone, by any means (CR 120.3, 400.7): "as long as it hasn't dealt damage yet" is this inside `not`. No fields. - `sourceAboveInGraveyard` — CR 400.7, 603.4: the source is in its owner's graveyard with cards put there after it: `direct` the card directly above it matches the filter ("with a creature card directly above it"); otherwise at least `min` (default 1) of the cards above it match ("with three or more creature cards above it"). Fields: `filter`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `min?`: number — Minimum number of selections / required amount; `direct?`: boolean — Only the card directly above the source counts ("with a creature card directly above it"); otherwise any card put there after it. - `controlsSourcePlaneswalker` — CR 400.7: you still control the same planeswalker object this ability came from. No fields. - `castDuringYourTurn` — CR 601.2, 608.2h: actually cast by you on your own turn, captured when cast; copies do not count. No fields. - `castAfterExile` — CR 702.143c, 702.170: the card was foretold/plotted immediately before casting, even if another cost was used; excludes spell copies. Fields: `designation`: "foretold" | "plotted" — How the card was exiled before it was cast: foretold or plotted. - `castDuringOpponentTurn` — CR 601.2: you cast this during an opponent's turn, captured when cast. No fields. - `castDuringMainPhase` — CR 601.2, 608.2h: you cast this spell during your main phase, captured when cast; uncast copies do not qualify. No fields. - `anotherSpellCastThisTurn` — Another actual spell cast by you this turn, excluding this spell itself if it was cast. No fields. - `castOrdinal` — CR 601.2i: this was your Nth actual spell cast this turn (optionally creature spells only). Fields: `ordinal`: number — Which occurrence (1 = first, 2 = second …); `creatureOnly?`: boolean — Count only creature spells. - `castAnotherNamedSpell` — CR 601.2i, 707.10: this spell's controller has cast another spell of the given name this game, including a countered spell. Putting a copy on the stack is not a cast. Fields: `name`: string — Printed name. On an ability: its ability word ("Hellfire Retribution"), shown in the English rendering, on the stack and in the log. - `castFrom` — The source spell was cast from this zone. Set owner to you when the printed rule requires your own hand or other zone. Fields: `zone`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — A zone name (battlefield, hand, graveyard, library, exile, stack, command); `owner?`: "you" — Whose zone (player selector). - `wasCast` — CR 400.7, 603.4: the entering object, or the source outside an enters-trigger context, was actually cast, optionally by you; direct entries and uncast copies fail. Fields: `by?`: "you" — Whose action it is, or which kind of source. - `castWith` — The source spell was cast with this alternative cost (blitz, dash, …). Fields: `alternative`: string — The alternative or additional cost the spell was cast with (a keyword ability id: `alternativeCost`, `flashback`, `evoke`, `dash` …). - `asCast` — CR 601.2i, 608.2h: the inner condition as it stood when this spell became cast ("if you controlled a Faerie as you cast this spell"); recorded as casting completes and kept by the permanent the spell becomes; false for an object that wasn't cast; a copy inherits it (CR 707.10). Fields: `condition`: ConditionDef — A ConditionDef that must hold. - `revealedToCast` — CR 601.2b, 601.2f: the optional additional cost "reveal a [filter] card from your hand" was paid for this spell ("you revealed a Dragon card"). Fields: `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together). - `playerHas` — Player designations; completedDungeon checks completion at least once this game (CR 309.7, 701.49). Fields: `who?`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — Which player(s) — a player selector (default `you`); `designation`: "monarch" | "initiative" | "cityBlessing" | "maxSpeed" | "enduringStory" | "completedDungeon" — A player designation: monarch, initiative, city's blessing, max speed, …. - `anyOpponent` — True if the condition holds for any opponent. Fields: `condition`: ConditionDef — A ConditionDef that must hold. - `anyPlayer` — CR 608.2h: true if the condition holds for some player of `who` (default every player) with "you" rebound to that player; `all` requires every one ("if a player controls more creatures than each other player"). Fields: `who?`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — Which player(s) — a player selector (default `you`); `condition`: ConditionDef — A ConditionDef that must hold; `all?`: boolean — True: the condition must hold for every selected player, not just one. - `opponentComparison` — CR 109.5, 608.2h: compare this quantity evaluated for you against the same quantity for an opponent, or every opponent if each is true; never pool opponents' quantities. Fields: `value`: ValueDef — The value to store or compare; `op`: ">" | "<" | ">=" | "<=" | "==" — Comparison between your value and the opponent's; `each?`: boolean — Compare with each opponent individually rather than any one of them; `who?`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — The players compared against (default: your opponents); triggeringPlayer for "that player controls more lands than you"; `subject?`: "you" | "opponent" — Whose quantity is on the left of the comparison (default you); `difference?`: number — The gap compared: (subject's ? other side's) op difference; default 0 ("an opponent has at least 5 more life than you": subject opponent, op >=, difference 5). - `phase` — The current step/phase. beforeAttackers ends when the declare attackers step begins; combatBeforeBlockers is restricted to combat before the declare blockers step; combatAfterBlockers requires blockers to have been declared this combat (CR 500.1, 508.1, 509.1). beforeCombatDamage ("Cast this spell only before the combat damage step") is the beginning phase, precombat main phase or combat before the combat damage step, while no combat damage step has begun this turn (CR 510). Fields: `is`: "upkeep" | "draw" | "untap" | "precombatMain" | "postcombatMain" | "main" | "combat" | "beforeAttackers" | "combatBeforeBlockers" | "combatAfterBlockers" | "declareAttackers" | "declareBlockers" | "endOfCombat" | "endStep" | "firstCombat" | "firstCombatYourTurn" | "beforeCombatDamage" — The current phase or step. - `topCard` — The top card of the player's library matches the filter. Fields: `who?`: "you" | "controller" | "abilityController" | "sourceController" | "owner" | "eachOpponent" | "eachPlayer" | "target" | "triggeringPlayer" | "defendingPlayer" | "attackingPlayer" | "activePlayer" | "replacedPlayer" | "damageSourceController" | "causeController" | "affectedController" | "affectedOwner" | "triggeringController" | "triggeringOwner" | "triggeringOtherController" | "triggeringOtherOwner" | "current" | "previousPlayer" | "mostLife" | "leastLife" | "mostCardsInHand" | "fewestCardsInHand" | "enchantedPlayer" | "yourTeam" | "chosenPlayer" | "playerToYourLeft" | "playerToYourRight" | "attackedPlayers" | "attackingOpponents" | "attackedBySourceThisTurn" | "attackedBySourceLastCombat" | object — Which player(s) — a player selector (default `you`); `filter`: ObjectFilter — Which objects (ObjectFilter; set fields AND together). - `affectedMatches` — An object the previous effect of this resolution applied to (the back-reference behind target mode "affected") matches the filter: "If it's a land card, you may put it onto the battlefield" after "exile the top card of your library". `span` unions the previous N effects' selections. Fields: `filter`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `zone?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — A zone name (battlefield, hand, graveyard, library, exile, stack, command); `span?`: number — How many preceding selections to union (default 1); `digSubset?`: "looked" | "picked" | "rest" — Read the cards of the enclosing `digTop`: `looked` (all looked at), `picked` (taken by a pick), `rest` (the remainder); `quantifier?`: "any" | "all" — any (default): at least one of the referenced objects matches; all: every one does and there is at least one ("if all cards revealed this way are creature cards"); `lastKnown?`: boolean — CR 608.2h: a referenced permanent that left the battlefield is tested with its last-known controller and counters ("If you controlled that permanent, draw a card"). - `sourceIs` — A state check on the source. Fields: `state`: "paired" | "attached" | "faceDown" | "token" | "blocked" | "blocking" | "enchanted" | "equipped" | "suspended" | "solved" | "transformed" | "ringBearer" — The state the source is in. - `objectMatches` — CR 109.2, 303.4, 301.5, 611.3: current characteristics and zone of this source or the permanent it enchants/equips; battlefield by default. Does not select targets. Fields: `object`: "source" | "host" — Which object is tested: the source or its host; `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `zone?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — A zone name (battlefield, hand, graveyard, library, exile, stack, command). - `startingPlayer` — CR 103.1: you were the starting player of this game. No fields. - `completedDungeon` — CR 309.7: you have completed a dungeon this game. No fields. - `all` — Every condition holds ("if X and Y"). Fields: `conditions`: ConditionDef[] — The conditions combined. - `any` — At least one condition holds ("if X or Y"). Fields: `conditions`: ConditionDef[] — The conditions combined. - `not` — e.g. “it's not your turn”. Fields: `condition`: ConditionDef — A ConditionDef that must hold.