# Drawstep — Magic: The Gathering card logic reference for AI assistants Generated from Drawstep's card schema (schema version 1). Vocabulary: 203 effects, 77 static effects, 17 replacements, 116 trigger events, 53 conditions, 59 value kinds, 169 keyword abilities, 44 simple keywords. This document is complete on its own: everything an assistant needs to turn a card's rules text into Drawstep card JSON is below. It is also served as plain Markdown at `https://drawstep.xyz/wiki/drawstep-mtg-ai-pack.md` on any Drawstep site, and every section is a page of the engine wiki at `https://drawstep.xyz/wiki/mtg/` (raw Markdown at `https://drawstep.xyz/wiki/mtg/.md`). ## 1. Your role You convert Magic: The Gathering card text (Oracle text, or a custom card written in the same style) into a **Drawstep card definition**: one JSON object in the format specified in this document. The Drawstep engine interprets that JSON directly and enforces it at the table exactly as written, so the JSON *is* the card's rules. Rules you must follow: 1. **Output JSON only** — a single object, no prose, no Markdown fences unless asked. It must validate against the format below. 2. **Use exact discriminators and field names** from the vocabulary reference (section 6). Never invent an effect, trigger, condition or keyword name. If a construct is not in the reference, it does not exist. The same goes for `native` ids: `{ "effect": "native", "id": … }` may name only an id the reference lists (the engine rejects any other when the card is saved) — a clause no native implements is a `tableRuling` step, never a made-up id. 3. **Never approximate.** If a clause cannot be expressed with the vocabulary, climb the honesty ladder (section 9): when its *timing* is clear, keep the ability automated and put `{ "effect": "tableRuling", "text": "" }` where that step belongs; a deck-construction / format sentence becomes a standalone `{ "kind": "tableRuling", "ruling": "formatReference", "onDemand": true, "text": "…" }` ability; only text with no capturable timing goes verbatim into `unparsed` (an array of strings). A card with `unparsed` lines is honestly flagged "partially enforced"; a card that silently does something different from its text is a bug. 4. **One printed ability → one entry in `abilities`** (keywords go to `keywords` / `keywordAbilities` instead). Keep the order of the printed text. A printed ability word ("Hellfire Retribution — When …") goes into that ability's `name`. 5. **Targets vs. choices.** "target …" → a TargetDef with `mode: "chosen"` (the default) — the engine prompts when the spell or ability is put on the stack and checks legality on resolution. "choose a …" / "return a creature card from your graveyard" → `mode: "choose"` (chosen on resolution, no targeting rules). "each …" / "all …" → `mode: "all"`. The card itself → `mode: "self"`. The thing it is attached to → `mode: "host"`. Mode, zone, player and filter are independent axes that compose with every action (section 6.8, "Selection algebra"): a random card from an opponent's hand, a chosen card from a graveyard, all cards in target player's exile — none needs its own primitive, and none is "unsupported" until you have composed it and it failed validation. 6. **"You" is always the controller of the card.** `who` defaults to `"you"`; use `"eachOpponent"`, `"eachPlayer"`, `"target"` (with a player TargetDef) or `"triggeringPlayer"` otherwise. 7. **Durations.** Layer-affecting one-shots (`modifyPT`, `grantKeyword`, `becomeType`, `setPT`, …) default to `"endOfTurn"`; use `"untilYourNextTurn"`, `"permanent"`, `"untilSourceLeaves"`, `"endOfCombat"`, `"untilYourNextEndStep"`, `"untilYourNextUpkeep"` or `"perpetual"` when the text says so. Continuous effects of permanents are **static abilities**, not durations. 8. **Statics go through the layer system.** "Creatures you control get +1/+1" is `{ kind: "static", effect: { type: "modifyPT", to: {…mode: "all"…}, power: 1, toughness: 1 } }`. A printed ability spanning several layers (Humility) is ONE static with several `effects`. 9. **Replacement effects** ("enters tapped", "enters with N counters", "if ~ would die, exile it instead", "if you would draw a card, instead …") use `kind: "replacement"`. 10. **Keep `text`** as the printed text (display only) and fill the characteristics (`types`, `subtypes`, `supertypes`, `manaCost`, `colors`, `power`, `toughness`, `loyalty`, `defense`) from the type line and stats. `id` is a lowercase slug of the name; `source` is `"custom"` for cards you write. 11. **Numbers** are plain integers; "X" is `{ "kind": "var", "name": "X" }`; counts and derived quantities use the ValueDef kinds. 12. When the user gives you an existing Drawstep JSON and asks for changes, return the complete corrected object. 13. **Read your JSON back before you answer.** The Studio renders every ability into English with the engine's own renderer and compares it with the printed text; a line that differs in a *rule* is refused with the difference spelled out. Check the same things yourself: every number; the qualifiers (target, may, opponent, up to, at random, nontoken, other, you control, tapped, attacking, combat damage, instead, exile vs destroy vs sacrifice, zone words); **who acts** (the actor of `dealDamage` is its `from` target — "that creature deals that much damage to itself" is `from` and `target` both `{ "of": "object", "mode": "triggeringOther" }`, not the card dealing it); **who is affected**; **when** ("when ~ attacks" is the event `attacks` with `filter: { "self": true }`, not a step trigger and not `youAttack`). Never reword `text` to make the reading match — change the abilities. 14. **Tokens.** `createToken.token` is the complete inline token (`name`, `types`, `subtypes`, `colors`, `power`, `toughness`, `keywords`, and the token's quoted text as the token's own `abilities`); Treasure / Food / Clue / Map / Incubator are `{ "name": "Treasure", "tokenDefId": "token-treasure" }`. When the user wants the token as a card of its own (art, a frame, a place in their deck's Tokens zone) — or asks for "the token too" — return **two** objects: a **token card** (`"layout": "token"`, `id` = its lower-case name, no `manaCost`, the token's abilities) and the creating card whose `createToken` carries the full inline spec **plus** `"tokenDefId": ""`; the server links the two when they are saved, in either order (section 11). ## 2. Output contract Return exactly this shape (fields marked optional may be omitted; empty arrays may be omitted): ```json { "id": "lightning-bolt", "name": "Lightning Bolt", "source": "custom", "layout": "normal", "supertypes": [], "types": ["Instant"], "subtypes": [], "manaCost": "{R}", "colors": ["R"], "text": "Lightning Bolt deals 3 damage to any target.", "keywords": [], "keywordAbilities": [], "abilities": [ { "kind": "spell", "effects": [ { "effect": "dealDamage", "target": { "of": "any" }, "amount": 3 } ] } ], "unparsed": [] } ``` `unparsed` is the honesty channel of last resort: a printed line you could not express *at all* goes there verbatim (section 9 explains the two rungs above it — a `tableRuling` step inside an automated ability, and an on-demand format ruling). The Studio's **Import** button accepts this object, validates it with the same `validateCard()` gate the engine uses, and shows any issue by path. ## 3. Card template — top-level fields | Field | Type | Required | Description | |---|---|---|---| | `schemaVersion` | `1` | no | Always 1 (default `1`) | | `id` | `string` | yes | Unique id (stock: oracle slug; custom: any unique string) | | `oracleId` | `string` | no | Scryfall oracle id of the printed card (corpus cards only) | | `name` | `string` | yes | The card's name; used for "~" in rules text and for name filters | | `game` | `string` | no | Engine id ("magic") (default `"magic"`) | | `source` | `"stock" \| "custom"` | no | "stock" for shipped cards, "custom" for player-made ones (default `"stock"`) | | `layout` | `"normal" \| "transform" \| "modal_dfc" \| "adventure" \| "split" \| "flip" \| "saga" \| "token" \| "class" \| "leveler" \| "meld" \| "emblem" \| "prepare" \| "dungeon" \| "host" \| "augment" \| "stickers"` | no | Single-faced "normal" unless the card has faces, chapters, levels, rooms, … (default `"normal"`) | | `supertypes` | `string[]` | no | Legendary, Basic, Snow, World, Ongoing (default `[]`) | | `types` | `string[]` | no | Card types: Creature, Instant, Sorcery, Artifact, Enchantment, Planeswalker, Land, Battle, Kindred (default `[]`) | | `subtypes` | `string[]` | no | Creature types, land types, Aura / Equipment / Saga / Class, spell subtypes (default `[]`) | | `manaCost` | `string` | no | Mana symbols as text: "{2}{W}{U}", hybrid "{W/U}", Phyrexian "{B/P}", "{X}" | | `colors` | `string[]` | no | W, U, B, R, G — normally derived from the mana cost; set explicitly for colorless-cost colored cards and color indicators (default `[]`) | | `power` | `number \| string` | no | Creature power; a string for "*" (then a static setPT with cda provides the value) | | `toughness` | `number \| string` | no | Creature toughness; a string for "*" | | `loyalty` | `number \| "X"` | no | Starting loyalty of a planeswalker; the letter "X" for one that enters with X loyalty counters, X being the value chosen as it was cast | | `keywords` | `string[]` | no | Rule-flag keywords, including Arena Double team: a nontoken attacker conjures its original into hand; both cards perpetually lose double team (default `[]`) | | `keywordAbilities` | `KeywordAbilityDef[]` | no | Keywords with parameters: cycling, kicker, ward, enchant, protection, … (default `[]`) | | `text` | `string` | no | The printed rules text. Display only — the engine reads `abilities`, never this (default `""`) | | `abilities` | `AbilityDef[]` | no | The card's behaviour: spell / triggered / activated / loyalty / static / replacement abilities, in printed order (default `[]`) | | `tableAdjudicated` | `boolean` | no | Full text coverage includes table-adjudicated rules (CR 100.7); report separately from fully automated cards | | `additionalCost` | `CostDef` | no | What must be paid. Amounts may be values: X in a non-mana cost is announced as the spell is cast / the ability activated (CR 601.2b) | | `chooseAsEnters` | `({ who?: "eachPlayer"; opponentsOnly?: boolean; kind: "option" \| "creatureType" \| "color" \| "cardName" \| "basicLandType" \| "landType" \| "cardType" \| "landNonland" \| "oddEven" \| "number" \| "player"; from?: ObjectFilter; zone?: "battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"; excludePreviouslyChosen?: boolean; options?: string[]; exclude?: string[]; filter?: object; key?: string; secret?: boolean; beforeGame?: "commander"; label?: string; min?: number; max?: number })[]` | no | Choices made as the card enters ("choose a creature type"); later effects read them via chosen* filters (default `[]`) | | `manaFromSource` | `{ types?: string[]; subtypes?: string[]; supertypes?: string[] }` | no | CR 106.3, 106.6: the producing source must have every listed type, subtype and supertype ("basic lands": supertypes [Basic], types [Land]; "creatures": types [Creature]; "Treasures": subtypes [Treasure]) | | `faces` | `({ name: string; manaCost?: string; supertypes?: string[]; types?: string[]; subtypes?: string[]; colors?: string[]; power?: number \| string; toughness?: number \| string; loyalty?: number \| "X"; keywords?: string[]; keywordAbilities?: KeywordAbilityDef[]; text?: string; abilities?: AbilityDef[]; additionalCost?: CostDef; chooseAsEnters?: object[]; manaFromSource?: object })[]` | no | Extra faces for transform/modal/adventure/split cards; face 0 is the front | | `classLevels` | `ClassLevelDef[]` | no | Class enchantments: levels 2..N (level 1 is the card's own abilities) | | `levels` | `LevelBandDef[]` | no | Leveler creatures: P/T and abilities per level-counter band | | `meld` | `MeldDef` | no | Meld front cards: partner name and melded result id | | `stationLevels` | `LevelBandDef[]` | no | Spacecraft: bands keyed to charge counters ("STATION 9+: 4/4 artifact creature") | | `rooms` | `DungeonRoomDef[]` | no | Dungeon cards: rooms in order; room 0 is the entrance | | `defense` | `number` | no | Battles: the defense counters it enters with | | `solveCondition` | `ConditionDef` | no | Cases: the "To solve —" condition, checked at the beginning of your end step while unsolved | | `attractionLights` | `number[]` | no | Attractions: the lit lights (2–6) | | `prize` | `EffectDef[]` | no | Attractions: the "Prize —" effects run by claimPrize | | `augment` | `AugmentDef` | no | Augment (Unstable): combine with a host | | `stickers` | `StickerSheetDef` | no | A sticker sheet (Unfinity, CR 123) | | `spellbook` | `string[]` | no | Arena spellbook card names supplied by external data; draft samples three entries without replacement | | `specializations` | `{ W?: string; U?: string; B?: string; R?: string; G?: string }` | no | Specialized card names keyed by discarded color/basic land type, linked from the corpus | | `unspecialized` | `string` | no | Original card name for unspecialize (Lukamina forms) | | `startingIntensity` | `number` | no | Starting intensity. Initialized once on the card object; increases survive all zone changes | | `image` | `{ normal?: string; art?: string }` | no | Image URLs for rendering; never read by the engine | | `appearance` | `{ frame?: object; flavor?: string; artist?: string; collector?: string; faces?: object[] }` | no | How the card is drawn (frame, flavor text, credits). Display only | | `pokemon` | `{ category: "Pokemon" \| "Trainer" \| "Energy"; set?: string; setName?: string; number?: string; series?: string; released?: string; rarity?: string; regulationMark?: string; legal?: string[]; illustrator?: string; dexIds?: number[]; stage?: "Basic" \| "Stage1" \| "Stage2" \| "BREAK" \| "LEVEL-UP" \| "MEGA" \| "VMAX" \| "VSTAR" \| "V-UNION" \| "Baby" \| "Restored" \| "LEGEND"; hp?: number; types?: ("Grass" \| "Fire" \| "Water" \| "Lightning" \| "Psychic" \| "Fighting" \| "Darkness" \| "Metal" \| "Fairy" \| "Dragon" \| "Colorless")[]; evolvesFrom?: string; level?: string; tags?: string[]; ruleBox?: boolean; prizes?: number; attacks?: object[]; abilities?: object[]; weaknesses?: object[]; resistances?: object[]; retreat?: number; trainerKind?: "Item" \| "Supporter" \| "Stadium" \| "Tool" \| "Technical Machine" \| "Rocket's Secret Machine" \| "Goldenrod Game Corner"; energyKind?: "Basic" \| "Special"; provides?: ("Grass" \| "Fire" \| "Water" \| "Lightning" \| "Psychic" \| "Fighting" \| "Darkness" \| "Metal" \| "Fairy" \| "Dragon" \| "Colorless")[]; text?: string; playCond?: any; cost?: any[]; effects?: any[]; statics?: any[]; triggers?: object[]; grantsAttacks?: object[]; stadiumAbility?: object; attachFilter?: object; unparsed?: string[] }` | no | Pokémon TCG cards (game "pokemon"): printed structure (stage, HP, types, Weakness / Resistance, Retreat, attacks, Trainer / Energy kind) and the rules steps the Pokémon engine runs | | `tcg` | `{ category: string; cost?: number; stats?: object; attributes?: string[]; traits?: string[]; keywords?: string[]; flags?: string[]; set?: string; number?: string; rarity?: string; legal?: string[]; limits?: object; extra?: object }` | no | Cards of the other games (game "yugioh", "onepiece", "fab", "gundam", "lorcana", "unionarena"): category, cost, printed stats, attributes, traits, legality. Plain data the game's ruleset reads; card text is resolved by the players | | `unparsed` | `string[]` | no | Rules-text lines not yet expressed in the vocabulary, kept verbatim. Any entry flags the card "partially enforced" (manual at a free table, surfaced at an enforced one) instead of approximating it; the engine ignores them | | `unparsed` | `string[]` | no | Printed lines that are not expressed in `abilities` yet — the last rung of the honesty ladder (see Custom mechanics). The table flags the card as partially enforced while this is non-empty. | Multi-face cards (`layout`: transform / modal_dfc / adventure / split / flip / prepare) put each face in `faces[]` (face 0 is the front; the card's own characteristics mirror face 0). Face fields: `name`, `manaCost`, `supertypes`, `types`, `subtypes`, `colors`, `power`, `toughness`, `loyalty`, `keywords`, `keywordAbilities`, `text`, `abilities`, `additionalCost`, `chooseAsEnters`, `manaFromSource`. ## 4. How the engine reads a card Every card in Drawstep — stock or custom — is a **declarative JSON document** interpreted by one rules engine. Cards never carry code; the engine reads the same vocabulary for a 1993 common and for a card you wrote this morning, so a custom card gets exactly the same enforcement as a printed one. Here is what happens to your JSON at the table. **Campaign extensions.** Roguelike campaigns use this same engine and card vocabulary. Modified physical cards receive campaign-scoped definitions, while initial passive powers use validated emblem definitions in the command zone. The server opts a campaign table into these packages and its starting-life values; its journal and replay retain them. Ordinary tables keep their normal setup, and the original card library is unchanged. **Authoring a roguelike campaign.** Use the [campaign authoring guide](https://drawstep.xyz/campaign-authoring.md), [campaign JSON schema](https://drawstep.xyz/campaign.schema.json) and an exported campaign alongside this reference. The campaign schema owns generated routes and optional freeform authored graphs (`roguelike.acts[].route`: canvas height, node positions and directed connections), persistent life/gold, reward categories, Discovery quantity ranges, draft and deck rules, ascensions, mastery, saves, artwork and palettes. These are not new card abilities. Put life recovery, victory gold and extra lives in campaign packages; put in-battle abilities in complete validated emblem/card definitions using this reference. An Augment replaces one physical instance, including while it is in reserve; commander and land eligibility must be explicit. Choosing several Augments in one cache requires different targets. Tier II ascension replaces tier I; equip one mastery package. Never invent a new engine effect to encode these campaign transitions, overwrite a stock card, or copy campaign-only powers into ordinary games. Prices, exact XP curves, commander lists and decks are authored content, not fixed engine semantics. **Portable campaign images.** Campaign management accepts JSON or a ZIP containing `campaign.json` and referenced PNG/JPEG/WebP/GIF images under `assets/`. The JSON format is unchanged; ZIP image paths are rewritten to local uploads only after a developer or admin reviews and applies the import. Preserve image files and crop settings when editing an exported ZIP. Music/sounds stay linked, stock library art is not bundled, and ZIP transfer adds no engine effects. See the campaign authoring guide for limits and the complete workflow. **Table decisions and shortcuts.** The table generates instructions from the exact declarative ability/effect that needs a choice, including legal restrictions and fixed trigger amounts. These instructions do not grant visibility or change the legal response. Custom cards use the same controls as stock cards. Describe real mechanics in the schema; do not author UI commands or an "infinite" resource value. Shortcuts describe a finite result, list the demonstrated sequence and let each opponent choose an earlier response point. The server verifies ordinary engine inputs and records them for replay; unverified, hidden/random or resource-consuming sequences stay manual. A verification limit never implies a draw. **Living campaign backdrops.** Every format accepts optional `backgroundScene` over `backgroundUrl` (image or animated GIF), with `backgroundDim`. Overview → Living backdrop edits up to 12 ordered ambient layers: dust, fireflies, embers, snow, rain, stars, bubbles, petals, fog, glow, rays and aurora. Layers have color, opacity, density, size, speed, placement and blending controls; presets and non-destructive image framing/camera controls share the actual player preview. System reduced motion and a device-local pause keep GIFs and effects still. Quality caps rendering work. Settings are cosmetic, version-pinned and exported with campaign JSON/ZIP; match table themes remain separate. See the campaign guide for all schema fields. **Commander campaign acquisition.** The Severed Atlas opts into `cardAcquisition`: 20 free basics plus a 79-card enforced-library draft guided toward 38 lands, contextual power tiers, enemy/library rewards, and saved reroll currency. Tiers use curated commander decks, thematic affinity, roles, popularity and supported two-to-four-card combos throughout the commander's colors, even without the commander as a piece. Finishing lines and infinite-resource engines set rarity floors; all partners must be legal and enforced. A separate fast-mana bonus weighs early mana output against casting/activation/material costs, setup, restrictions and the commander's mana needs. Cards show the resulting Fast mana +N contribution alongside combo/fit explanations, not bracket labels. Ordinary rocks and filters do not get this extra bonus; unknown variable production is not assumed to be maximized. Every full commander draft round reserves two distinct authored commander seeds across its packets, and each reward section reserves one when eligible picks remain in its own pool. Rerolls preserve these guarantees, rarity weights and land targets; other slots retain full-library discovery. Commander mechanics exposes seededDraftSlots (0–4, default 2) and seededRewardSlots (0–3, default 1). Starter/kit foundations, additional picks, nonbasic reference lands and matching decks supply seeds, shown with Commander seed badges. Enemy spoils never invent cards outside the defeated decks; saved offers stay unchanged. `startingRerolls` defaults to 5; `encounter.rewards.rerollReward` overrides the normal/boss victory defaults of 2/3. A reroll costs one and unused currency carries forward. Easy/Medium/Hard is fixed when starting a new save; composer `difficultySettings` tunes bot ceilings and rarity boosts. New commander unlocks draft at their difficulty's starting odds; returning to an unlocked commander restores its saved deck. Typed-land eligibility is checked. Composer **Commander mechanics** configures optional `cardAcquisition.rules`: included basics/land target, focused packets, loot reservations, enemy commander drops, start/end rarity weights, progression, victory currency defaults and sanctuary returns. Act provisions and legacy reward pools do not drive procedural loot; starter/kit lists remain rarity guidance. The simulation is an authored-deck benchmark and does not model acquisition or campaign difficulty. These are campaign transitions, not card effects. See the campaign guide for quotas, scoring, rarity curves, legacy-version compatibility and save behavior. **Zones.** An object is always in exactly one zone: `library`, `hand`, `battlefield`, `graveyard`, `exile`, `stack` or `command`. Moving between zones creates a new object (CR 400.7); filters and targets name the zone they look in (`zone`, default battlefield). A graveyard departure also triggers when the card returns to the battlefield or is cast from there. Thran Vigil groups simultaneous departures and can target a creature that just returned during your end step. **Casting and the stack.** Casting a spell or activating an ability puts it on the stack with its choices made (CR 601.2): modes (`modes`, `chooseMin/Max`), targets (every TargetDef in `mode: "chosen"` prompts the controller and is checked for legality), X (`{ "kind": "var", "name": "X" }`), and costs (`cost`, `additionalCost`, keyword alternative costs). Players then receive priority in turn; when all pass, the top object resolves: its `effects` run **in order**, each target is re-checked (an illegal target makes that part fizzle, CR 608.2b), nested lists (`if.then`, `optional.then`, `mayPay`) run only when their guard holds. **Prowl (CR 702.76a).** A spell with prowl can use its alternative cost after a source you controlled dealt combat damage to a player this turn and shared at least one of the spell's creature types at the time of damage. First-strike damage qualifies; damage to creatures or planeswalkers and noncombat damage do not. Hunting Velociraptor grants Dinosaur spells prowl {2}{R}, including Etali, Primal Conqueror cast from the command zone; commander tax still applies. The qualifying damage lasts for the turn and is not consumed by a cast. Printed prowl and a currently active spell-keyword grant use the same requirement. Existing games retain their recorded rules version; the corrected casting check applies to new games. **Triggered abilities.** The engine emits an event for everything that happens (an object entered, a creature died, a player drew, combat damage was dealt, …). Each `{ kind: "triggered", trigger }` watches one `event`, narrowed by `by` (whose action / turn), `filter` (which object — `self: true` for the card itself) and an intervening-if `condition`. Triggers wait until a player would receive priority, then go on the stack in APNAP order (CR 603.3); `optional: true` makes them "you may". **Static abilities and layers.** A `{ kind: "static" }` ability does not use the stack: it applies continuously while its source is on the battlefield (or, with `eminence`, in the command zone) and its `condition` holds. Every static part is applied through the CR 613 layer system — copy (1), control (2), text (3), type (4), color (5), abilities (6), power/toughness (7a–7d) — ordered by dependency and then timestamp, so authors never encode ordering. One printed ability that touches several layers (Humility: lose all abilities *and* base P/T 1/1) is one static with several `effects`, so its parts stay together (CR 613.6). One-shot effects with a `duration` (`modifyPT`, `grantKeyword`, `becomeCopy`, …) create timestamped continuous effects that go through the same layers. **Replacement effects.** Before an event happens it passes through a replacement pipeline: each applicable `{ kind: "replacement" }` may rewrite or cancel it (enters tapped, enters with counters, damage prevention, "if ~ would die, exile it instead", "if you would draw a card, instead …"). Each replacement applies at most once per event. The affected player or controller chooses among competing replacements (CR 616). For Ojer Axonil, compare the incoming damage with its current power each time you determine which effects still apply. Temple of Power counts the noncombat damage actually dealt by red sources you controlled at the time, including damage to permanents. **State-based actions** (lethal damage, zero toughness, 0 life, 10 poison, legend rule, Aura attachment legality, planeswalker loyalty 0, …) are checked whenever a player would receive priority. You never write them; they follow from the characteristics you declare. **Winota's private look.** When a non-Human creature you control attacks, Winota shows you the top six cards in library order. Acknowledge the look, then choose a Human creature to enter tapped and attacking or skip the choice. If none qualifies, acknowledging the look puts all six on the bottom in random order. Opponents and spectators see only the Human that enters. **Decision prompts.** Whenever the engine needs a human choice it suspends and sends a typed request to the right seat — choose targets, choose modes, yes/no (`optional`), choose a number (X), order triggers or blockers, select cards from a zone (`searchLibrary`, `digTop`), pay or decline a cost (`mayPay`, `unlessPays`). Your JSON decides *when* a prompt appears: `mode: "chosen"` prompts at cast time, `mode: "choose"` prompts on resolution, `mode: "all"` never prompts. **Composition.** The vocabulary is not a menu of finished effects; it is a small set of primitives whose axes are **independent**, and any value on one axis combines with any value on another. What varies on each family: - *Effects* carry `who` (any player selector), `target` (the selection algebra — `of` × `mode` × `zone` × `player` / `playerTarget` × `filter` × `min` / `max` × `chooser`; see **Filters & targets**), `amount` (any ValueDef) and `duration`. The control-flow effects — `if`, `optional`, `mayPay`, `unlessPays`, `forEachPlayer`, `forEachObject`, `repeat`, `choose`, `ifDone`, `delayedTrigger`, `reflexiveTrigger` — nest *any* list of effects, so "do X; if you do, Y", "for each opponent, Z" and "when that creature dies this turn, …" are structure, not primitives. - *Values* compose: `count` of any filter in any zone for any player, `math` over any values, `affected` / `triggering` / `doneThisWay` / `costPaid` reading what earlier steps selected or paid. - *Conditions* combine with `all` / `any` / `not`, and the same ConditionDef serves `if` effects, intervening-if triggers, "as long as" statics, `onlyIf` activations and replacement `unless`. - *Triggers* are `event` × `filter` × `by` × `condition` × `triggersFrom` (the zone the ability works from) × `onceEachTurn` / `onlyOnce` × `optional`. - *Statics* are a layer effect × `to` (the same TargetDef algebra) × `condition`; *replacements* are `replaces` × filter × `optional` / `firstEachTurn` × any effects in their `instead` / `then`; *costs* are any combination of parts in one object, reused by keywords, `mayPay` and `unlessPays`. - *Back-references* — `affected`, `thisWay`, `triggering`, `triggeringOther`, `about`, `created`, `linked` — make any earlier selection the input of a later effect, so multi-step text chains without new vocabulary. A new mechanic is therefore almost always a new *combination*. Compose it first; the validator says whether it holds and **Explain** reads it back. Only when a composition genuinely cannot express a clause does the honesty ladder apply. **Honesty.** A card is "fully enforced" when every printed line is expressed in the vocabulary. The engine leaves room for mechanics the vocabulary lacks without ever approximating them — see **Custom mechanics** for the ladder: a `tableRuling` *effect* keeps an ability automated and pauses at the one step the table carries out; an `onDemand` table ruling records a deck-construction or format sentence without pausing play; anything whose timing cannot be captured either stays verbatim in `unparsed[]`, and the table shows the card as *partially enforced*. Approximating ("close enough") is never acceptable — a card that does something different from its text is a bug at the table. **Natives and adjudication.** Two more things sit beside the vocabulary. A **native** (`{ "effect": "native", "id": … }`, also as a static part, a value, a condition or a filter) is an ability the game module implements in the engine under a registered id — the card still carries no code, and an id the running engine has not registered is rejected when the card is saved and when the game is dealt, so a card can never name one that does not exist. **Adjudication** is a table feature, not card vocabulary: while a `tableRuling` step has the engine paused, any seat may propose a bounded manual change (move cards, counters, life, tap, a token, attach, control, transform, a note) and the other players approve or reject it; the engine applies an approved change with its own primitives, then runs state-based actions and triggers, and logs it. The card stays *partially enforced* — the ladder is unchanged, the table just has hands — and nothing about it is written in a card. ## 5. Translating a card step by step 1. **Fill in the characteristics first.** `name`, `manaCost`, `colors`, `supertypes` / `types` / `subtypes`, `power` / `toughness`, `loyalty` or `defense`, and the printed `text`. These drive casting, legality and rendering without any ability. 2. **Split the rules text into abilities.** Each paragraph (line) of Oracle text is one ability; keyword lines ("Flying, trample") are split on commas. Reminder text in parentheses is dropped. In the Studio, paste the text into **Rules text** to get one to-do chip per line. 3. **Classify each line.** - Plain keyword → a string in `keywords` (`"Flying"`, `"First strike"`, `"Can't be blocked"`). - Keyword with a parameter (cycling {2}, kicker, ward, enchant, protection, flashback, …) → `keywordAbilities`. - "When / Whenever / At the beginning of" → `triggered` (pick the `event`, then `by` / `filter` / `condition`). - "[cost]: [effect]" → `activated` (`cost` parts; `timing: "sorcery"` for "Activate only as a sorcery"). - "+N / −N:" on a planeswalker → `loyalty`. - A sentence describing an ongoing state ("Creatures you control get +1/+1", "~ can't be countered", "You have hexproof") → `static`. - "enters tapped / with counters", "if ~ would …, instead" → `replacement`. - The spell's own text on an instant or sorcery → one `spell` ability. 4. **Map clauses to blocks.** Inside an ability, each verb phrase is one effect, in printed order: "Draw a card, then discard a card" → `drawCards` then `discard`. Search the palette by verb ("destroy", "exile", "return") or noun ("token", "counter"). "If … , …" wraps effects in `if`; "You may …" in `optional`; "You may pay … If you do" in `mayPay`; "unless … pays" in `unlessPays`. 5. **Targets vs. choices.** The word "target" means a TargetDef with `mode: "chosen"` — chosen when the spell/ability goes on the stack, re-checked on resolution. "Choose a …", "a creature card from your graveyard", "up to one other …" without "target" → `mode: "choose"`. "Each / all" → `mode: "all"`. The card itself → `mode: "self"`; what it is attached to → `mode: "host"`. Add `min` / `max` for "up to two", "any number of". 6. **Numbers and values.** Literal numbers are integers. "X" → `{ "kind": "var", "name": "X" }`. "equal to the number of creatures you control" → `{ "kind": "count", "filter": {…} }`. "its power" (of the affected object) → `{ "kind": "affected", "property": "power" }`; "~'s power" → `{ "kind": "sourcePower" }`. Devotion, domain, storm, turn history, hand size, life totals and arithmetic all have value kinds — never bake a derived number into a constant. 7. **Durations.** "until end of turn" is the default for layer-affecting one-shots; write `"permanent"` when the text has no duration ("becomes a Forest" with no "until"), `"untilYourNextTurn"`, `"endOfCombat"`, `"untilSourceLeaves"` for "for as long as ~ remains on the battlefield". Continuous abilities of permanents are statics, never one-shots with a duration. 8. **Filters say exactly what the text says.** "nonland permanent" → `{ notTypes: ["Land"] }`; "creature or planeswalker" → `{ anyTypes: ["Creature", "Planeswalker"] }`; "another creature you control" → `{ types: ["Creature"], controller: "you", other: true }`; "with power 4 or greater" → `minPower: 4`. Do not widen a filter to make it easier to express. 9. **Validate.** The Studio validates on every change with the engine's own gate (`validateCard`); errors are shown by path and link to the block that owns them. Warnings (an Aura without `enchant`, a Saga without chapter triggers) do not block saving but almost always mean something is missing. 10. **Read it back.** Turn on **Explain** to read the JSON as English and compare it with the printed text, line by line. Choose **Playtest**, build a position where the effect should apply, and choose **Play position**. Cast the card and check its targets and the resulting board. Record a checkpoint for the outcome you expect. 11. **Name the abilities that are printed with a word.** A custom ability word ("Hellfire Retribution — When …") goes into the ability's `name`; the stack, the game log and the English rendering use it. 12. **Climb down the honesty ladder for the rest.** A clause with clear timing but an action the vocabulary lacks becomes a `{ "effect": "tableRuling", "text": "…" }` step inside the otherwise automated ability; a deck-construction / format sentence becomes a standalone `tableRuling` ability with `onDemand: true`; only text with no capturable timing stays verbatim in `unparsed[]` (the Rules text panel does this for you). Never approximate. See **Custom mechanics**. > The reference is split: sections 6.1–6.9 are the **core** vocabulary; 6.10 onwards (**full reference**) follows the worked examples so the most-used constructs come first. The same reference in parts under 100 KB each: `https://drawstep.xyz/wiki/mtg/pack.md`. ## 6. Vocabulary reference Every tagged union lists its options as `discriminator` — description, then its fields as `name`: Type (required unless marked `?`) — description. Types: `TargetDef`, `ValueDef`, `CostDef`, `ConditionDef`, `ObjectFilter`, `EffectDef[]` … refer to the sections below. Player selectors (`who`): —. Durations: `endOfTurn`, `endOfCombat`, `endOfAdditionalCombat`, `untilYourNextTurn`, `untilEndOfYourNextTurn`, `untilEndOfNextTurn`, `untilStackEmpty`, `untilYourNextEndStep`, `untilYourNextUpkeep`, `permanent`, `whileYouControlSource`, `whileYourTurn`. Zones: `battlefield`, `hand`, `graveyard`, `library`, `exile`, `stack`, `command`. ### 6.1 Abilities (`AbilityDef`, discriminator `kind`) Every entry of `abilities[]` is one of these. - `spell` — e.g. “(no effects)”. Fields: `name?`: string — Printed ability word / name of this ability ("Hellfire Retribution", "Totality"): the English rendering, the stack and the game log use it (": Hellfire Retribution"); `xManaColor?`: "W" | "U" | "B" | "R" | "G" — CR 107.3: "Spend only black mana on X" — each {X} in the spell's mana cost is paid with this colour; `onlyIf?`: ConditionDef — CR 601.3, 601.2e: cast this spell only when this condition holds, including free casts and zone permissions; `stackRules?`: ({ condition?: ConditionDef; rules: ("cantCounter" | "cantPreventDamage" | "cantCopy" | "splitSecond")[] })[] — CR 112.1, 615.12, 702.61, 707.10: the spell itself has these rules while on the stack. Each copy uses its own controller, X and additional costs. Conditions are checked when the rule would apply; `effects?`: EffectDef[] — The effects, resolved in order (EffectDef[]); `modes?`: object[] — Modal choices: each `{ label, effects, weight?, cost? }` (spree modes carry their `cost`); `chooseMin?`: number — Minimum number of modes chosen (default 1; 0 for "choose any number"); `chooseMax?`: ValueDef — CR 700.2a, 107.3: maximum modes, including X announced for the spell; `chooseAtRandom?`: boolean — CR 700.2a: choose the announced modes using the seeded RNG before targets; `repeatModes?`: boolean — CR 700.2d: allow repeated modes, each with independent targets announced before resolution; `modeBudget?`: { amount: number; exact?: boolean; symbol?: "pawprint" } — CR 700.2i: maximum (or exact) total weight of the modes announced before targets; `chooseIf?`: { condition: ConditionDef; min: number; max?: number } — "Choose one. If , (you may) choose both / any number instead": mode bounds that apply when the condition holds as the modes are chosen (CR 601.4); `distinctModeTargets?`: "player" — CR 601.2c, 700.2: "Each mode must target a different player." — no two chosen modes may target the same player; each mode's player target is announced from the players no earlier mode targets (checked as the targets are chosen, CR 601.2c). - `tableRuling` — CR 100.7 / Un-set release notes: pause and let the table adjudicate this text. Enforced play without a table decision handler leaves it inert and flagged; the engine never invents a result. Fields: `name?`: string — Ability word / name shown for this table ruling; `text`: string — Exact printed rules text, retained verbatim for the table; `ruling`: "ante" | "subgame" | "physical" | "artReference" | "outsideGame" | "flavorReference" | "formatReference" | "other" — Which kind of table ruling this is (ante, subgame, physical, outsideGame, flavorReference, formatReference …); `onDemand?`: boolean — The text is not a game action (a deck-construction or format rule such as "you may have creatures of these types of any color in a deck with ~ as commander"): never pauses casting, entry or resolution; the table records it on demand only; `prompts?`: string[] — Additional questions whose answers the table records. - `openingHand` — CR 103.6: offered to each player in turn order once every hand is kept, for each such card in their hand: the Leylines, Gemstone Caverns, the Chancellors. Fields: `name?`: string — Ability word / name of this opening-hand action; `action?`: "battlefield" | "reveal" | "exile" — battlefield (default): "you may begin the game with it on the battlefield"; reveal: "you may reveal this card from your opening hand" (then usually a delayedTrigger); exile: "If this card is in your opening hand, you may exile it"; `condition?`: ConditionDef — Read when the choice is offered ("if you're not the starting player" = { kind: "not", condition: { kind: "startingPlayer" } }); `counters?`: { counter: string; amount: ValueDef } — It begins the game on the battlefield with these counters (Gemstone Caverns' luck counter); `then?`: EffectDef[] — Effects that follow right away ("If you do, exile a card from your hand"); this card is their source. - `triggered` — e.g. “When ~ enters, (no effects)”. Fields: `whenChosen?`: string — CR 614.12c, 607.2m: anchor word; this ability exists only if that option was chosen as this source entered; `name?`: string — Printed name. On an ability: its ability word ("Hellfire Retribution"), shown in the English rendering, on the stack and in the log; `trigger`: TriggerDef — The TriggerDef: which event, whose, which object; `optional?`: boolean — "You may": the player chooses whether to do it; `effects`: EffectDef[] — The effects, resolved in order (EffectDef[]); `modes?`: object[] — Modal choices: each `{ label, effects, cost? }`; `chooseMin` / `chooseMax` bound how many are picked; `modeHistory?`: "game" | "turn" — CR 700.2a, 400.7: "choose one that hasn't been chosen (this turn)" — only modes not chosen earlier for this ability of this object; recorded as the ability is put onto the stack (CR 603.3c); `chooseMin?`: number — Minimum number of modes chosen (default 1; 0 for "choose any number"); `chooseMax?`: ValueDef — CR 700.2a, 107.3: maximum modes, including X announced for the spell; `chooseAtRandom?`: boolean — CR 700.2a: choose the announced modes using the seeded RNG before targets; `repeatModes?`: boolean — CR 700.2d: allow repeated modes, each with independent targets announced before resolution; `modeBudget?`: { amount: number; exact?: boolean; symbol?: "pawprint" } — CR 700.2i: maximum (or exact) total weight of the modes announced before targets; `chooseIf?`: { condition: ConditionDef; min: number; max?: number } — "Choose one. If , (you may) choose both / any number instead": mode bounds that apply when the condition holds as the modes are chosen (CR 601.4); `distinctModeTargets?`: "player" — CR 601.2c, 700.2: "Each mode must target a different player." — no two chosen modes may target the same player; each mode's player target is announced from the players no earlier mode targets (checked as the targets are chosen, CR 601.2c); `banner?`: boolean — Host banner: an augment replaces this ability's trigger; `eminence?`: boolean — Also functions while the card is in the command zone; `triggersFrom?`: "graveyard" | "exile" | "hand" | "library" | ("battlefield" | "graveyard" | "exile" | "hand" | "library")[] — CR 113.6b, 113.6k: the ability functions only while its source is in this zone — its effect moves the source out of it ("Whenever a land you control enters, you may return this card from your graveyard to the battlefield"). It never triggers on the battlefield, and a card that entered the zone in the same simultaneous event does not see that event (CR 603.10). - `activated` — e.g. “Channel — {1}: (no effects)”. 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; `cost`: CostDef — The cost (CostDef); `costModifiers?`: object[] — CR 602.2b, 601.2f: this ability's own "costs {N} less/more to activate …"; summed with other cost changes, floored once; `abilityWord?`: "channel" — Printed Channel ability word (CR 207.2c); use discardSelf and activateFrom hand for its payment; `anyPlayer?`: boolean — CR 602.2: any player with priority may activate and controls the resulting ability; `opponentsOnly?`: boolean — Only opponents of the source controller may activate (CR 602.2); `timing?`: "instant" | "sorcery" — Activation timing, combinable with limits and onlyIf. Explicit instant requires priority even for a mana ability (CR 602.5d-e); `effects?`: EffectDef[] — The effects, resolved in order (EffectDef[]); `modes?`: object[] — Modal choices: each `{ label, effects, cost? }`; `chooseMin` / `chooseMax` bound how many are picked; `modeHistory?`: "game" | "turn" — CR 700.2a, 400.7: choose only modes not chosen earlier for this ability of this object, over its lifetime or this turn. Recorded on successful activation, even if countered; `chooseMin?`: number — Minimum number of modes chosen (default 1; 0 for "choose any number"); `chooseMax?`: ValueDef — CR 700.2a, 107.3: maximum modes, including X announced for the spell; `chooseAtRandom?`: boolean — CR 700.2a: choose the announced modes using the seeded RNG before targets; `repeatModes?`: boolean — CR 700.2d: allow repeated modes, each with independent targets announced before resolution; `modeBudget?`: { amount: number; exact?: boolean; symbol?: "pawprint" } — CR 700.2i: maximum (or exact) total weight of the modes announced before targets; `chooseIf?`: { condition: ConditionDef; min: number; max?: number } — "Choose one. If , (you may) choose both / any number instead": mode bounds that apply when the condition holds as the modes are chosen (CR 601.4); `distinctModeTargets?`: "player" — CR 601.2c, 700.2: "Each mode must target a different player." — no two chosen modes may target the same player; each mode's player target is announced from the players no earlier mode targets (checked as the targets are chosen, CR 601.2c); `onceEver?`: boolean — CR 602.5b, 400.7: activate only once for this object, across turns and controllers; a zone change resets the limit; `oncePerTurn?`: boolean — Activate only once each turn, independently of other timing restrictions (CR 602.5b); `maxActivationsPerTurn?`: number — Maximum activations per turn for this object (CR 602.5b, 400.7); `exhaust?`: boolean — Exhaust: activate only once per game; `boast?`: boolean — Boast: only if the source attacked this turn, once each turn; `powerUp?`: boolean — Power-up: once only; cost reduced by the source's mana cost if it entered this turn; `outlast?`: boolean — Outlast (CR 702.107a): the activation is an outlast ability (activatesAbility abilityKind outlast); `embalm?`: boolean — Embalm (CR 702.128a): the activation is an embalm ability (activatesAbility abilityKind embalm); `eternalize?`: boolean — Eternalize (CR 702.129a): the activation is an eternalize ability (activatesAbility abilityKind eternalize); `onlyIf?`: ConditionDef — Activation condition; combine phase, turn and battlefield predicates with all (CR 602.1b); `activateFrom?`: "battlefield" | "graveyard" | "hand" | "exile" | "command" — Zone the ability is activated from (default battlefield). - `loyalty` — e.g. “+1: (no effects)”. 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; `loyaltyCost`: number | "-X" — +N / −N / 0, or "-X" (X chosen on activation); `effects`: EffectDef[] — The effects, resolved in order (EffectDef[]); `modes?`: object[] — Modal choices: each `{ label, effects, cost? }`; `chooseMin` / `chooseMax` bound how many are picked; `chooseMin?`: number — Minimum number of modes chosen (default 1; 0 for "choose any number"); `chooseMax?`: ValueDef — CR 700.2a, 107.3: maximum modes, including X announced for the spell; `chooseAtRandom?`: boolean — CR 700.2a: choose the announced modes using the seeded RNG before targets; `repeatModes?`: boolean — CR 700.2d: allow repeated modes, each with independent targets announced before resolution; `modeBudget?`: { amount: number; exact?: boolean; symbol?: "pawprint" } — CR 700.2i: maximum (or exact) total weight of the modes announced before targets; `chooseIf?`: { condition: ConditionDef; min: number; max?: number } — "Choose one. If , (you may) choose both / any number instead": mode bounds that apply when the condition holds as the modes are chosen (CR 601.4); `distinctModeTargets?`: "player" — CR 601.2c, 700.2: "Each mode must target a different player." — no two chosen modes may target the same player; each mode's player target is announced from the players no earlier mode targets (checked as the targets are chosen, CR 601.2c). - `static` — e.g. “(empty static ability).”. Fields: `whenChosen?`: string — CR 614.12c, 607.2m: anchor word; this ability exists only if that option was chosen as this source entered; `name?`: string — Printed name. On an ability: its ability word ("Hellfire Retribution"), shown in the English rendering, on the stack and in the log; `effect?`: StaticEffectDef — The continuous effect (single part); `effects?`: StaticEffectDef[] — Parts of one continuous effect applying in different layers (e.g. lose all abilities + base P/T 1/1). Once the first part applies the rest keep applying even if the ability is removed later (CR 613.6); `condition?`: ConditionDef — CR 611.3a-b: this continuous effect applies only while the condition is true; `eminence?`: boolean — Also functions while the card is in the command zone; `functionsExceptIn?`: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[] — CR 113.6c: the ability functions everywhere except these zones instead of only on the battlefield — "As long as Grist isn't on the battlefield, it's a 1/1 Insect creature in addition to its other types" is ["battlefield"] (library, hand, graveyard, exile, command zone and stack). Listing every zone but one makes it function only there: "As long as this card is in your graveyard and you control an Island, creatures you control have flying" (Wonder) lists all zones except graveyard, with the Island as `condition`; there its controller is its owner. - `replacement` — e.g. “As long as this card is in your graveyard, ~ enters tapped.”. 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; `replacement`: ReplacementDef — The replacement effect (a ReplacementDef); `functionsFrom?`: "graveyard" — CR 113.6: the replacement ability states it functions only while its card is in this zone ("As long as this creature is in your graveyard, …", Dearly Departed); it applies from there and never from the battlefield. **Modes.** Modal abilities carry `modes: [{ label, effects, cost? }]` with `chooseMin` / `chooseMax` (default 1 / 1; "choose one or both" = 1 / 2; "choose any number" = 0 / modes.length) and optionally `chooseIf: { condition, min, max? }` ("if …, you may choose both instead"). Spree modes each carry their own `cost`. ### 6.2 Effects (`EffectDef`, discriminator `effect`) One-shot effects, resolved in order. Common optional fields: `target` (TargetDef), `who` (player selector), `amount` (ValueDef), `duration`, `if` / `optional` / `mayPay` / `unlessPays` wrappers. - `native` — A one-shot step carried out 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 step stands for. - `tableRuling` — One step the table resolves by hand inside an otherwise automated ability (CR 100.7). The engine runs the trigger, costs, targets and the other effects, pauses here with the text, and records the table's outcome; in strict enforced play the step is inert and the card flagged. Prefer this over `unparsed` when the timing of the clause is clear and the card should stay playable. Fields: `text`: string — The printed instruction the table carries out by hand, verbatim; `ruling?`: "ante" | "subgame" | "physical" | "artReference" | "outsideGame" | "flavorReference" | "formatReference" | "other" — Why software cannot resolve it; defaults to other (a custom mechanic the vocabulary lacks); `prompts?`: string[] — Extra questions whose answers the table records ("Which Aura did you attach?"). - `drawCards` — e.g. “draw a card”. 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`); `also?`: "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 — CR 121.2c: an additional player in the same draw instruction; deduplicated and performed in APNAP order; `target?`: TargetDef — What it acts on (TargetDef); `amount`: ValueDef — How many / how much (integer or ValueDef); `upTo?`: boolean — CR 107.1c: "draws up to N cards" — amount is the most each drawing player may draw; each chooses zero through it on resolution; `reveal?`: boolean — "Draw a card and reveal it" (CR 701.20a): the drawn cards are revealed and become the latest selection for the following clauses ("that card's mana value", "if it's a land card, discard it"). - `discard` — e.g. “you choose a card from it. You discard that card”. 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`); `also?`: "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 — CR 701.9, 608.2c: an additional player in the same discard instruction ("you and those players each … discard a card at random"); deduplicated and performed in APNAP order; `target?`: TargetDef — What it acts on (TargetDef); `cards?`: TargetDef — Specific cards to discard ("that player discards that card", "discard those cards"): each is discarded by its owner from their hand, with no further choice (CR 701.8a). With cards, who / amount / filter are not used; `amount?`: ValueDef — How many / how much (integer or ValueDef); `anyNumber?`: boolean — CR 701.8, 608.2d: choose zero or more cards to discard on resolution, up to amount if present; `drawDiscarded?`: boolean — After all discard choices and discards, each player draws that many cards; `drawDiscardedOffset?`: number — With drawDiscarded: each player draws that many plus this signed number ("draws that many cards minus one" = -1), never below zero; `wholeHand?`: boolean — Discard the whole hand; `keep?`: ValueDef — With wholeHand: the discarding player chooses this many cards to keep; the rest of the hand is discarded ("chooses a card in their hand and discards the rest", CR 701.9a, 608.2d); `random?`: boolean — Discard at random; `chosenBy?`: "you" — The source's controller chooses the card(s) from the player's hand ("you choose a nonland card from it"); `filter?`: ObjectFilter — With chosenBy: the cards that may be chosen. - `mill` — e.g. “mill a card”. 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`); `target?`: TargetDef — What it acts on (TargetDef); `amount`: ValueDef — How many / how much (integer or ValueDef). - `scry` — e.g. “scry 1”. 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`); `target?`: TargetDef — "Target player scries N" (CR 601.2c, 701.22a): the scrying player is a target chosen as the spell is cast; `who: "target"` alone targets a player too; `amount`: ValueDef — How many / how much (integer or ValueDef). - `surveil` — e.g. “surveil 1”. 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`); `target?`: TargetDef — "Target player surveils N" (CR 601.2c, 701.25a): the surveilling player is a target chosen as the spell is cast; `who: "target"` alone targets a player too; `amount`: ValueDef — How many / how much (integer or ValueDef). - `dealDamage` — e.g. “~ deals 1 damage to target permanent chosen at random that share a creature type”. Fields: `whenCreatureDies?`: EffectDef[] — Trigger these effects once if a creature dies from this damage at the immediately following state-based action check; `target`: { of: "object" | "player" | "spell" | "ability" | "spellOrAbility" | "any"; slot?: string; mode?: "chosen" | "choose" | "all" | "self" | "random" | "host" | "triggering" | "created" | "convoked" | "linked" | "paired" | "top" | "affected" | "replaced" | "replacedSource" | "triggeringOther" | "about" | "thisWay" | "costPaid" | "attacked" | "grantor"; action?: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; among?: "triggering"; chooser?: any; random?: true; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; allZones?: boolean; position?: "top" | "bottom"; filter?: ObjectFilter; player?: any; playerOwns?: true; exceptPlayer?: any; playerFilter?: "opponent"; sameZoneOwner?: boolean; maxTotalManaValue?: ValueDef; maxTotalPower?: ValueDef; distinctBy?: "name" | "manaValue" | "controller" | "power"; equalBy?: "toughness" | "power" | "manaValue"; sharesType?: "card" | "permanent"; sharedBy?: "creatureType"; zones?: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[]; playerTarget?: PlayerTargetDef; digSubset?: "looked" | "picked" | "rest"; span?: number; targetCount?: number; targetsOnlySource?: boolean; permanents?: true; stackTargets?: object; spell?: object; ability?: object; min?: ValueDef; max?: ValueDef | "any"; differentFromEarlierTargets?: boolean; attacker?: "self" | "triggering"; label?: string } — Who or what is dealt the damage. Whatever the mode, only creatures, planeswalkers, battles and players are ever selected (CR 120.3): the filter need not say so; `amount`: ValueDef — How many / how much (integer or ValueDef); `from?`: TargetDef — The object that deals the damage instead of the source ("target creature you control deals damage equal to its power to …"); values such as sourcePower are read from it; `divided?`: boolean — "… damage divided as you choose among one, two, or three targets / any number of targets": the division is announced as the spell is cast (each target at least 1, CR 601.2d); an illegal target on resolution loses its share; `dividedEvenly?`: boolean — CR 608.2b, 608.2h: divide damage evenly, rounded down, among targets still legal on resolution; no casting-time allocation; `excessTo?`: "controller" | { controllerIfSourceHas: string } — "Excess damage is dealt to that creature's controller instead" (CR 120.4a): each selected permanent is dealt only lethal damage (toughness less damage marked, 1 from a deathtouch source, loyalty, defense) and its controller is dealt the rest at the same time; `and?`: ({ target: TargetDef; amount: ValueDef })[] — Further recipients of the same instruction (CR 120.2b, 608.2c, 603.2c): "deals 4 damage to any target and 3 damage to each of up to two other targets", "to each creature without flying and each player". The same source (`from` included) deals all of it as one simultaneous damage event: every group is selected before any damage is dealt, a recipient named twice is dealt the sum once, lifelink gains once (CR 120.3f) and each prevention effect applies once per recipient (CR 615.13). - `setLife` — CR 119.5: gain/lose the difference to set a life total, with replacements and triggers. 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`); `target?`: TargetDef — What it acts on (TargetDef); `amount`: ValueDef — How many / how much (integer or ValueDef). - `redistributeLife` — "Redistribute any number of life totals" (CR 119.5, 608.2d): choose any number of players (one per team sharing a life total, CR 810.9), then give each of them one of their life totals back; each one's life becomes that number. No fields. - `exchangeLife` — CR 701.12: exchange life totals, all or nothing if a required gain/loss is prohibited. 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`); `target`: PlayerTargetDef — What it acts on (TargetDef). - `exchangeLifeWithStat` — CR 701.12g, 613.4b: "exchange your life total with this creature's toughness" - the player's life becomes the object's previous power/toughness (gain or loss) and a layer-7b effect with no duration sets the stat to the previous life total; all or nothing (CR 701.12a): nothing happens if the object has left the battlefield or the life change is prohibited. 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 — Whose life total is exchanged; default you. "target opponent's life total" is "target" with a player target; `target?`: PlayerTargetDef — What it acts on (TargetDef); `object`: { of: "object" | "player" | "spell" | "ability" | "spellOrAbility" | "any"; slot?: string; mode?: "chosen" | "choose" | "all" | "self" | "random" | "host" | "triggering" | "created" | "convoked" | "linked" | "paired" | "top" | "affected" | "replaced" | "replacedSource" | "triggeringOther" | "about" | "thisWay" | "costPaid" | "attacked" | "grantor"; action?: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; among?: "triggering"; chooser?: any; random?: true; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; allZones?: boolean; position?: "top" | "bottom"; filter?: ObjectFilter; player?: any; playerOwns?: true; exceptPlayer?: any; playerFilter?: "opponent"; sameZoneOwner?: boolean; maxTotalManaValue?: ValueDef; maxTotalPower?: ValueDef; distinctBy?: "name" | "manaValue" | "controller" | "power"; equalBy?: "toughness" | "power" | "manaValue"; sharesType?: "card" | "permanent"; sharedBy?: "creatureType"; zones?: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[]; playerTarget?: PlayerTargetDef; digSubset?: "looked" | "picked" | "rest"; span?: number; targetCount?: number; targetsOnlySource?: boolean; permanents?: true; stackTargets?: object; spell?: object; ability?: object; min?: ValueDef; max?: ValueDef | "any"; differentFromEarlierTargets?: boolean; attacker?: "self" | "triggering"; label?: string } — The permanent whose power or toughness is exchanged (usually the source); `stat`: "power" | "toughness" — Which characteristic of the permanent is exchanged with the life total (CR 701.12a, 119.7-8). - `duelReveal` — CR 701.20a, 608.2c: two players each reveal the top card of their library, each loses life equal to the mana value of the card the other revealed (one simultaneous event), then each puts the card they revealed into their hand (Keen Duelist, Parker Luck). Fields: `target`: { of: "player"; slot?: string; mode?: "chosen" | "choose" | "all" | "random" | "triggering" | "about" | "affected"; span?: number; player?: any; exceptPlayer?: any; random?: true; min?: ValueDef; max?: ValueDef | "any"; label?: string } — The target opponent (withYou) or the two target players; `withYou?`: boolean — You and the one target player duel ("you and target opponent each reveal"); otherwise the two target players. - `gainLife` — e.g. “you gain 1 life”. 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`); `also?`: "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 — Each named participant gains the amount; if both refer to the same player, they gain twice the amount as one event; `target?`: TargetDef — What it acts on (TargetDef); `amount`: ValueDef — How many / how much (integer or ValueDef). - `loseLife` — e.g. “you lose 1 life”. 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`); `target?`: TargetDef — What it acts on (TargetDef); `amount`: ValueDef — How many / how much (integer or ValueDef). - `destroy` — e.g. “destroy target creature”. Fields: `target`: TargetDef — What it acts on (TargetDef); `noRegenerate?`: boolean — "It can't be regenerated."; `andSelf?`: boolean — Destroy the selected objects and the source simultaneously (CR 701.7a, 608.2c); `and?`: ({ target: TargetDef })[] — Further objects of the same instruction (CR 701.8a, 608.2c): "destroy target enchantment and each other enchantment that shares a color with it" — each group selected as its own clause would be, all destroyed at the same time. - `exile` — Exile selected objects; mode choose and chooser target let the targeted player choose their own cards on resolution (CR 406.1, 608.2d). Fields: `target`: TargetDef — What it acts on (TargetDef); `faceDown?`: boolean — Face down (CR 708); `link?`: boolean | "timestampOrder" — Link the exiled cards to this source incarnation. timestampOrder lets the exiling player order simultaneous components so the latest card is defined (CR 712.21b, 727.3); `until?`: { untilEvent: TriggerDef } | { leaves: TargetDef } — CR 610.3: exile only until this event; the cards then return (Palace Jailer, Calix). - `bounce` — Return selected cards to their individual owners' hands, including all cards linked to the source (CR 400.3, 607.2a). Fields: `target`: TargetDef — What it acts on (TargetDef). - `moveTo` — e.g. “put target creature onto the battlefield”. Fields: `target`: TargetDef — What it acts on (TargetDef); `destination`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — Zone the objects are put into; `position?`: "top" | "bottom" | { fromTop: any } | { chooser: "owner" | "you"; options?: any[]; each?: boolean } — Exact placement in a library, including third from the top (CR 401.4, 401.7); { chooser } asks that player for top or bottom on resolution ("its owner puts it on their choice of the top or bottom of their library", CR 608.2d); `order?`: "chosen" | "random" — Order only the moved group within each owner's library, not the whole deck. Omitted: owner chooses (CR 401.4); `tapped?`: boolean — Tapped (true) or untapped (false); on an effect that puts something onto the battlefield, it enters tapped; `andSelf?`: boolean — The source moves together with the selected objects (CR 608.2c): "Return ~ and another target creature to their owners' hands"; `attachedTo?`: TargetDef — Enter attached to this object (CR 303.4f, 701.3), before enters triggers; `attacking?`: boolean | "defendingPlayer" — Enter attacking without attack triggers or implicit tapping; optionally fixed to the defending player (CR 508.4); `controller?`: "you" | "owner" | "opponent" — Who controls it on the battlefield: you (default), its owner, or an opponent you choose as the effect resolves (CR 608.2d); `withCounters?`: { counter: string; amount: ValueDef; filter?: ObjectFilter } | object[] — Each selected permanent enters with these additional counters, before enters triggers (CR 122.6, 614.12); `faceDown?`: boolean | "choose" — CR 708.2, 608.2d: choose face up or face down for each card as it enters; `transformed?`: boolean — Onto the battlefield back face up: a transform card enters transformed (CR 712.14a); a custom modal double-faced card enters as its back face ("return Juiblex from the graveyard to the battlefield" on the back of a modal card). Without it a double-faced card enters front face up; `link?`: boolean — Link the moved cards to the source (CR 607.2a): later abilities of the source refer to them with `mode: "linked"` / filter `linkedToSource`; `as?`: EffectDef[] — Continuous effects applied to each permanent as it enters, before it chooses what to enchant and before enters triggers (CR 303.4f, 611.2a): "It's an Aura enchantment with enchant creature you control and '…' and it loses all other abilities" — the entering permanent is { mode: "affected" }; use permanent durations. - `sacrifice` — The players `who` means (default you) each sacrifice `target` (mode `choose` = of their choice; `random` = `max` of their permanents at random, default one; `all` = every match). The count is per player. `who: "target"` with `player` is "target player / opponent sacrifices …" (the player is a target of the spell). Fields: `target`: TargetDef — What it acts on (TargetDef); `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`); `player?`: PlayerTargetDef — Player selector for whose zone or which player is counted; `also?`: "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 — CR 701.21a, 101.4: an additional player in the same sacrifice instruction ("you and that player each sacrifice a creature"); each chooses their own permanent and the sacrifices happen at once. Deduplicated, in APNAP order. - `tap` — e.g. “tap target creature”. Fields: `target`: TargetDef — What it acts on (TargetDef). - `untap` — e.g. “untap target creature”. Fields: `target`: TargetDef — What it acts on (TargetDef). - `removeFromCombat` — CR 506.4: remove the selected creatures from combat — they stop attacking / blocking (a blocked attacker stays blocked), deal and receive no combat damage this combat. Fields: `target`: TargetDef — What it acts on (TargetDef). - `reselectAttack` — "Reselect which player or permanent target attacking creature is attacking" (Misleading Signpost): this effect's controller chooses anew what each selected attacking creature attacks — any player other than its controller, or a planeswalker or battle such a player controls — ignoring attack requirements, restrictions and costs. It stays attacking and still counts as having attacked what it was declared to attack; no attack ability triggers (CR 506.4, 508.1b, 508.4). Fields: `target`: TargetDef — What it acts on (TargetDef). - `endTurn` — CR 716.1: end the turn — exile every object on the stack (including the resolving card), remove all creatures from combat, check state-based actions, then skip straight to the cleanup step; "at the beginning of the end step" abilities do not trigger this turn (CR 716.4). No fields. - `endCombat` — "End the combat phase" (CR 506.1, 716 by analogy; Mandate of Peace rulings): exile every spell and ability on the stack (the resolving card too), check state-based actions, remove all creatures from combat and end "until end of combat" effects, then skip the end of combat step to the next phase. Only during a combat phase. No fields. - `suspendCard` — CR 702.62c: the selected exiled cards gain suspend — with time counters on them they are suspended cards: their owner removes a time counter at each upkeep and casts the card without paying its mana cost when the last is removed ("exile it with three time counters on it and it gains suspend"). Fields: `target`: TargetDef — What it acts on (TargetDef). - `plotCard` — CR 702.170a, 702.170d: the selected exiled cards become plotted ("exile target spell. It becomes plotted"): their owner may cast each one as a sorcery on a later turn without paying its mana cost. Fields: `target`: TargetDef — What it acts on (TargetDef). - `addCounters` — e.g. “put a +1/+1 counter on target creature”. Fields: `sacrificeRest?`: ObjectFilter — CR 101.4, 701.21a, 608.2c: after counter placement, simultaneously sacrifice matching permanents those players control other than the chosen recipients; retain the recipients as affected; `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 — CR 101.4, 122.1: players placing counters; each chooses before counters are placed simultaneously; current is that player; `optional?`: boolean — Each placing player may decline (CR 608.2d); `then?`: EffectDef[] — After placement, run for each player who chose to act, with current bound to them (CR 118.12); `target`: TargetDef — What it acts on (TargetDef); `counters?`: ({ counter: string; if: ObjectFilter })[] — CR 122.1, 608.2c, 603.2c: put amount of each matching counter kind simultaneously; test all recipient filters before placing any counters; `chosenCounter?`: string — CR 122.1, 608.2d: key of a counter kind chosen earlier in this resolution; an impossible choice adds nothing. Supports permanent and player counters; `onlyIfAbsent?`: boolean — CR 608.2c: add counters only if the recipient has none of the chosen kind; `counter?`: string | string[] — CR 122.1, 608.2d: a kind, or a list for "your choice of a +1/+1, first strike, or trample counter" chosen on resolution for each recipient; `amounts?`: ValueDef[] — CR 122.1, 608.2d: with a counter list, the count for each alternative in order ("your choice of a +1/+1 counter or two charge counters"); the chosen alternative places its own count instead of amount; `amount`: ValueDef — How many / how much (integer or ValueDef); `upTo?`: boolean — CR 107.1b, 608.2d: choose zero through amount on resolution for each recipient; `divided?`: boolean — "Distribute N +1/+1 counters among one, two, or three target creatures": the distribution is announced as the spell is cast (each target at least one, CR 601.2d); `maxTotal?`: ValueDef — "This ability can't cause the total number of +1/+0 counters on this creature to be greater than four": put only as many as keep each recipient's count of this counter at or below this total (CR 122.1). - `tapOrUntap` — CR 608.2d: choose to tap or untap the declared target on resolution. Fields: `target`: TargetDef — What it acts on (TargetDef); `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 — CR 608.2d: player choosing tap or untap; defaults to the ability controller. - `removeCounters` — e.g. “remove a +1/+1 counter from target creature”. Fields: `target`: TargetDef — What it acts on (TargetDef); `counter?`: string — Counter kind; defaults to +1/+1. any permits a mixture of kinds chosen on resolution (CR 122.1); `amount`: ValueDef | "any" | "all" — Remove this many counters; any chooses zero through the available counters on resolution, all removes every available counter (CR 122.1, 608.2d, 609.3); `upTo?`: boolean — CR 107.1b, 608.2d: choose zero through amount on resolution for each recipient. - `modifyPT` — e.g. “target creature gets +1/+1 until end of turn”. Fields: `target`: TargetDef — What it acts on (TargetDef); `power`: ValueDef — Power (a number, or a string such as "*" for characteristic-defining values); `toughness`: ValueDef — Toughness (a number, or a string such as "*" for characteristic-defining values); `duration?`: "instant" | "endOfTurn" | "endOfCombat" | "endOfAdditionalCombat" | "untilYourNextTurn" | "untilEndOfYourNextTurn" | "untilEndOfNextTurn" | "untilStackEmpty" | "untilYourNextEndStep" | "untilYourNextUpkeep" | "permanent" | "untilSourceLeaves" | "whileYouControlSource" | "whileYourTurn" | "perpetual" | { whileSource: object; whileTarget?: object } | { whileSource?: object; whileTarget: object } | { untilEvent: TriggerDef } — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes; `alternative?`: { power: ValueDef; toughness: ValueDef } — CR 608.2d: choose either printed P/T change on resolution. - `grantKeyword` — e.g. “target creature gains flying until end of turn”. Fields: `target`: TargetDef — What it acts on (TargetDef); `keyword`: string | string[] — A keyword, or a printed list from which the controller chooses one at resolution for all recipients (CR 608.2d); `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `createToken` — e.g. “create a colorless creature token”. 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`); `also?`: "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 — CR 101.4, 111.2, 608.2c: additional creators in the same instruction; each player creates once, in APNAP order (you and that player each create); `target?`: PlayerTargetDef — The targeted player who creates these tokens (CR 601.2c, 111.2); `attachedTo?`: TargetDef — Create attached to this host before enters triggers (CR 303.4f); `token`: object | { oneOf: object[]; chooseAtRandom?: boolean; excludeControlled?: boolean } — The complete inline token spec (TokenSpec: name, types, subtypes, colors, power, toughness, keywords, abilities …); `amount?`: ValueDef — How many / how much (integer or ValueDef); `tapped?`: boolean — Tapped (true) or untapped (false); on an effect that puts something onto the battlefield, it enters tapped; `attacking?`: boolean | "defendingPlayer" | "current" | { player: any; orPlaneswalker: true } — Enter attacking, optionally a fixed player: the defending player or current bound by forEachPlayer (CR 508.4). It does not tap the tokens: "tapped and attacking" also sets tapped; `blocking?`: TargetDef — CR 509.4, 506.3d: enter blocking this attacking creature ("a 0/1 green Plant creature token that's blocking that creature"); for triggers it never "blocked"; `and?`: ({ token: object; amount?: ValueDef })[] — CR 701.7a, 603.2c, 603.6a, 614.12: further token kinds created by the same instruction ("create a 3/3 … Wurm token with deathtouch and a 3/3 … Wurm token with lifelink"): every token is created in one event — token replacement effects apply to the whole event once and all the tokens enter simultaneously, so "one or more tokens enter" triggers once. The other fields apply to every kind. - `createTokenCopy` — e.g. “create a token that's a copy of target creature”. Fields: `target`: TargetDef — What it acts on (TargetDef); `link?`: boolean — CR 400.7, 607.1: link all tokens created by this instruction to the source incarnation, so later instructions can refer to tokens created with it; `amount?`: ValueDef — How many / how much (integer or ValueDef); `tapped?`: boolean — Tapped (true) or untapped (false); on an effect that puts something onto the battlefield, it enters tapped; `attacking?`: boolean — Attacking (true) / not attacking (false); on an effect that creates or moves a creature, it enters attacking; `haste?`: boolean — The created tokens have haste; `except?`: { keywords?: string[]; keywordAbilities?: KeywordAbilityDef[]; abilities?: any[]; addTypes?: string[]; addSubtypes?: string[]; setTypes?: string[]; setSubtypes?: string[]; removeSubtypes?: string[]; colors?: string[]; addColors?: string[]; power?: ValueDef; toughness?: ValueDef; loyalty?: ValueDef; notLegendary?: boolean; legendary?: boolean; name?: string; noManaCost?: boolean } — Except: changes to the copy's copiable values (CR 707.9); `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 player who creates the token (CR 111.2); default: the controller; `withCounters?`: { counter: string; amount: ValueDef } — CR 122.6, 614.1c: "except it enters with an additional +1/+1 counter on it" — counters each token enters with; not a copiable value. - `addMana` — e.g. “add {G}”. 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`); `retain?`: "endOfTurn" | "permanent" — CR 106.4: only mana produced by this instruction survives step/phase ends for the specified duration; spending restrictions are preserved; `target?`: PlayerTargetDef — CR 601.2c, 608.2h: player targeted by a contextual quantity; mana still goes to who (default you); `mana`: string | string[] — Mana symbols to produce; {any} chooses a color, {chosen} uses the chosen color, W|U chooses one symbol. An array chooses one whole bundle; `amount?`: ValueDef — Repeat the mana bundle this many times, evaluated on resolution (CR 106.3); `oneColor?`: boolean — Choose a single color for all {any} symbols: mana of any one color; `differentColors?`: boolean — Each mana in this production bundle must have a different color; applies to manual and automatic payment choices (CR 106.3, 608.2d); `colorsFromExiled?`: boolean — Choose from the colors of cards currently exiled with this source (CR 106.3, 607.2a); `colorsAmong?`: { filter?: ObjectFilter; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; who?: any; each?: boolean } — Colors among matching objects: any one of them ({any}), or with each one fixed unit of every such color (CR 105.1, 106.1a, 106.5, 608.2h); `colorsFromCommanderIdentity?`: boolean — Choose from the colors in your commander's color identity (CR 903.4); outside a Commander game no mana is produced; `availableFrom?`: ObjectFilter — Only mana types matching permanents could produce, ignoring their activation costs and spending restrictions (CR 106.7); `colorsOnly?`: boolean — For availableFrom: colors only, excluding colorless mana; `onSpend?`: { spells: ObjectFilter; abilities?: ObjectFilter | "any"; by?: "you"; sharesCreatureTypeWithCommander?: boolean; triggered?: boolean; onceEachTurn?: boolean; separateTriggers?: boolean; effects: EffectDef[] } — CR 106.6: each mana unit carries this rider through manual or automatic payment. triggering refers to the spell paid for; you is the mana ability controller; `restriction?`: { notSpells?: ObjectFilter; spells?: ObjectFilter; abilities?: ObjectFilter | "any"; actions?: ("cumulativeUpkeep" | "foretell" | "morph" | "manifest" | "turnFaceUp" | "equip" | "unlockDoor" | "disturb" | "powerUp")[]; fromExiled?: boolean; spellFrom?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; spellNotFrom?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; costContains?: "X" | "C"; sameColor?: boolean; notGeneric?: boolean; uncounterable?: boolean } — Spending permissions joined by OR across spells, abilities, and actions (CR 106.6). Restricted mana empties normally. - `manaDoesntEmpty` — CR 106.4, 611.2: selected players retain all unspent mana as steps and phases end for this duration. 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`); `duration?`: "endOfTurn" | "endOfCombat" | "endOfAdditionalCombat" | "untilYourNextTurn" | "untilEndOfYourNextTurn" | "untilEndOfNextTurn" | "untilStackEmpty" | "untilYourNextEndStep" | "untilYourNextUpkeep" | "permanent" | "whileYouControlSource" | "whileYourTurn" — How long it lasts (see Durations on the Relationships & references page). - `loseUnspentMana` — CR 106.4, 608.2c: "… loses all unspent mana" — the selected players' mana pools (restricted and retained mana included) empty now; the mana is lost, not spent. 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`). - `searchLibrary` — e.g. “search your library for a card, put it into your hand, then shuffle”. Fields: `optional?`: boolean — The searcher may decline the entire search, including its shuffle (CR 701.23, 608.2d); `searcher?`: "searchedPlayer" | "controller" — searchedPlayer: the targeted player searches their own zones; controller: the ability's controller searches the selected players' zones ("Search its controller's graveyard, hand, and library"); otherwise you search a targeted player's zones (CR 701.19a); `target?`: PlayerTargetDef — Declared player target whose library is searched (CR 601.2c); `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); `zones?`: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[] — Zones searched together; default library (CR 701.19); `optionalZones?`: boolean — And/or: choose which listed zones to search; shuffle only when library is searched (CR 701.19); `findAll?`: boolean — "Search … for all cards …": every card matching the quality in the searched zones is found — the searcher sees each whole zone, so nothing can be missed (CR 701.19b, Sowing Salt rulings). Use max "any"; `finds?`: ({ filter?: ObjectFilter; max?: any; forEach?: TargetDef })[] — Separate finds with different qualities, excluding already found cards; one final shuffle (CR 701.19); `distinctNames?`: boolean — Found cards must have different names (CR 201.2, 701.19b); `shareLandType?`: boolean — CR 205.3i, 701.23b: found cards share a land type across the group; zero or one card is allowed, including one Wastes; `destination?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — Zone the objects are put into; `position?`: "top" | "bottom" | { fromTop: number } — Place found cards here after shuffling the remaining library (CR 701.20b, 401.4, 401.7); `then?`: EffectDef[] — Effects on the found set (affected targets), replacing the default move, before the shuffle (CR 608.2c); `distribute?`: { chooser?: "opponent"; target?: PlayerTargetDef; count?: number; destination: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; restDestination: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" } — Choose one found card for destination and put the rest into restDestination; opponent chooses if specified (CR 608.2c); `tapped?`: boolean — Tapped (true) or untapped (false); on an effect that puts something onto the battlefield, it enters tapped; `controllerTarget?`: PlayerTargetDef — CR 110.2a, 601.2c: "put it onto the battlefield under target player's control" - found cards enter under this declared player's control; `reveal?`: boolean — Reveal the cards found / taken; `min?`: ValueDef — Required minimum found (CR 701.19b: a search for cards may find fewer only when it cannot); a computed value for "for that many cards" (CR 107.3, 608.2h); `max?`: ValueDef | "any" — Default 1; computed resolution-time limit or any number of matching cards (CR 701.19); `shuffle?`: boolean — Shuffle the library afterwards. - `shuffle` — CR 701.20: shuffle each selected player library; a target is declared on casting. 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`); `target?`: PlayerTargetDef — What it acts on (TargetDef). - `shufflePermanentsAndReveal` — Each player shuffles all permanents they own into their library and reveals that many cards. Matching cards enter together for each filter in order across all players. Owners put the rest on the bottom in their chosen order. Fields: `battlefieldGroups`: ObjectFilter[] — An ObjectFilter (all set fields must match). - `exchangeZones` — CR 701.12a, 400.7: "exchange your graveyard and library" - every card in each of the two zones moves to the other at once. 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`); `zones`: any[] — The two zones exchanged; `shuffle?`: boolean — ", then shuffle": the player shuffles their library afterwards. - `fight` — e.g. “~ fights target creature”. Fields: `target`: TargetDef — What it acts on (TargetDef); `what?`: TargetDef — The creature that fights (default: the source): "target creature you control fights target creature you don't control"; `pairwise?`: boolean — CR 701.14a, 608.2d: pair different creatures; with unequal numbers as many pairs as possible fight; `whenCreatureDies?`: EffectDef[] — Trigger these effects once if a creature dies from that fight at the immediately following state-based action check. - `counterSpell` — CR 701.5, 614.15: counter a spell; if successfully countered, put it in the specified zone instead of its owner's graveyard (library defaults to top unless position specifies otherwise). Fields: `target?`: TargetDef — What it acts on (TargetDef); `destination?`: "exile" | "hand" | "library" — Where the countered spell goes instead of the graveyard (library = top); `position?`: "top" | "bottom" | { chooser: "you" } — CR 401.4, 614.15: placement for a counter into library; chooser chooses top or bottom only if the counter succeeds. - `counterUnlessPays` — CR 701.5, 614.15: counter unless its controller pays amount or cost; destination applies only if countered (library defaults to top unless position specifies otherwise). Fields: `target?`: TargetDef — What it acts on (TargetDef); `amount?`: ValueDef — Generic mana to pay; `cost?`: CostDef — CR 118.12, 608.2c: any other payment instead of amount ("pays {1} and 1 life", "discards their hand"); `ifPaid?`: EffectDef[] — CR 608.2c: "If they do, …" — run for this effect's controller when the payment is made; `ifNotPaid?`: EffectDef[] — CR 608.2c: "If that player doesn't, …" — run when the spell's controller doesn't pay (declined or unable), `current` bound to that player (Power Sink); `destination?`: "exile" | "hand" | "library" — Where the spell goes if it is countered (library = top). - `gainControl` — e.g. “gain control of target creature”. Fields: `target`: TargetDef — What it acts on (TargetDef); `controller?`: PlayerTargetDef — The targeted player who gains control (CR 613.1b); defaults to you; `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `gainControlEachOthers` — CR 611.2c, 613.1b: you and the selected player gain control of each other's matching permanents simultaneously. Either group may be empty. Fields: `target`: PlayerTargetDef — What it acts on (TargetDef); `filter`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `attach` — e.g. “attach ~ to target creature”. Fields: `target`: TargetDef — What it acts on (TargetDef); `what?`: TargetDef — What to attach (default: the source), e.g. a Role token just created; `afterMovingFromCreature?`: EffectDef[] — Resolve only if this actually moved the attachment from a different creature. - `transform` — Transform a transforming permanent (CR 701.28, 712). Fields: `target?`: TargetDef — What it acts on (TargetDef); `convert?`: boolean — Print convert, the same action as transform (CR 701.28). - `flip` — CR 710.2-4: flip a flip permanent; already flipped permanents stay flipped. Fields: `target?`: TargetDef — What it acts on (TargetDef). - `regenerate` — e.g. “regenerate ~”. Fields: `target?`: TargetDef — What it acts on (TargetDef). - `preventDamage` — Prevent the next N (or all) damage that would be dealt to the target this turn (CR 615.7). Fields: `target`: TargetDef — What it acts on (TargetDef); `amount?`: ValueDef — How many / how much (integer or ValueDef); `combatOnly?`: boolean — Only combat damage; `divided?`: boolean — CR 601.2d, 615.7: the amount is divided among the targets as they are chosen (each at least 1); each target gets a shield of its share ("prevent the next 5 damage that would be dealt this turn to any number of targets, divided as you choose"). - `cantPrevent` — CR 615.12: damage cannot be prevented for this duration. Prevention side effects still occur; finite shields retain their budgets. Fields: `duration?`: "endOfTurn" | "endOfCombat" | "endOfAdditionalCombat" | "untilYourNextTurn" | "untilEndOfYourNextTurn" | "untilEndOfNextTurn" | "untilStackEmpty" | "untilYourNextEndStep" | "untilYourNextUpkeep" | "permanent" | "whileYouControlSource" | "whileYourTurn" — How long it lasts (see Durations on the Relationships & references page). - `digTop` — e.g. “look at the top a card of your library. Put up to one of them into your hand. Put the rest on the bottom of your library”. Fields: `exile?`: boolean — CR 406.1, 608.2c: exile the examined cards before picks, then route the uncast cards with restTo; `amount?`: ValueDef — How many / how much (integer or ValueDef); `until?`: ObjectFilter — Stop when a card matching this filter is revealed; `untilCount?`: ValueDef — How many matching cards to find before stopping; `reveal?`: boolean — Reveal the cards found / taken; `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`); `target?`: PlayerTargetDef — What it acts on (TargetDef); `chooser?`: "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 | "opponent" | "thatPlayer" — Who chooses among the cards looked at (defaults to the digging player); `piles?`: { separator?: "you" | "opponent" | "target"; chooser?: "you" | "opponent"; faceDown?: boolean } — Partition into two possibly empty piles, then choose one. Picks apply to that pile; all unpicked cards use restTo. faceDown hides the first pile from its chooser (CR 700.3a-d); `picks?`: ({ position?: "top" | "bottom"; faceDown?: boolean; take: number | "all" | "any"; min?: number; filter?: ObjectFilter; destination?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; tapped?: boolean; withCounters?: any; optional?: boolean; order?: "first" | "chosen" | "random"; attacking?: boolean | "defendingPlayer"; ifNonePicked?: boolean; maxTotalManaValue?: ValueDef; then?: EffectDef[]; castFree?: boolean; castPayCost?: boolean; reveal?: boolean; controller?: "you" | "owner" | "opponent" })[] — What the player takes from the cards looked at: each pick `{ take, filter?, destination?, position?, tapped?, … }`; `take?`: number — How many cards this pick takes; `min?`: number — Minimum number of selections / required amount; `optional?`: boolean — "You may": the player chooses whether to do it; `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `restTo?`: "bottom" | "graveyard" | "hand" | "exile" | "shuffle" | "top" — Where the unpicked cards go (default the bottom of the library); `restOrder?`: "random" | "chosen" — Order of the unpicked cards: `random` or `chosen` by the player; `restFaceDown?`: boolean — Unpicked cards go to their zone face down; `shuffleFirst?`: boolean — CR 701.24a: shuffle the library after the examination, then place the rest by identity ("Then shuffle and put the cards you looked at this way on top in any order"); `link?`: boolean — CR 406.3 / 607.2a: cards this examination exiles (the rest or a pick) are "exiled with" the source, so "cast a card exiled with ~" finds them; `pool?`: boolean — CR 608.2c-d: with several examining players, the picks choose among all their examined cards together ("Choose one of the revealed creature cards"); the rest go to their owners' zones; `destination?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — Zone the objects are put into; `withCounters?`: object | object[] — CR 122.6, 614.1c: all matching additional counters are placed as the permanent enters, before triggers; `tapped?`: boolean — Tapped (true) or untapped (false); on an effect that puts something onto the battlefield, it enters tapped. - `separatePiles` — CR 700.3: separate cards from any zone into two piles, let a player choose one, then do things with each pile ("separate them into a face-down pile and a face-up pile. An opponent chooses one of those piles. Put that pile into your hand and exile the rest"). Fields: `target`: { of: "object" | "player" | "spell" | "ability" | "spellOrAbility" | "any"; slot?: string; mode?: "chosen" | "choose" | "all" | "self" | "random" | "host" | "triggering" | "created" | "convoked" | "linked" | "paired" | "top" | "affected" | "replaced" | "replacedSource" | "triggeringOther" | "about" | "thisWay" | "costPaid" | "attacked" | "grantor"; action?: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; among?: "triggering"; chooser?: any; random?: true; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; allZones?: boolean; position?: "top" | "bottom"; filter?: ObjectFilter; player?: any; playerOwns?: true; exceptPlayer?: any; playerFilter?: "opponent"; sameZoneOwner?: boolean; maxTotalManaValue?: ValueDef; maxTotalPower?: ValueDef; distinctBy?: "name" | "manaValue" | "controller" | "power"; equalBy?: "toughness" | "power" | "manaValue"; sharesType?: "card" | "permanent"; sharedBy?: "creatureType"; zones?: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[]; playerTarget?: PlayerTargetDef; digSubset?: "looked" | "picked" | "rest"; span?: number; targetCount?: number; targetsOnlySource?: boolean; permanents?: true; stackTargets?: object; spell?: object; ability?: object; min?: ValueDef; max?: ValueDef | "any"; differentFromEarlierTargets?: boolean; attacker?: "self" | "triggering"; label?: string } — The cards to separate: a graveyard selection, the top cards of a library (mode top), or "those cards" (mode affected); `separator?`: "you" | "opponent" — Who splits the cards into two piles (default you); `chooser?`: "you" | "opponent" | "target" — Who picks a pile (default you); an opponent is chosen on resolution when there are several; target is the declared player whose permanents are separated ("… in the pile of their choice"); `faceDown?`: boolean — CR 700.3d: the first pile stays face down for a chooser who didn't separate it; `reveal?`: boolean — Reveal the set before separating it; `chosen?`: EffectDef[] — Effects on the chosen pile: target mode affected is "those cards"; `rest?`: EffectDef[] — Effects on the other pile: target mode affected is "those cards". - `becomeCopy` — e.g. “~ becomes a copy of target creature until end of turn”. Fields: `target`: TargetDef — What it acts on (TargetDef); `applyTo?`: TargetDef — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events); `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes; `except?`: { keywords?: string[]; keywordAbilities?: KeywordAbilityDef[]; abilities?: any[]; addTypes?: string[]; addSubtypes?: string[]; setTypes?: string[]; setSubtypes?: string[]; removeSubtypes?: string[]; colors?: string[]; addColors?: string[]; power?: ValueDef; toughness?: ValueDef; loyalty?: ValueDef; notLegendary?: boolean; legendary?: boolean; name?: string; noManaCost?: boolean } — Except: changes to the copied characteristics (CR 707.9). - `becomeType` — e.g. “target creature becomes a in addition to its other types until end of turn”. Fields: `subtypeKind?`: "creatureType" | "basicLandType" — Replace only this subtype family; an empty subtype list removes all of it (CR 205.3, 613.1d); `allCreatureTypes?`: boolean — Gain all creature types without gaining changeling (CR 205.3m); `target`: TargetDef — What it acts on (TargetDef); `chosenSubtype?`: boolean | string — Snapshot the earlier chosen subtype; true reads creatureType, a string names its key (CR 205.3, 608.2d); `types?`: string[] — Card types, e.g. ["Artifact", "Creature"]; `subtypes?`: string[] — Subtypes, e.g. ["Elf", "Warrior"]; `supertypes?`: string[] — Supertypes gained ("becomes a legendary 4/4 … creature", "becomes snow"); kept even when `replace` sets the card types (CR 205.4a, 613.1d); `replace?`: boolean — Replace the existing types / colors instead of adding to them; `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `removeTypes` — CR 205.1a, 613.1d: a resolving effect removes card types, supertypes or subtypes for a duration ("this creature isn't a creature until end of turn"). Fields: `target`: TargetDef — What it acts on (TargetDef); `types?`: string[] — Card types removed ("isn't a creature"); the subtypes only they had go with them (CR 205.1a); `supertypes?`: string[] — Supertypes removed ("isn't snow", "is no longer snow"); `subtypes?`: string[] — Subtypes removed ("isn't a Human"); `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `becomeColor` — e.g. “target creature becomes colorless until end of turn”. Fields: `target`: TargetDef — What it acts on (TargetDef); `colors`: string[] — Colors as W / U / B / R / G codes; `chosenColor?`: boolean | string — Use the earlier chosen color instead of colors (CR 105.3, 608.2d); `colorsOfChoice?`: boolean — "The color or colors of your choice": one or more colors chosen as it resolves (CR 105.2, 608.2d); colors is then []; `replace?`: boolean — Replace the existing types / colors instead of adding to them; `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `loseAbilities` — e.g. “target creature loses all abilities until end of turn”. Fields: `target`: TargetDef — What it acts on (TargetDef); `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `loseAbility` — CR 613.1f: the selected permanents lose one printed ability — `this` is the resolving ability ("this creature loses this ability"), a number a printed index; the other abilities keep their positions. Fields: `target`: TargetDef — What it acts on (TargetDef); `ability`: "this" | number — Which printed ability is lost: `this` (the resolving ability) or the index of a printed ability; `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `endable` — CR 116.2c: "You may pay {W} to end this effect." — run the effects; every continuous effect they create belongs to one group that the player may end as a special action, any time they have priority, by paying the cost. Ending them all at once lets a Licid stop being an Aura and come unattached (CR 704.5n). Fields: `cost`: CostDef — The cost (CostDef); `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 — Who may end it (default: the controller); `label?`: string — Shown with the special action; `then`: EffectDef[] — Effects that follow ("then …", "if you do …"). - `removeKeyword` — Remove this keyword in layer 6; use permanent for a printed loss with no stated duration (CR 611.2a, 613.1f). Fields: `target`: TargetDef — What it acts on (TargetDef); `keyword`: string — A plain keyword string ("Flying", "Haste" …) as in `keywords[]`; `cantHave?`: boolean — CR 101.2, 613.1f: also cannot have or gain this keyword during the duration, even from later grants; `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `removeKeywordAbilities` — Lose every ability of this parametrised family, including earlier grants; later grants still apply (CR 702.14, 702.22, 613.1f). Fields: `target`: TargetDef — What it acts on (TargetDef); `keyword`: "landwalk" | "bandsWithOther" | "enchant" — The parametrised family removed (landwalk, bands with other); `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `grantAbility` — CR 113.7a, 611.2, 707.9: grant an ability, or copy the resolving ability with this. Perpetual grants follow the card across zones. Fields: `target`: TargetDef — What it acts on (TargetDef); `ability`: AbilityDef | "this" — The ability granted (an AbilityDef); `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `grantKeywordAbility` — Grant a parametrised keyword ability ("gains bands with other Dinosaurs", "has ward {2} until end of turn"). Fields: `target`: TargetDef — What it acts on (TargetDef); `keywordAbility`: KeywordAbilityDef | KeywordAbilityDef[] — A parametrised keyword ability (KeywordAbilityDef: `{ "keyword": "ward", "cost": { … } }`); `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `gainAbilitiesOf` — CR 611.2c, 613.1f: "gains all activated abilities of target creature until end of turn" — the targets have the from objects' abilities (fixed on resolution) for the duration; each gained ability refers to the object that has it. Fields: `target`: TargetDef — What it acts on (TargetDef); `from`: { of: "object" | "player" | "spell" | "ability" | "spellOrAbility" | "any"; slot?: string; mode?: "chosen" | "choose" | "all" | "self" | "random" | "host" | "triggering" | "created" | "convoked" | "linked" | "paired" | "top" | "affected" | "replaced" | "replacedSource" | "triggeringOther" | "about" | "thisWay" | "costPaid" | "attacked" | "grantor"; action?: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; among?: "triggering"; chooser?: any; random?: true; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; allZones?: boolean; position?: "top" | "bottom"; filter?: ObjectFilter; player?: any; playerOwns?: true; exceptPlayer?: any; playerFilter?: "opponent"; sameZoneOwner?: boolean; maxTotalManaValue?: ValueDef; maxTotalPower?: ValueDef; distinctBy?: "name" | "manaValue" | "controller" | "power"; equalBy?: "toughness" | "power" | "manaValue"; sharesType?: "card" | "permanent"; sharedBy?: "creatureType"; zones?: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[]; playerTarget?: PlayerTargetDef; digSubset?: "looked" | "picked" | "rest"; span?: number; targetCount?: number; targetsOnlySource?: boolean; permanents?: true; stackTargets?: object; spell?: object; ability?: object; min?: ValueDef; max?: ValueDef | "any"; differentFromEarlierTargets?: boolean; attacker?: "self" | "triggering"; label?: string } — The objects whose abilities are gained, as they exist on resolution (a chosen target, the linked exiled cards, a zone set); `kinds?`: ("activated" | "triggered" | "static" | "keyword")[] — Which classes of abilities (default all): activated includes loyalty and mana abilities, static includes replacement effects, keyword covers simple keywords and parametrised keyword abilities; `spendAsAny?`: { colors?: ("W" | "U" | "B" | "R" | "G")[] } — CR 609.4b, 613.1f: "You may spend mana as though it were mana of any color to activate those abilities" — the costs of the gained activated abilities may be paid with mana of any color; `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes; `chooseKeyword?`: boolean — Each recipient gains up to one keyword ability of its controller's choice. - `setPT` — CR 107.3, 611.2c, 613.4b: set base power/toughness to values fixed on resolution, including X/X. Fields: `target`: TargetDef — What it acts on (TargetDef); `power?`: ValueDef — Base power; omitted leaves it unchanged; `toughness?`: ValueDef — Base toughness; omitted leaves it unchanged; `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `exchangeBasePower` — CR 701.12a/g, 208.4b, 613.4b: simultaneously exchange two legal creatures' base power, before counters and bonuses. Neither changes if either target is illegal; perpetual survives zone changes. Fields: `target`: TargetDef — What it acts on (TargetDef); `second`: TargetDef — The second object of the exchange (default the source); `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `switchPT` — e.g. “switch target creature's power and toughness until end of turn”. Fields: `target`: TargetDef — What it acts on (TargetDef); `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `becomeBlocked` — CR 509.1h: each selected attacking creature becomes blocked (without blockers) if it isn't already; "becomes blocked" abilities trigger. Nothing happens to a creature that isn't attacking. Fields: `target`: TargetDef — What it acts on (TargetDef). - `restrict` — A temporary rule restriction, combat requirement (CR 508.1d, 509.1c), or capacity increase of one (blockAdditional, CR 509.1a), independent of abilities (CR 611.2). Selected targets are fixed; object sets with mode all stay dynamic, including later entrants (CR 611.2c), and so do spell sets with mode all ("Spells you control can't be countered this turn" covers spells cast later this turn). assignsNoCombatDamage: the creature stays in combat but assigns no combat damage (CR 510.1). damageByToughness: it assigns combat damage equal to its toughness rather than its power (CR 510.1a; Bill the Pony) — over a mode-all set the rule follows whichever creatures currently match (CR 611.2c). Fields: `target`: TargetDef — What it acts on (TargetDef); `planeswalkers?`: boolean — CR 508.1c: cantAttack also forbids planeswalkers controlled by the defending players; `restriction`: "blockAdditional" | "mustAttack" | "mustBlock" | "mustBeBlocked" | "cantAttack" | "cantBlock" | "cantBeBlocked" | "cantAttackOrBlock" | "cantRegenerate" | "cantBeTargeted" | "cantBeCountered" | "cantActivateLoyalty" | "cantActivate" | "loyaltyActivationsTwice" | "cantUntap" | "doesntUntap" | "assignsNoCombatDamage" | "damageByToughness" — Which restriction applies; `duration?`: Duration | "whileYouControlSource" | "controllersNextTurnEnd" — CR 611.2a-b: whileYouControlSource ends permanently when you lose control of the source incarnation; controllersNextTurnEnd applies only during the affected controller's next turn, fixed on resolution; `onlySource?`: boolean — For cantBlock, prevents blocking only the source object, whose identity is fixed now; `by?`: ObjectFilter — CR 509.1b: with cantBeBlocked, only blockers matching this filter (evaluated against the resolving ability) are forbidden. CR 115.1, 701.6: with cantBeTargeted / cantBeCountered, only spells / abilities whose source matches are restricted ("can't be the targets of blue or black spells": { colors: ["U", "B"] } with byKind spells); `byKind?`: "spells" | "abilities" | "spellsOrAbilities" — CR 115.1, 701.6: with cantBeTargeted / cantBeCountered, restrict only spells, only abilities, or both (default); `exceptBy?`: ObjectFilter — CR 509.1b: with cantBeBlocked, blockers matching this filter can still block. CR 508.1c: with cantAttack, attackers matching this filter can still attack ("Only land creatures can attack during that combat phase": { types: ["Creature", "Land"] }; "Only Throat Wolf can attack": { self: true }), the affected creatures that don't match can't; `defending?`: "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 | "itsOwner" — CR 508.1c-d, 611.2c: with cantAttack, forbidden defending players; with mustAttack, the player each creature must attack if able, fixed on resolution — a selector ("attacks that player each combat if able": current in a forEachPlayer) or itsOwner (each creature's own owner: "attacks its owner this turn if able"); `defendingTarget?`: PlayerTargetDef — CR 508.1d, 601.2c: with mustAttack, a declared player target to attack if able ("target creature attacks target opponent this turn if able"); no requirement if it's no longer a legal target; `defendingObject?`: TargetDef — CR 508.1d: with mustAttack, the planeswalker or battle to attack if able, fixed on resolution ("attack Gideon Jura if able": {of: object, mode: self}); no requirement once it has left; `turnOf?`: "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 — CR 611.2a: "During target player's next turn, …" — applies only during that player's next turn (fixed on resolution) and ends with it; omit duration. An object set with mode all stays dynamic during that turn; `otherThan?`: "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 — CR 508.1d: with mustAttack, "… and attacks a player other than you if able" (the requirement goad imposes, CR 701.15b, without goading): the players to attack someone other than, fixed on resolution. A creature able to attack only those players or planeswalkers still attacks; `unlessPays?`: CostDef — CR 508.1g-i, 509.1d-f, 611.2: with cantAttack / cantBlock, a cost to attack / block for the duration instead of a ban ("Until your next turn, creatures can't attack you unless their controller pays {2} for each of those creatures": defending you, planeswalkers; "This turn, creatures can't block unless their controller pays {X} for each blocking creature they control"). mana / payLife / genericAmount (fixed on resolution, X included) for each affected attacker of a defending player (any without defending) or blocker; `perCreatureText?`: "those" — CR 508.1d, 509.1d: render the per-creature payment as "for each of those creatures"; no rules difference. - `cantCast` — Selected players cannot cast matching spells for this duration (CR 611.2). 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`); `target?`: TargetDef — What it acts on (TargetDef); `filter?`: ObjectFilter — Only spells matching this filter are forbidden; omitted means every spell; `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `mustBlock` — CR 509.1c: affected creatures block if able, optionally the specified attacker. Maximise requirements globally without violating blocking restrictions. Fields: `target`: TargetDef — What it acts on (TargetDef); `attacker?`: TargetDef — A specific creature that must be blocked if it attacks; selected independently from the blocker; `duration?`: "endOfTurn" | "endOfCombat" | "endOfAdditionalCombat" | "untilYourNextTurn" | "untilEndOfYourNextTurn" | "untilEndOfNextTurn" | "untilStackEmpty" | "untilYourNextEndStep" | "untilYourNextUpkeep" | "permanent" | "whileYouControlSource" | "whileYourTurn" — How long it lasts (see Durations on the Relationships & references page). - `controlDeclarations` — CR 508.6 / 509.6 (Master Warcraft, Odric, Master Tactician): for the duration, the selected player makes every attack or block declaration instead of the players who would, subject to the usual requirements, restrictions and costs. The most recently created such effect applies. Fields: `declarations`: "attackers" | "blockers" — Which declarations the player takes over: every attack (attackers, CR 508.6) or every block (blockers, CR 509.6); `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 player who makes the declarations (default: the effect's controller); fixed on resolution; `duration?`: "endOfTurn" | "endOfCombat" — "this turn" (endOfTurn) or "this combat" (endOfCombat); default endOfTurn; `howOnly?`: boolean — Render "you choose how those creatures block" — the same control, printed after a clause that already forces the blocks. - `playerRule` — A floating player rule from a resolving spell; defaults to end of turn (CR 305.2, 402.2, 611.2a). cantAttack: "can't attack with creatures" (CR 508.1c). 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`); `target?`: TargetDef — A declared player target ("Target player can't play lands this turn"); `rule`: "additionalLands" | "noMaxHandSize" | "maxHandSizeModifier" | "cantGainLife" | "cantLoseLife" | "lifeCantChange" | "cantLoseGame" | "cantWinGame" | "cantSearchLibraries" | "cantPlayLands" | "cantDrawCards" | "ignoreLegendRule" | "cantAttack" — Which player rule applies; `amount?`: ValueDef — Additional land plays or signed hand-size change, fixed on resolution; `duration?`: "endOfTurn" | "untilYourNextTurn" | "permanent" — How long it lasts (see Durations on the Relationships & references page). - `copyNextWithXMana` — CR 603.7: this turn, the next spell cast with {X} in its mana cost or ability activated with {X} in its activation cost triggers a copy with optional new targets. No fields. - `copyBoundStackObject` — CR 707.10: copy the triggering stack object or a spell actually cast by the enclosing castFree effect; its choices are copied. Fields: `from`: "trigger" | "castThisWay" — Where / what it comes from; `newTargets?`: boolean — The copy may have new targets chosen for it. - `nextSpellCantBeCountered` — The next matching spell you actually cast this turn cannot be countered (CR 611.2, 601.2i). Fields: `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together). - `nextSpellHas` — The next matching spell you cast this turn has this keyword ability, already while being cast (CR 611.2, 601.2). Fields: `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `keywordAbility`: KeywordAbilityDef — A parametrised keyword ability (KeywordAbilityDef: `{ "keyword": "ward", "cost": { … } }`). - `costModifier` — A resolving spell or ability changes what matching spells cost for a duration (CR 601.2f, 611.2a). 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`); `target?`: TargetDef — What it acts on (TargetDef); `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `amount`: number | { kind: "var"; name: string } | { kind: "count"; digSubset?: "looked" | "picked" | "rest"; of?: "object" | "player"; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; filter?: ObjectFilter; player?: any } | { kind: "doneThisWay"; of: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; filter?: ObjectFilter; distinctOwners?: boolean; by?: any } | { kind: "playerAggregate"; op: "max" | "min"; players?: any; value: ValueDef } | … (60 options) — Signed generic change, fixed on resolution (negative = less); `next?`: boolean — Only the next matching spell each affected player casts; `duration?`: "endOfTurn" | "untilYourNextTurn" | "permanent" — Default endOfTurn. permanent (with next): no time limit — lasts until a matching spell is cast ("The next planeswalker spell you cast costs {1} less to cast"). - `poisonCounters` — e.g. “you get a poison counter”. 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`); `target?`: TargetDef — What it acts on (TargetDef); `amount`: ValueDef — How many / how much (integer or ValueDef). - `playerCounters` — Give (negative: remove) player counters such as energy ({E}), experience or rad. 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`); `target?`: TargetDef — What it acts on (TargetDef); `counter`: string — Counter kind (any string: "+1/+1", "loyalty", "time", "oil" …); `amount`: ValueDef — How many / how much (integer or ValueDef). - `removePlayerCounters` — CR 122.1: selected players lose all counters, including poison, energy, experience and rad. 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`); `target?`: TargetDef — What it acts on (TargetDef). - `proliferate` — Proliferate: choose any number of permanents and/or players that have a counter, then give each another counter of each kind already there. No fields. - `addCounterEachKind` — CR 122.1, 122.6: for each kind of counter on the target permanent or player, give it another counter of that kind; not proliferate. Fields: `target`: TargetDef — What it acts on (TargetDef). - `populate` — CR 701.36: choose a creature token you control during resolution and create a copy. No creature tokens means no action. Fields: `tapped?`: boolean — Tapped (true) or untapped (false); on an effect that puts something onto the battlefield, it enters tapped; `attacking?`: boolean — Attacking (true) / not attacking (false); on an effect that creates or moves a creature, it enters attacking. - `createEmblem` — "You get an emblem with …": a command-zone object with these abilities. 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`); `target?`: PlayerTargetDef — CR 114.2, 601.2c: targeted player receiving the emblem; `name?`: string — The emblem's name; `abilities`: AbilityDef[] — Abilities (AbilityDef[]), the same shapes as a card's own. - `winGame` — e.g. “you win the game”. 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`). - `loseGame` — e.g. “you lose the game”. 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`); `target?`: TargetDef — What it acts on (TargetDef). - `cascade` — Exile from the top until a cheaper nonland card; you may cast it free; rest to the bottom at random. No fields. - `castAsFlash` — CR 702.8 / 611.2a: for the duration (default until end of turn), cast matching spells as though they had flash. 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); `once?`: boolean — Consumed by the next matching cast, even at normal timing; `duration?`: "endOfTurn" | "untilYourNextTurn" — CR 611.2a: endOfTurn (default) = "this turn"; untilYourNextTurn = "Until your next turn, you may cast sorcery spells as though they had flash" (Teferi, Time Raveler). - `playFromGraveyard` — CR 305.1 / 601.3: until end of turn, play matching graveyard cards with normal costs and timing. 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`); `fromPlayer?`: "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 graveyard supplies the one spell. Resolve this player when the permission is created; a matching card can arrive later; `anyMana?`: "color" | "type" — Spend mana as any color or type only while casting the spell using this permission; `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `target?`: TargetDef — CR 400.7, 611.2a: only these selected graveyard card incarnations receive permission; `castOnly?`: boolean — CR 305.1, 601.3: allow spells, not land plays; `once?`: boolean — CR 611.2a: one matching spell may be cast under this permission, which is then spent; `graveyardReplacement?`: "exile" — CR 614.1a, 400.7g: "If that spell would be put into your graveyard, exile it instead" — the spell cast using this permission is exiled instead of entering a graveyard from the stack; requires once and castOnly. - `castFreeFromZone` — CR 118.9, 611.2a: cast matching spells from the specified zone free until end of turn, with normal timing and additional costs. Fields: `zone`: "hand" | "graveyard" — CR 601.3: zone from which the permission allows casting; `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `duration?`: "endOfTurn" — How long it lasts (see Durations on the Relationships & references page). - `castFree` — Cast or play the target card without paying its mana cost, immediately during resolution (CR 608.2g). Fields: `target`: TargetDef — What it acts on (TargetDef); `anyOrder?`: boolean — CR 608.2g: the player may cast any number of the selected cards in any order, choosing the next card after each cast; `optional?`: boolean — "You may": the player chooses whether to do it; `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 — CR 608.2g: the casting player (default: the effect's controller); `current` inside a per-player examination is that player — "they may cast that card without paying its mana cost"; `play?`: boolean — CR 701.18 / 305: play, including a legal land play, during resolution; `payLife?`: ValueDef — CR 118.9: "by paying life equal to its mana value rather than paying its mana cost" (Anrakyr the Traveller) — life paid instead of the mana cost, read per card with { kind: "affected", property: "manaValue" }; always offered as a choice; `payCost?`: boolean — CR 608.2g, 601.2f-h: cast during resolution paying its costs ("you may cast it"), skipped if they can't be paid; `anyMana?`: "color" | "type" — CR 609.4b: with payCost — ", and mana of any type can be spent to cast that spell": spend mana as though it were mana of any color / any type to cast it (automatic and manual payment); `graveyardReplacement?`: "exile" — CR 614.1a / 400.7g: exile this cast spell if it would enter a graveyard while on the stack; `graveyardReplacementFilter?`: ObjectFilter — CR 614.1a: with graveyardReplacement, only spells cast this way matching this filter are exiled instead ("If an instant or sorcery spell cast this way would be put into your graveyard, exile it instead"); others reach the graveyard normally; `then?`: EffectDef[] — CR 608.2g: resolve if at least one card was actually cast or played; `else?`: EffectDef[] — CR 608.2g: resolve if no card was cast or played, including declined and impossible casts. - `exileMayPlay` — Impulse draw: exile cards and allow the player to play them for their normal costs until the end of this turn / your next turn / your next end step or upkeep / forever. Fields: `graveyardReplacement?`: "exile" — CR 614.1a, 400.7g: exile the spell cast using this permission if it would move from the stack to a graveyard, whether it resolves or is countered; `playLimit?`: number — Shared maximum number of cards playable across this permission (CR 611.2a, 601.3); `choose?`: number — Select this many exiled cards now; only they get permission (CR 608.2d); `while?`: ConditionDef — Ends permanently the first time this condition is false (CR 611.2b); `condition?`: ConditionDef — Checked whenever a card would be played, without ending permission (CR 601.3); `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`); `amount?`: ValueDef — Cards from the top of the library (default 1) when no target is given; `target?`: TargetDef — Specific cards to exile instead of the top of your library (e.g. mode top of another player's library); `until?`: "endOfTurn" | "endOfNextTurn" | "nextEndStep" | "nextUpkeep" | "endOfNextCombat" | "nextExile" | "forever" — Permission lifetime; next combat is on your next turn, and nextExile tracks the source incarnation (CR 611.2a, 400.7); `free?`: boolean — CR 118.9: cast spells without paying their mana costs under this permission; `optionalFree?`: boolean — Offer the option of casting without paying the mana cost in addition to normal play; `freeIf?`: ConditionDef — CR 118.9, 611.2c: evaluate when granting permission; if true spells may be cast without paying their mana costs; `filter?`: ObjectFilter — CR 601.3, 611.2a: only exiled cards matching this filter get the permission ("you may cast noncreature spells from among those cards", Narset, Enlightened Master); the others stay exiled; `castOnly?`: boolean — "You may cast" rather than play (no land plays); `faceDown?`: boolean — Face down (CR 708); `flash?`: boolean — CR 702.8: cast these cards as though they had flash while permission lasts; `anyMana?`: "color" | "type" — Mana may be spent as though it were mana of any color / any type to cast those spells (CR 609.4b). - `meld` — Exile this and its meld partner you own and control; put the melded card onto the battlefield. No fields. - `gainClassLevel` — Gain the next Class level. No fields. - `double` — Double a creature's power/toughness, the counters of a kind on it, or a player's life total. Fields: `what`: "power" | "toughness" | "powerAndToughness" | "counters" | "life" — What is doubled: power, toughness, both, counters or a life total; `factor?`: 2 | 3 — Multiplier 2 or 3 (default 2). Counters (CR 701.9e, 122.6): add (factor - 1) times the current count, subject to counter-placement replacements. Power / toughness (CR 701.10): +X/+0 (+0/+X) where X is (factor - 1) times the current value — "triple target creature's power"; `target?`: TargetDef — What it acts on (TargetDef); `counter?`: string — Counter kind (any string: "+1/+1", "loyalty", "time", "oil" …); `allCounters?`: boolean — CR 701.9e: multiply each kind of counter already on each selected object; absent kinds are never added; `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`); `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `designate` — Give (or remove) a designation: monstrous, renowned, saddled, exerted, …. Fields: `target?`: TargetDef — What it acts on (TargetDef); `designation`: string — A designation name (monarch, monstrous, renowned, saddled, suspected, prepared …); `value?`: boolean — False removes the designation instead of giving it; `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes. - `adapt` — CR 701.46a: adapt N — if this permanent has no +1/+1 counters on it, put N +1/+1 counters on it (a pending "adapts as though it had no counters" waiver is spent). Fields: `amount`: ValueDef — How many / how much (integer or ValueDef). - `goad` — Goad: it attacks each combat if able and attacks a player other than you if able. Fields: `target`: TargetDef — What it acts on (TargetDef). - `unlockDoor` — CR 709.5: unlock a locked door of a Room (lockOrUnlock: lock or unlock a door); the controller chooses the door. Fields: `target`: TargetDef — What it acts on (TargetDef); `lockOrUnlock?`: boolean — Lock or unlock a door instead of only unlocking. - `suspect` — Suspect: it has menace and can't block. Fields: `target`: TargetDef — What it acts on (TargetDef). - `detain` — Detain: until your next turn it can't attack, block, or activate abilities. Fields: `target`: TargetDef — What it acts on (TargetDef). - `skipNextUntap` — CR 502.2, 611.2c: skip the controller's next untap, or a specified player's next untap step. All-object selectors stay dynamic; declared targets retain object identity. Fields: `target?`: TargetDef — What it acts on (TargetDef); `during?`: "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 untap step is skipped (default the permanent's controller); `playerTarget?`: PlayerTargetDef — The player target that `who` / `during: "target"` reads (a PlayerTargetDef: `{ "of": "player", "mode": "chosen" }`). - `explore` — e.g. “~ explores”. Fields: `target?`: TargetDef — What it acts on (TargetDef). - `connive` — e.g. “~ connives”. Fields: `target?`: TargetDef — What it acts on (TargetDef); `amount?`: ValueDef — How many / how much (integer or ValueDef). - `amass` — Amass N. Fields: `target?`: TargetDef — What it acts on (TargetDef); `subtype?`: string — A subtype; `amount`: ValueDef — How many / how much (integer or ValueDef); `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 player who amasses (CR 701.47a); default: the controller. - `bolster` — e.g. “bolster 1”. Fields: `amount`: ValueDef — How many / how much (integer or ValueDef). - `blight` — Blight N (CR 701.68): each blighting player puts N -1/-1 counters on a creature they control, chosen as it's done (not targeted); "the blighted creature" is target mode affected. Fields: `amount`: number | { kind: "var"; name: string } | { kind: "count"; digSubset?: "looked" | "picked" | "rest"; of?: "object" | "player"; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; filter?: ObjectFilter; player?: any } | { kind: "doneThisWay"; of: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; filter?: ObjectFilter; distinctOwners?: boolean; by?: any } | { kind: "playerAggregate"; op: "max" | "min"; players?: any; value: ValueDef } | … (60 options) — N: the -1/-1 counters put on the chosen creature; `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 blighting players (default you); `target?`: PlayerTargetDef — A declared player who blights ("target opponent blights 2"). - `endure` — Endure N: N +1/+1 counters or an N/N white Spirit token. Fields: `amount`: ValueDef — How many / how much (integer or ValueDef); `target?`: TargetDef — What it acts on (TargetDef). - `cloak` — Cloak: face down 2/2 with ward {2}. 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`); `target?`: TargetDef — What it acts on (TargetDef); `amount?`: ValueDef — How many / how much (integer or ValueDef). - `collectEvidence` — CR 701.59: exile graveyard cards with total mana value N or greater; an impossible optional collection cannot be chosen. Fields: `amount`: ValueDef — How many / how much (integer or ValueDef); `optional?`: boolean — "You may": the player chooses whether to do it. - `earthbend` — Earthbend N. Fields: `target`: TargetDef — What it acts on (TargetDef); `amount`: ValueDef — How many / how much (integer or ValueDef). - `airbend` — Airbend: exile; owner may cast it for {2} while exiled. Fields: `target`: TargetDef — What it acts on (TargetDef). - `moveCounters` — Move counters from the source (default) or `from` onto the target. Fields: `anyKind?`: boolean — CR 122.5, 608.2d: choose one counter kind on the donor on resolution; `allKinds?`: boolean — CR 122.5, 608.2d: every counter of every kind on the donor ("move all counters from …"); a donor that has left the battlefield — the source of its own dies / leaves trigger, or `from` the triggering object ("put its counters on …") — hands over the counters it last had (CR 603.10a). `counter`, `amount` and `anyKind` do not apply. With distributeAny, choose zero through the available number of each counter kind on a live donor for the single recipient; `distributeAny?`: boolean — CR 122.5, 608.2d: move any number of counters distributed among the selected recipients during resolution; `from?`: TargetDef — Where / what it comes from; `target`: TargetDef — What it acts on (TargetDef); `counter?`: string — Counter kind (any string: "+1/+1", "loyalty", "time", "oil" …); `amount?`: ValueDef — How many / how much (integer or ValueDef). - `discover` — Discover N. Subsequent effects can use var discoverDifference for the positive difference between N and the discovered card’s mana value, or zero when none qualifies (CR 701.57c). Fields: `amount`: ValueDef — How many / how much (integer or ValueDef). - `manifestDread` — Manifest dread: look at the top two cards of your library, manifest one of them (a face-down 2/2 creature) and put the other into your graveyard. 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`). - `clash` — e.g. “clash with an opponent”. Fields: `opponent?`: "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 — CR 701.30a: the opponent you clash with when the text names one ("clash with defending player"); omitted means an opponent of your choice; `then?`: EffectDef[] — Effects that follow ("then …", "if you do …"); `else?`: EffectDef[] — Effects run when the condition / choice / payment fails ("otherwise …", "if you don't …"). - `flipCoin` — Flip coin(s): then = you win, else = you lose, perWin = once per flip won. Fields: `untilLose?`: boolean — CR 705: repeat called flips until a loss; `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`); `amount?`: ValueDef — How many / how much (integer or ValueDef); `then?`: EffectDef[] — Effects that follow ("then …", "if you do …"); `else?`: EffectDef[] — Effects run when the condition / choice / payment fails ("otherwise …", "if you don't …"); `perWin?`: EffectDef[] — Effects run once per flip won; `perHeads?`: EffectDef[] — CR 705.2: uncalled flips (no flip is won or lost); runs once for each coin that comes up heads. Excludes then / else / perWin / untilLose. - `rollDie` — Roll a die (d20 default); the matching result's effects run. 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`); `sides?`: number — Number of sides of the die (default 20); `reroll?`: { condition: ConditionDef; optional?: boolean } — CR 706.6: ignore a matching initial roll and reroll once before roll events; `perResult?`: EffectDef[] — After all dice are rolled, do this for each result; `chooseResult?`: boolean — CR 706.3, 608.2d: the roller chooses one result; dieResult.of chosen/other read it; `then?`: EffectDef[] — Instructions after the rolls; dieResult.of can read total/highest/lowest; `amount?`: ValueDef — How many / how much (integer or ValueDef); `add?`: ValueDef — CR 706.2: "roll a d20 and add X" — X is added to the (single) die's result before the results table is read; dieResult is the modified result; `results`: ({ min: number; max?: number; orMore?: boolean; effects: EffectDef[] })[] — Result ranges of the die roll: each `{ min, max?, effects }`. - `vote` — Each player votes; winner = most-voted option(s) run once, each = run once per vote (CR 701.38). Fields: `options`: ({ label: string; effects: EffectDef[] })[] — Named options; empty when players vote for a player (forPlayer) or an object (forObject); `tally?`: "winner" | "each" — winner: most-voted option(s) run once; each: run once per vote with current bound to the voter, an option's votes in APNAP order; afterwards the union of the votes' selections is the affected selection (CR 701.38, 101.4, 608.2c); `tieOption?`: number — CR 701.38: designated winner when the vote is tied; `extraVotes?`: ValueDef — Extra votes the controller gets; `secret?`: boolean — CR 701.38a, 101.4: each player secretly votes, then all votes are revealed together; `forPlayer?`: { otherThanVoter?: boolean } — CR 701.38a: players vote for a player; read the votes each player received with the value votes (player); `forObject?`: TargetDef — CR 701.38a, 608.2c: players vote for one of these objects; the object(s) with the most votes or tied for most become the affected selection. - `joinForces` — CR 101.4, 117.1d, 608.2g: each player, starting with you in turn order, may pay any amount of mana; all payments finish before the continuation. Fields: `effects`: EffectDef[] — CR 608.2c: continuation with X equal to the sum actually paid by all players. - `temptingOffer` — Each opponent may do the same; for each who does, you do it again. Fields: `effects`: EffectDef[] — The effects, resolved in order (EffectDef[]). - `parley` — Parley: each player reveals their top card; run once per nonland card; then each player draws. Fields: `perNonland`: EffectDef[] — Effects run once for each nonland card revealed. - `fromOutsideGame` — Take a matching card you own from outside the game (sideboard); learn also offers discard-then-draw. Fields: `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `destination?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — Zone the objects are put into; `optional?`: boolean — "You may": the player may decline; `learn?`: boolean — Learn: also offer "discard a card, then draw a card" instead of taking a Lesson; `reveal?`: boolean — CR 400.11, 701.20a: false when the card isn't revealed ("put a card you own from outside the game into your hand"); default true (wishes and learn print "reveal"). - `incubate` — e.g. “incubate 1”. 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 — The player who gets the Incubator token ("its controller incubates X", CR 701.36a); default you; `amount`: ValueDef — How many / how much (integer or ValueDef). - `tokenCopyPerOpponent` — For each opponent, create a token copy attacking that player (myriad / encore). Fields: `target?`: TargetDef — What it acts on (TargetDef); `haste?`: boolean — The created tokens have haste; `cleanup`: "exileEndOfCombat" | "sacrificeEndStep" | "none" — What happens to the token copies: exiled at end of combat, sacrificed at the end step, or nothing. - `venture` — Venture into the dungeon. Fields: `dungeon?`: string — Name of the dungeon to venture into (default: the player's choice). - `choose` — Announce a legal choice while resolving; available to every later effect of this ability (CR 608.2c-d). Fields: `excludeExisting?`: boolean — CR 122.1, 608.2d: counterKind chooses from explicit options absent from target, instead of existing counters on target; `startingWithYou?`: boolean — CR 101.4, 608.2d: choose in turn order starting with the ability controller, rather than the active player; `different?`: boolean — CR 608.2d: with several choosers (kind object), each chooses an object no earlier chooser chose — "that hasn't been chosen", "a different card"; `secret?`: boolean — CR 101.4: keep choices private until reveal; `selections?`: TargetDef[] — CR 608.2d: each player makes these selections in order, then the next player chooses; `opponentsOnly?`: boolean — A player choice must be an opponent of the ability controller (CR 102.2, 608.2d); `chooseAtRandom?`: boolean — Choose one member of the selected set uniformly at random (CR 608.2c); `from?`: ObjectFilter — Choose only colors of matching objects (CR 105.1, 608.2d); `zone?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — Zone containing the color sources; defaults to battlefield (CR 400.1); `excludePreviouslyChosen?`: boolean — Exclude earlier values chosen by this source object; reset on zone changes (CR 608.2d, 400.7); `options?`: string[] — Explicit legal values, such as a printed list of card names (CR 608.2d); `exclude?`: string[] — Forbidden choice values; colors use W/U/B/R/G codes (CR 608.2d); `kind`: "object" | "option" | "counterKind" | "creatureType" | "color" | "cardName" | "basicLandType" | "landType" | "cardType" | "landNonland" | "oddEven" | "number" | "player" — CR 608.2d: option selects one of the explicit named options; collect retains each player's answer. landType: any land type (CR 205.3i); exclude the five basic types for "a nonbasic land type"; `key?`: string — Storage key; defaults to kind; `label?`: string — Prompt shown to the chooser; `min?`: number — Fewest selections; `max?`: number — Most selections; `filter?`: { types?: string[]; notTypes?: string[]; anyTypes?: string[] } — Printed card-type restrictions on a card name, such as nonland (CR 201.4a); `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 — Chooser; defaults to controller. When given, the chooser is also the selection's current player (player/controller/owner "current" read as theirs: each player picks from their own graveyard). When omitted the controller chooses and "current" keeps its outer binding — inside forEachPlayer the iterated player ("for each opponent, choose a permanent that player controls": you pick among that opponent's permanents); `target?`: TargetDef — kind object records a selection; counterKind reads counters on this object or player; otherwise this is the chooser player target (CR 601.2c, 608.2d, 122.1); `inline?`: boolean — Printed within the following effect as of your choice; still a resolution-time choice (CR 608.2d); `remember?`: boolean — Also retain on the source for linked later abilities (CR 607.2d); otherwise local to this resolution; `collect?`: boolean — With several choosers (who: eachPlayer), keep every player's choice: a chosenSubtype filter reading this key matches any of them — "of a type chosen this way" (CR 608.2d). Local to this resolution; `revealAs?`: "simultaneous" | "plain" — With secret collected answers (kind number, who eachPlayer), how they are revealed. simultaneous (default): all players reveal them at once and the highest and lowest are determined (Wheel of Misfortune). plain: the printed "then those numbers are revealed" with no further reveal (Menacing Ogre). Rules-neutral wording; CR 101.4. - `noteValue` — CR 107.3, 608.2h: snapshot value under key (default number) for later noted references; local restricts numeric storage to the resolution. Fields: `target?`: TargetDef — What it acts on (TargetDef); `key?`: string — Storage key of a noted value or choice (defaults to the choice's kind); `value?`: ValueDef — The value to store or compare; `local?`: boolean — CR 608.2h: store numeric value only in this resolution's variables, inherited by delayed effects; do not persist on the source; `chooseCardName?`: boolean — The noted value is a card name chosen as it resolves; `chooseColor?`: boolean — The noted value is a color chosen as it resolves. - `guess` — CR 608.2c-d: a player guesses whether a statement is true ("An opponent guesses whether the top card of your library is the chosen kind"). Read the outcome later in this resolution with the guessedRight condition ("If they guessed right, …"), usually after a reveal. Fields: `guesser?`: "opponent" | "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 guesser: "opponent" (default) is an opponent of your choice (you choose in a multiplayer game); a player selector names the guesser ("defending player guesses" = defendingPlayer); `condition`: { kind: "native"; id: string; params?: object; text?: string } | { kind: "kicked"; of?: "triggering"; kicker?: string } | { kind: "bargained"; of?: "triggering" } | { kind: "costPaidMatches"; cost: "sacrifice" | "discard" | "returnToHand"; noun?: "creature" | "permanent" | "artifact" | "card" | "land"; filter: ObjectFilter; thisWay?: "passive" | "active" } | { kind: "choseOption"; option: string; key?: string; who?: any } | … (53 options) — The statement guessed about, read from this ability's point of view as the guess is made: "whether the top card of your library is the chosen kind" = { kind: "topCard", who: "you", filter: { chosenKind: true } }; `key?`: string — Storage key for the guess; default "guess". - `repeat` — CR 608.2c, 608.2h: evaluate amount once, then perform effects in order that many times. Negative counts perform no instructions. Choices within effects occur on each iteration. Fields: `amount?`: ValueDef — How many / how much (integer or ValueDef); `from?`: ValueDef — Inclusive start; amount is the inclusive end (CR 608.2c); `index?`: string — Locally bound index variable for each number (CR 107.1); `effects`: EffectDef[] — The effects, resolved in order (EffectDef[]); `process?`: boolean — CR 608.2c: "repeat this process" — run effects again after each pass in which a nested repeatProcess executed. Inside a pass, "this way" (doneThisWay, thisWay) reads only that pass's actions ("If an Insect card was milled this way, … repeat this process"); `cumulative?`: boolean — With process: "this way" spans every pass so far, not only the current one (CR 608.2c: "unless it has the same name as another card exiled this way", Tainted Pact). - `repeatProcess` — CR 608.2c: repeat the enclosing repeat { process: true } after this pass. Fields: `optional?`: boolean — CR 608.2d: "you may repeat this process any number of times"; `once?`: boolean — CR 608.2c: "repeat this process once" — only the first pass may start one more pass. - `forEachObject` — CR 608.2c, 608.2h, 400.7: process a fixed object selection once per object. Each body starts with that object as affected; thisWay retains action-time controller/owner information, including tokens. A thisWay target.zone restricts the recorded action destination (CR 614.1), including tokens that later cease to exist. Fields: `target`: TargetDef — What it acts on (TargetDef); `effects`: EffectDef[] — The effects, resolved in order (EffectDef[]); `simultaneous?`: boolean — CR 614.12, 608.2c: the passes' entries are one simultaneous event ("put those cards onto the battlefield" after searching for each); no card entering modifies how another enters. - `forEachPlayer` — CR 101.4, 601.2c, 608.2c: process each player in APNAP order, binding current to them. Declare nested chosen targets once per player when putting the spell/ability on the stack. Fields: `players`: "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" | { kind: "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"; span?: number; where?: ConditionDef; except?: any; most?: ValueDef; fewest?: ValueDef } — The players iterated in APNAP order (CR 101.4); any player selector; `effects`: EffectDef[] — The effects, resolved in order (EffectDef[]); `atAnnouncement?`: true — CR 601.2c, 603.3d: fix the players when targets are announced, including when no player qualifies; `simultaneous?`: boolean — CR 608.2c, 120.2b: the passes are one simultaneous damage event ("~ deals damage to each player equal to the number of nonbasic lands that player controls"; Incite Rebellion: the damage is dealt simultaneously) — lifelink gains once and each prevention effect triggers and finishes once (CR 120.3f, 615.13, 615.5). - `forEachCardType` — CR 205.2a, 608.2c: "for each card type among permanents …" — the types are fixed as this starts; effects run once per type (artifact, battle, creature, enchantment, kindred, land, planeswalker) with it as the chosen card type (filter chosenType: "a permanent card of that type"). Fields: `among`: { native?: object; exclude?: any; anyOf?: ObjectFilter[]; types?: string[]; anyTypes?: string[]; subtypes?: string[]; supertypes?: string[]; colors?: string[]; notTypes?: string[]; notSubtypes?: string[]; notSupertypes?: string[]; notColors?: string[]; colorless?: boolean; multicolored?: boolean; monocolored?: boolean; colorCount?: number; minCardTypes?: number; controller?: Relation; owner?: "you" | "opponent" | "any" | "notYou" | "current"; kicked?: boolean; sharesColorWithTriggeringMana?: boolean; manaSpentToCast?: object; manaSpentFrom?: object; castFrom?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; notCastFrom?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; convoked?: boolean; enteredFrom?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; hasHybridMana?: boolean; manaCostContains?: string; hasAdventure?: boolean; withKeyword?: string; hasBasicLandType?: boolean; hasNonbasicLandType?: boolean; withKeywordAbility?: string; withoutKeywordAbility?: string; withTapAbility?: boolean; withAbility?: "activated" | "triggered" | "mana" | "nonManaActivated"; withoutManaAbility?: boolean; withoutAbilities?: boolean; withoutKeyword?: any; tapped?: boolean; isRingBearer?: boolean; isToken?: boolean; attacking?: boolean; attackingAlone?: boolean; tappedForSourceThisTurn?: "crew" | "saddle"; attackedThisTurn?: boolean; canAttack?: boolean; blockedThisTurn?: boolean; wasBlockedThisTurn?: boolean; attackingPlayer?: any; attackingPlaneswalkerControlledBy?: any; blocking?: boolean; blocked?: boolean; modified?: boolean; bandedWithSource?: boolean; minPowerOrToughness?: number; maxPowerOrToughness?: number; minPowerPlusToughness?: number; maxPowerPlusToughness?: number; minPower?: number; maxBasePower?: number; maxBaseToughness?: number; basePower?: number; baseToughness?: number; powerAboveBase?: boolean; maxPower?: number; minToughness?: number; maxToughness?: number; minToughnessValue?: any; maxToughnessValue?: any; minManaValueValue?: any; minManaValue?: number; maxManaValue?: number; manaValueValue?: any; manaValues?: number[]; manaCosts?: string[]; maxManaValueValue?: any; manaValueVar?: string; hasCounter?: string; inZone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; suspended?: boolean; withoutCounter?: string; self?: boolean; other?: boolean; otherThanTrigger?: boolean; otherThanAffected?: boolean; name?: string; nameOf?: "self" | "affected"; host?: boolean; attachedToSource?: boolean; attachedToReference?: "affected" | "triggering" | "triggeringOther"; attachedTo?: any; sharesWithHost?: "creatureType" | "color" | "cardType"; attachedToHost?: boolean; enchanted?: boolean; hasAttachment?: object; enchantedByOther?: boolean; equipped?: boolean; notAffected?: boolean; notChosenSubtype?: boolean | string; chosenSubtype?: boolean | string; chosenColor?: boolean | string; chosenParity?: boolean | string; chosenPowerParity?: boolean | string; manaValueParity?: "odd" | "even"; chosenKind?: boolean | string; chosenType?: boolean | string; chosenName?: boolean | string; chosenBy?: "controller" | "owner"; comparedToSource?: object; comparedToTrigger?: object; maxManaValueVar?: string; minManaValueVar?: string; minPowerValue?: any; maxPowerVar?: string; maxPowerValue?: any; designation?: string; withoutDesignation?: string; attachedToSameHost?: boolean; isCommander?: boolean; linkedToSource?: boolean; putWithSource?: boolean; phasedOut?: boolean; faceDown?: boolean; sharesWithSource?: "creatureType" | "cardType" | "color" | "name"; sharesWithSacrificed?: "creatureType" | "cardType" | "color" | "name"; notSharesLandTypeWith?: object; sharesWithTarget?: "creatureType" | "cardType" | "color" | "name"; sharesWith?: object; comparedTo?: object; attachedToSelection?: any; inSelection?: any; targetableByTriggering?: boolean; targetOfTriggering?: boolean; controllerOfTriggeringTarget?: boolean; combatWith?: object; discardedThisTurn?: boolean; enteredGraveyardThisTurn?: true | "fromAnywhere" | "fromBattlefield" | "fromLibrary" | "milled"; attached?: boolean; enteredThisTurn?: boolean; alreadyOnBattlefield?: boolean; enteredThisTurnUnder?: any; damagedThisTurn?: boolean; dealtDamageThisTurn?: boolean; dealtDamageToThisTurn?: any; dealtCombatDamageToThisTurn?: any; counterPlacedThisTurnBy?: "you"; damagedBySource?: boolean; damagedByHost?: boolean; damagedThisTurnBy?: any; drawnThisTurn?: boolean; fromStartingDeck?: boolean; minCounters?: number; hasSticker?: "any" | "name" | "art" | "ability" | "pt"; onSprocket?: 1 | 2 | 3 | "crank"; isHost?: boolean; hasAugment?: boolean } — The battlefield permanents whose card types are counted ("permanents your opponents control": { controller: "opponent" }); `effects`: EffectDef[] — The effects, resolved in order (EffectDef[]). - `pair` — Soulbond: pair the source with another unpaired creature you control. Fields: `target?`: TargetDef — What it acts on (TargetDef). - `unattach` — e.g. “unattach ~”. Fields: `target?`: TargetDef — What it acts on (TargetDef). - `extraTurn` — e.g. “you take an extra turn after this one”. 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`); `target?`: TargetDef — What it acts on (TargetDef); `atEnd?`: EffectDef[] — CR 500.7, 603.7: delayed effects at the beginning of this particular extra turn's end step; other extra turns do not satisfy it, and a skipped turn has no end step; `skipUntap?`: boolean — CR 500.7, 614.10: "Skip the untap step of that turn."; `noSchemes?`: boolean — CR 701.32a, 904.9: "Schemes can't be set in motion that turn." — neither the archenemy's turn-based action nor an effect sets a scheme in motion during that extra turn. - `additionalCombat` — CR 500.8, 506.1: after the current phase, add a combat phase without an implicit untap or main phase. Fields: `followedByMain?`: boolean — "… followed by an additional main phase" (CR 505.1a): a main phase follows the added combat before the turn resumes. - `additionalPhase` — CR 500.8, 501.1: "there is an additional beginning phase after this phase" — the phase is inserted directly after the current one (the most recently created first), then the turn resumes where it left off. Gets an additional upkeep step after this step" (CR 500.8) adds an upkeep step directly after the upkeep step that is in progress. Fields: `phase`: "beginning" | "upkeep" — The kind of phase added: the beginning phase (untap, upkeep and draw steps) or an additional upkeep step; `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 player the added upkeep step is for ("that player gets an additional upkeep step"); it is added to the turn being taken. - `skipStep` — e.g. “you skip your next untap step”. 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`); `target?`: TargetDef — What it acts on (TargetDef); `step`: "untap" | "draw" | "combat" | "turn" — Which step or turn is skipped; `thisTurn?`: boolean — CR 500.11: with combat, "skips their next combat phase this turn" — lapses at the end of this turn; `allOfNextTurn?`: boolean — CR 500.11: with combat, "skips all combat phases of their next turn" — every combat phase of the next turn they take. - `becomeMonarch` — e.g. “you become the monarch”. 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`); `target?`: TargetDef — What it acts on (TargetDef). - `setDayNight` — CR 730.1, 730.3: "it becomes day / night"; nothing happens if it already is. Fields: `to`: "day" | "night" — Day or night. - `temptRing` — CR 701.64 (formerly 701.52): the Ring tempts you; gain its next ability and choose a creature you control as Ring-bearer. 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`). - `takeInitiative` — e.g. “you take the initiative”. 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`); `target?`: TargetDef — What it acts on (TargetDef). - `phaseOut` — e.g. “target creature phases out”. Fields: `target`: TargetDef — What it acts on (TargetDef); `untilSourceLeaves?`: boolean — CR 702.26: "phases out until this enchantment leaves the battlefield" — no untap-step phase-in; it phases in immediately after the source leaves. Nothing phases out if the source already left; `phaseInTapped?`: boolean — With untilSourceLeaves: "Tap that creature as it phases in this way" — it phases in tapped (no becomes-tapped trigger). - `exchangeControl` — Exchange two permanents atomically; target may select exactly two, or second defaults to the source (CR 701.12a-b). Fields: `target`: TargetDef — What it acts on (TargetDef); `second?`: TargetDef — The second object of the exchange (default the source). - `startEngines` — e.g. “start your engines!”. 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`). - `ascend` — CR 702.131a: resolving ascend grants the city's blessing if you control ten or more permanents. 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`). - `conjure` — Conjure a card (by library id, or a duplicate of the target) into a zone. 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`); `target?`: PlayerTargetDef — The declared player that who "target" reads ("that player conjures …", CR 115.1, 608.2c); `cardId?`: string — Library id of the card conjured; `choices?`: string[] — Printed named alternatives; the conjuring player chooses one at resolution (Izzet Polarizer); `chooseAtRandom?`: boolean — Sample one named alternative uniformly, without a player choice (CR 608.2c analogue); `copyOf?`: TargetDef — A selection whose card is duplicated; `destination?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — Zone the objects are put into; `position?`: "top" | "bottom" — Top or bottom of the library; `randomWithinTop?`: number — Insert each conjured card at a uniformly random position among the final top N cards; leave existing library cards in order (CR 401.2 analogue); `tapped?`: boolean — Tapped (true) or untapped (false); on an effect that puts something onto the battlefield, it enters tapped; `attacking?`: boolean — "onto the battlefield tapped and attacking": a conjured permanent enters attacking, without being declared (CR 508.4); `amount?`: ValueDef — How many / how much (integer or ValueDef). - `seek` — Seek: a random matching card from your library into your hand. 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); `amount?`: ValueDef — How many / how much (integer or ValueDef); `fromTop?`: ValueDef — "from among the top N cards of your library": only those N cards, fixed when the effect starts, are candidates; `shuffle?`: boolean — "…, then shuffle": the seeking player shuffles their library afterwards (CR 701.24); `pick?`: "highestManaValue" — "seek a card with the highest mana value among …": only the candidates of greatest mana value are sought, at random among them (Alchemy; CR 202.3). - `draft` — Draft: choose one of three distinct random entries from the source card's spellbook and conjure it into hand. Requires supplied spellbook data. The drafted cards are the effect's selection ("and reveals it"). 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`); `target?`: PlayerTargetDef — The declared player that who "target" reads ("target opponent drafts …", CR 115.1). - `perpetualManaCost` — Perpetually replace the card's mana cost, or reduce its generic symbols. This changes mana value and survives zone changes. Fields: `target`: TargetDef — What it acts on (TargetDef); `manaCost?`: string — Mana cost in braces, e.g. "{2}{G}{G}"; `reduce?`: number — Reduce the generic part of the mana cost by this much. - `intensify` — Increase persistent intensity by amount (default 1). Default target is the source; allOwned selects cards the controller owns in every zone, narrowed by filter. Fields: `target?`: TargetDef — What it acts on (TargetDef); `amount?`: ValueDef — How many / how much (integer or ValueDef); `allOwned?`: boolean — Every card you own in every zone (narrowed by `filter`) instead of the source; `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together). - `specialize` — Change the source into a specialization allowed by the card discarded to activate specialize. No fields. - `unspecialize` — Revert to the printed base card. returnTapped returns it from the graveyard tapped only if it unspecialized this way. Fields: `target?`: TargetDef — What it acts on (TargetDef); `returnTapped?`: boolean — Return it to the battlefield tapped if it unspecialized this way. - `oneTimeBoon` — Give a player a floating triggered ability that persists after its source leaves and is consumed when it first triggers (or after `uses` triggers). 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`); `trigger`: TriggerDef — The TriggerDef: which event, whose, which object; `effects`: EffectDef[] — The effects, resolved in order (EffectDef[]); `uses?`: number — An N-time boon ("you get a three-time boon with …"): it triggers up to this many times, each trigger using one; absent = one-time. - `spellEntersWith` — The spell's permanent enters with the specified counters or temporary ability, or enters tapped (CR 614.1c). Amounts are read now, with it = that spell. Fields: `target`: TargetDef — What it acts on (TargetDef); `counters?`: ({ counter: string; amount: ValueDef })[] — Counters it enters with: each `{ counter, amount }`; `additional?`: boolean — Counters in addition to those it would otherwise enter with; `tapped?`: boolean — Tapped (true) or untapped (false); on an effect that puts something onto the battlefield, it enters tapped; `keywordUntilNextTurn?`: KeywordAbilityDef — The permanent that this spell becomes enters with this keyword ability until your next turn. - `heist` — Heist the targeted opponent's library: sample three distinct random nonlands, choose one to exile face down; you may cast it while exiled using mana of any type. Repeat amount times (default 1). Fields: `target`: PlayerTargetDef — What it acts on (TargetDef); `amount?`: number — How many / how much (integer or ValueDef). - `openAttraction` — Open an Attraction: the top card of your Attraction deck onto the battlefield. 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`); `amount?`: ValueDef — How many / how much (integer or ValueDef). - `rollToVisit` — Roll to visit your Attractions. 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`). - `claimPrize` — Claim the prize: run this Attraction's Prize effects. No fields. - `assembleContraption` — Assemble a Contraption onto a sprocket of your choice. 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`); `amount?`: ValueDef — How many / how much (integer or ValueDef). - `reassembleContraption` — Gain control of target Contraption and move it onto one of your sprockets. Fields: `target`: TargetDef — What it acts on (TargetDef). - `moveContraption` — Move target Contraption to another sprocket. Fields: `target`: TargetDef — What it acts on (TargetDef); `sprocket?`: 1 | 2 | 3 — Sprocket 1, 2 or 3. - `crank` — Crank the target Contraption(s). Fields: `target`: TargetDef — What it acts on (TargetDef). - `advanceCrank` — Move your CRANK! counter to the next sprocket and crank that sprocket's Contraptions. 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`); `any?`: boolean — Unfinity crank variant flag; leave unset unless a stock example uses it. - `setInMotion` — Set a scheme in motion (CR 701.32): turn the top card of the player's scheme deck face up in the command zone; its "When you set this scheme in motion" abilities trigger. amount times, one at a time (CR 701.32c). 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`); `amount?`: ValueDef — How many / how much (integer or ValueDef); `target?`: TargetDef — CR 701.32b: a particular scheme ("set that scheme in motion again": { of: "object", mode: "triggering" }) instead of the top of the scheme deck; it is set in motion even if it is already face up. - `chooseSelfOrOthers` — Archenemy (CR 904, 608.2d): "target opponent chooses self or others. If that player chooses self, … If the player chooses others, …". 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 — The chooser; default the declared target player; `target?`: PlayerTargetDef — What it acts on (TargetDef); `self`: EffectDef[] — Runs if they choose self, with the chooser as current ("that player sacrifices two creatures"); `others`: EffectDef[] — Runs if they choose others, with the chooser as current ("each of your other opponents": { kind: "eachOpponent", except: "current" }). - `abandon` — Abandon this scheme (CR 701.33): the face-up ongoing scheme that is the source is turned face down and put on the bottom of its owner's scheme deck. No fields. - `putSticker` — Put a sticker on the target: choose an unused sticker from your sheets and pay its ticket cost. 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`); `target?`: TargetDef — What it acts on (TargetDef); `kinds?`: ("name" | "art" | "ability" | "pt")[] — Which sticker kinds may be chosen: name, art, ability, pt; `amount?`: ValueDef — How many / how much (integer or ValueDef). - `combineAugment` — Combine this augment card with target host. Fields: `target?`: TargetDef — What it acts on (TargetDef). - `empower` — Empower N: put N loyalty counters on a token you control with that name, creating it first if you control none. 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`); `tokenName`: string — Name of the token to empower (created first if you control none); `token`: { name: string; supertypes?: string[]; types?: string[]; subtypes?: string[]; colors?: string[]; manaCost?: string; power?: ValueDef; toughness?: ValueDef; keywords?: string[]; abilities?: AbilityDef[]; abilitiesInFollowingSentence?: boolean; keywordAbilities?: KeywordAbilityDef[]; tokenDefId?: string; withCounters?: object } — The complete inline token spec (TokenSpec: name, types, subtypes, colors, power, toughness, keywords, abilities …); `amount`: ValueDef — How many / how much (integer or ValueDef). - `timeTravel` — Time travel: add or remove a time counter on each suspended card you own and each permanent you control with a time counter. 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`). - `recruit` — Recruit: draw, then discard; if a nonland card was discarded, create a 1/1 white Human Soldier token. 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`). - `assimilate` — Assimilate: the creature card enters under your control with a +1/+1 counter as a Borg artifact creature with no other creature types. Fields: `target`: TargetDef — What it acts on (TargetDef). - `fateseal` — Fateseal N: look at the top N cards of an opponent's library and put any number of them on the bottom. Fields: `amount`: ValueDef — How many / how much (integer or ValueDef); `target?`: TargetDef — What it acts on (TargetDef). - `manifest` — Manifest the specified number of cards face down as 2/2 creatures. 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`); `from?`: "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 — CR 701.40, 110.2: manifest from this single player's library under who's control; omitted uses who's library; `amount?`: ValueDef — How many / how much (integer or ValueDef); `fromZone?`: "library" | "hand" — CR 701.40: library top by default; hand cards are chosen privately by the manifesting player. - `turnFaceUp` — e.g. “turn ~ face up”. Fields: `target?`: TargetDef — What it acts on (TargetDef). - `turnFaceDown` — CR 708.2a: turn a face-up permanent face down — the same object, now a 2/2 face-down creature; it turns face up again only through morph / megamorph / disguise. Double-faced permanents can't be turned face down (CR 712). Fields: `target?`: TargetDef — The permanents turned face down (default: the source); `as?`: { types: string[]; subtypes?: string[] } — CR 708.2: the face-down characteristics the effect lists ("It's a 2/2 Cyberman artifact creature"); always 2/2, nameless, textless, without mana cost. - `investigate` — Investigate: create a Clue token ("{2}, Sacrifice this artifact: Draw a card."). 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`); `amount?`: ValueDef — How many / how much (integer or ValueDef). - `exileUntilSourceLeaves` — e.g. “exile target creature until ~ leaves the battlefield”. Fields: `target`: TargetDef — What it acts on (TargetDef). - `flicker` — e.g. “exile target creature, then return that card to the battlefield under its owner's control”. Fields: `target`: TargetDef — What it acts on (TargetDef); `delayed?`: boolean — Return it at the beginning of the next end step instead of immediately. - `retarget` — CR 115.7: change existing targets to legal targets, retaining count and division. single changes one target; to fixes the new recipient. Fields: `target`: TargetDef — What it acts on (TargetDef); `to?`: TargetDef — What it applies to (TargetDef); `single?`: boolean — Change only one of the targets; `optional?`: boolean — "You may": the player chooses whether to do it; `newTargets?`: boolean — CR 115.7d: "you may choose new targets for …" — each target may be kept (even if illegal) or changed to a new legal target; the final set must be legal together. - `copyAbility` — CR 707.10: copy an activated or triggered ability and its choices; optionally choose new targets. Fields: `target`: TargetDef — What it acts on (TargetDef); `amount?`: ValueDef — How many copies ("copy … twice"); default one; `newTargets?`: boolean — The copy may have new targets chosen for it. - `copySpell` — Copy target spell (default: the source spell itself); `amount` copies (storm). Fields: `target?`: TargetDef — What it acts on (TargetDef); `amount?`: ValueDef — How many / how much (integer or ValueDef); `controller?`: "chosenOpponent" | "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 — Who controls the copy (CR 707.10): chosenOpponent prompts the controller for an opponent as it resolves; any player selector names the copier directly (the Chain cycle); `newTargets?`: boolean — CR 707.10: false retains targets; default true preserves legacy copies; `except?`: { keywords?: string[]; keywordAbilities?: KeywordAbilityDef[]; abilities?: any[]; addTypes?: string[]; addSubtypes?: string[]; setTypes?: string[]; setSubtypes?: string[]; removeSubtypes?: string[]; colors?: string[]; addColors?: string[]; power?: ValueDef; toughness?: ValueDef; loyalty?: ValueDef; notLegendary?: boolean; legendary?: boolean; name?: string; noManaCost?: boolean } — CR 707.9: exceptions the copies are made with ("the copy isn't legendary and has starting loyalty X"); a permanent spell's copy becomes a token with them; `copyTargets?`: TargetDef — CR 707.10d-e: one copy for each object this selects (amount and newTargets don't apply), every target of that copy changed to that object — "copy that spell for each other creature you control that the spell could target. Each copy targets a different one of those creatures", "The copy targets the chosen creature". An object that isn't a legal target for each instance of the word target gets no copy. - `copyCard` — Cast a copy of each selected card. Set optional and payManaCost for "you may cast the copies" at normal cost. For a group, its controller chooses the casting order during resolution (CR 707.12). Fields: `target?`: TargetDef — What it acts on (TargetDef); `chosenName?`: boolean | string — Create the named card copy using the earlier choice (CR 707.13); `payManaCost?`: boolean — Pay the copy's mana cost; otherwise waived (CR 707.12-13). With a target: "You may cast the copy" (paying its costs) rather than "… without paying its mana cost"; `optional?`: boolean — "You may": the player chooses whether to do it. - `link` — Link the target to the source (see target mode linked / filter linkedToSource). Fields: `target`: TargetDef — What it acts on (TargetDef). - `ripple` — Ripple N: reveal the top N; cast any with the same name free; rest to the bottom. Fields: `amount`: ValueDef — How many / how much (integer or ValueDef). - `encode` — Cipher: exile the source spell card encoded on the target creature. Fields: `target`: TargetDef — What it acts on (TargetDef). - `reflexiveTrigger` — When you do (CR 603.12): a separate triggered ability about the objects just acted on; choose its targets on the stack. Fields: `about?`: TargetDef — Optional fixed objects this trigger refers to; omitted for a payment-only trigger; `effects`: EffectDef[] — The effects, resolved in order (EffectDef[]); `modes?`: ({ label: string; effects: EffectDef[]; weight?: number; cost?: CostDef })[] — CR 603.12, 700.2a: "When you do, choose one —": the reflexive ability's modes, chosen as it goes on the stack; effects is then empty; `chooseMin?`: number — Minimum number of modes chosen (default 1; 0 for "choose any number"); `chooseMax?`: ValueDef — CR 700.2a, 107.3: maximum modes of the reflexive ability; `condition?`: ConditionDef — CR 603.12: it triggers only if this holds as the preceding action finishes ("When you reveal one or more nonland cards this way, …"). - `delayedTrigger` — Set up a delayed triggered ability (CR 603.7): "at the beginning of the next end step, …", "when that creature dies this turn, …", "whenever that creature is dealt damage this turn, …". Fields: `stepPlayer?`: "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 — CR 603.7d: snapshot whose next step to wait for on creation, independently of the ability controller (for example owner for Phytotitan); `nextTurn?`: boolean — Wait for a subsequent turn (CR 603.7); combined with trigger.by: you, the specified step on your next turn; `trigger`: TriggerDef — The TriggerDef: which event, whose, which object; `effects`: EffectDef[] — The effects, resolved in order (EffectDef[]); `about?`: TargetDef — The object(s) or player the delayed trigger is about, fixed once as it is created (CR 603.7c): mode chosen = a target of this spell / ability ("Choose target creature. Whenever that creature …"), affected = what the previous effect applied to ("~ deals 3 damage to target creature. When that creature dies this turn, …"). The ability then triggers only for those objects (a new object after a zone change no longer counts, CR 400.7; dies / leaves look back). Inside `effects`, mode about / triggering refer to it; `duration?`: Duration — How long it waits: endOfTurn = "this turn", endOfCombat = "this combat", untilYourNextTurn. Without one it triggers once, the next time the event happens (CR 603.7b); with one it triggers every time ("whenever") until then; `once?`: boolean — With a duration: trigger only once even so ("when that creature dies this turn", "when you next cast a spell this turn"); `optional?`: boolean — "You may" — asked as the delayed trigger resolves. - `replacement` — Create a replacement effect for a duration (default end of turn): "prevent all combat damage that would be dealt this turn", "if that creature would die this turn, exile it instead". once = applies to one event ("the next time …"); budget = the total amount it prevents / redirects ("the next 3 damage"). Fields: `replacement`: { replaces: "event"; event: "damage" | "draw" | "drawBatch" | "beginTurn" | "beginStep" | "dies" | "toGraveyard" | "leavesBattlefield" | "enters" | "destroy" | "counter" | "copySpell" | "untap" | "createTokens" | "putCounters" | "lifeGain" | "lifeLoss" | "loseGame" | "loseMana" | "addMana" | "mill" | "searchLibrary" | "rollDice" | "flipCoin" | "explore" | "connive" | "scry" | "proliferate" | "setInMotion"; to?: TargetDef; toPlayer?: any; from?: TargetDef; by?: any; lifeLossBy?: any; damageKind?: "combat" | "noncombat"; minAmount?: ValueDef; maxAmount?: ValueDef; exactAmount?: ValueDef; counter?: string; extraTurnOnly?: boolean; step?: "untap" | "draw"; duringUntapStep?: boolean; firstEachTurn?: boolean; manaColor?: string; coloredManaOnly?: boolean; manaFromColors?: string[]; manaPlayers?: any; manaAdditional?: string[]; manaMultiply?: number; manaExact?: string; manaOneColor?: boolean; tappedForMana?: boolean; enterController?: any; chooseEnterController?: boolean; enterTapped?: boolean; enterAttacking?: boolean; enterCounters?: object[]; enterAs?: EffectDef[]; tokenReplace?: object[]; tokenChoices?: object[]; tokenAdditional?: object[]; tokenAdditionalOnce?: object[]; shuffleOwnedIntoLibrary?: boolean; randomResults?: object; dieSides?: number; searchTop?: number; ownLibrary?: boolean; regenerate?: boolean; removeDamage?: boolean; removeCounterToUntap?: string; removeAllCounters?: string; tokenFilter?: ObjectFilter; fromZone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; toZone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; orEvents?: object[]; discarded?: boolean; causedBy?: "opponent"; notCast?: boolean; exceptFirstInDrawStep?: boolean; condition?: ConditionDef; optional?: boolean; prevent?: boolean; preventAmount?: ValueDef; preventAllBut?: ValueDef; multiply?: number; add?: ValueDef; newTargets?: boolean; addDieRoll?: number; half?: "up" | "down"; set?: ValueDef; redirectTo?: TargetDef; lifeFloor?: ValueDef; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; position?: "top" | "bottom"; shuffle?: boolean; link?: boolean; instead?: EffectDef[]; then?: EffectDef[] } — A general replacement effect: which event, which objects / players / sources, and what happens instead; `duration?`: Duration — CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes; `once?`: boolean — Applies only once (to the next matching event), then ends; `budget?`: ValueDef — Total amount this effect may prevent or redirect ("the next 3 damage"). - `reveal` — Reveal cards without moving them; object mode random selects on resolution (CR 701.20a, 608.2d). A prompt beginning "looks at" makes it a private look instead ("look at target player's hand"): only the controller sees the cards, for one acknowledgement decision, and nothing is revealed (CR 701.20a). Fields: `target?`: TargetDef — What it acts on (TargetDef); `zone?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — A zone name (battlefield, hand, graveyard, library, exile, stack, command); `prompt?`: string — Prompt text shown to the deciding player. - `if` — Conditional instructions (CR 608.2). Kicker/additional/alternative cost choices determine branch-specific targets during casting (CR 601.2c); identical targets in alternatives share a slot. Fields: `condition`: ConditionDef — A ConditionDef that must hold; `then`: EffectDef[] — Effects that follow ("then …", "if you do …"); `else?`: EffectDef[] — Effects run when the condition / choice / payment fails ("otherwise …", "if you don't …"). - `ifDone` — CR 608.2c, 609.3: perform the mandatory action as far as possible, then branch on full completion. Fields: `action`: { effect: "discard"; amount: ValueDef } | { effect: "tap"; target: TargetDef } | { effect: "removeCounters"; target: TargetDef; counter?: string; amount: any } | { effect: "moveTo"; target: TargetDef; destination: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; position?: "top" | "bottom"; tapped?: boolean; transformed?: boolean; controller?: "you" | "owner" } | { effect: "bounce"; target: TargetDef } | … (7 options) — The mandatory action; `then` runs only if it was done in full (CR 609.3); `then`: EffectDef[] — Effects that follow ("then …", "if you do …"); `else?`: EffectDef[] — Effects run when the condition / choice / payment fails ("otherwise …", "if you don't …"); `failure?`: "cant" — Render the failure branch as if you cannot perform the action. - `villainousChoice` — CR 608.2d: each affected player chooses one of two instructions; current is that player and you remains the controller. 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`); `options`: any[] — The two instructions the player chooses between. - `optional` — CR 608.2d: optional instructions, with current bound to the deciding 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 — CR 608.2d: each selected player makes their own yes/no choice; defaults to you. You in the body remains the source's controller; `target?`: PlayerTargetDef — CR 115.1: declared player target when who is target; `prompt?`: string — Prompt text shown to the deciding player; `then`: EffectDef[] — Effects that follow ("then …", "if you do …"); `else?`: EffectDef[] — Effects on declining the optional action (CR 608.2d); `onceEachTurn?`: boolean — "Do this only once each turn": the ability still triggers and resolves, but once the action has been taken this turn the choice is no longer offered (declining keeps it available later in the turn). - `mayPay` — Optional payment with If you do / When you do and an optional failure branch (CR 118.12, 603.12). Fields: `paymentForm?`: "unlessPrefix" | "anyPlayer" — CR 118.12: equivalent printed payment form; does not alter who pays or which branch resolves; `repeatable?`: boolean — CR 118.12, 603.12: pay zero or more times; then runs once if paid, with timesPaid resolution bound to the payment count; `cost`: CostDef — The cost (CostDef); `then`: EffectDef[] — Effects that follow ("then …", "if you do …"); `else?`: EffectDef[] — Effects run when the condition / choice / payment fails ("otherwise …", "if you don't …"); `who?`: "anyPlayer" | "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 — Who is offered the payment: anyPlayer = in APNAP order, the first payer prevents the else branch (CR 101.4, 118.12); a player selector ("that player may pay {2}") offers it to those players — the then / else branches still belong to the source's controller ("If the player doesn't, you create a Treasure token"); `target?`: TargetDef — CR 118.12, 601.2c: player target or an object/stack target whose controller may pay (who: affectedController). Selected before evaluating the cost; branches read mode affected; `chooseX?`: { min?: number; max?: ValueDef } — Choose X at resolution within these bounds, then pay that value; the body reads the paid X (CR 107.3). - `unlessPays` — Each affected player may pay the cost; for each who doesn't, `then` runs with that player as "you". 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`); `target?`: TargetDef — What it acts on (TargetDef); `cost`: CostDef — The cost (CostDef); `then`: EffectDef[] — Effects that follow ("then …", "if you do …"); `prompt?`: string — Prompt text shown to the deciding player. **Registered `native` ids.** These are **all** the ids this engine registers for `native` effects; a card naming any other id is rejected when it is saved and when a game is dealt. Never invent one — a clause no native implements is a `tableRuling` step. - `magic.keepOnePerTypeSacrificeRest` — Each player keeps one permanent of each listed type (chosen by you or by that player) and sacrifices every other matching permanent. Params: `types` (non-empty list of card types, one kept of each), `chooser` (`"you"` or `"eachPlayer"`, default eachPlayer), `nonland` (default true: lands are spared). Tragic Arrogance: `{ "types": ["Artifact", "Creature", "Enchantment", "Planeswalker"], "chooser": "you" }`; Cataclysm adds `"Land"` to `types` with `"nonland": false`. ### 6.3 Static effects (`StaticEffectDef`, discriminator `type`) Continuous effects applied through the CR 613 layers: gainControl (2), changeColorWord (3), addTypes/setTypes/removeTypes (4), addColors/setColors (5), grantKeyword/removeKeyword/grantAbility/grantKeywordAbility/loseAllAbilities (6), setPT (7a with `cda`, else 7b), modifyPT (7c), switchPT (7d). `playerRule` rules: `hexproof`, `shroud`, `noMaxHandSize`, `maxHandSize`, `maxHandSizeModifier`, `ignoreLegendRule`, `cantGainLife`, `cantLoseLife`, `cantLoseGame`, `cantWinGame`, `cantSearchLibraries`, `cantSearchOwnLibrary`, `cantDrawCards`, `cantDrawExtraCards`, `additionalLands`, `additionalGraveyardLands`, `cantPlayLands`, `oneSpellPerTurn`, `castAsFlash`, `castWithoutPaying`, `playFromGraveyard`, `playFromLibrary`, `castFromExile`, `topCardRevealed`, `lookAtTopCard`, `handsRevealed`, `skipUpkeep`, `skipUntap`, `lifeCantChange`, `cantCastSpells`, `castOnlyAsSorcery`, `playLinkedExile`, `castLinkedExile`, `additionalVotes`, `cantLoseForZeroLife`, `manaAsAnyColor`, `manaAsAnyType`, `cantAttack`. - `native` — A continuous effect applied by the engine in the given layer. 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 continuous effect stands for; `to?`: TargetDef — The objects it applies to (default: the source); `layer`: "L2" | "L3" | "L4" | "L5" | "L6" | "7a" | "7b" | "7c" | "7d" — CR 613.1: the layer a native continuous effect applies in. - `grantKeyword` — CR 112.1, 613.1f: grant a keyword to matching permanents or spell groups, including resolving spells (e.g. instant and sorcery spells you control have lifelink). Fields: `to`: TargetDef — What it applies to (TargetDef); `keyword`: string — A plain keyword string ("Flying", "Haste" …) as in `keywords[]`. - `removeKeyword` — CR 613.1f: remove this keyword ability in layer 6. Fields: `to`: TargetDef — What it applies to (TargetDef); `keyword`: string — A plain keyword string ("Flying", "Haste" …) as in `keywords[]`. - `removeKeywordAbilities` — Layer 6: remove every ability of this family at this timestamp (CR 613.1f). Fields: `to`: TargetDef — What it applies to (TargetDef); `keyword`: "landwalk" | "bandsWithOther" | "enchant" — The parametrised family removed (landwalk, bands with other). - `cantHaveKeyword` — Lose and cannot have or gain this keyword, even from later grants (CR 613.1f, 101.2). Fields: `to`: TargetDef — What it applies to (TargetDef); `keyword`: string — A plain keyword string ("Flying", "Haste" …) as in `keywords[]`. - `loseAllAbilities` — e.g. “~ loses all abilities”. Fields: `to`: TargetDef — What it applies to (TargetDef); `exceptMana?`: boolean — CR 613.1f, 605.1a: "lose all abilities except mana abilities" — the affected objects keep their mana abilities (Blood Sun). - `loseAbility` — CR 613.1f: one printed ability, by index, is removed (positions of the others are kept). Fields: `to`: TargetDef — What it applies to (TargetDef); `index`: number — Index of the printed ability lost (0 = first). - `grantAbility` — e.g. “~ has "When ~ enters, (no effects)"”. Fields: `to`: TargetDef — What it applies to (TargetDef); `ability`: AbilityDef — The ability granted (an AbilityDef). - `grantKeywordAbility` — CR 112.1, 613.1f: the affected objects have this parametrised keyword ability; spell groups also read it during casting (e.g. split second, CR 601.2). Fields: `to`: TargetDef — What it applies to (TargetDef); `keywordAbility`: KeywordAbilityDef — A parametrised keyword ability (KeywordAbilityDef: `{ "keyword": "ward", "cost": { … } }`). - `gainAbilitiesOf` — CR 613.1f: the affected objects have all abilities of the from objects as though printed on them ("has all activated abilities of all creature cards in all graveyards"); each gained ability refers to the object that has it, and nothing gains abilities from itself. Fields: `to`: TargetDef — What it applies to (TargetDef); `from`: { of: "object" | "player" | "spell" | "ability" | "spellOrAbility" | "any"; slot?: string; mode?: "chosen" | "choose" | "all" | "self" | "random" | "host" | "triggering" | "created" | "convoked" | "linked" | "paired" | "top" | "affected" | "replaced" | "replacedSource" | "triggeringOther" | "about" | "thisWay" | "costPaid" | "attacked" | "grantor"; action?: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; among?: "triggering"; chooser?: any; random?: true; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; allZones?: boolean; position?: "top" | "bottom"; filter?: ObjectFilter; player?: any; playerOwns?: true; exceptPlayer?: any; playerFilter?: "opponent"; sameZoneOwner?: boolean; maxTotalManaValue?: ValueDef; maxTotalPower?: ValueDef; distinctBy?: "name" | "manaValue" | "controller" | "power"; equalBy?: "toughness" | "power" | "manaValue"; sharesType?: "card" | "permanent"; sharedBy?: "creatureType"; zones?: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[]; playerTarget?: PlayerTargetDef; digSubset?: "looked" | "picked" | "rest"; span?: number; targetCount?: number; targetsOnlySource?: boolean; permanents?: true; stackTargets?: object; spell?: object; ability?: object; min?: ValueDef; max?: ValueDef | "any"; differentFromEarlierTargets?: boolean; attacker?: "self" | "triggering"; label?: string } — The objects whose abilities are had: a zone set ("all creature cards in all graveyards"), the linked exiled cards (mode linked), the host, …; `kinds?`: ("activated" | "triggered" | "static" | "keyword")[] — Which classes of abilities (default all): activated includes loyalty and mana abilities, static includes replacement effects, keyword covers simple keywords and parametrised keyword abilities; `spendAsAny?`: { colors?: ("W" | "U" | "B" | "R" | "G")[] } — CR 609.4b, 613.1f: "You may spend mana as though it were mana of any color to activate those abilities" — the costs of the gained activated abilities may be paid with mana of any color. - `modifyPT` — e.g. “~ gets +1/+1”. Fields: `to`: TargetDef — What it applies to (TargetDef); `power`: ValueDef — Power (a number, or a string such as "*" for characteristic-defining values); `toughness`: ValueDef — Toughness (a number, or a string such as "*" for characteristic-defining values). - `setPT` — e.g. “~ has base toughness ?”. Fields: `to`: TargetDef — What it applies to (TargetDef); `fromLastLinkedCreature?`: boolean — Set power and toughness to those of the last creature card still exiled with this source, in layer 7b (CR 607.2a, 613.4b); `power?`: ValueDef — Power (a number, or a string such as "*" for characteristic-defining values); `toughness?`: ValueDef — Toughness (a number, or a string such as "*" for characteristic-defining values); `cda?`: boolean — Characteristic-defining P/T in layer 7a and every zone (CR 604.3, 613.4a). - `switchPT` — e.g. “~'s power and toughness are switched”. Fields: `to`: TargetDef — What it applies to (TargetDef). - `addTypes` — e.g. “~ is (no types) in addition to its other types”. Fields: `to`: TargetDef — What it applies to (TargetDef); `types?`: string[] — Card types, e.g. ["Artifact", "Creature"]; `subtypes?`: string[] — Subtypes, e.g. ["Elf", "Warrior"]; `allCreatureTypes?`: boolean — CR 205.3m, 613.1d: every creature subtype in layer 4, without gaining changeling; `allLandTypes?`: boolean — CR 205.3i, 613.1d: every land type ("is every land type in addition to its other types"); `allNonbasicLandTypes?`: boolean — CR 205.3i, 613.1d: every nonbasic land type ("This land is every nonbasic land type", Planar Nexus); `supertypes?`: string[] — CR 205.4, 613.1d: additional supertypes, such as Legendary from The Ring; `chosenSubtype?`: boolean | string — CR 205.3, 613.1d: also the creature type chosen for the source; true reads creatureType, a string names its key; `cda?`: boolean — CR 604.3, 613.3: a characteristic-defining ability of the object itself ("Burakos is also a Cleric, Rogue, Warrior, and Wizard"); functions in every zone and applies first in layer 4. Use with to self. - `setTypes` — CR 205.1a-b, 205.3c, 613.1d: replace the specified card types or subtype family; associated subtypes of lost card types are also lost. Fields: `to`: TargetDef — What it applies to (TargetDef); `fromLastLinkedCreature?`: boolean — Replace creature types with those of the last creature card still exiled with this source, together with any listed subtypes (CR 205.3m, 607.2a); `subtypeKind?`: "creatureType" | "basicLandType" — Replace only this subtype family, preserving subtypes of other card types (CR 205.1b, 305.7); `types?`: string[] — Card types, e.g. ["Artifact", "Creature"]; `subtypes?`: string[] — Subtypes, e.g. ["Elf", "Warrior"]; `chosenSubtype?`: boolean | string — CR 205.3, 613.1d: the subtypes become the creature type chosen for the source (Conspiracy: "are the chosen type"); true reads creatureType, a string names its key. Nothing changes until a type is chosen. - `removeTypes` — e.g. “~ is no longer (no types)”. Fields: `to`: TargetDef — What it applies to (TargetDef); `types?`: string[] — Card types, e.g. ["Artifact", "Creature"]; `subtypes?`: string[] — Subtypes, e.g. ["Elf", "Warrior"]; `supertypes?`: string[] — Supertypes removed (CR 205.4). - `addColors` — e.g. “~ is colorless in addition to its other colors”. Fields: `to`: TargetDef — What it applies to (TargetDef); `colors`: string[] — Colors as W / U / B / R / G codes; `chosenColor?`: boolean | string — CR 105.3, 613.1e: also the color chosen for the source ("is the chosen color in addition to its other colors"); true reads the color key, a string names it. Nothing changes until a color is chosen. - `setColors` — e.g. “~ is colorless”. Fields: `to`: TargetDef — What it applies to (TargetDef); `colors`: string[] — Colors as W / U / B / R / G codes; `chosenColor?`: boolean | string — CR 105.3, 613.1e: the color chosen for the source replaces the colors ("is the chosen color"); true reads the color key, a string names it. Nothing changes until a color is chosen; `cda?`: boolean — CR 604.3: a characteristic-defining ability of the object itself; it functions in every zone ("Clara Oswald is the chosen color"). - `changeColorWord` — e.g. “in ~'s text, "" reads ""”. Fields: `to`: TargetDef — What it applies to (TargetDef); `from`: string — The color word replaced; `toColor`: string — The color word it becomes. - `evasion` — Blocking restrictions, minimum/maximum blocking group size, or cannot be blocked unless a condition holds (CR 509.1b); with none of those fields, can't be blocked at all ("Equipped creature can't be blocked"). A rule effect of the static ability (CR 613.11): the affected creature losing all abilities doesn't remove it. Fields: `to`: TargetDef — What it applies to (TargetDef); `cantBeBlockedBy?`: ObjectFilter — An ObjectFilter (all set fields must match); `onlyBlockedBy?`: ObjectFilter — An ObjectFilter (all set fields must match); `minBlockers?`: number — It can't be blocked except by this many or more creatures; `maxBlockers?`: number — It can't be blocked by more than this many creatures; `unless?`: ConditionDef — The effect doesn't apply while this condition holds. - `cantBlock` — Cannot block matching attackers unless the condition holds (CR 509.1b); with alone, can't block alone; with unlessPays, can't block without paying that cost (CR 509.1d). Fields: `to`: TargetDef — What it applies to (TargetDef); `attackers?`: ObjectFilter — Which attacking creatures are counted; `unless?`: ConditionDef — The effect doesn't apply while this condition holds; `alone?`: boolean — CR 506.5, 509.1b: "can't block alone" — can't be the only creature declared as a blocker this step (every defending player's blockers count); combine with no other field; `unlessPays?`: CostDef — CR 509.1c-d, 509.1f: a cost to block instead of a ban — "creatures can't block unless their controller pays {1} for each of those creatures" (Archangel of Tithes), "Enchanted creature can't block unless its controller pays {3}" (Oppressive Rays), with attackers "can't block creatures with power 3 or greater unless you pay {1}" (Hipparion): this cost (mana, genericAmount evaluated for this ability's controller, payLife) for each affected creature declared as a blocker (of a matching attacker). The defending player pays the total once the declaration is otherwise legal, or declares again; requirements don't oblige paying. Combine with attackers only; `perCreatureText?`: "those" — CR 509.1d: render the per-blocker payment as "for each of those creatures"; no rules difference. - `blockCapacity` — Additional creatures this blocker may block each combat, or any number (CR 509.1a). Fields: `to`: TargetDef — What it applies to (TargetDef); `additional`: number | "any" — How many additional creatures it can block (a number, or "any"). - `blockAsThough` — CR 509.1b, 702.28b, 702.9b: the affected creatures can block as though the attackers' shadow / landwalk weren't there, or as though they had shadow / reach; other blocking restrictions still apply. Fields: `to`: { of: "object" | "player" | "spell" | "ability" | "spellOrAbility" | "any"; slot?: string; mode?: "chosen" | "choose" | "all" | "self" | "random" | "host" | "triggering" | "created" | "convoked" | "linked" | "paired" | "top" | "affected" | "replaced" | "replacedSource" | "triggeringOther" | "about" | "thisWay" | "costPaid" | "attacked" | "grantor"; action?: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; among?: "triggering"; chooser?: any; random?: true; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; allZones?: boolean; position?: "top" | "bottom"; filter?: ObjectFilter; player?: any; playerOwns?: true; exceptPlayer?: any; playerFilter?: "opponent"; sameZoneOwner?: boolean; maxTotalManaValue?: ValueDef; maxTotalPower?: ValueDef; distinctBy?: "name" | "manaValue" | "controller" | "power"; equalBy?: "toughness" | "power" | "manaValue"; sharesType?: "card" | "permanent"; sharedBy?: "creatureType"; zones?: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[]; playerTarget?: PlayerTargetDef; digSubset?: "looked" | "picked" | "rest"; span?: number; targetCount?: number; targetsOnlySource?: boolean; permanents?: true; stackTargets?: object; spell?: object; ability?: object; min?: ValueDef; max?: ValueDef | "any"; differentFromEarlierTargets?: boolean; attacker?: "self" | "triggering"; label?: string } — The blockers; `attackers?`: ObjectFilter — Only when blocking these attackers ("can block Dragons as though it had reach"); `ignore?`: "shadow" | "landwalk" — Block as though the attackers didn't have this ("can block creatures with shadow as though they didn't have shadow"); `had?`: "shadow" | "reach" — Block as though the blocker had this ("can block creatures with shadow as though it had shadow"). - `ignoreLandwalk` — CR 702.14c, 509.1b: the affected creatures can be blocked as though they didn't have that landwalk ("Creatures with islandwalk can be blocked as though they didn't have islandwalk"); the ability stays. Fields: `to`: { of: "object" | "player" | "spell" | "ability" | "spellOrAbility" | "any"; slot?: string; mode?: "chosen" | "choose" | "all" | "self" | "random" | "host" | "triggering" | "created" | "convoked" | "linked" | "paired" | "top" | "affected" | "replaced" | "replacedSource" | "triggeringOther" | "about" | "thisWay" | "costPaid" | "attacked" | "grantor"; action?: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; among?: "triggering"; chooser?: any; random?: true; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; allZones?: boolean; position?: "top" | "bottom"; filter?: ObjectFilter; player?: any; playerOwns?: true; exceptPlayer?: any; playerFilter?: "opponent"; sameZoneOwner?: boolean; maxTotalManaValue?: ValueDef; maxTotalPower?: ValueDef; distinctBy?: "name" | "manaValue" | "controller" | "power"; equalBy?: "toughness" | "power" | "manaValue"; sharesType?: "card" | "permanent"; sharedBy?: "creatureType"; zones?: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[]; playerTarget?: PlayerTargetDef; digSubset?: "looked" | "picked" | "rest"; span?: number; targetCount?: number; targetsOnlySource?: boolean; permanents?: true; stackTargets?: object; spell?: object; ability?: object; min?: ValueDef; max?: ValueDef | "any"; differentFromEarlierTargets?: boolean; attacker?: "self" | "triggering"; label?: string } — The attacking creatures; `landType?`: string — The landwalk ignored ("Island" for islandwalk); every landwalk ability when omitted. - `cantAttack` — Cannot attack (alone when specified) unless the condition holds (CR 508.1c); with onlyAlone, can only attack alone; with unlessPays, can't attack without paying that cost (CR 508.1d). Fields: `to`: TargetDef — What it applies to (TargetDef); `unless?`: ConditionDef — The effect doesn't apply while this condition holds; `alone?`: boolean — Can't attack alone (it may attack together with others); `defending?`: "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 | "itsOwner" — CR 508.1c: only attacks against these players are forbidden; itsOwner is each affected creature's own owner ("can't attack its owner"), fixed per creature; `planeswalkers?`: boolean — Also forbid attacking planeswalkers those players control; `onlyAlone?`: boolean — CR 508.1c: "can only attack alone" — can't attack while any other creature attacks; combine with no other field; `alreadyAttacked?`: boolean — CR 508.1c: "can't attack a player it has already attacked this turn" (Bloodthirster) — each affected creature can't attack a player it was declared attacking earlier this turn; planeswalker and battle attacks don't count. Combine with no other field; `perCreatureText?`: "those" — CR 508.1g-h: render the per-attacker payment as for each of those creatures; identical rules to the expanded wording; `unlessPays?`: CostDef — CR 508.1d, 508.1g-i: a cost to attack instead of a ban — "Creatures can't attack you unless their controller pays {2} for each creature they control that's attacking you" (Ghostly Prison, Propaganda; Sphere of Safety with planeswalkers and genericAmount "{X} …, where X is the number of enchantments you control"): this cost (mana, genericAmount evaluated for this ability's controller, payLife) for each affected creature attacking one of `defending` (and, with planeswalkers, a planeswalker they control; any defender without `defending`). The attacking player pays the total while declaring attackers, or redoes the declaration; requirements don't oblige paying. Combine with defending / planeswalkers only. - `attackWithDefender` — May attack as though it did not have defender; other restrictions apply (CR 702.3b, 609.4). Fields: `to`: TargetDef — What it applies to (TargetDef). - `attackAsHaste` — CR 302.6, 508.1a, 609.4: may attack as though it had haste; does not permit tap abilities while summoning sick. Fields: `to`: TargetDef — What it applies to (TargetDef). - `mustAttack` — Affected creatures attack each combat if able. Fields: `to`: TargetDef — What it applies to (TargetDef); `otherThan?`: "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 — CR 508.1d: and attack a player other than these players if able ("… and attack a player other than you if able"; goad's requirement, CR 701.15b, without goading). - `mustAttackWithCreature` — CR 508.1d: a player requirement — each `who` player attacks with at least one creature each combat if able (Seeker of Slaanesh; Trove of Temptation with defending you and planeswalkers). One requirement, maximised with the others within the restrictions; costs to attack never oblige paying. 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" | { kind: "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"; span?: number; where?: ConditionDef; except?: any; most?: ValueDef; fewest?: ValueDef } — The players who must attack (relative to this ability's controller): eachOpponent for "Each opponent must attack …"; `defending?`: "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 — That creature attacks one of these players ("must attack you … with at least one creature"); `planeswalkers?`: boolean — Attacking a planeswalker one of `defending` controls also obeys it ("you or a planeswalker you control"). - `goaded` — CR 701.15b-c, 508.1d: continuously goaded by this static ability's controller; must attack each combat and a different player if able. Ends when the static stops applying. Fields: `to`: TargetDef — What it applies to (TargetDef). - `mustBlock` — Affected creatures block each combat if able. Fields: `to`: TargetDef — What it applies to (TargetDef). - `mustBeBlocked` — Affected attacking creatures must be blocked if able: the defending player assigns at least one legal blocker to each (CR 509.1c). Fields: `to`: TargetDef — What it applies to (TargetDef). - `lure` — CR 509.1c (Lure): every creature able to block an affected attacking creature must do so — one blocking requirement per able blocker, maximised with the others. Fields: `to`: TargetDef — What it applies to (TargetDef); `blockers?`: ObjectFilter — Only these creatures are required ("All Walls able to block ~ do so"); default every creature. - `cantActivate` — CR 602.1b, 606.3: prohibit all, non-mana, mana, or loyalty abilities, or only abilities with {T} in their costs (tap); nonManaNonLoyalty: "aren't mana abilities or loyalty abilities". Fields: `to`: TargetDef — What it applies to (TargetDef); `by?`: "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 — CR 602.5, 109.5: players forbidden to activate, independently of who controls the affected source; omitted restricts every player; `abilities?`: "all" | "nonMana" | "nonManaNonLoyalty" | "mana" | "loyalty" | "tap" — Which abilities can't be activated: all, nonMana, mana, loyalty, or {T} abilities. - `cantCrew` — CR 702.122a: affected creatures can't be tapped to crew Vehicles ("can't crew Vehicles"); saddling Mounts is unaffected. Fields: `to`: TargetDef — What it applies to (TargetDef). - `cantPayLife` — CR 118.3, 107.4f: life can't be paid as a cost for the stated spells or abilities, Phyrexian mana included. 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 — Players who can't pay life; omitted means every player; `spells?`: boolean — CR 118.3: can't pay life to cast spells (Karn's Sylex: "to cast spells or to activate abilities that aren't mana abilities"); `abilities?`: "all" | "nonMana" — CR 118.3: can't pay life to activate abilities; nonMana leaves mana abilities alone. - `cantBeTargeted` — CR 115.1, 115.1c: selected objects cannot be targeted by matching spells or abilities, including cards in graveyards. Fields: `to`: TargetDef — What it applies to (TargetDef); `by`: "spells" | "abilities" | "spellsOrAbilities" — Which stack objects can't target it: spells, abilities, or both; `from?`: ObjectFilter — Spell or ability source qualities; last known information applies (CR 113.7a, 608.2h); `controller?`: "you" | "opponent" | "any" | "notYou" — Stack controller relative to the restriction controller, independently of source control. - `cantTransform` — The affected permanents cannot transform, including by converting or a day/night change (CR 701.28). Fields: `to`: TargetDef — What it applies to (TargetDef). - `cantBeCountered` — CR 701.6, 101.2: matching spells or abilities cannot be countered. Fields: `to`: TargetDef — What it applies to (TargetDef). - `cantBeSacrificed` — CR 101.2, 701.21, 118.3: matching permanents cannot be sacrificed for effects or costs; they cannot be chosen to pay a sacrifice cost. Fields: `to`: TargetDef — What it applies to (TargetDef). - `cantGetCounters` — CR 122.1, 101.2: counters can't be put on these permanents / players ("Creatures you control can't have -1/-1 counters put on them", "You can't get poison counters", "Players can't get counters"): placements simply don't happen for them, after replacement effects and as a permanent enters, and costs that would put such counters can't be paid. Counters already there stay. Fields: `to?`: TargetDef — Permanents that can't have counters put on 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 — Players who can't get counters; `counter?`: string — Only this kind ("-1/-1", "+1/+1", "poison"); any kind when omitted. - `cantPrevent` — CR 615.12: damage cannot be prevented while this static is active — all damage, or only the damage `from` / `damageKind` narrow it to. Prevention side effects still occur and finite shields are not depleted. Fields: `from?`: ObjectFilter — CR 615.12: only damage dealt by sources matching this filter ("damage that would be dealt by this creature can't be prevented": { self: true }); `damageKind?`: "combat" — CR 510.2, 615.12: only combat damage ("combat damage that would be dealt by creatures you control can't be prevented"). - `damageAsThough` — CR 120.3, 609.4: damage to these recipients (all if omitted) has the results of wither/infect. Does not grant abilities or prevent damage. Fields: `keyword`: "wither" | "infect" — A plain keyword string ("Flying", "Haste" …) as in `keywords[]`; `to?`: TargetDef — What it applies to (TargetDef). - `cantCast` — CR 601.3, 101.2: these players cannot cast spells matching 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); `exceptFrom?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — CR 601.2a, 101.2: forbid only spells cast from anywhere other than this zone — "Your opponents can't cast spells from anywhere other than their hands" is exceptFrom: "hand" (Drannith Magistrate): no flashback, foretell, commanders from the command zone, top of library, adventures or cascade from exile. Playing lands isn't casting; `from?`: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[] — CR 601.2a, 101.2: forbid only spells cast from these zones — "Players can't cast spells from graveyards or libraries" (Grafdigger's Cage) is ["graveyard", "library"]; "You can't … cast spells from your hand" is ["hand"]. A card cast from exile is cast from exile. - `cantEnterBattlefield` — CR 101.2, 400.3: cards matching the filter in these zones can't enter the battlefield ("Creature cards in graveyards and libraries can't enter the battlefield", Grafdigger's Cage): an effect that would put one there does nothing to it, and such a land card can't be played. Spells cast from there enter from the stack, unaffected. Fields: `filter?`: ObjectFilter — The cards that can't enter, judged as they exist in their zone; `zones`: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[] — The zones they can't enter the battlefield from ("in graveyards and libraries"). - `abilityCostModifier` — Activated abilities of the affected objects cost a signed generic amount more/less (CR 602.2b, 601.2f). Fields: `to`: TargetDef — What it applies to (TargetDef); `amount`: ValueDef — How many / how much (integer or ValueDef). - `activationCostModifier` — CR 602.2b, 601.2f, 118.7 (Zirda): "Abilities you activate [that aren't mana abilities] cost {N} less to activate" — every activated ability these players activate, from any source and zone (cycling from a hand included). 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" | { kind: "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"; span?: number; where?: ConditionDef; except?: any; most?: ValueDef; fewest?: ValueDef } — The players whose activations it changes (you); `firstOfPermanentType?`: string — Only that player's first activated ability from a permanent of this card type each turn. Mana abilities and earlier activations before this static entered also count; `amount`: number | { kind: "var"; name: string } | { kind: "count"; digSubset?: "looked" | "picked" | "rest"; of?: "object" | "player"; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; filter?: ObjectFilter; player?: any } | { kind: "doneThisWay"; of: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; filter?: ObjectFilter; distinctOwners?: boolean; by?: any } | { kind: "playerAggregate"; op: "max" | "min"; players?: any; value: ValueDef } | … (60 options) — Signed generic change: -2 = "cost {2} less to activate"; `nonMana?`: boolean — Only abilities that aren't mana abilities (CR 605.1a); `source?`: TargetDef — CR 602.2b, 601.2f: ability sources matching this selection, in its specified zone; evaluated relative to this static's source; `abilityKeyword?`: "equip" | "cycling" | "ninjutsu" | "boast" — CR 702.6, 702.29, 702.49, 702.142: only the indicated keyword's activations; cycling and ninjutsu apply in hand; `targets?`: TargetDef — CR 602.2b, 601.2c/f: apply once if any announced activation target matches; self and host refer to this static's source; `minMana?`: number — "This effect can't reduce the mana in that cost to less than one mana": this effect's reduction stops at this much mana in total; a cost already at or below it is unaffected. - `damageByToughness` — CR 510.1a: affected creatures assign combat damage equal to their toughness rather than power. Fields: `to`: TargetDef — What it applies to (TargetDef). - `assignDamageAsUnblocked` — CR 510.1c, 609.4: each affected attacking creature's controller may assign its entire combat damage as though unblocked; blockers still deal damage. Fields: `to`: TargetDef — What it applies to (TargetDef). - `crewPowerBonus` — CR 702.122: affected creatures crew Vehicles as though their power were this much greater ("This creature crews Vehicles as though its power were 2 greater"); the Pilot tokens add saddling. Fields: `to`: TargetDef — What it applies to (TargetDef); `amount`: ValueDef — How many / how much (integer or ValueDef); `saddle?`: boolean — Also counts when saddling Mounts (CR 702.172); `station?`: boolean — Also counts when stationing a Spacecraft (CR 702.184a: "…stations permanents as though its power were 2 greater"). - `crewWithToughness` — CR 702.122a: affected creatures crew Vehicles using their toughness rather than their power (Giant Ox, Interface Ace). Fields: `to`: TargetDef — What it applies to (TargetDef); `saddle?`: boolean — Also when saddling Mounts (CR 702.171a): "saddles Mounts and crews Vehicles using its toughness". - `activateAsHaste` — CR 302.6, 609.4, 702.10: activate tap/untap abilities as though these creatures had haste; no attack permission or actual haste. Fields: `to`: TargetDef — What it applies to (TargetDef). - `boastActivationLimit` — CR 702.142: affected creatures may activate each boast ability this many times per turn if they attacked. Use the static isYourTurn condition to limit it to its controller's turns. Fields: `to`: TargetDef — What it applies to (TargetDef); `times`: number — Total activations allowed per turn for each boast ability of an affected creature (2 to 9). - `loyaltyActivationLimit` — CR 606.3: "You may activate the loyalty abilities of planeswalkers you control twice each turn rather than only once" (Oath of Teferi): each affected planeswalker may have a loyalty ability activated this many times a turn. Fields: `to`: { of: "object" | "player" | "spell" | "ability" | "spellOrAbility" | "any"; slot?: string; mode?: "chosen" | "choose" | "all" | "self" | "random" | "host" | "triggering" | "created" | "convoked" | "linked" | "paired" | "top" | "affected" | "replaced" | "replacedSource" | "triggeringOther" | "about" | "thisWay" | "costPaid" | "attacked" | "grantor"; action?: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; among?: "triggering"; chooser?: any; random?: true; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; allZones?: boolean; position?: "top" | "bottom"; filter?: ObjectFilter; player?: any; playerOwns?: true; exceptPlayer?: any; playerFilter?: "opponent"; sameZoneOwner?: boolean; maxTotalManaValue?: ValueDef; maxTotalPower?: ValueDef; distinctBy?: "name" | "manaValue" | "controller" | "power"; equalBy?: "toughness" | "power" | "manaValue"; sharesType?: "card" | "permanent"; sharedBy?: "creatureType"; zones?: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[]; playerTarget?: PlayerTargetDef; digSubset?: "looked" | "picked" | "rest"; span?: number; targetCount?: number; targetsOnlySource?: boolean; permanents?: true; stackTargets?: object; spell?: object; ability?: object; min?: ValueDef; max?: ValueDef | "any"; differentFromEarlierTargets?: boolean; attacker?: "self" | "triggering"; label?: string } — The planeswalkers ("planeswalkers you control", self); `times`: number — Loyalty activations per turn per planeswalker ("twice each turn rather than only once"). - `activateAsInstant` — CR 606.3, 702.6a, 117.1a: "You may activate loyalty abilities of planeswalkers you control on any player's turn any time you could cast an instant" / "You may activate equip abilities any time you could cast an instant" — the source's controller may activate those abilities whenever they have priority; loyalty abilities stay once each turn per planeswalker. Fields: `abilities`: "loyalty" | "equip" — Which abilities: loyalty abilities (CR 606.3) or equip abilities (CR 702.6a); `to?`: TargetDef — The permanents whose abilities may be activated ("planeswalkers you control", self); default: permanents the source's controller controls; `anyPlayersTurn?`: boolean — Prints "on any player's turn" — instant timing already includes every turn. - `damageNotRemoved` — CR 514.2: "Damage isn't removed from this creature during cleanup steps" — the affected permanents keep their marked damage through cleanup. Fields: `to`: TargetDef — What it applies to (TargetDef). - `untapDuringOthersUntap` — CR 502.3, 613.11: untap affected permanents during each other player's untap step, relative to the source controller; not a triggered ability. Fields: `to`: TargetDef — What it applies to (TargetDef); `opponentsOnly?`: boolean — Only during each opponent's untap step ("during each opponent's untap step"). - `untapLimit` — CR 502.3: "players can't untap more than N [permanents] during their untap steps" (Static Orb, Winter Orb, Smoke). The active player chooses which N of the permanents that would untap do; the rest stay tapped. Condition the ability for "as long as ~ is untapped". Fields: `amount`: ValueDef — How many / how much (integer or ValueDef); `filter?`: ObjectFilter — Which permanents the limit counts ("more than one land"); default every permanent; `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 — Whose untap steps are limited; default every player's. - `attackLimit` — CR 508.1c: "No more than N creatures can attack [you] each combat" (Crawlspace; Silent Arbiter without defending) — a restriction on the whole declaration. Other players and permanents may still be attacked; requirements are obeyed as far as the limit allows (CR 508.1d). Fields: `amount`: ValueDef — How many / how much (integer or ValueDef); `defending?`: "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 — Limit only the creatures attacking these players (attacks on their planeswalkers and battles don't count); default: every attacking creature. - `blockLimit` — CR 509.1b-c: no more than this many distinct creatures can block each combat, across all defending players. Blocking requirements obey this limit; a creature blocking multiple attackers counts once. Fields: `amount`: ValueDef — How many / how much (integer or ValueDef). - `costFloor` — Trinisphere: "each spell that would cost less than N mana to cast costs N mana to cast" — applied after every other cost change, the difference paid as generic mana. Fields: `amount`: ValueDef — How many / how much (integer or ValueDef); `filter?`: ObjectFilter — Which spells; default every spell; `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 — Whose spells; default every player's. - `suppressTriggers` — Torpor Orb, Hushbringer: "creatures entering [or dying] don't cause abilities to trigger" — the event still happens (counters, replacements apply); no ability of any object triggers on it. Fields: `events`: ("enters" | "dies")[] — Which events' triggers are suppressed; `filter?`: ObjectFilter — Which permanents; default creatures; `sources?`: ObjectFilter — CR 603.2: only abilities of objects matching this filter are kept from triggering ("abilities of permanents your opponents control", Elesh Norn, Mother of Machines); default every object's. - `optionalUntap` — CR 502.3: controller may leave each affected permanent tapped during their untap step. Fields: `to`: TargetDef — What it applies to (TargetDef). - `countersPersist` — CR 122.2, 400.7, 113.6: counters remain on this source as it changes zones, except into these destinations. Functions in every zone; does not place the retained counters again. Fields: `exceptZones`: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[] — Destinations the counters don't carry into. - `doesntUntap` — Affected permanents don't untap during their controller's untap step. Fields: `to`: TargetDef — What it applies to (TargetDef). - `cantUntap` — CR 701.26, 101.2: affected permanents can't become untapped at all ("Enchanted creature can't become untapped") — not in the untap step, not by effects or {Q} costs; doesntUntap skips only the untap step. Fields: `to`: TargetDef — What it applies to (TargetDef). - `triggersTwice` — CR 603.2d: triggered abilities of matching permanents trigger an additional time; restrict the cause to entering/leaving the battlefield, dying, casting/copying a spell, declaring attackers, dealing combat damage to a player, being dealt damage, a player drawing a card, or a face-down permanent being turned face up. Multiple instances add. Fields: `to`: TargetDef — What it applies to (TargetDef); `causedBy?`: { event: "enters" | "dies" | "castSpell" | "copiedSpell" | "attacks" | "dealsCombatDamageToPlayer" | "isDealtDamage" | "drawsCard" | "leaves" | "turnedFaceUp" | ("enters" | "dies" | "castSpell" | "copiedSpell" | "attacks" | "dealsCombatDamageToPlayer" | "isDealtDamage" | "drawsCard" | "leaves" | "turnedFaceUp")[]; filter?: ObjectFilter; by?: any } — What caused the event: an enters or dies event matching the filter. - `gainControl` — e.g. “you control ~”. Fields: `to`: TargetDef — What it applies to (TargetDef). - `costModifier` — Spells matching the filter cost {N} less/more; with filter self on a spell, that spell's own cost ("This spell costs {1} less to cast …"). Fields: `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `amount`: number | { kind: "var"; name: string } | { kind: "count"; digSubset?: "looked" | "picked" | "rest"; of?: "object" | "player"; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; filter?: ObjectFilter; player?: any } | { kind: "doneThisWay"; of: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; filter?: ObjectFilter; distinctOwners?: boolean; by?: any } | { kind: "playerAggregate"; op: "max" | "min"; players?: any; value: ValueDef } | … (60 options) — Signed generic cost change; negative values reduce the cost (CR 601.2f); `from?`: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[] — Cast only from one of these zones (CR 601.2a/f); `notFrom?`: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[] — Exclude these casting origins, e.g. anywhere other than hand (CR 601.2a/f); `targets?`: TargetDef — Apply once when any announced target matches this group, relative to this ability's source (CR 601.2c/f); `perTarget?`: boolean — Scale by the spell's number of announced targets; repeated occurrences count separately (CR 601.2c/f, 115.3); `addedMana?`: string — Additional colored or colorless mana required, e.g. {B}; not a generic increase (CR 601.2f); `reduceMana?`: string — CR 118.7b-d: a colored or colorless reduction per unit, e.g. {U} or {W}{U}{B}{R}{G} ("cost {U} less to cast"); each symbol removes a matching symbol of the cost (or a hybrid symbol with that color), the excess reduces generic mana. Pair with amount 0; `coloredOnly?`: boolean — "This effect reduces only the amount of colored mana you pay": the part of reduceMana the cost has no matching symbol for is lost instead of reducing generic mana; `ifAdditionalCostPaid?`: boolean — CR 118.8, 601.2b/f (Defilers): only spells for which the optional additional cost granted by a spellsHave part of this same static ability was paid ("Those spells cost {G} less to cast if you paid life this way"); `addedCost?`: CostDef — CR 118.8, 601.2f-h: a non-mana cost each affected spell's caster also pays, once per spell ("Spells your opponents cast that target this creature cost an additional 3 life to cast": { payLife: 3 }, amount 0); `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 — Players whose spells are modified; defaults to you; `firstEachTurn?`: boolean — Only the first spell matching this filter that player casts each turn (CR 601.2f); `perCount?`: { filter?: ObjectFilter; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" } — Scale by a count of matching objects ("for each artifact you control"); `perValue?`: ValueDef — Scale by a value ("for each creature that died this turn", "for each basic land type among lands you control"). - `spellsHave` — Spells these players cast matching the filter have the keyword ability ("Creature spells you cast have convoke"; firstEachTurn: "The first spell you cast each turn has cascade"; an alternativeCost grant: "You may pay {0} rather than pay the mana cost for Zombie creature spells you cast", its values read for the spell — affected manaValue is "its mana value"). 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); `keywordAbility`: KeywordAbilityDef — A parametrised keyword ability (KeywordAbilityDef: `{ "keyword": "ward", "cost": { … } }`); `firstEachTurn?`: boolean — The first spell you cast each turn; with a filter or from, the first spell you cast each turn that matches them ("The first spell you cast each turn that mana from a Treasure was spent to cast has cascade", Rain of Riches); `from?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — CR 601.2a: only spells cast from this zone, including while casting and on the stack; `oncePerTurn?`: boolean — CR 118.9: with an alternativeCost grant ("Once each turn, you may pay {0} rather than pay the mana cost for a spell you cast …"), one spell each turn may be cast with it, per source ability; condition the static on isYourTurn for "once during each of your turns". - `revealFirstDraw` — CR 701.20a: the controller reveals the first card they draw each turn as they draw it (Primitive Etchings, Inquisitor Eisenhorn); revealedFirstDraw triggers read the revealed card. Fields: `optional?`: boolean — "You may reveal the first card you draw each turn as you draw it" (CR 701.20a): the controller decides as the card is drawn; without it the reveal is mandatory ("Reveal the first card you draw each turn"). - `playerRule` — A rule applying to players: "You have hexproof", "You have no maximum hand size", "Your opponents can't gain life". 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" | { kind: "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"; span?: number; where?: ConditionDef; except?: any; most?: ValueDef; fewest?: ValueDef } — Which players the rule applies to (you / eachOpponent / eachPlayer); `rule`: "hexproof" | "shroud" | "noMaxHandSize" | "maxHandSize" | "maxHandSizeModifier" | "ignoreLegendRule" | "cantGainLife" | "cantLoseLife" | "cantLoseGame" | "cantWinGame" | "cantSearchLibraries" | "cantSearchOwnLibrary" | "cantDrawCards" | "cantDrawExtraCards" | "additionalLands" | "additionalGraveyardLands" | "cantPlayLands" | "oneSpellPerTurn" | "castAsFlash" | "castWithoutPaying" | "playFromGraveyard" | "playFromLibrary" | "castFromExile" | "topCardRevealed" | "lookAtTopCard" | "handsRevealed" | "skipUpkeep" | "skipUntap" | "lifeCantChange" | "cantCastSpells" | "castOnlyAsSorcery" | "playLinkedExile" | "castLinkedExile" | "additionalVotes" | "cantLoseForZeroLife" | "manaAsAnyColor" | "manaAsAnyType" | "cantAttack" — CR 402.2, 514.1, 613.11: maxHandSize sets a timestamp-ordered limit using amount. CR 704.5a: cantLoseForZeroLife blocks only the loss for 0 or less life. CR 101.2, 701.23: cantSearchOwnLibrary — spells and abilities these players control can't cause them to search their own library (others' effects still can; a mandatory search still shuffles). CR 101.2, 305.2: cantPlayLands overrides all land-play permissions. castWithoutPaying: "You may cast spells from your hand without paying their mana costs" (Omniscience) — matching spells cast from `from` (any zone they may be cast from when omitted) have an alternative cost of no mana; additional costs are paid and X is 0 (CR 118.9, 107.3b). playLinkedExile / castLinkedExile: play / cast cards linked to ~ (exiled with it, or moved to the command zone by it) from where they lie (CR 601.3). manaAsAnyColor / manaAsAnyType: these players may spend mana as though it were mana of any color / any type to cast spells matching the filter (CR 609.4b). topCardRevealed: "play with the top card of your library revealed" — every player sees it; lookAtTopCard: "you may look at the top card of your library any time" — only that player sees it (pair it with playFromLibrary for "… you may cast it"). handsRevealed: "players play with their hands revealed" (Revelation) / "your opponents play with their hands revealed" (Telepathy) — the affected players' hands are public (CR 400.2, 701.20a; no rule outcome changes). castOnlyAsSorcery: "each opponent can cast spells only any time they could cast a sorcery" — only during their own main phase with an empty stack and nothing resolving, overriding flash and castAsFlash permissions; abilities and land plays are unaffected (CR 307.1, 608.2g); `amount?`: ValueDef — For maxHandSize: the size to set (CR 402.2, 613.11). For maxHandSizeModifier / additionalLands: the change (e.g. -2 / 1). For additionalVotes: optional extra votes while voting (CR 701.38); `filter?`: ObjectFilter — For castAsFlash / playFromGraveyard / playFromLibrary / castFromExile / playLinkedExile / castLinkedExile / manaAsAnyColor / manaAsAnyType: matching cards with normal costs and timing (CR 305.1, 401.5, 601.3, 702.8). Self filters function in their permitted zone (CR 113.6m). For ignoreLegendRule: exempt permanents (CR 704.5j). cantPlayLands prohibits land plays (CR 305.2b); `extraCost?`: CostDef — For castAsFlash: the additional cost of using the permission — "You may cast this spell as though it had flash if you pay {2} more to cast it" (CR 601.2f). Charged only when the spell is cast at a time it could not otherwise be cast; a permission without extraCost makes the surcharge moot. For playFromGraveyard / playFromLibrary: an additional cost of each spell cast using the permission — "You may cast this card from your graveyard by discarding a card in addition to paying its other costs" / "You may cast spells from the top of your library by sacrificing a nonland permanent in addition to paying their other costs" (CR 601.2b, 601.2f-h, 118.8); never charged for a land play or a cast another permission allows; `alternative?`: "bestow" | "blitz" | "dash" | "mutate" | "sneak" | "warp" — For playFromGraveyard: matching cards may be cast from the graveyard only with this alternative-cost keyword ability — "You may cast this card from your graveyard using its blitz ability" (CR 118.9, 601.2b, 601.2f). Neither the mana cost nor another alternative cost may be paid under it, and lands can't be played with it; `genericDiscount?`: number — Reduce the generic cost by this much only when this graveyard casting permission is used; `landEntersTapped?`: boolean — A land played using this graveyard permission enters tapped; `spellEnters?`: { tapped?: boolean; counter?: string; amount?: number; additional?: boolean; filter?: ObjectFilter; haste?: boolean } — For playFromGraveyard / playFromLibrary / castLinkedExile: "If you cast a spell this way, that creature enters with a finality counter on it / that artifact enters tapped" — a replacement effect on the permanent a spell cast using this permission becomes (CR 614.1c, 614.12, 400.7); `from?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — For castWithoutPaying: the zone the spells are cast from ("from your hand"); omitted, any zone they may be cast from (CR 601.2a). For cantPlayLands: only land cards played from this zone ("Your opponents can't play land cards from graveyards"; CR 305.2); `flash?`: boolean — For castWithoutPaying: spells cast without paying their mana costs this way may be cast as though they had flash (Aluren; CR 702.8, 601.3); `cleanupSacrifice?`: boolean — For a self castAsFlash permission: "If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step" (Armor of Thorns; CR 307.1, 514.3a, 603.7) — whatever allowed the cast at that time; `payLife?`: ValueDef — For playLinkedExile / castLinkedExile / playFromLibrary / castFromExile: spells cast under this permission are cast by paying this much life rather than their mana cost (CR 118.9) — "If you cast a spell this way, pay life equal to its mana value rather than pay its mana cost" is { kind: "affected", property: "manaValue" } (Valgavoth, Terror Eater; Bolas's Citadel). A mandatory alternative cost: the mana cost can't be paid instead, additional costs (kicker, casualty) are still paid, and lands played this way cost nothing; `free?`: boolean — For playFromLibrary (CR 118.9, 601.2b): spells cast under this permission are cast without paying their mana cost — a mandatory free alternative cost ("Once during each of your turns, you may cast a spell from your hand or the top of your library without paying its mana cost", One with the Multiverse). Additional costs are still paid and X is 0 (CR 107.3b); `castOnly?`: boolean — For playFromGraveyard: spells only — "you may cast … from your graveyard" never lets a land be played (CR 305.1, 601.3); `oncePerTurn?`: boolean | "eachTurn" — For playFromGraveyard / playFromLibrary: "Once during each of your turns, you may cast …" (Lurrus, Karador) — only during the affected player's own turns, one spell per turn per source object (CR 400.7); "eachTurn" is "Once each turn, you may cast …" (Assemble the Players) — on any player's turn. For playLinkedExile / castLinkedExile: one land or one spell each turn per player (Share the Spoils ruling). A spell cast under another permission (flashback, escape, an unlimited permission) doesn't use it, and it never permits a land play (CR 601.3); `ownTurnOnly?`: boolean — CR 500.1, 601.3: "During each player's turn, that player may …" (Share the Spoils) — the permission works only during the affected player's own turn, and never during another's. "During your turn" is the static's isYourTurn condition instead; `anyMana?`: "color" | "type" — CR 609.4b: spells cast under this permission may spend mana as though it were mana of any color ("and they may spend mana as though it were mana of any color to cast that spell", Share the Spoils) or any type ("mana of any type can be spent to cast those spells", Tinybones). For castFromExile / playLinkedExile / castLinkedExile; `whenUsed?`: EffectDef[] — CR 603.12: "When they do, …" — a reflexive trigger each time the affected player plays a land or casts a spell under this linked-exile permission (Share the Spoils); the effects read that player as you; `castTargetFilter?`: ObjectFilter — CR 601.3e, 601.2e: a self castAsFlash permission checked against announced targets; at least one must match. Normal sorcery timing remains available; `graveyardReplacement?`: "exile" — CR 614.1a, 400.7g: exile a spell cast using this graveyard permission if it would enter a graveyard from the stack ("If a spell cast this way would be put into your graveyard, exile it instead"); requires playFromGraveyard and castOnly. - `playerProtection` — CR 702.16b–e, 702.16j: "You have protection from …" — these players can't be targeted by matching spells or abilities from matching sources, can't be enchanted by matching Auras, and damage from matching sources is prevented. 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`); `from`: { filter?: ObjectFilter; colors?: string[]; types?: string[]; subtypes?: string[]; everything?: boolean; allColors?: boolean; ownColors?: boolean; colorsAmong?: ObjectFilter; player?: any; fixedPlayers?: string[]; doesntRemove?: ObjectFilter; colorsNotInCommanderIdentity?: boolean; monocolored?: boolean; multicolored?: boolean; colorless?: boolean; chosenColor?: boolean | string; chosenType?: boolean | string } — The quality; filters read from the source's controller ("protection from each of your opponents" = controller: opponent; "the chosen card name" = chosenName). - `controlWhileSearching` — CR 722.2, 722.5, 701.23 (Opposition Agent): "You control your opponents while they're searching their libraries" — the source's controller makes the choices of each search these players make of their own library (which cards they find, within the instruction; a search for a stated quality may find nothing, CR 701.23b). With several such sources, the most recently entered one applies (CR 722.1a). 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" | { kind: "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"; span?: number; where?: ConditionDef; except?: any; most?: ValueDef; fewest?: ValueDef } — The players controlled while they search their own libraries (eachOpponent). - `shareAttachments` — Equipment and Auras attached to the `to` permanents are treated as if they were also attached to the `with` permanents (default: the source itself): their "equipped / enchanted creature …" statics, host-mode effects and host filters apply to both (CR 301.5, 303.4). Custom-card primitive. Fields: `to`: TargetDef — What it applies to (TargetDef); `with?`: TargetDef — What it is shared or compared with. - `spendManaAsAny` — CR 609.4b, 106.7, 118.14: spend mana as any color/type; omit both filters for all costs. The permission never removes spending restrictions. 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`); `mana`: "color" | "type" — Any color still requires colorless mana for {C}; any type permits any mana for {C}; `spells?`: ObjectFilter — Matching spells' costs, including additional mana costs; `abilities?`: ObjectFilter — Sources of activated abilities whose mana costs are covered. - `retainMana` — CR 106.4, 500.4, 613.11: this player's unspent mana does not empty as steps and phases end. 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`); `colors?`: string[] — Mana colors to retain; omitted means all types. Spending restrictions are preserved. ### 6.4 Replacement effects (`ReplacementDef`, discriminator `replaces`) Used as `{ kind: "replacement", replacement: {…} }`. - `entersTapped` — e.g. “~ enters tapped”. Fields: `applyTo?`: TargetDef — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events); `unless?`: ConditionDef — Enters untapped if this holds ("unless you control two or more other lands"); `unlessPay?`: CostDef — "As ~ enters, you may pay …. If you don't, it enters tapped."; `castBy?`: "you" | "opponent" — Only a spell cast by you / by an opponent that enters the battlefield (CR 601.2a, 614.1c): "Creatures played by your opponents enter tapped" (Uphill Battle). Entering without being cast (put onto the battlefield, copied, reanimated) doesn't match. - `entersUntapped` — CR 614.1c, 614.12, 616.1: "Lands you control enter untapped". A permanent an instruction puts onto the battlefield tapped enters untapped; if another replacement would have it enter tapped, its controller chooses the order (so whether it enters tapped). Permanents entering together with the source aren't affected. Fields: `applyTo?`: TargetDef — The entering permanents it applies to ("lands you control", `mode: all`); default the source itself; `condition?`: ConditionDef — Read as the permanent would enter ("as long as ~ is untapped"). - `entersWithCounters` — e.g. “~ enters with a +1/+1 counter on it”. Fields: `counter?`: string | string[] — The counter kind (default +1/+1). A list is "your choice of a trample counter or a menace counter" — the replacement's controller picks as it applies (CR 122.1b, 614.1c); `chooseKinds?`: number — With a list: choose this many different kinds, `amount` of each ("your choice of two different counters from among menace, deathtouch, and lifelink"); `amount`: ValueDef — How many / how much (integer or ValueDef); `additional?`: boolean — Counters in addition to those it would otherwise enter with (CR 122.6); `applyTo?`: TargetDef — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events); `condition?`: ConditionDef — A ConditionDef that must hold. - `entersUnlessSacrifice` — CR 614.12a: Scorched Ruins / Lotus Vale entry replacement. Fields: `sacrifice`: { of: "object" | "player" | "spell" | "ability" | "spellOrAbility" | "any"; slot?: string; mode?: "chosen" | "choose" | "all" | "self" | "random" | "host" | "triggering" | "created" | "convoked" | "linked" | "paired" | "top" | "affected" | "replaced" | "replacedSource" | "triggeringOther" | "about" | "thisWay" | "costPaid" | "attacked" | "grantor"; action?: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; among?: "triggering"; chooser?: any; random?: true; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; allZones?: boolean; position?: "top" | "bottom"; filter?: ObjectFilter; player?: any; playerOwns?: true; exceptPlayer?: any; playerFilter?: "opponent"; sameZoneOwner?: boolean; maxTotalManaValue?: ValueDef; maxTotalPower?: ValueDef; distinctBy?: "name" | "manaValue" | "controller" | "power"; equalBy?: "toughness" | "power" | "manaValue"; sharesType?: "card" | "permanent"; sharedBy?: "creatureType"; zones?: ("battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command")[]; playerTarget?: PlayerTargetDef; digSubset?: "looked" | "picked" | "rest"; span?: number; targetCount?: number; targetsOnlySource?: boolean; permanents?: true; stackTargets?: object; spell?: object; ability?: object; min?: ValueDef; max?: ValueDef | "any"; differentFromEarlierTargets?: boolean; attacker?: "self" | "triggering"; label?: string } — Permanents its would-be controller must sacrifice before it enters; failure puts this card into its owner's graveyard. - `asEnters` — CR 614.1c, 614.12: "As this enters, ": performed as part of the entry, before the permanent is on the battlefield; its own entersWithCounters read the results (doneThisWay, ifYouDo). Fields: `effects`: EffectDef[] — The effects, resolved in order (EffectDef[]); `condition?`: ConditionDef — A ConditionDef that must hold. - `asAttaches` — Make and remember a color choice as this becomes attached to a new matching object (Sanctuary Blade). Fields: `filter`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `key?`: string — Storage key of a noted value or choice (defaults to the choice's kind). - `turnedFaceUp` — CR 614.1c, 702.37e: "As this creature is turned face up, " (morph): performed as part of turning it face up, before its turned-face-up triggers. Fields: `effects`: EffectDef[] — The effects, resolved in order (EffectDef[]); `condition?`: ConditionDef — A ConditionDef that must hold. - `preventDamage` — e.g. “prevent all damage that would be dealt to ~”. Fields: `amount?`: ValueDef — How many / how much (integer or ValueDef); `combatOnly?`: boolean — Only combat damage; `applyTo?`: TargetDef — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events); `fromFilter?`: ObjectFilter — Only damage from sources matching this filter. - `diesToExile` — e.g. “if ~ would die, exile it instead”. Fields: `applyTo?`: TargetDef — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events). - `entersAsCopyOfHost` — CR 614.12, 616.1c: matching permanents enter as a copy of the permanent this source is attached to. Fields: `applyTo`: { native?: object; exclude?: any; anyOf?: ObjectFilter[]; types?: string[]; anyTypes?: string[]; subtypes?: string[]; supertypes?: string[]; colors?: string[]; notTypes?: string[]; notSubtypes?: string[]; notSupertypes?: string[]; notColors?: string[]; colorless?: boolean; multicolored?: boolean; monocolored?: boolean; colorCount?: number; minCardTypes?: number; controller?: Relation; owner?: "you" | "opponent" | "any" | "notYou" | "current"; kicked?: boolean; sharesColorWithTriggeringMana?: boolean; manaSpentToCast?: object; manaSpentFrom?: object; castFrom?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; notCastFrom?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; convoked?: boolean; enteredFrom?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; hasHybridMana?: boolean; manaCostContains?: string; hasAdventure?: boolean; withKeyword?: string; hasBasicLandType?: boolean; hasNonbasicLandType?: boolean; withKeywordAbility?: string; withoutKeywordAbility?: string; withTapAbility?: boolean; withAbility?: "activated" | "triggered" | "mana" | "nonManaActivated"; withoutManaAbility?: boolean; withoutAbilities?: boolean; withoutKeyword?: any; tapped?: boolean; isRingBearer?: boolean; isToken?: boolean; attacking?: boolean; attackingAlone?: boolean; tappedForSourceThisTurn?: "crew" | "saddle"; attackedThisTurn?: boolean; canAttack?: boolean; blockedThisTurn?: boolean; wasBlockedThisTurn?: boolean; attackingPlayer?: any; attackingPlaneswalkerControlledBy?: any; blocking?: boolean; blocked?: boolean; modified?: boolean; bandedWithSource?: boolean; minPowerOrToughness?: number; maxPowerOrToughness?: number; minPowerPlusToughness?: number; maxPowerPlusToughness?: number; minPower?: number; maxBasePower?: number; maxBaseToughness?: number; basePower?: number; baseToughness?: number; powerAboveBase?: boolean; maxPower?: number; minToughness?: number; maxToughness?: number; minToughnessValue?: any; maxToughnessValue?: any; minManaValueValue?: any; minManaValue?: number; maxManaValue?: number; manaValueValue?: any; manaValues?: number[]; manaCosts?: string[]; maxManaValueValue?: any; manaValueVar?: string; hasCounter?: string; inZone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; suspended?: boolean; withoutCounter?: string; self?: boolean; other?: boolean; otherThanTrigger?: boolean; otherThanAffected?: boolean; name?: string; nameOf?: "self" | "affected"; host?: boolean; attachedToSource?: boolean; attachedToReference?: "affected" | "triggering" | "triggeringOther"; attachedTo?: any; sharesWithHost?: "creatureType" | "color" | "cardType"; attachedToHost?: boolean; enchanted?: boolean; hasAttachment?: object; enchantedByOther?: boolean; equipped?: boolean; notAffected?: boolean; notChosenSubtype?: boolean | string; chosenSubtype?: boolean | string; chosenColor?: boolean | string; chosenParity?: boolean | string; chosenPowerParity?: boolean | string; manaValueParity?: "odd" | "even"; chosenKind?: boolean | string; chosenType?: boolean | string; chosenName?: boolean | string; chosenBy?: "controller" | "owner"; comparedToSource?: object; comparedToTrigger?: object; maxManaValueVar?: string; minManaValueVar?: string; minPowerValue?: any; maxPowerVar?: string; maxPowerValue?: any; designation?: string; withoutDesignation?: string; attachedToSameHost?: boolean; isCommander?: boolean; linkedToSource?: boolean; putWithSource?: boolean; phasedOut?: boolean; faceDown?: boolean; sharesWithSource?: "creatureType" | "cardType" | "color" | "name"; sharesWithSacrificed?: "creatureType" | "cardType" | "color" | "name"; notSharesLandTypeWith?: object; sharesWithTarget?: "creatureType" | "cardType" | "color" | "name"; sharesWith?: object; comparedTo?: object; attachedToSelection?: any; inSelection?: any; targetableByTriggering?: boolean; targetOfTriggering?: boolean; controllerOfTriggeringTarget?: boolean; combatWith?: object; discardedThisTurn?: boolean; enteredGraveyardThisTurn?: true | "fromAnywhere" | "fromBattlefield" | "fromLibrary" | "milled"; attached?: boolean; enteredThisTurn?: boolean; alreadyOnBattlefield?: boolean; enteredThisTurnUnder?: any; damagedThisTurn?: boolean; dealtDamageThisTurn?: boolean; dealtDamageToThisTurn?: any; dealtCombatDamageToThisTurn?: any; counterPlacedThisTurnBy?: "you"; damagedBySource?: boolean; damagedByHost?: boolean; damagedThisTurnBy?: any; drawnThisTurn?: boolean; fromStartingDeck?: boolean; minCounters?: number; hasSticker?: "any" | "name" | "art" | "ability" | "pt"; onSprocket?: 1 | 2 | 3 | "crank"; isHost?: boolean; hasAugment?: boolean } — Entering objects to which the copy effect applies, relative to the attached source controller. - `entersAsCopy` — e.g. “you may have ~ enter as a copy of any creature on the battlefield”. Fields: `exceptIfEmbalmed?`: { keywords?: string[]; keywordAbilities?: KeywordAbilityDef[]; abilities?: any[]; addTypes?: string[]; addSubtypes?: string[]; setTypes?: string[]; setSubtypes?: string[]; removeSubtypes?: string[]; colors?: string[]; addColors?: string[]; power?: ValueDef; toughness?: ValueDef; loyalty?: ValueDef; notLegendary?: boolean; legendary?: boolean; name?: string; noManaCost?: boolean } — CR 707.9, 702.128a: apply these copiable exceptions when this token enters from resolving an embalm ability; `exilePairForCounters?`: { counter: string; property: "power" | "toughness" } — CR 614.12, 707.9e: exile two matching cards from graveyards, copy one and enter with additional counters equal to the other card's specified characteristic; `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `zone?`: "battlefield" | "graveyard" | "exile" — Zone containing the copy model; default battlefield (CR 707.2, 614.12); `tapped?`: boolean — Enter tapped if the copy option is chosen; declining preserves normal entry (CR 614.12); `withCounters?`: { counter: string; amount: ValueDef } — Additional entry counters when copying; not part of the copiable values (CR 707.9e, 122.6); `additionalCounters?`: ({ counter: string; amount: ValueDef; filter?: ObjectFilter })[] — Additional entry counters when copying, combined with initial counters; not copiable (CR 707.9e, 122.6); `optional?`: boolean — "You may": the player chooses whether to do it; `except?`: { keywords?: string[]; keywordAbilities?: KeywordAbilityDef[]; abilities?: any[]; addTypes?: string[]; addSubtypes?: string[]; setTypes?: string[]; setSubtypes?: string[]; removeSubtypes?: string[]; colors?: string[]; addColors?: string[]; power?: ValueDef; toughness?: ValueDef; loyalty?: ValueDef; notLegendary?: boolean; legendary?: boolean; name?: string; noManaCost?: boolean } — Except: apply before entry, including added enters abilities (CR 707.9); `condition?`: ConditionDef — CR 614.12: the replacement applies only while this holds as it would enter ("Raid — If you attacked this turn, you may have ~ enter as a copy of any creature on the battlefield", Protean Raider). - `draw` — "If you would draw a card, instead …" (dredge-like). Fields: `optional?`: boolean — "You may": the player chooses whether to do it; `then`: EffectDef[] — Effects that follow ("then …", "if you do …"); `applyTo?`: "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 — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events). - `toGraveyard` — "If ~ would be put into a graveyard from anywhere, exile it instead". Fields: `instead`: "exile" | "shuffleIntoLibrary" | "hand" — Where it goes instead: exile, shuffled into its owner's library, or its owner's hand; `applyTo?`: TargetDef — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events); `fromBattlefieldOnly?`: boolean — Only when it would go to the graveyard from the battlefield. - `entersDesignated` — "~ enters prepared": enters with the designation. Fields: `designation`: string — A designation name (monarch, monstrous, renowned, saddled, suspected, prepared …); `applyTo?`: TargetDef — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events). - `lifeGain` — "If you would gain life, you gain twice that much instead". Fields: `applyTo?`: "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 — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events); `multiply?`: number — Multiplier ("twice that much" = 2); `add?`: number — Amount added ("that much plus N"); `prevent?`: boolean — The event doesn't happen at all. - `damageDealt` — Damage dealt to the affected is doubled / increased. Fields: `applyTo?`: TargetDef — What the replacement watches (default the source itself; `mode: "all"` + filter for a group, a player selector for player events); `multiply?`: number — Multiplier ("twice that much" = 2); `add?`: number — Amount added ("that much plus N"). - `event` — A general replacement effect: which event, which objects / players / sources, and what happens instead. Fields: `event`: "damage" | "draw" | "drawBatch" | "beginTurn" | "beginStep" | "dies" | "toGraveyard" | "leavesBattlefield" | "enters" | "destroy" | "counter" | "copySpell" | "untap" | "createTokens" | "putCounters" | "lifeGain" | "lifeLoss" | "loseGame" | "loseMana" | "addMana" | "mill" | "searchLibrary" | "rollDice" | "flipCoin" | "explore" | "connive" | "scry" | "proliferate" | "setInMotion" — CR 614-616: watch countering spells (701.6), damage, individual or batch draws (121.2a), turn/step beginnings (500, 614.10), zone changes and entry (614.12), token creation (111), counters (122), life and game loss (104), mana production or loss (106), searches (701.23), keyword actions (701), and dice/coin result sets (705-706); `to?`: TargetDef — The object(s) the event would happen to (default: the source itself when toPlayer is absent — or, for a damage event with `from` written, whatever that source would damage): mode all + filter, self, host, or — created by the one-shot effect — chosen / affected; `toPlayer?`: "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 player(s) the event would happen to: damaged, drawing, gaining / losing, milling; the controller tokens / counters would go to; `from?`: TargetDef — damage: the source must match ("a red source", "creatures", "sources you don't control", of: spell = "a spell"); mode choose = "a source of your choice", picked as the effect resolves. putCounters: the source of the effect placing the counters (mode all + filter other = "by a source other than this one"). With to self, counter and prevent: true that is "Adaptation counters can't be put on ~ except by its own abilities" — proliferate and every other spell or ability are stopped, the card's own abilities still put them (CR 122.1, 614.1a); `by?`: "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 controller of the effect creating tokens, placing counters, or countering a spell; `lifeLossBy?`: "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 — Only life loss caused by a spell or ability controlled by these players. Payments of life have no causing controller; `damageKind?`: "combat" | "noncombat" — damage: only combat / only noncombat damage; `minAmount?`: ValueDef — The event's amount must be at least this ("3 or more damage"); `maxAmount?`: ValueDef — CR 615.1a: only damage events no greater than this amount ("3 or less damage"); `exactAmount?`: ValueDef — CR 614.1a: only damage events of exactly this amount ("exactly 2 damage"); `counter?`: string — putCounters: only this kind of counter; `extraTurnOnly?`: boolean — CR 500.7 / 614.10: watch only extra turns; `step?`: "untap" | "draw" — CR 502 / 504: step whose beginning is replaced; `duringUntapStep?`: boolean — CR 502.3: only during the object's controller's untap step; `firstEachTurn?`: boolean — CR 614.1a: first matching event each turn for each affected player; `manaColor?`: string — CR 106: transform retained or produced mana to this type, retaining spending restrictions; "any" = a color of the producer's choice, "chosen" = the color chosen as this ability resolved; `coloredManaOnly?`: boolean — CR 106.1: transform colored mana only; `manaFromColors?`: string[] — CR 106.1: transform only mana of these types ("instead of white mana"); `manaPlayers?`: "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 — CR 106.1: produce the same mana for these players instead; `manaAdditional?`: string[] — CR 106.1: extra mana types produced in the same event; `manaMultiply?`: number — CR 106.1, 614.1a: "it produces twice as much of that mana instead" — every unit produced that many times, of the same type; `manaExact?`: string — CR 106.1, 614.1a: "it produces {B} instead of any other type and amount" — the whole production becomes exactly this mana string ({any} = a color of the producer's choice); `manaOneColor?`: boolean — With manaExact {any}…: every unit is the same chosen color ("three mana of a color of your choice"); `tappedForMana?`: boolean — CR 605.1b wording "is tapped for mana" / "you tap … for mana": only mana a {T} mana ability of the source produces, not rituals or other abilities; `enterController?`: "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 — CR 614.12 / 616.1b: enters under this player's control instead; `chooseEnterController?`: boolean — CR 614.12, 616.1b: "enters under the control of an opponent of your choice" — the replacement's controller chooses one of the players enterController names (no targeting) as it would enter; `enterTapped?`: boolean — CR 614.1c: enters tapped instead; `enterAttacking?`: boolean — CR 508.4: enters attacking a legal defender instead; `enterCounters?`: ({ counter: string; amount: ValueDef })[] — CR 614.1c, 122.6: it enters with these additional counters ("this turn, each creature you control enters with an additional +1/+1 counter on it"); `enterAs?`: EffectDef[] — CR 614.1c, 614.12: continuous effects the entering permanent gets as it enters (target `{ mode: "affected" }`, duration permanent), before its enters abilities trigger — "enters … as a Mutant in addition to its other types" (becomeType), "it becomes a 7/7 Dinosaur creature in addition to its other types" (becomeType + setPT); `tokenReplace?`: object[] — CR 111 / 614.1a: each replaced token becomes one of each spec; `tokenChoices?`: object[] — CR 111 / 614.1a: choose one token spec for the whole event; `tokenAdditional?`: object[] — CR 111 / 614.1a: keep the tokens and add that many of each spec; `tokenAdditionalOnce?`: object[] — CR 614.1a, 614.5, 616.1: add one of each spec to this same creation event; prior replacements do not apply again; `shuffleOwnedIntoLibrary?`: boolean — CR 104.4 / 614.1a: shuffle the affected player's hand, graveyard and all owned permanents into their library; `randomResults?`: { add?: number; multiply?: number; ignore?: "lowest" | "chosen"; chooser?: "you" | "replacedPlayer"; perDie?: boolean; oneDie?: boolean; sum?: boolean } — CR 706.6 / 705: enlarge a result set, ignore results before triggers, or use its sum; `dieSides?`: number — CR 706: only dice with this many sides; `searchTop?`: number — CR 701.23: restrict the searchable library domain to its top N cards; `ownLibrary?`: boolean — searchLibrary: only a search of the searching player's own library ("while an opponent is searching their library"). With zone, every card that search finds goes to that zone instead of where the instruction would put it; the instruction's other effects can't see them, and `then` runs on them as `affected` (Opposition Agent: zone exile, then exileMayPlay). Several such effects: the player controlling the search chooses one (CR 616.1); `regenerate?`: boolean — CR 614.8 / 701.19: regenerate now instead of destruction, unless prohibited; `removeDamage?`: boolean — CR 701.8: remove all marked damage instead of destruction; `removeCounterToUntap?`: string — CR 122.2 / 614.1a: remove one counter instead of untapping; untap only when a counter was actually removed; `removeAllCounters?`: string — CR 122.2: remove all counters of this kind instead; `tokenFilter?`: ObjectFilter — createTokens: only tokens matching this filter ("one or more Treasure tokens"); `fromZone?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — toGraveyard / enters: the object must move from this zone; `toZone?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — leavesBattlefield: the object would move to this zone ("if enchanted creature would be exiled" = exile); `orEvents?`: ({ event: "damage" | "draw" | "drawBatch" | "beginTurn" | "beginStep" | "dies" | "toGraveyard" | "leavesBattlefield" | "enters" | "destroy" | "counter" | "copySpell" | "untap" | "createTokens" | "putCounters" | "lifeGain" | "lifeLoss" | "loseGame" | "loseMana" | "addMana" | "mill" | "searchLibrary" | "rollDice" | "flipCoin" | "explore" | "connive" | "scry" | "proliferate" | "setInMotion"; fromZone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; toZone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" })[] — CR 614.1a: further events the same replacement watches — "if enchanted creature would be destroyed or exiled" = event destroy + orEvents [{ event: leavesBattlefield, toZone: exile }]. All other match fields (to, toPlayer, condition, …) and all result fields are shared; the replacement still applies only once to one event (CR 614.5); `discarded?`: boolean — CR 701.9a: toGraveyard — only a discard; `causedBy?`: "opponent" — CR 701.9a, 614.1a: only an event a spell or ability an opponent controls causes; `notCast?`: boolean — enters: only permanents that weren't cast; `exceptFirstInDrawStep?`: boolean — draw: not the first card the player draws in each of their draw steps; `condition?`: ConditionDef — Checked as the event would happen ("while you have 5 or less life", "if you control a creature"); `optional?`: boolean — "You may … instead" (draw / createTokens / lifeGain); `prevent?`: boolean — The event doesn't happen at all; `preventAmount?`: ValueDef — CR 615.1a / 615.6: prevent this much of each damage event. Math over replaced.amount supports half that damage with rounding; `preventAllBut?`: ValueDef — damage: prevent all but this much; `multiply?`: number — "twice that much" = 2; `add?`: ValueDef — "that much plus N"; `newTargets?`: boolean — CR 707.10c: allow new targets for extra spell copies supplied by this copySpell replacement, even when original copies retain their targets; `addDieRoll?`: number — CR 614.1a / 706: add the result of a die with this many sides to damage, with normal roll replacements and triggers; `half?`: "up" | "down" — "half that damage, rounded up / down"; `set?`: ValueDef — The amount becomes this instead; `redirectTo?`: TargetDef — damage: dealt to this object or player instead; `lifeFloor?`: ValueDef — damage to a player: can't reduce the life total below this; `zone?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — Zone-change events: the object goes here instead. searchLibrary with ownLibrary: the found cards go here instead; `position?`: "top" | "bottom" — With `zone: "library"`: top or bottom; `shuffle?`: boolean — With zone library: shuffle it in; `link?`: boolean — CR 400.7: a card moved to exile (or the command zone) by this replacement is "exiled with" the source — linked to that incarnation of it, so the source's playLinkedExile / castLinkedExile permission and `linked` selections cover it (Valgavoth, Terror Eater: "exile it instead. During your turn, you may play cards exiled with Valgavoth"); `instead?`: EffectDef[] — Effects that happen instead of the event (the event itself doesn't). On dies / toGraveyard / leavesBattlefield with no zone written, the zone change does not happen and these run in its place ("if enchanted creature would be destroyed, instead it phases out"); a moveTo of the replaced permanent with destination battlefield there returns it to the battlefield as a new object (CR 400.7) — "If ~ would leave the battlefield, return it to the battlefield under an opponent's control instead" (controller: opponent): its counters, damage, attachments and the effects on it are gone, enters abilities trigger and leaves abilities don't; `then?`: EffectDef[] — Effects that also happen right after the (modified or prevented) event. ### 6.5 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" }`. ### 6.6 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. ### 6.7 Values (`ValueDef`, discriminator `kind`; a plain integer is also a ValueDef) Numbers: constants, X, counts and derived quantities. - `var` — e.g. “Token”. Fields: `name`: string — Announced variable; lifeLostThisWay, damageDealtThisWay and countersRemovedThisWay read the actual total of the preceding corresponding instruction after replacements/prevention, including redirected damage (CR 119.3, 120.4, 122.2, 608.2h); targetSpellManaValue is the mana value of the target spell of the preceding counterSpell / counterUnlessPays as it last existed on the stack, X included, also when it couldn't be countered (kept by a later delayed trigger: "that spell's mana value", CR 202.3e, 608.2h). - `count` — e.g. “the number of permanents on the battlefield”. Fields: `digSubset?`: "looked" | "picked" | "rest" — Use the last dig's fixed subset and action-time characteristics; zone restricts actual disposition, excluding replaced moves (CR 608.2h, 609.3, 400.7); `of?`: "object" | "player" — Count objects (default) or players; `zone?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — Zone counted (default battlefield); `filter?`: ObjectFilter — Which objects are counted; `player?`: "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 is counted (on the battlefield: controller; elsewhere: owner). - `doneThisWay` — Number of successful earlier actions; filter uses action-time characteristics, including tokens (CR 609.3, 608.2h). Fields: `of`: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created" — Which action of this resolution is counted (see `thisWay` actions); `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `distinctOwners?`: boolean — CR 400.3, 121.1, 608.2h: count each owner of the action-time cards once. For drawn cards this counts the players who actually drew, even if replacement effects changed the number drawn; for searched, the players who searched; `by?`: "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 — CR 109.5, 608.2h: only actions these players performed — the searcher (searched), the card's owner (discarded / drawn / milled), the controller as it was sacrificed (sacrificed). In a player selector's where, you is each candidate: "each player who discarded a card this way", "each opponent who searched a library this way". - `playerAggregate` — CR 107.1, 608.2h: greatest/least value among players (default eachPlayer). Bind current separately for each player without rebinding you; empty set yields zero. Fields: `op`: "max" | "min" — Comparison or arithmetic operator; `players?`: "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 players are compared (default each player); the value is evaluated as each of them in turn; `value`: ValueDef — The value to store or compare. - `triggerAmount` — CR 603.2, 608.2h: recorded amount of the event that caused the trigger; damage is the amount actually dealt after prevention. No fields. - `triggeringCount` — CR 603.2c: number of distinct objects in the triggering event (oneOrMore, or youAttack), fixed when it happened; separate from triggerAmount's damage total. No fields. - `affectedCount` — CR 608.2h: number of objects in the preceding selection of this resolution ("for each creature chosen this way"). Fields: `noun?`: string — Which kind of object the cost paid with is read. - `devoured` — CR 702.82a: number of creatures this permanent devoured as it entered (devour); "for each creature it devoured". No fields. - `counterKinds` — CR 122.1: number of different kinds of counter on the permanents matching filter (default: permanents you control); "for each kind of counter among permanents you control". Fields: `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together). - `countersAmong` — CR 122.1: the number of counters on the permanents matching filter (default: permanents you control) — of one kind when counter is given, else of every kind; "if there are thirty or more counters among artifacts and creatures you control". Fields: `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `counter?`: string — Counter kind (any string: "+1/+1", "loyalty", "time", "oil" …). - `costPaid` — CR 601.2h, 602.2b, 608.2h: the single object sacrificed, discarded, revealed or exiled (`cost`) to pay this spell or ability; its characteristics are fixed at payment, before it changes zones. `reveal` is the card a reveal cost showed; `exile` is the one card exiled by an exileOthers cost. Fields: `cost`: "sacrifice" | "discard" | "reveal" | "exile" — Which cost paid is read: sacrifice, discard, reveal or exile; `property`: "power" | "toughness" | "manaValue" — Which characteristic of what was paid: power, toughness or mana value; `noun?`: "creature" | "artifact" | "enchantment" | "permanent" | "card" — Which kind of object the cost paid with is read. - `blockers` — CR 509.1g-h: count creatures currently blocking the source (default) or triggering creature; departed blockers do not count. Fields: `of?`: "source" | "triggering" — Blockers of the source or of the triggering creature. - `sourcePower` — e.g. “~'s power”. No fields. - `sourceToughness` — e.g. “~'s toughness”. No fields. - `intensity` — The source card's persistent intensity, initialized by startingIntensity; not a counter. No fields. - `affected` — CR 608.2h: a property of the object evaluated by a static, or the preceding single object selection during resolution; a departed battlefield object uses last-known characteristics ("its mana value", "equal to its toughness"). Fields: `property`: "power" | "toughness" | "manaValue" | "counters" | "colors" — colors: CR 105.2 number of colors, last known after it left the battlefield; `counter?`: string — CR 122.1: counter kind; omitted or any totals all counters on the affected object. - `sacrificed` — CR 601.2h, 602.2b, 608.2h: last-known power, toughness, or mana value of the single object sacrificed as this spell or ability's cost; retained by copies (CR 707.10). Fields: `property`: "power" | "toughness" | "manaValue" — Which characteristic of the sacrificed object: power, toughness or mana value; `object?`: "artifact" | "enchantment" | "permanent" — Printed noun of the sacrifice cost; defaults to creature (CR 108.1). - `countersOnSource` — e.g. “the number of counters on ~”. Fields: `counter?`: string — CR 122.1, 608.2h: a counter kind; omitted or any totals every kind of counter on the source, using last known information after it leaves. - `activationsThisTurn` — CR 602.2, 608.2h: how many times the resolving activated ability has been activated this turn, counting this activation ("if this ability has been activated four or more times this turn"). No fields. - `excessDamageThisWay` — CR 120.4a: the total damage beyond lethal dealt by this resolution so far ("the amount of excess damage dealt this way"; "if excess damage was dealt this way" compares it with 0). No fields. - `damageDealt` — CR 120.1, 608.2h: damage actually dealt this turn after prevention and replacement, narrowed by recipient, source, kind and combat; "if it was dealt damage this turn" compares it with 0. Fields: `to?`: "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 | TargetDef — Recipients: a player selector ("an opponent was dealt damage" is eachOpponent), or an object selection compared by identity — { mode: "self" } for "this creature", { mode: "affected" } / { mode: "triggering" } for "it" (the same incarnation, CR 400.7); `from?`: ObjectFilter — Match source characteristics when the damage was dealt. For red sources you controlled, use { colors: ["R"], controller: "you" }; `damageKind?`: "combat" | "noncombat" — Only combat / noncombat damage; `excess?`: boolean — CR 120.4a: sum the damage beyond lethal instead of the damage dealt; `combat?`: boolean — CR 506.1: only this combat phase (0 outside combat); `lastTurn?`: boolean — Read last turn instead of this turn; `thisGame?`: boolean — CR 120.1: damage dealt to players at any time this game, not only this turn ("each opponent dealt combat damage this game by a creature named Gollum, Obsessed Stalker": to you, from { name, types: ["Creature"] }, combat). Damage to permanents is only kept for the turn. - `lifeTotal` — CR 119.1: a selected player life total, or the lowest/highest among players or opponents. 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`); `of?`: "lowest" | "highest" — With `among`: the lowest or highest life total; `among?`: "players" | "opponents" — Among which players the value is read. - `chosenNumber` — Numeric choice in this resolution, falling back to the source choice (CR 608.2d). Fields: `key?`: string — Named numeric choice; defaults to number (CR 608.2d); `of?`: "you" | "highest" | "lowest" — A number every player chose (choose with collect): `you` = the one the player "you" stands for chose (each candidate of a player selector's most / fewest / where); `highest` / `lowest` = the greatest / least of them all. - `votes` — CR 701.38: votes cast in the latest vote of this resolution, for an option or received by a player. Fields: `option?`: string — The option label: "the number of truth votes"; `player?`: "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 — Votes the selected player(s) received when players voted for a player: "for each vote you received". - `ringTemptations` — CR 701.64 (formerly 701.52): times the Ring has tempted this 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`). - `playerCounters` — Counters a player has: "energy" ({E}), "experience", "rad", …. Fields: `counter`: string — Counter kind (any string: "+1/+1", "loyalty", "time", "oil" …); `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`). - `unspentMana` — CR 106.4: unspent mana in the players' mana pools ("Omnath gets +1/+1 for each unspent mana you have"). 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`); `color?`: "W" | "U" | "B" | "R" | "G" | "C" — Only mana of this color ("unspent green mana"). - `stormCount` — Spells cast this turn before the source spell (storm). No fields. - `spellsCastLastTurn` — Spells cast during the previous turn — total, or the most by any single player. Fields: `by?`: "total" | "mostByOnePlayer" — Count all spells cast last turn (`total`) or the most cast by one player. - `turnsTaken` — CR 500.1, 102.1: turns these players have taken this game, counting a current turn of theirs ("unless it's your first, second, or third turn of the game" with isYourTurn, Starting Town). Extra turns count as taken. 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`). - `classLevel` — Current level of this Class enchantment. No fields. - `thisTurn` — Turn history: how many times something happened this turn (or last turn), optionally only to objects matching a look-back filter, by a player, or during this combat. Fields: `filter?`: ObjectFilter — CR 400.7, 608.2h look-back: count only events whose object matched this filter as the event happened (its characteristics, controller and counters then; tokens included). Allowed on every object event: entered, left, died, destroyed, sacrificed, cast, countered, drawn, discarded, exiled, returned to hand, left a graveyard, attacked, counters placed / removed; `counter?`: string — countersPlaced / countersRemoved: only counters of this kind; `combat?`: boolean — CR 506.1, 500.8: only events during the current combat phase count ("this combat"); 0 outside combat; `event`: "creaturesDied" | "permanentsLeft" | "permanentCardsToGraveyard" | "cardsToGraveyard" | "spellsCast" | "instantsSorceriesCast" | "noncreatureSpellsCast" | "creatureSpellsCast" | "cardsDrawn" | "lifeGained" | "lifeLost" | "landsPlayed" | "creaturesAttacked" | "damageDealtToOpponents" | "creaturesEntered" | "artifactsEntered" | "permanentsEntered" | "nonlandPermanentsEntered" | "permanentsToGraveyard" | "spellsWarped" | "cardsDiscarded" | "permanentsSacrificed" | "crimesCommitted" | "diceRolled" | "attractionsVisited" | "attractionsOpened" | "contraptionsAssembled" | "stickersPlaced" | "opponentsAttacked" | "permanentsExplored" | "cardsLeftGraveyard" | "cardsExiled" | "permanentsToHand" | "librariesSearched" | "scried" | "surveilled" | "cardsCycled" | "spellsCountered" | "permanentsDestroyed" | "countersPlaced" | "countersRemoved" | "tokensCreated" — The turn-history event counted. scried / surveilled: CR 701.22a / 701.25a actions by `who` (scry 0 is none); cardsCycled: CR 702.29a cards `who` cycled; `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`); `lastTurn?`: boolean — Read last turn instead of this turn; `sinceYourLastTurn?`: boolean — CR 500.1, 608.2h: every event since the end of the ability controller's most recent turn, across the turns in between and this one so far ("if no opponent cast a spell since your last turn ended"); since the game began before their first turn; `beforeTriggering?`: boolean — CR 603.2, 608.2h: "… you've cast before it this turn" (Thousand-Year Storm) — only the casts before the triggering spell, excluding it, fixed as it was cast (spells cast in response don't count). spellsCast / instantsSorceriesCast / creatureSpellsCast. - `cardTypesIn` — Number of distinct card types among cards in a zone (delirium). Fields: `zone`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — A zone name (battlefield, hand, graveyard, library, exile, stack, command); `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`). - `partySize` — CR 700.8: largest party of distinct controlled creatures, one each of Cleric, Rogue, Warrior and Wizard (0 to 4). 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`). - `domain` — Basic land types among lands you control. 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`). - `unlockedDoors` — Unlocked doors among Rooms the player controls (CR 709.5). 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`). - `devotion` — Devotion to the colors: mana symbols of those colors among permanents you control (chroma: among cards in `zone`). Fields: `colors`: string[] — Colour letters; "chosen" is the colour chosen earlier in this resolution (Nykthos: choose a color, then your devotion to that color); `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`); `zone?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — A zone name (battlefield, hand, graveyard, library, exile, stack, command); `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together). - `commanderIdentityColors` — CR 903.4: the number of colors in the player's commanders' color identity (War Room); 0 outside a Commander game. 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`). - `manaSpent` — Mana spent to cast the source spell: total, number of colors (converge), or of one color (adamant); `from` restricts to mana from matching producers (CR 106.3). Fields: `of?`: "total" | "colors" | "color" — Total mana spent, the number of colors spent, or the amount of one `color`; `color?`: string — A color (W / U / B / R / G); `from?`: { types?: string[]; subtypes?: string[]; supertypes?: string[] } — CR 106.3: count only mana produced by a source with all the given types/subtypes/supertypes, as it existed when it produced the mana ("for each mana from a Treasure spent to cast it", Marut); `thisTurn?`: boolean — Total mana spent by the controller to cast spells this turn. - `timesPaid` — How many times an optional additional cost was paid (CR 118.8, 707.10). Cost additional is the generic optionalAdditionalCost; copies retain the payment count. Cost resolution reads the enclosing repeatable mayPay payment count (CR 118.12, 603.12). Fields: `cost?`: "kicker" | "replicate" | "squad" | "strive" | "casualty" | "teamwork" | "waterbend" | "stickerKicker" | "additional" | "resolution" — Which optional or additional cost is counted (kicker, replicate, squad, …). - `aggregate` — CR 107.1, 608.2h: greatest / least / total power, toughness, mana value or counters among filtered objects in zone (default battlefield), scoped by who. Empty sets give zero. Fields: `sets?`: ({ zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; filter?: ObjectFilter; who?: any })[] — CR 400.1, 608.2h: union independently filtered/scoped object sets across zones, counting each object once; an empty union gives zero; `target?`: TargetDef — Read the property from a selection instead of a filtered zone: a declared target slot ("Choose target creature. … that creature's power" — the same `slot` as the declaring effect), `affected`, `triggering`, `triggeringOther`, `host`, `self`, `thisWay`. No prompt is ever made: an undeclared target or a resolution-time choice reads as empty (zero); `digSubset?`: "looked" | "picked" | "rest" — Use the last dig's fixed subset and action-time characteristics; zone restricts actual disposition, excluding replaced moves (CR 608.2h, 609.3, 400.7); `op`: "max" | "min" | "sum" — Aggregate over the matching objects: max, min or sum; `property`: "power" | "toughness" | "manaValue" | "counters" — counters (CR 122.1): the number of `counter` counters on each object ("for each +1/+1 counter among other creatures you control" = op sum); `counter?`: string — property counters: the counter kind; omitted or "any" totals every kind; `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); `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`). - `triggering` — A property of the object that caused the trigger (manaSpent: mana spent to cast the triggering spell; counters: the counters on it, as it last existed on the battlefield once it has left — "the number of counters it had on it", CR 603.10a, 608.2h). Fields: `property`: "power" | "toughness" | "manaValue" | "manaSpent" | "colors" | "counters" | "targets" — targets (CR 115.1, 601.2c): the number of targets the triggering spell had as it was cast, each instance of the word target counting; `counter?`: string — property counters: only this kind ("+1/+1"); omitted or "any" totals every kind (CR 122.1). - `startingLife` — CR 103.3: actual starting life total. 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`). - `poison` — e.g. “the number of poison counters you have”. 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`). - `speed` — A player's speed (0 when they have none). 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`). - `timesMutated` — CR 702.140: number of times the source permanent has mutated (merged creature spells); a new object starts at zero (CR 400.7). No fields. - `commanderTax` — CR 903.8: highest commander tax ({2} per previous command-zone cast) among the player's commanders. 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`). - `commanderCasts` — CR 903.8: times the player cast their commander from the command zone this game. 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`); `of?`: "triggering" — CR 903.8: only the triggering commander, including this cast. - `noted` — A value noted earlier by noteValue. Fields: `key?`: string — Storage key of a noted value or choice (defaults to the choice's kind). - `maxSameName` — CR 201.2a, 608.2h: largest number of matching battlefield permanents sharing a name. Face-down and nameless permanents contribute nothing. Fields: `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `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`). - `distinct` — Number of different values of a property among matching objects (coven); cardType counts card types (CR 205.2a). Fields: `property`: "power" | "toughness" | "manaValue" | "name" | "color" | "creatureType" | "cardType" — Which characteristic's distinct values are counted; `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); `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`); `target?`: TargetDef — Read the objects of a selection instead of a zone: thisWay (as the action found them — "card type among cards discarded this way"), triggering (a oneOrMore group, as each last existed — "among those cards"), a target slot. Never prompts. - `dieResult` — Result of the most recent die roll; with several dice: their total, the highest, the lowest, the number of different results, or the chosen / other result of rollDie.chooseResult. Fields: `of?`: "total" | "highest" | "lowest" | "distinct" | "chosen" | "other" — Which result: total, highest, lowest, distinct, the chosen result or the other one. - `handSize` — e.g. “the number of cards in your hand”. 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`). - `sharedCreatureTypeMax` — The greatest number of creatures a player controls that have a creature type in common (CR 205.3m, 107.1); zero with none. 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`). - `targetsChosen` — Number of targets chosen for this spell/ability. No fields. - `replaced` — Inside a replacement effect: the amount of the replaced event ("that much damage", "that many counters") or the damage it prevented ("the damage prevented this way"). Fields: `property`: "amount" | "prevented" — The replaced event's amount, or the amount prevented. - `math` — CR 107.1-107.3, 608.2h: recursive arithmetic: add (+), subtract (-), multiply (*) including twice X, divide (/) with round up/down (default down; zero divisor gives zero), or min/max of two values. Negative results remain negative for P/T; effects clamp amounts where the rules require. A printed minus sign (-X/-X) is multiplication by -1. Fields: `op`: "+" | "-" | "*" | "/" | "min" | "max" — Arithmetic: + − * / min max; `a`: ValueDef — The first operand; `b`: ValueDef — The second operand; `round?`: "up" | "down" — Rounding of a division: up or down. - `native` — A number computed 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 value stands for. - `asCast` — CR 601.2i, 608.2h: the inner value as it stood when this spell became cast ("where X is the number of creatures on the battlefield as you cast this spell"); recorded as casting completes, 0 for an object that wasn't cast; a copy inherits it (CR 707.10). Fields: `value`: ValueDef — The value to store or compare. ### 6.8 Targets & filters **TargetDef** — what an effect acts on. | Field | Type | Required | Description | |---|---|---|---| | `of` | `"object" \| "player" \| "spell" \| "ability" \| "spellOrAbility" \| "any"` | yes | What kind of thing is selected | | `slot` | `string` | no | Shared declaration: identical slot names refer to one target group across clauses, even across intervening choices (CR 601.2c) | | `mode` | `"chosen" \| "choose" \| "all" \| "self" \| "random" \| "host" \| "triggering" \| "created" \| "convoked" \| "linked" \| "paired" \| "top" \| "affected" \| "replaced" \| "replacedSource" \| "triggeringOther" \| "about" \| "thisWay" \| "costPaid" \| "attacked" \| "grantor"` | no | chosen = player picks a target (targeting prompt at cast/activation); choose = picked as the effect resolves, not a target; all = every match; self; random = sample on resolution, except of any declares a legal random target during casting (CR 115.6, 601.2c); host = what the source is attached to; triggering = the object that caused the trigger; created = objects this resolution created; linked = cards exiled with the source; paired = soulbond partner; thisWay = objects actually acted on by earlier effects (action specifies which; filter reads action-time characteristics); costPaid (action sacrificed) = the objects sacrificed to pay this spell's or ability's cost — "the sacrificed creature", "that card" after "Sacrifice another creature:" — followed into the zone they went to, and copied as they last existed on the battlefield (CR 601.2h, 400.7, 608.2h); top = the top card(s) of a library, or the topmost matching graveyard card(s) (CR 401.4, 404.1; zone selects the ordered pile, player says whose); affected = what the previous effect applied to ("those creatures", "it"); replaced / replacedSource = inside a replacement effect, the object the replaced event would have affected / the source of the replaced damage; triggeringOther = the other object of the triggering event (the creature blocked / blocking / dealt damage — "that creature"; for a becomesTarget trigger with of spell / ability / spellOrAbility, the spell or ability that targeted — "change that target"); about = inside a delayed trigger's effects, the object(s) the delayed trigger is about ("that creature" fixed when it was created; a new object after a zone change no longer counts, except the one whose zone change triggered it) | | `action` | `"sacrificed" \| "milled" \| "destroyed" \| "exiled" \| "discarded" \| "returned" \| "putIntoLibrary" \| "tapped" \| "untapped" \| "damaged" \| "drawn" \| "revealed" \| "countersPlaced" \| "countersRemoved" \| "amassed" \| "countered" \| "phasedOut" \| "searched" \| "created"` | no | mode thisWay or choose/action: successful earlier actions, tracking resulting object identities across their own zone changes (CR 400.7) | | `among` | `"triggering"` | no | mode choose: pick among the triggering event's group instead of the zone ("put one of them onto the battlefield" after a oneOrMore trigger; CR 603.2c, 608.2d) | | `chooser` | `"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 601.2c, 603.3d, 608.2d: player making a selection, including targets explicitly chosen by another player; defaults to controller | | `random` | `true` | no | With mode chosen: "target creature an opponent controls chosen at random" — still a target (declared as the spell is cast or the ability is put on the stack, rechecked on resolution) but picked at random among the legal candidates (CR 601.2c, 603.3d, 608.2b) | | `zone` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | Zone to look in (default battlefield) | | `allZones` | `boolean` | no | Select card objects across every in-game zone, excluding tokens; for Arena perpetual effects on all cards you own | | `position` | `"top" \| "bottom"` | no | mode top: read this end of the library or graveyard; graveyard filters select the top matching cards (CR 401.2, 404.3) | | `filter` | `ObjectFilter` | no | Which objects (ObjectFilter; set fields AND together) | | `player` | `"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 | Candidate players when of = player; for object zones: controllers on battlefield, owners elsewhere. target reads playerTarget in the current effect slot | | `playerOwns` | `true` | no | CR 108.3, 110.2: with player, a battlefield selection is the permanents those players own rather than control ("all artifacts target player owns") | | `exceptPlayer` | `"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 | of = player: players removed from the candidates — "each other opponent" is eachOpponent except triggeringPlayer (CR 608.2h) | | `playerFilter` | `"opponent"` | no | CR 115.4, 601.2c: restrict only the player half of an any target to opponents | | `sameZoneOwner` | `boolean` | no | CR 400.3, 601.2c: all selected cards belong to one player's zone | | `maxTotalManaValue` | `ValueDef` | no | CR 202.3, 601.2c: total mana value budget for the selected group | | `maxTotalPower` | `ValueDef` | no | CR 208.1, 601.2c: total power budget for the selected group ("with total power 10 or less") | | `distinctBy` | `"name" \| "manaValue" \| "controller" \| "power"` | no | CR 601.2c, 608.2d: no two selected objects share this value ("with different names") | | `equalBy` | `"toughness" \| "power" \| "manaValue"` | no | CR 601.2c, 608.2d: every selected object has the same value ("with equal toughness") | | `sharesType` | `"card" \| "permanent"` | no | CR 205.2a, 601.2c, 608.2b: the selected objects share at least one card type / permanent type ("two target permanents that share a card type"); rechecked on resolution | | `sharedBy` | `"creatureType"` | no | CR 601.2c, 205.3m: the selected objects share a creature type — one type every one of them has, changelings having all ("two target creature cards that share a creature type") | | `zones` | `("battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command")[]` | no | CR 400.1, 115.1a, 608.2d: one selection across these zones, e.g. hand and/or graveyard. For of object, stack contributes spells including copies, represented by stack references; battlefield contributes permanents | | `playerTarget` | `PlayerTargetDef` | no | With player = target: the player target whose zone is read, in any mode (top, random, choose, all). mode chosen makes that player a target of the spell ("target opponent's hand"); mode choose picks the player on resolution ("an opponent's hand") | | `digSubset` | `"looked" \| "picked" \| "rest"` | no | Read the cards of the enclosing `digTop`: `looked` (all looked at), `picked` (taken by a pick), `rest` (the remainder) | | `span` | `number` | no | mode = affected: how many preceding effects' selections to union (default 1) | | `targetCount` | `number` | no | CR 115.7: exact announced target count of a stack object | | `targetsOnlySource` | `boolean` | no | CR 115.7: all targets are this source | | `permanents` | `true` | no | With of any: the object half is any permanent (target permanent or player, CR 115.4) | | `stackTargets` | `{ object?: ObjectFilter; player?: "you" \| "opponent" \| "any" \| "notYou" }` | no | CR 115.1, 115.10, 601.2c: a stack-object target that currently targets at least one matching object (relative to this ability) or player (relative to its controller): "target spell that targets a creature you control", "… that targets you" | | `spell` | `{ controller?: "you" \| "opponent" \| "any" \| "notYou"; filter?: ObjectFilter }` | no | Constraints on spells, including the stack branch of of object with zones. There, spell.filter overrides the common object filter; an explicit empty filter leaves spells unrestricted (CR 115.1a, 601.2c) | | `ability` | `{ controller?: "you" \| "opponent" \| "any" \| "notYou"; kind?: "activated" \| "triggered"; source?: ObjectFilter }` | no | CR 707.10: constraints on an ability on the stack, including its source | | `min` | `ValueDef` | no | Minimum selections (0 for "up to"); a value such as X ("Return X target cards") is resolved as the targets are chosen — X is announced first (CR 601.2b) | | `max` | `ValueDef \| "any"` | no | Maximum selections (mode = top: how many cards from the top; mode = random: how many distinct objects are sampled); "any" = "any number of targets" (min defaults to 0; a divided effect needs at least one) | | `differentFromEarlierTargets` | `boolean` | no | Other targets: exclude targets declared earlier in this spell or ability (CR 115.3, 601.2c) | | `attacker` | `"self" \| "triggering"` | no | mode attacked: the attacking creature (the source, or the triggering object) whose attacked player / planeswalker / battle is selected (CR 506.2, 508.1b) | | `label` | `string` | no | Prompt text shown to the player | **PlayerTargetDef** — a player target for `playerTarget` (cannot nest). | Field | Type | Required | Description | |---|---|---|---| | `slot` | `string` | no | Shared declaration: identical slot names refer to one target group across clauses (CR 601.2c) | | `mode` | `"chosen" \| "choose" \| "all" \| "random" \| "triggering" \| "about" \| "affected"` | no | chosen = targeted at cast/activation (default); choose = picked on resolution; all = every candidate; random; triggering = the player that caused the trigger; about = the player a delayed trigger is about ("that player"); affected = the previous selection | | `span` | `number` | no | How many preceding selections to union (default 1) | | `player` | `"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 | Candidate players (default: every player) | | `exceptPlayer` | `"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 | Players removed from the candidates — "each other opponent" is eachOpponent except triggeringPlayer (CR 608.2h) | | `random` | `true` | no | With mode chosen: "target opponent chosen at random" — still a target, picked at random among the legal candidates (CR 601.2c, 603.3d) | | `min` | `ValueDef` | no | Minimum selections (0 for "up to"); a value such as X is resolved as the targets are chosen | | `max` | `ValueDef \| "any"` | no | Maximum selections; "any" = any number of targets | | `label` | `string` | no | Prompt text shown to the player | **ObjectFilter** — characteristics; all set fields AND together. | Field | Type | Required | Description | |---|---|---|---| | `native` | `{ id: string; params?: object; text?: string }` | no | An engine-implemented predicate on the object, ANDed with the other fields | | `exclude` | `ObjectFilter` | no | CR 608.2c: exclude objects matching the whole nested filter; negates its conjunction, not each individual field | | `anyOf` | `ObjectFilter[]` | no | Outer filter AND at least one branch; branches are a union, never multiple targets (CR 601.2c). Historic (CR 700.6) uses Artifact OR Legendary OR Saga branches | | `types` | `string[]` | no | Card types the object must have (all), e.g. ["Creature"] | | `anyTypes` | `string[]` | no | At least one of these card types ("artifact or enchantment", "creature or planeswalker") | | `subtypes` | `string[]` | no | At least one of these subtypes, e.g. ["Forest"] | | `supertypes` | `string[]` | no | At least one of these supertypes, e.g. ["Basic"] | | `colors` | `string[]` | no | At least one of these colors (W,U,B,R,G) | | `notTypes` | `string[]` | no | CR 205.2: must NOT have any of these types (nonland). CR 700.6 nonhistoric composes Artifact, Legendary and Saga exclusions | | `notSubtypes` | `string[]` | no | CR 205.3, 702.73: excludes every listed subtype, including changelings; a negated subtype union | | `notSupertypes` | `string[]` | no | Negated supertypes: "nonbasic", "nonlegendary" | | `notColors` | `string[]` | no | Has none of these colors | | `colorless` | `boolean` | no | Is colorless (true) / has a color (false) | | `multicolored` | `boolean` | no | Is two or more colors | | `monocolored` | `boolean` | no | Is exactly one color | | `colorCount` | `number` | no | CR 105.2, 202.2: exactly this many colors ("that isn't all colors" = exclude { colorCount: 5 }; "exactly two colors" = 2); colorless is 0 | | `minCardTypes` | `number` | no | CR 205.2a: at least this many card types ("a card with two or more card types" = 2) | | `controller` | `"you" \| "opponent" \| "any" \| "notYou" \| "affectedController" \| "triggeringController" \| "current" \| "notCurrent" \| "yourTeam" \| "previousPlayer" \| "chosenPlayer" \| "enchantedPlayer"` | no | Who controls it, relative to you (yourTeam: you or a teammate, CR 102.3, 810.2). previousPlayer: the player(s) of the preceding non-target player selection — after { effect: "choose", kind: "object", target: { of: "player", mode: "choose", player: "mostLife" } }, "creatures that player controls" (CR 608.2d, 608.2h). chosenPlayer: the player chosen for the source ("creatures the chosen player controls", CR 607.2d). enchantedPlayer: the player the source Aura is attached to ("creatures enchanted player controls", CR 303.4) | | `owner` | `"you" \| "opponent" \| "any" \| "notYou" \| "current"` | no | Who owns it, relative to you; `current` is the player the enclosing per-player effect is acting for (CR 608.2c: "each player … draws that many" counts that player's own cards via doneThisWay + owner current) | | `kicked` | `boolean` | no | CR 702.33: kicker or multikicker was paid at least once for this spell | | `sharesColorWithTriggeringMana` | `boolean` | no | CR 105.1, 605.1b: has a color among the mana the triggering tapped-for-mana event produced ("shares a color with the mana that land produced"); colorless mana has none | | `manaSpentToCast` | `{ min?: number; max?: number; colored?: boolean }` | no | CR 601.2h: mana actually spent to cast this spell / the permanent it became (any payer, additional costs included); colored counts only W/U/B/R/G. Not cast, or a copy: none spent — "no mana was spent to cast it" is { max: 0 } | | `manaSpentFrom` | `{ types?: string[]; subtypes?: string[]; supertypes?: string[]; min?: number }` | no | CR 601.2h, 106.3: at least min (default 1) of the mana spent to cast this spell / the permanent it became was produced by a source with all the given types/subtypes/supertypes, as the source existed when it produced the mana — "if mana from a Treasure was spent to cast it" is { subtypes: ["Treasure"] }; "three or more mana from creatures" is { types: ["Creature"], min: 3 }; "if {S} was spent to cast this spell" is { supertypes: ["Snow"] }. Not cast, or a copy: none spent | | `castFrom` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | CR 601.2a: the spell was cast from this zone ("target spell cast from a graveyard"); copies were not cast | | `notCastFrom` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | CR 601.2a, 707.10: the spell wasn't cast from this zone ("that wasn't cast from its owner's hand"); copies match | | `convoked` | `boolean` | no | CR 702.51: whether one or more creatures were tapped to pay for this spell with convoke | | `enteredFrom` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | CR 400.7, 603.6a: the permanent entered the battlefield from this zone ("if it entered from your graveyard"); a resolved permanent spell entered from the stack, a token from nowhere | | `hasHybridMana` | `boolean` | no | CR 107.4e-f: mana cost has a hybrid symbol, including 2/W, C/W and W/U/P; W/P alone is not hybrid | | `manaCostContains` | `string` | no | CR 107.3, 202.1: the printed mana cost contains this symbol, e.g. X, even when X is zero | | `hasAdventure` | `boolean` | no | CR 715.1: this card has an Adventure | | `withKeyword` | `string` | no | Has this plain keyword ("Flying") | | `hasBasicLandType` | `boolean` | no | CR 205.3i, 305.6: has a basic land subtype, including nonbasic lands | | `hasNonbasicLandType` | `boolean` | no | CR 205.3i: has a land type other than Plains, Island, Swamp, Mountain and Forest (Gate, Desert, Urza's, …) | | `withKeywordAbility` | `string` | no | Has this parametrized keyword ability identifier, e.g. levelUp (CR 702.1, 702.87) | | `withoutKeywordAbility` | `string` | no | Lacks this parametrized keyword ability identifier ("each nonland card in your hand without foretell") | | `withTapAbility` | `boolean` | no | Has an activated ability with the tap symbol in its cost (CR 602.1, 107.5) | | `withAbility` | `"activated" \| "triggered" \| "mana" \| "nonManaActivated"` | no | CR 602.1, 603.1, 605.1: has an activated, triggered, mana, or nonmana activated ability, including granted and intrinsic abilities | | `withoutManaAbility` | `boolean` | no | CR 605.1: has no activated or triggered mana abilities | | `withoutAbilities` | `boolean` | no | CR 113.1, 113.10: no abilities of any kind, including keywords, granted abilities and intrinsic land abilities | | `withoutKeyword` | `string \| string[]` | no | Lacks this keyword; a list lacks every keyword in it ("Creatures without flying or islandwalk" — neither) | | `tapped` | `boolean` | no | Tapped (true) or untapped (false); on an effect that puts something onto the battlefield, it enters tapped | | `isRingBearer` | `boolean` | no | CR 701.54e (formerly 701.52e): currently a Ring-bearer on the battlefield | | `isToken` | `boolean` | no | CR 111.1: whether this object is a token; false excludes every token type | | `attacking` | `boolean` | no | Attacking (true) / not attacking (false); on an effect that creates or moves a creature, it enters attacking | | `attackingAlone` | `boolean` | no | CR 506.5: attacking and no other creature is attacking ("that's attacking alone") | | `tappedForSourceThisTurn` | `"crew" \| "saddle"` | no | CR 702.122, 702.171, 400.7: this incarnation tapped to crew or saddle this source incarnation this turn | | `attackedThisTurn` | `boolean` | no | Was declared as an attacker this turn, including after combat (CR 508.1) | | `canAttack` | `boolean` | no | CR 508.1a: could attack this turn — untapped, not prevented from attacking, and not summoning sick unless it has haste; false = couldn't attack ("except for creatures that couldn't attack" is true) | | `blockedThisTurn` | `boolean` | no | CR 509.1, 608.2b: this incarnation was declared as a blocker this turn, including after combat | | `wasBlockedThisTurn` | `boolean` | no | CR 509.1h, 608.2b: this incarnation became blocked this turn, including after blockers leave | | `attackingPlayer` | `"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" \| { kind: "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"; span?: number; where?: ConditionDef; except?: any; most?: ValueDef; fewest?: ValueDef }` | no | Attacking this player directly, excluding attacks on their planeswalkers or battles (CR 508.1b, 508.6) | | `attackingPlaneswalkerControlledBy` | `"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 | Attacking a planeswalker controlled by this player; excludes attacks on players or battles (CR 508.1b) | | `blocking` | `boolean` | no | Is blocking | | `blocked` | `boolean` | no | CR 509.1h, 506.4: true selects blocked attackers, false unblocked attackers, only after blockers are declared; blocked status survives the blockers leaving combat | | `modified` | `boolean` | no | CR 700.9: a permanent with a counter, Equipment, or an Aura controlled by its own controller | | `bandedWithSource` | `boolean` | no | CR 702.22c-f: a different attacking creature in the source's current band; leaving combat removes membership | | `minPowerOrToughness` | `number` | no | Power OR toughness is at least this number (CR 208.1) | | `maxPowerOrToughness` | `number` | no | Power OR toughness is at most this number (CR 208.1) | | `minPowerPlusToughness` | `number` | no | CR 208.1: power plus toughness is at least this number | | `maxPowerPlusToughness` | `number` | no | CR 208.1: power plus toughness is at most this number ("with total power and toughness 5 or less") | | `minPower` | `number` | no | Power at least this number | | `maxBasePower` | `number` | no | CR 208.1: the base power after setting effects and before modifiers is at most this value | | `maxBaseToughness` | `number` | no | CR 208.1: the base toughness after setting effects and before modifiers is at most this value | | `basePower` | `number` | no | CR 208.1: the base power after setting effects and before modifiers is exactly this ("with base power 1"; base power and toughness 1/1 uses both fields) | | `baseToughness` | `number` | no | CR 208.1: the base toughness after setting effects and before modifiers is exactly this | | `powerAboveBase` | `boolean` | no | CR 208.1: current power is greater than the base power after setting effects ("with power greater than its base power"); false: not greater | | `maxPower` | `number` | no | Power at most this number | | `minToughness` | `number` | no | Toughness at least this number | | `maxToughness` | `number` | no | Toughness at most this number | | `minToughnessValue` | `ValueDef` | no | CR 208.1, 608.2h: computed minimum toughness; affectedController refers to the candidate | | `maxToughnessValue` | `ValueDef` | no | CR 208.1, 608.2h: computed maximum toughness ("toughness X or less"); affectedController refers to the candidate | | `minManaValueValue` | `ValueDef` | no | CR 202.3, 608.2h: contextual lower mana value bound | | `minManaValue` | `number` | no | Mana value at least this number | | `maxManaValue` | `number` | no | Mana value at most this number | | `manaValueValue` | `ValueDef` | no | Exact computed mana value (CR 202.3, 608.2h) | | `manaValues` | `number[]` | no | Allowed mana values, e.g. 2 or 3 (CR 202.3) | | `manaCosts` | `string[]` | no | The card's mana cost is exactly one of these — "an artifact card with mana cost {0} or {1}" (Urza's Saga): a card with {X} in its cost or no mana cost does not match (CR 202.1) | | `maxManaValueValue` | `ValueDef` | no | Mana value at most a computed value, such as your devotion to black (CR 202.3) | | `manaValueVar` | `string` | no | Mana value equals this variable (e.g. "X") | | `hasCounter` | `string` | no | Has a counter of this kind; any = any kind of counter (CR 122.1) | | `inZone` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | The object is in this zone: one branch of a union target across zones ("target permanent or suspended card" → anyOf [{ inZone: battlefield }, { suspended: true }] over zones battlefield and exile; CR 400.1) | | `suspended` | `boolean` | no | CR 702.62a: a suspended card (exiled with time counters under suspend) when true; false excludes them | | `withoutCounter` | `string` | no | Has no counters of this kind; any = no counters at all (CR 122.1, 608.2b) | | `self` | `boolean` | no | Only the source itself | | `other` | `boolean` | no | Anything except the source ("another") | | `otherThanTrigger` | `boolean` | no | Exclude the object that caused the trigger, rather than the ability's source (CR 603.10a, 608.2h) | | `otherThanAffected` | `boolean` | no | Exclude the object the effect is being applied to, rather than the ability's source: "Each legendary creature you control gets +1/+1 for each other legendary creature you control" (CR 608.2h, 613.4c) | | `name` | `string` | no | Exact card name | | `nameOf` | `"self" \| "affected"` | no | Shares the source's name ("self"), or the name of the preceding single object selection ("affected": "a creature card with the same name as that creature", CR 201.2) | | `host` | `boolean` | no | The object the source is attached to | | `attachedToSource` | `boolean` | no | Attached to the source ("Auras attached to ~") | | `attachedToReference` | `"affected" \| "triggering" \| "triggeringOther"` | no | Attached to the preceding selected object or the triggering event's object/other object: Equipment/Auras attached to that creature (CR 301.5, 303.4, 608.2c) | | `attachedTo` | `ObjectFilter` | no | CR 301.5, 303.4, 701.3: attached to a battlefield permanent matching this host filter; does not select or target the host | | `sharesWithHost` | `"creatureType" \| "color" \| "cardType"` | no | Shares this characteristic with the source's attachment host (CR 303.4, 301.5) | | `attachedToHost` | `boolean` | no | Is (or is not) attached to the source's host | | `enchanted` | `boolean` | no | Has (or does not have) at least one Aura attached (CR 303.4b) | | `hasAttachment` | `{ subtypes?: string[]; supertypes?: string[]; controller?: "you" \| "opponent" \| "any" \| "notYou" }` | no | CR 303.4, 301.5: has an attached Aura / Equipment (its subtypes / supertypes, and its controller relative to this ability's controller) — "creatures that are enchanted by an Aura you control", "a creature you control with a legendary Equipment attached to it". Non-recursive: the attachment is a plain characteristic set | | `enchantedByOther` | `boolean` | no | CR 303.4, 704.5m: has an attached Aura other than this ability source. Rechecked for enchant legality after attachment | | `equipped` | `boolean` | no | Has (or does not have) at least one Equipment attached (CR 301.5) | | `notAffected` | `boolean` | no | Exclude objects in the latest affected selection: the rest (CR 608.2c-d) | | `notChosenSubtype` | `boolean \| string` | no | Does not have the chosen creature type; changeling has every creature type (CR 205.3m, 702.73) | | `chosenSubtype` | `boolean \| string` | no | Choice in the resolving ability, falling back to the source; true uses the default kind key, a string selects a named key (CR 608.2d) | | `chosenColor` | `boolean \| string` | no | Choice in the resolving ability, falling back to the source; true uses the default kind key, a string selects a named key (CR 608.2d) | | `chosenParity` | `boolean \| string` | no | Mana value has the chosen odd/even quality; zero is even (CR 107.1) | | `chosenPowerParity` | `boolean \| string` | no | Power has the chosen odd/even quality ("each creature with power of the chosen quality"); zero is even (CR 107.1, 208.1) | | `manaValueParity` | `"odd" \| "even"` | no | "With an odd / even mana value": a fixed parity; zero is even (CR 202.3) | | `chosenKind` | `boolean \| string` | no | CR 608.2d: matches the chosen land or nonland kind | | `chosenType` | `boolean \| string` | no | Matches the chosen card type (CR 205.2, 608.2d) | | `chosenName` | `boolean \| string` | no | Choice in the resolving ability, falling back to the source; true uses the default kind key, a string selects a named key (CR 608.2d) | | `chosenBy` | `"controller" \| "owner"` | no | CR 101.4, 608.2d: with several choosers (choose with collect), chosenColor / chosenName / chosenType / chosenSubtype / notChosenSubtype read the answer of this object's controller (a card's owner off the battlefield) or owner — "only the color its controller chose" | | `comparedToSource` | `{ property: "power" \| "toughness" \| "manaValue"; op: "<" \| "<=" \| ">" \| ">=" \| "==" }` | no | Compare a property with the source's ("creature with lesser power", "greater mana value than ~") | | `comparedToTrigger` | `{ property: "power" \| "toughness" \| "manaValue"; op: "<" \| "<=" \| ">" \| ">=" \| "==" }` | no | Compare a property with the object that caused the trigger; death/leaves events use its battlefield snapshot (CR 603.10a, 608.2h) | | `maxManaValueVar` | `string` | no | Mana value at most this cast-time variable ("mana value X or less") | | `minManaValueVar` | `string` | no | Mana value at least this cast-time variable ("mana value X or greater") | | `minPowerValue` | `ValueDef` | no | Minimum power evaluated in context | | `maxPowerVar` | `string` | no | Power at most this cast-time variable ("power X or less") | | `maxPowerValue` | `ValueDef` | no | Computed maximum power; affectedController refers to the candidate (CR 608.2h) | | `designation` | `string` | no | Carries this designation (monstrous, renowned, suspected, saddled, goaded, paired, …) | | `withoutDesignation` | `string` | no | Lacks this designation | | `attachedToSameHost` | `boolean` | no | Attached to the same object the source is attached to | | `isCommander` | `boolean` | no | Is a commander | | `linkedToSource` | `boolean` | no | Cards exiled with / linked to the source (imprint, "the exiled card") | | `putWithSource` | `boolean` | no | CR 607.2a: put onto the battlefield with the source — the permanent its ability put there is linked to it ("the creature put onto the battlefield with this enchantment", Diabolic Servitude; "enchant creature put onto the battlefield with this Aura", Animate Dead). Same link as linkedToSource; it only prints differently | | `phasedOut` | `boolean` | no | Is phased out | | `faceDown` | `boolean` | no | Face down (CR 708) | | `sharesWithSource` | `"creatureType" \| "cardType" \| "color" \| "name"` | no | Shares a creature type / card type / color / name with the source | | `sharesWithSacrificed` | `"creatureType" \| "cardType" \| "color" \| "name"` | no | CR 601.2h, 602.2b, 608.2h: shares the characteristic with the object sacrificed to pay this spell's or ability's cost, as it last existed on the battlefield (Pyre of Heroes: "a creature card that shares a creature type with the sacrificed creature"); with any of them when several were sacrificed, never when none was | | `notSharesLandTypeWith` | `{ controller?: "you" \| "opponent" \| "any" \| "notYou" }` | no | Shares no land subtype with any battlefield land controlled by this relation (CR 205.3i, 608.2b) | | `sharesWithTarget` | `"creatureType" \| "cardType" \| "color" \| "name"` | no | Shares a creature type / card type / color / name with the ability's first chosen target (radiance) | | `sharesWith` | `{ property: "creatureType" \| "cardType" \| "permanentType" \| "color" \| "name" \| "manaValue" \| "controller"; with?: TargetDef; negate?: boolean }` | no | CR 608.2h: shares the property with an object of the selection reference — { mode: "self" } the source, { mode: "affected" } / { mode: "triggering" } "that creature" / "it", { mode: "host" } the enchanted permanent, a declared target slot. Generalises sharesWithSource / sharesWithHost / sharesWithTarget; negate = "doesn't share". Never matches the referenced object itself | | `comparedTo` | `{ property: "power" \| "toughness" \| "manaValue" \| "powerPlusToughness"; op: "<" \| "<=" \| ">" \| ">=" \| "=="; with?: TargetDef; offset?: number }` | no | CR 608.2h: compare a characteristic with every object of the selection reference ("creatures with power less than that creature's power"); `offset` is added to theirs ("at least 2 greater"). Generalises comparedToSource / comparedToTrigger | | `attachedToSelection` | `TargetDef` | no | CR 301.5, 303.4: attached to an object of the selection reference ("all Equipment attached to that creature" = { mode: "affected" }). Generalises attachedToSource / attachedToReference | | `inSelection` | `TargetDef` | no | Is one of the objects of the selection reference (the same incarnation, CR 400.7) — with anyOf it unions a declared target with the objects related to it: "target creature and each other creature that shares a creature type with it" destroyed as one event | | `targetableByTriggering` | `boolean` | no | CR 115.1, 707.10d: "that spell could target" — a legal target for each instance of the word target of the spell or ability that caused this trigger (castSpell / activatesAbility), as it now is on the stack; nothing once it has no targets or left the stack | | `targetOfTriggering` | `boolean` | no | CR 115.1, 603.2: an object the spell or ability that caused this trigger targeted as it was cast or activated (same incarnation, CR 400.7) — "each other Golem" than the one it targets is exclude targetOfTriggering | | `controllerOfTriggeringTarget` | `boolean` | no | CR 115.1, 603.2: controlled by a player who controlled an object the triggering spell or ability targeted as it was cast or activated (fixed then) — "another opponent" than the one whose permanent it targets is controller opponent with exclude controllerOfTriggeringTarget | | `combatWith` | `{ relation: "blocking" \| "blockedBy" \| "attacking" \| "attackedBy"; of?: TargetDef }` | no | CR 506.4, 509.1: in this combat relation to an object of the selection reference — blocking it, blocked by it, attacking it (a planeswalker or battle), attacked by it | | `discardedThisTurn` | `boolean` | no | Was discarded this turn (mayhem) | | `enteredGraveyardThisTurn` | `true \| "fromAnywhere" \| "fromBattlefield" \| "fromLibrary" \| "milled"` | no | Cards still in the graveyard that were put there this turn (CR 400.7, 404.3): true from anywhere ("a creature card from a graveyard that was put there this turn"), fromAnywhere the same printed "put there from anywhere this turn", fromBattlefield only from the battlefield, fromLibrary only from a library ("put there from their library this turn"), milled only by a mill action (CR 701.17a, surveil's graveyard pile included — "cards in your graveyard that were milled this turn") | | `attached` | `boolean` | no | Is (not) attached to something | | `enteredThisTurn` | `boolean` | no | CR 400.7, 603.6a, 608.2b: this incarnation entered this turn; false excludes such entries | | `alreadyOnBattlefield` | `boolean` | no | CR 614.12: "for each Angel you already control" — while a permanent's entry replacements apply, neither it nor a permanent entering at the same time matches; otherwise every battlefield permanent does | | `enteredThisTurnUnder` | `"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.6a, 400.7: entered this turn under this player's control, independent of current control | | `damagedThisTurn` | `boolean` | no | Was dealt damage this turn | | `dealtDamageThisTurn` | `boolean` | no | CR 120.4, 608.2b: this incarnation dealt positive damage this turn | | `dealtDamageToThisTurn` | `"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 120.4, 400.7, 608.2b: this incarnation dealt positive damage to this player earlier this turn | | `dealtCombatDamageToThisTurn` | `"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 510.2, 400.7, 608.2b: this incarnation dealt positive combat damage to this player earlier this turn ("a creature … that dealt combat damage to you this turn") | | `counterPlacedThisTurnBy` | `"you"` | no | You put a counter on this incarnation this turn; remains true after removal (CR 122.6, 608.2b) | | `damagedBySource` | `boolean` | no | Was dealt damage by this incarnation of the source this turn (CR 400.7, 603.10a; "a creature dealt damage this way") | | `damagedByHost` | `boolean` | no | CR 120.1, 603.10a: was dealt damage this turn by the host of this Aura or Equipment, the creature it enchants or equips as that creature is now ("a creature dealt damage by equipped creature this turn") | | `damagedThisTurnBy` | `ObjectFilter` | no | CR 120.1, 400.7, 608.2h: this incarnation was dealt damage this turn by a source matching this filter as the source was when it dealt the damage — "another creature dealt damage this turn by a Spider you controlled" is { subtypes: ["Spider"], controller: "you" } (Shelob, Child of Ungoliant) | | `drawnThisTurn` | `boolean` | no | CR 121.1, 400.7: a card in hand its owner drew this turn and that hasn't left the hand since ("two cards in your hand drawn this turn": Sylvan Library) | | `fromStartingDeck` | `boolean` | no | Alchemy (Actualize): the card began the game in your deck (a commander is part of it, CR 903.5a); false = conjured, drafted or created cards, or another player's ("a spell that isn't from your starting deck") | | `minCounters` | `number` | no | At least this many of the hasCounter kind | | `hasSticker` | `"any" \| "name" \| "art" \| "ability" \| "pt"` | no | Has a sticker of this kind on it | | `onSprocket` | `1 \| 2 \| 3 \| "crank"` | no | Contraption on this sprocket (or the one with the CRANK! counter) | | `isHost` | `boolean` | no | A host creature without an augment | | `hasAugment` | `boolean` | no | A combined host + augment creature | **Selection algebra — a `target` is a composition, not a menu.** The engine has no "exile a random card" primitive and no "discard chosen cards" primitive. It has *actions* (`exile`, `moveTo`, `destroy`, `discard`, `sacrifice`, `bounce`, `tap`, `dealDamage`, counters, …) that each take a TargetDef, and a TargetDef is the product of independent axes. Pick a value on each axis; every action accepts the result: | Axis | Field | Values | |---|---|---| | what | `of` | `object` (cards and permanents), `player`, `spell`, `ability`, `spellOrAbility`, `any` (creature, player, planeswalker or battle) | | how it is picked | `mode` | `chosen` — a *target*, prompted when the spell or ability is put on the stack (default); `choose` — picked as the effect resolves, not a target; `all`; `random` — sampled on resolution; `top` — the top card(s) of an ordered zone; `self`; `host`; and the back-references `affected`, `triggering`, `triggeringOther`, `created`, `linked`, `paired`, `about`, `replaced`, `replacedSource`, `thisWay` | | where | `zone` / `zones` / `allZones` | `battlefield` (default), `hand`, `graveyard`, `library`, `exile`, `stack`, `command`; `zones: ["hand", "graveyard"]` is one pick across both | | whose | `player` (+ `playerTarget`) | `you` (default), `eachOpponent`, `eachPlayer`, `controller`, `owner`, `triggeringPlayer`, `defendingPlayer`, …; `"target"` reads a player target written in `playerTarget` — `mode: "chosen"` is "target opponent's hand", `mode: "choose"` is "an opponent's hand" picked on resolution. On the battlefield `player` means controller; in every other zone, owner | | all but one | `exceptPlayer` (`of: "player"`) | a player selector removed from the candidates — "each other opponent" is `player: "eachOpponent", exceptPlayer: "triggeringPlayer"`; "each other player" after a named player excludes that player the same way | | which | `filter` | any ObjectFilter — types, colours, controller, power, counters, names, …; omit it for "a card". Relations to another selection are fields too: `sharesWith: { property, with }`, `comparedTo: { property, op, with }`, `attachedToSelection`, `combatWith: { relation, of }` — `with` / `of` is any TargetDef (`{ "mode": "affected" }` "it", `{ "mode": "self" }`, a `slot`) | | how many | `min` / `max` | `max: 2` = "two", `min: 0` = "up to", `max: "any"` = "any number", a ValueDef such as X; for `random`, `max` is how many distinct objects are sampled | | who decides | `chooser` | the player making a `chosen` / `choose` pick when it is not the controller ("that player chooses", "of their choice") | | one group, several clauses | `slot` | a name shared by every `chosen` selector that means the same declared target ("Choose target creature you control and target creature you don't control. … those creatures fight each other" → the fight repeats both selectors with their slots); the engine prompts once per slot and any later clause — or a value, `{ "kind": "aggregate", "target": … }` — reads the same group (CR 601.2c) | Players compose the same way: every player selector (`who`, `player`, `chooser`, a value's `who`) may be the structured form `{ "kind": "eachOpponent" | "eachPlayer" | …, "where": , "except": , "most" | "fewest": }` — "each opponent who controls a creature", "each player other than you", "the player with the most cards in hand" — with `where` and the value read *as each candidate* (CR 608.2h). Because the axes are independent, phrases nobody wrote a primitive for are already expressible: - "Exile a card at random from an opponent's hand" → `{ "effect": "exile", "target": { "of": "object", "mode": "random", "zone": "hand", "player": "target", "playerTarget": { "of": "player", "mode": "choose", "player": "eachOpponent" } } }`. - "Target opponent exiles two cards at random from their hand" → the same with `"playerTarget": { "of": "player", "mode": "chosen", "player": "eachOpponent" }` and `"max": 2`. - "Each opponent exiles a card at random from their hand" → `"player": "eachOpponent"` and no `playerTarget`. - "Put a creature card at random from your graveyard onto the battlefield" → `{ "effect": "moveTo", "destination": "battlefield", "target": { "of": "object", "mode": "random", "zone": "graveyard", "player": "you", "filter": { "types": ["Creature"] } } }`. - "Destroy a land chosen at random" → `{ "effect": "destroy", "target": { "of": "object", "mode": "random", "filter": { "types": ["Land"] } } }` — `random` works on the battlefield too. - "Exile all cards from target player's graveyard" → `{ "effect": "exile", "target": { "of": "object", "mode": "all", "zone": "graveyard", "player": "target", "playerTarget": { "of": "player", "mode": "chosen" } } }`. - "Return a creature or Aura card from your graveyard to your hand" → `{ "effect": "bounce", "target": { "of": "object", "mode": "choose", "zone": "graveyard", "player": "you", "filter": { "anyOf": [{ "types": ["Creature"] }, { "subtypes": ["Aura"] }] } } }` — an OR across two filter fields is `anyOf` branches (each branch is a whole filter). - "Target player sacrifices an artifact of their choice" → `{ "effect": "sacrifice", "who": "target", "player": { "of": "player", "mode": "chosen" }, "target": { "of": "object", "mode": "choose", "filter": { "types": ["Artifact"] } } }` (`sacrifice` names its player target `player`). Rules of thumb: `discard.random: true` is a convenience for the discard wording ("discards a card at random") — it is not evidence that randomness belongs to discard; "a card" with no filter means any card; a player exiling, sacrificing or returning *their own* cards is said with `player` (whose zone) plus `chooser` only when someone other than the controller makes the pick. **Never declare a combination unsupported before composing it on these axes and validating it**: what the validator accepts, the engine plays, and the English rendering (Explain) shows exactly what it will do. **What the engine guarantees.** Every cell of action × mode × zone × player × filter × count is played in the engine's own test suite (the *selection matrix*: exile, bounce, moveTo to each zone, destroy, sacrifice, discard, tap, dealDamage, addCounters × chosen / choose / all / random / top × battlefield / hand / graveyard / library / exile × you / eachOpponent / eachPlayer / target × filter × 1 / 2 / any — some three thousand combinations), and each must act on exactly the objects the axes name. A combination that validates and then does nothing is a bug, not a limitation. Three details the matrix pins down: - *Counts are per player for `who`-based actions and pooled for selections.* "Each player sacrifices two creatures" / "each player discards a card" (`sacrifice`, `discard` with `who`) apply the count to each player; "exile two cards from graveyards" (a `target` with `player: "eachPlayer"`) picks two in total. - *The action adds its own eligibility rule to any selection.* `dealDamage` only ever selects creatures, planeswalkers and battles (CR 120.3) — "deals 1 damage to each permanent" harms only those, whichever mode picks them — so the filter never has to repeat the rules of the game. - *The one combination that cannot mean anything is rejected, with guidance.* A `target` (`mode: "chosen"`, declared while casting) cannot have its player half picked on resolution (`playerTarget.mode: "choose"`): the validator says so and names the three honest forms — make the player a target too (`"chosen"`: "target opponent's graveyard"), say whose with the filter (`controller` / `owner: "opponent"`), or pick the object on resolution (`mode: "choose"`). Every `mode`, player selector, filter relation, duration and `thisWay` action, one line each, and how parts of a card refer to each other: **Relationships & references** (`https://drawstep.xyz/wiki/mtg/references.md`). Selector cheat-sheet: "target creature an opponent controls" = `{ of: "object", mode: "chosen", filter: { types: ["Creature"], controller: "opponent" } }`; "any target" = `{ of: "any" }`; "each creature" = `{ of: "object", mode: "all", filter: { types: ["Creature"] } }`; "target player" = `{ of: "player", mode: "chosen" }`; "target opponent" = `{ of: "player", mode: "chosen", player: "eachOpponent" }`; "enchanted creature" = `{ of: "object", mode: "host" }`; "target creature card in your graveyard" = `{ of: "object", zone: "graveyard", filter: { types: ["Creature"], owner: "you" } }`; "target spell" = `{ of: "spell" }`; "nonbasic lands" = `{ of: "object", mode: "all", filter: { types: ["Land"], notSupertypes: ["Basic"] } }`; "up to two target creatures" = add `min: 0, max: 2`. ### 6.9 Relationships & references A card's parts talk about each other: "exile target creature. **Its controller** creates a token", "when **that creature** dies this turn", "cards exiled with **~**", "creatures of **the chosen type**", "deals **that much** damage". In Drawstep JSON every such reference is explicit — a `mode` on a selection, a player selector, a filter field or a value kind — and the engine resolves it exactly, including last known information (an object that has left the battlefield is read as it last existed there, CR 608.2h). Nothing refers to anything by position in the text; there is no free-text "it". **The reference words, by printed phrase.** | Printed | JSON | Refers to | |---|---|---| | "~", "this creature" | `{ "of": "object", "mode": "self" }` | the source card itself | | "target creature" | `{ "of": "object", "mode": "chosen", "filter": { "types": ["Creature"] } }` | a target declared on cast / activation / trigger | | "it", "them", "that creature" right after an action of the same ability | `{ "of": "object", "mode": "affected" }` | what the previous step acted on (`span` for several steps) | | "it", "that creature" — the thing the trigger is about | `{ "of": "object", "mode": "triggering" }` | the object of the triggering event (last known information) | | "that creature" — the *other* creature of a block / damage / targeting event | `{ "of": "object", "mode": "triggeringOther" }` | the event's other object (`trigger.other` narrows it) | | "enchanted / equipped creature" | `{ "of": "object", "mode": "host" }` | what the source is attached to | | "the token", "it" after "create …" | `{ "of": "object", "mode": "created" }` | tokens created earlier in this resolution | | "each creature destroyed this way" | `{ "of": "object", "mode": "thisWay", "action": "destroyed" }` | objects an earlier step actually acted on | | "that creature" inside "when that creature dies this turn, …" / "at the beginning of the next end step, return it" | `{ "of": "object", "mode": "about" }` | what a delayed / reflexive trigger was set up about | | "the exiled card", "cards exiled with ~" | `{ "of": "object", "mode": "linked", "zone": "exile" }` or filter `{ "linkedToSource": true }` | cards linked to the source (moved with `link: true`) | | "its paired creature" | `{ "of": "object", "mode": "paired" }` | the soulbond partner | | "the player or planeswalker it's attacking" | `{ "of": "any", "mode": "attacked", "attacker": "self" }` | the attacked player / permanent | | "that player" (the one who did the triggering thing) | `"triggeringPlayer"` | the player of the triggering event | | "target player … that player" | `"target"` (with the player target in `target` / `playerTarget`, a shared `slot` across effects) | the declared player target | | "its controller", "its owner" (of what was just acted on) | `"affectedController"`, `"affectedOwner"` | the previous step's object's (last known) controller / owner | | "its controller" (of the triggering object) | `"triggeringController"`, `"triggeringOwner"` | the triggering object's controller / owner | | "that player", "they" inside "for each player …" / "each opponent may …" | `"current"` | the player being processed | | "choose an opponent. That player …" | `"previousPlayer"` | the player picked by the preceding `choose` | | "the chosen player / color / creature type / name" | `"chosenPlayer"`; filter `chosenColor` / `chosenSubtype` / `chosenName` | a choice made as the source entered (`chooseAsEnters`) or remembered by `choose` | | "that much", "that many" | `{ "kind": "triggerAmount" }` | the triggering event's amount (damage, life, counters, cards) | | "the number of …" fixed earlier ("X is …", "that many" after a count) | `noteValue` then `{ "kind": "noted", "key": … }` | a number snapshotted earlier in the resolution | | "the sacrificed creature's power" | `{ "kind": "sacrificed", "property": "power" }` / `{ "kind": "costPaid", … }` | what was paid as a cost, as it last existed | | "its power" (of the triggering object) | `{ "kind": "triggering", "property": "power" }` | the triggering object's characteristic (last known information) | | "for each card discarded this way" | `{ "kind": "doneThisWay", "of": "discarded" }` | the count of an earlier action | Three rules decide which one to use: 1. **Same ability, earlier step → `affected`** (or `created` / `thisWay` when the text says "the token" / "… this way"). **The event that triggered the ability → `triggering` / `triggeringOther` / `triggeringPlayer`.** **A later, separate trigger set up by this one → `about`** (`delayedTrigger.about` / `reflexiveTrigger.about` fixes the objects; the delayed effects read `mode: "about"`). 2. **A target is declared once.** Two clauses that mean the same target ("target player draws two cards, then discards a card" — the same player twice) share a `slot` name; the engine asks once per slot. Without a slot, two `chosen` selections are two different targets. 3. **Zone changes make new objects** (CR 400.7). "Exile it, then return it" works because `thisWay` / `affected` / `about` follow the card across the move the ability itself made; a card that left by some other route is no longer "it". Values read from an object that has left (`triggering`, `sacrificed`, `affectedController`) use last known information. ### Back-references inside one resolution: affected, created, thisWay Each effect step records what it acted on. The next step's `{ "mode": "affected" }` is "it" / "them"; a player selector `affectedController` / `affectedOwner` is "its controller" / "its owner". `created` is the tokens made earlier in the resolution; `thisWay` with an `action` is what an earlier step *actually* did (a creature that regenerated was not "destroyed this way"). #### "Exile target creature. Its controller creates a token." **Fair Exchange** — printed text: > Exile target creature. Its controller creates a 1/1 white Spirit creature token with flying. ```json { "id": "fair-exchange", "name": "Fair Exchange", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [ "W" ], "keywords": [], "keywordAbilities": [], "manaCost": "{1}{W}", "types": [ "Instant" ], "text": "Exile target creature. Its controller creates a 1/1 white Spirit creature token with flying.", "abilities": [ { "kind": "spell", "effects": [ { "effect": "exile", "target": { "of": "object", "mode": "chosen", "filter": { "types": [ "Creature" ] } } }, { "effect": "createToken", "who": "affectedController", "token": { "name": "Spirit", "types": [ "Creature" ], "subtypes": [ "Spirit" ], "colors": [ "W" ], "power": 1, "toughness": 1, "keywords": [ "Flying" ] } } ] } ] } ``` The engine reads it back as: “Exile target creature, then its controller creates a 1/1 white Spirit creature token with flying.” `createToken.who` is `affectedController`: the controller of the creature the previous step exiled, read as it last existed on the battlefield. #### "Destroy all creatures. Exile each creature card destroyed this way." **Final Ashes** — printed text: > Destroy all creatures. Exile each creature card destroyed this way. ```json { "id": "final-ashes", "name": "Final Ashes", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [ "B" ], "keywords": [], "keywordAbilities": [], "manaCost": "{3}{B}{B}", "types": [ "Sorcery" ], "text": "Destroy all creatures. Exile each creature card destroyed this way.", "abilities": [ { "kind": "spell", "effects": [ { "effect": "destroy", "target": { "of": "object", "mode": "all", "filter": { "types": [ "Creature" ] } } }, { "effect": "exile", "target": { "of": "object", "mode": "thisWay", "action": "destroyed", "zone": "graveyard", "filter": { "types": [ "Creature" ] } } } ] } ] } ``` The engine reads it back as: “Destroy all creatures, then exile those cards.” `thisWay` + `action: "destroyed"` follows each destroyed creature to its graveyard (add `zone: "graveyard"`); an indestructible or regenerated creature is not included. #### "Create a token. It gains haste." **Sudden Recruit** — printed text: > Create a 2/1 red Goblin creature token. It gains haste until end of turn. ```json { "id": "sudden-recruit", "name": "Sudden Recruit", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [ "R" ], "keywords": [], "keywordAbilities": [], "manaCost": "{1}{R}", "types": [ "Sorcery" ], "text": "Create a 2/1 red Goblin creature token. It gains haste until end of turn.", "abilities": [ { "kind": "spell", "effects": [ { "effect": "createToken", "token": { "name": "Goblin", "types": [ "Creature" ], "subtypes": [ "Goblin" ], "colors": [ "R" ], "power": 2, "toughness": 1 } }, { "effect": "grantKeyword", "target": { "of": "object", "mode": "created" }, "keyword": "Haste", "duration": "endOfTurn" } ] } ] } ``` The engine reads it back as: “Create a 2/1 red Goblin creature token, then that token gains haste until end of turn.” `created` is exactly the tokens this resolution made — not every token you control. ### The triggering object, the other object, the triggering player A triggered ability reads its event: `triggering` is the object the event happened to (the creature that died, the card that entered, the spell cast), `triggeringOther` the event's other object (the creature blocked or blocking, the permanent dealt damage, the damage source, the spell that targeted), `triggeringPlayer` the player who acted. Their characteristics are read with **last known information**: "its power" of a creature that died is its power on the battlefield. #### "Whenever a creature an opponent controls dies, its controller loses 1 life and you gain life equal to its power." **Grave Accountant** — printed text: > Whenever a creature an opponent controls dies, its controller loses 1 life and you gain life equal to its power. ```json { "id": "grave-accountant", "name": "Grave Accountant", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Vampire" ], "colors": [ "B" ], "keywords": [], "keywordAbilities": [], "manaCost": "{2}{B}", "types": [ "Creature" ], "power": 2, "toughness": 3, "text": "Whenever a creature an opponent controls dies, its controller loses 1 life and you gain life equal to its power.", "abilities": [ { "kind": "triggered", "trigger": { "event": "dies", "filter": { "types": [ "Creature" ], "controller": "opponent" } }, "effects": [ { "effect": "loseLife", "who": "triggeringController", "amount": 1 }, { "effect": "gainLife", "who": "you", "amount": { "kind": "triggering", "property": "power" } } ] } ] } ``` The engine reads it back as: “Whenever a creature an opponent controls dies, that creature's controller loses 1 life, then you gain life equal to that creature's power.” `triggeringController` and `{ "kind": "triggering", "property": "power" }` both read the dead creature as it last existed on the battlefield. #### "Whenever this creature blocks a creature, that creature gets -2/-0." **Shield Warden** — printed text: > Whenever this creature blocks a creature, that creature gets -2/-0 until end of turn. ```json { "id": "shield-warden", "name": "Shield Warden", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Human", "Soldier" ], "colors": [ "W" ], "keywords": [], "keywordAbilities": [], "manaCost": "{1}{W}", "types": [ "Creature" ], "power": 1, "toughness": 4, "text": "Whenever this creature blocks a creature, that creature gets -2/-0 until end of turn.", "abilities": [ { "kind": "triggered", "trigger": { "event": "blocks", "filter": { "self": true } }, "effects": [ { "effect": "modifyPT", "target": { "of": "object", "mode": "triggeringOther" }, "power": -2, "toughness": 0, "duration": "endOfTurn" } ] } ] } ``` The engine reads it back as: “Whenever Shield Warden blocks, that creature gets -2/-0 until end of turn.” For `blocks`, the triggering object is the blocker (`filter: { self: true }`) and `triggeringOther` is the creature it blocked; `trigger.other` would narrow which attackers count. #### "Whenever an opponent draws a card, that player loses 1 life." **Whispering Quill** — printed text: > Whenever an opponent draws a card, that player loses 1 life. ```json { "id": "whispering-quill", "name": "Whispering Quill", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [ "B" ], "keywords": [], "keywordAbilities": [], "manaCost": "{2}{B}", "types": [ "Enchantment" ], "text": "Whenever an opponent draws a card, that player loses 1 life.", "abilities": [ { "kind": "triggered", "trigger": { "event": "drawsCard", "by": "opponent" }, "effects": [ { "effect": "loseLife", "who": "triggeringPlayer", "amount": 1 } ] } ] } ``` The engine reads it back as: “Whenever an opponent draws a card, that player loses 1 life.” `by: "opponent"` scopes the player event; `triggeringPlayer` is whoever drew. ### Later, separate triggers: delayed and reflexive triggers (about) "At the beginning of the next end step, return **it**", "when **that creature** dies this turn", "when you do, …" are separate triggered abilities created by the resolving one. `delayedTrigger` / `reflexiveTrigger` take `about` — a selection fixed when they are created (usually `{ "mode": "affected" }`, the thing just acted on) — and their effects say `{ "mode": "about" }`. A delayed trigger's `trigger` is an ordinary TriggerDef; for "when that creature dies" leave out the filter (the `about` objects are the subject). `once: true` makes it fire once; `duration` bounds how long it waits. #### "Exile another target creature you control. Return it at the beginning of the next end step." **Blink Warden** — printed text: > When this creature enters, exile another target creature you control. Return that card to the battlefield under its owner's control at the beginning of the next end step. ```json { "id": "blink-warden", "name": "Blink Warden", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Spirit" ], "colors": [ "W" ], "keywords": [], "keywordAbilities": [], "manaCost": "{2}{W}", "types": [ "Creature" ], "power": 2, "toughness": 2, "text": "When this creature enters, exile another target creature you control. Return that card to the battlefield under its owner's control at the beginning of the next end step.", "abilities": [ { "kind": "triggered", "trigger": { "event": "enters", "filter": { "self": true } }, "effects": [ { "effect": "exile", "target": { "of": "object", "mode": "chosen", "filter": { "types": [ "Creature" ], "controller": "you", "other": true } } }, { "effect": "delayedTrigger", "trigger": { "event": "endStep", "by": "any" }, "about": { "of": "object", "mode": "affected" }, "effects": [ { "effect": "moveTo", "target": { "of": "object", "mode": "about", "zone": "exile" }, "destination": "battlefield", "controller": "owner" } ] } ] } ] } ``` The engine reads it back as: “When Blink Warden enters, exile another target creature you control, then return it to the battlefield under its owner's control at the beginning of the next end step.” The exile's object is fixed as the delayed trigger's `about`; the return reads `{ "mode": "about", "zone": "exile" }` and puts it back under its owner's control (`controller: "owner"`). #### "Target creature gets +2/+0. When that creature dies this turn, draw a card." **Last Rites Rally** — printed text: > Target creature gets +2/+0 until end of turn. When that creature dies this turn, draw a card. ```json { "id": "last-rites-rally", "name": "Last Rites Rally", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [ "B" ], "keywords": [], "keywordAbilities": [], "manaCost": "{B}", "types": [ "Instant" ], "text": "Target creature gets +2/+0 until end of turn. When that creature dies this turn, draw a card.", "abilities": [ { "kind": "spell", "effects": [ { "effect": "modifyPT", "target": { "of": "object", "mode": "chosen", "filter": { "types": [ "Creature" ] } }, "power": 2, "toughness": 0, "duration": "endOfTurn" }, { "effect": "delayedTrigger", "trigger": { "event": "dies" }, "about": { "of": "object", "mode": "affected" }, "duration": "endOfTurn", "once": true, "effects": [ { "effect": "drawCards", "who": "you", "amount": 1 } ] } ] } ] } ``` The engine reads it back as: “Target creature gets +2/+0 until end of turn, then When that creature is put into a graveyard from the battlefield this turn, draw a card.” No filter on the delayed `dies` trigger: its subject is the `about` creature. `once` + `duration: "endOfTurn"` = "this turn", one time. #### "Create a token. When you do, it deals damage equal to its power to any target." **Catapult Crew** — printed text: > Create a 3/3 red Giant creature token. When you do, it deals damage equal to its power to any target. ```json { "id": "catapult-crew", "name": "Catapult Crew", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [ "R" ], "keywords": [], "keywordAbilities": [], "manaCost": "{3}{R}", "types": [ "Sorcery" ], "text": "Create a 3/3 red Giant creature token. When you do, it deals damage equal to its power to any target.", "abilities": [ { "kind": "spell", "effects": [ { "effect": "createToken", "token": { "name": "Giant", "types": [ "Creature" ], "subtypes": [ "Giant" ], "colors": [ "R" ], "power": 3, "toughness": 3 } }, { "effect": "reflexiveTrigger", "about": { "of": "object", "mode": "created" }, "effects": [ { "effect": "dealDamage", "target": { "of": "any", "mode": "chosen" }, "amount": { "kind": "sourcePower" }, "from": { "of": "object", "mode": "about" } } ] } ] } ] } ``` The engine reads it back as: “Create a 3/3 red Giant creature token, then when you do, it deals damage equal to its power to any target.” A reflexive trigger (CR 603.12) chooses its own targets when it goes on the stack; `about: { mode: "created" }` makes the token the damage's `from` (the actor of `dealDamage` is its `from`). ### Linked abilities: "exiled with ~" Abilities of one card refer to the same cards through a **link** (CR 607): a move with `link: true` (`exile`, `moveTo`, a replacement's `link`), `exileUntilSourceLeaves` or the `link` effect ties the cards to *this incarnation* of the source. Other abilities of the source read them with `{ "mode": "linked" }` or filter `{ "linkedToSource": true }`, may cast or play them (`playerRule` `castLinkedExile` / `playLinkedExile`) or pay with them (cost `linkedToGraveyard`). The link ends when the source leaves the battlefield. #### "Exile the top card of each opponent's library. You may play cards exiled with this creature." **Larcenous Imp** — printed text: > When this creature enters, exile the top card of each opponent's library. > You may play lands and cast spells from among cards exiled with this creature. > {2}, Sacrifice this creature: Put each card exiled with this creature into its owner's hand. ```json { "id": "larcenous-imp", "name": "Larcenous Imp", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Imp" ], "colors": [ "B" ], "keywords": [], "keywordAbilities": [], "manaCost": "{2}{B}", "types": [ "Creature" ], "power": 2, "toughness": 2, "text": "When this creature enters, exile the top card of each opponent's library.\nYou may play lands and cast spells from among cards exiled with this creature.\n{2}, Sacrifice this creature: Put each card exiled with this creature into its owner's hand.", "abilities": [ { "kind": "triggered", "trigger": { "event": "enters", "filter": { "self": true } }, "effects": [ { "effect": "exile", "target": { "of": "object", "mode": "top", "zone": "library", "player": "eachOpponent" }, "link": true } ] }, { "kind": "static", "effect": { "type": "playerRule", "who": "you", "rule": "playLinkedExile" } }, { "kind": "activated", "cost": { "mana": "{2}", "sacrificeSelf": true }, "effects": [ { "effect": "moveTo", "target": { "of": "object", "mode": "linked", "zone": "exile" }, "destination": "hand" } ] } ] } ``` The engine reads it back as: “When Larcenous Imp enters, exile the top card of each opponent's library.” · “You may play lands and cast spells from among cards exiled with Larcenous Imp.” · “{2}, Sacrifice Larcenous Imp: Return the card exiled with Larcenous Imp to its owner's hand.” The enters trigger exiles with `link: true`; the static `playLinkedExile` lets you play exactly those cards, and the activated ability returns them with `mode: "linked"`. ### Selection references inside filters: shares, compares, attached, in combat with A filter can relate each candidate to *another selection* — any TargetDef, written in place: `sharesWith: { property, with, negate? }` ("shares a creature type with it"), `comparedTo: { property, op, with, offset? }` ("with power less than that creature's"), `attachedToSelection: ` ("Equipment attached to that creature"), `combatWith: { relation, of }` ("each creature blocking it"), `inSelection: ` (is one of those objects — with `anyOf` it unions a declared target with the objects related to it). `with` / `of` default to `{ "mode": "affected" }` ("it"); `{ "mode": "self" }` is the source, `{ "mode": "host" }` the enchanted permanent, a `slot` a declared target. Older fixed forms remain: `sharesWithSource`, `sharesWithHost`, `sharesWithTarget`, `sharesWithSacrificed`, `comparedToSource`, `comparedToTrigger`, `attachedToSource`, `attachedToReference`, `attachedTo` (a host filter). #### "Destroy target creature and each other creature that shares a creature type with it." **Kinship Purge** — printed text: > Destroy target creature and each other creature that shares a creature type with it. ```json { "id": "kinship-purge", "name": "Kinship Purge", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [ "B" ], "keywords": [], "keywordAbilities": [], "manaCost": "{3}{B}{B}", "types": [ "Sorcery" ], "text": "Destroy target creature and each other creature that shares a creature type with it.", "abilities": [ { "kind": "spell", "effects": [ { "effect": "destroy", "target": { "of": "object", "mode": "all", "filter": { "types": [ "Creature" ], "anyOf": [ { "inSelection": { "of": "object", "mode": "chosen", "slot": "kin", "filter": { "types": [ "Creature" ] } } }, { "sharesWith": { "property": "creatureType", "with": { "of": "object", "mode": "chosen", "slot": "kin", "filter": { "types": [ "Creature" ] } } } } ] } } } ] } ] } ``` The engine reads it back as: “Destroy target creature and each creature that shares a creature type with it.” One destroy event: `anyOf` unions the declared target (`inSelection` of the slot) with every creature that `sharesWith` it; the shared `slot` makes both references the same single target. #### "Whenever this creature attacks, tap target creature with power less than this creature's power." **Bullying Ogre** — printed text: > Whenever this creature attacks, tap target creature with power less than this creature's power. ```json { "id": "bullying-ogre", "name": "Bullying Ogre", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Ogre" ], "colors": [ "R" ], "keywords": [], "keywordAbilities": [], "manaCost": "{3}{R}", "types": [ "Creature" ], "power": 4, "toughness": 3, "text": "Whenever this creature attacks, tap target creature with power less than this creature's power.", "abilities": [ { "kind": "triggered", "trigger": { "event": "attacks", "filter": { "self": true } }, "effects": [ { "effect": "tap", "target": { "of": "object", "mode": "chosen", "filter": { "types": [ "Creature" ], "comparedTo": { "property": "power", "op": "<", "with": { "of": "object", "mode": "self" } } } } } ] } ] } ``` The engine reads it back as: “Whenever Bullying Ogre attacks, tap target creature with power less than Bullying Ogre's.” `comparedTo.with` is the source (`mode: "self"`); the comparison is made with current values when the target is chosen and again on resolution. #### "Destroy all Equipment attached to target creature, then destroy that creature." **Disarming Strike** — printed text: > Destroy all Equipment attached to target creature, then destroy that creature. ```json { "id": "disarming-strike", "name": "Disarming Strike", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [ "R" ], "keywords": [], "keywordAbilities": [], "manaCost": "{2}{R}{R}", "types": [ "Instant" ], "text": "Destroy all Equipment attached to target creature, then destroy that creature.", "abilities": [ { "kind": "spell", "effects": [ { "effect": "destroy", "target": { "of": "object", "mode": "all", "filter": { "subtypes": [ "Equipment" ], "attachedToSelection": { "of": "object", "mode": "chosen", "slot": "victim", "filter": { "types": [ "Creature" ] } } } } }, { "effect": "destroy", "target": { "of": "object", "mode": "chosen", "slot": "victim", "filter": { "types": [ "Creature" ] } } } ] } ] } ``` The engine reads it back as: “Destroy all Equipment attached to target creature, then destroy target creature.” `attachedToSelection: { mode: "affected" }` would mean "attached to what the previous step acted on"; here the Equipment are found *before* the creature is destroyed, so the reference is the declared target's slot. #### "Whenever this creature becomes blocked, each creature blocking it gets -1/-1." **Thornhide Charger** — printed text: > Whenever this creature becomes blocked, each creature blocking it gets -1/-1 until end of turn. ```json { "id": "thornhide-charger", "name": "Thornhide Charger", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Beast" ], "colors": [ "G" ], "keywords": [], "keywordAbilities": [], "manaCost": "{2}{G}", "types": [ "Creature" ], "power": 3, "toughness": 3, "text": "Whenever this creature becomes blocked, each creature blocking it gets -1/-1 until end of turn.", "abilities": [ { "kind": "triggered", "trigger": { "event": "becomesBlocked", "filter": { "self": true } }, "effects": [ { "effect": "modifyPT", "target": { "of": "object", "mode": "all", "filter": { "types": [ "Creature" ], "combatWith": { "relation": "blocking", "of": { "of": "object", "mode": "self" } } } }, "power": -1, "toughness": -1, "duration": "endOfTurn" } ] } ] } ``` The engine reads it back as: “Whenever Thornhide Charger becomes blocked, creatures blocking Thornhide Charger get -1/-1 until end of turn.” `combatWith: { relation: "blocking", of: { mode: "self" } }` selects the creatures in that combat relation to the source. ### One target across several clauses: slots Every `chosen` selection is a target declared when the spell or ability is put on the stack. When the text names the **same** target twice ("target player draws two cards, then discards a card"; "choose target creature you control and target creature you don't control … those creatures fight"), give the selections the same `slot` — the engine asks once per slot and every clause with that slot reads the same choice, even across intervening choices. Different slot names (or none) are different targets. A value can read a slot too: `{ "kind": "aggregate", "target": … }`. #### "Target player draws two cards, then discards a card." **Forced Study** — printed text: > Target player draws two cards, then discards a card. ```json { "id": "forced-study", "name": "Forced Study", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [ "U" ], "keywords": [], "keywordAbilities": [], "manaCost": "{1}{U}", "types": [ "Sorcery" ], "text": "Target player draws two cards, then discards a card.", "abilities": [ { "kind": "spell", "effects": [ { "effect": "drawCards", "who": "target", "target": { "of": "player", "mode": "chosen", "slot": "student" }, "amount": 2 }, { "effect": "discard", "who": "target", "target": { "of": "player", "mode": "chosen", "slot": "student" }, "amount": 1 } ] } ] } ``` The engine reads it back as: “Target player draws two cards, then discards a card.” Both effects carry the player target in `target` with the same `slot`, so one player is targeted once. #### "Put a +1/+1 counter on target creature you control. Then that creature fights target creature you don't control." **Measured Brawl** — printed text: > Put a +1/+1 counter on target creature you control. Then that creature fights target creature you don't control. ```json { "id": "measured-brawl", "name": "Measured Brawl", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [ "G" ], "keywords": [], "keywordAbilities": [], "manaCost": "{1}{G}", "types": [ "Instant" ], "text": "Put a +1/+1 counter on target creature you control. Then that creature fights target creature you don't control.", "abilities": [ { "kind": "spell", "effects": [ { "effect": "addCounters", "target": { "of": "object", "mode": "chosen", "slot": "mine", "filter": { "types": [ "Creature" ], "controller": "you" } }, "counter": "+1/+1", "amount": 1 }, { "effect": "fight", "what": { "of": "object", "mode": "chosen", "slot": "mine", "filter": { "types": [ "Creature" ], "controller": "you" } }, "target": { "of": "object", "mode": "chosen", "slot": "theirs", "filter": { "types": [ "Creature" ], "controller": "notYou" } } } ] } ] } ``` The engine reads it back as: “Put a +1/+1 counter on target creature you control, then that creature fights target creature you don't control.” Two slots, two targets. The `fight` names its fighter in `what` and its opponent in `target`, each by slot. ### Choices that later parts read: chosen color, type, player, noted numbers "As ~ enters, choose a color" is `chooseAsEnters: [{ "kind": "color" }]` on the card; its abilities read the choice with the filter fields `chosenColor` / `chosenSubtype` / `chosenName` / `chosenType` (true = the default key), keyword-ability specs such as `protection: { from: { chosenColor: true } }`, and the selector `chosenPlayer`. Inside one resolution, `{ "effect": "choose", … }` announces a choice every later step can read (`remember: true` keeps it on the source for linked abilities); a player picked that way is `previousPlayer`. `noteValue` snapshots a number under a key, read back with `{ "kind": "noted", "key": … }` — use it when the text fixes a number before later steps change the board ("X is the number of …; then …"). #### "As this creature enters, choose a creature type. Other creatures you control of the chosen type get +1/+1." **Banner of the Clan** — printed text: > As this creature enters, choose a creature type. > Other creatures you control of the chosen type get +1/+1. ```json { "id": "banner-of-the-clan", "name": "Banner of the Clan", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Human", "Knight" ], "colors": [ "W" ], "keywords": [], "keywordAbilities": [], "manaCost": "{2}{W}", "types": [ "Creature" ], "power": 2, "toughness": 2, "text": "As this creature enters, choose a creature type.\nOther creatures you control of the chosen type get +1/+1.", "chooseAsEnters": [ { "kind": "creatureType" } ], "abilities": [ { "kind": "static", "effect": { "type": "modifyPT", "to": { "of": "object", "mode": "all", "filter": { "types": [ "Creature" ], "controller": "you", "other": true, "chosenSubtype": true } }, "power": 1, "toughness": 1 } } ] } ``` The engine reads it back as: “As Banner of the Clan enters, choose a creature type.” · “Other creatures you control of the chosen type get +1/+1.” The choice lives on the permanent; the static filter reads it with `chosenSubtype: true`. #### "Choose an opponent. That player sacrifices a creature." **Pointed Demand** — printed text: > Choose an opponent. That player sacrifices a creature. ```json { "id": "pointed-demand", "name": "Pointed Demand", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [ "B" ], "keywords": [], "keywordAbilities": [], "manaCost": "{1}{B}", "types": [ "Sorcery" ], "text": "Choose an opponent. That player sacrifices a creature.", "abilities": [ { "kind": "spell", "effects": [ { "effect": "choose", "kind": "object", "target": { "of": "player", "mode": "choose", "player": "eachOpponent" } }, { "effect": "sacrifice", "who": "previousPlayer", "target": { "of": "object", "mode": "choose", "filter": { "types": [ "Creature" ] } } } ] } ] } ``` The engine reads it back as: “Choose an opponent. That player sacrifices a creature of their choice.” `choose` with a player selection records the player; `previousPlayer` is "that player". Choosing is not targeting. ### Each player in turn: current "For each opponent, …", "each player may …", "each player sacrifices …" process players one at a time. Inside `forEachPlayer` (and `unlessPays`, `optional` / `villainousChoice` with several players, a `choose` with `who`) the selector `current` and the filter relation `controller: "current"` mean *that* player; "you" still means the controller. A target inside the loop is declared once per player when the spell is cast. #### "For each opponent, destroy up to one target creature that player controls." **Measured Reprisal** — printed text: > For each opponent, destroy up to one target creature that player controls. ```json { "id": "measured-reprisal", "name": "Measured Reprisal", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [ "B" ], "keywords": [], "keywordAbilities": [], "manaCost": "{3}{B}", "types": [ "Sorcery" ], "text": "For each opponent, destroy up to one target creature that player controls.", "abilities": [ { "kind": "spell", "effects": [ { "effect": "forEachPlayer", "players": "eachOpponent", "effects": [ { "effect": "destroy", "target": { "of": "object", "mode": "chosen", "filter": { "types": [ "Creature" ] }, "player": "current", "min": 0, "max": 1 } } ] } ] } ] } ``` The engine reads it back as: “For each opponent, destroy up to one target creature that player controls.” `player: "current"` restricts each declared target to the processed opponent's creatures. ### Numbers that point back: that much, the sacrificed creature's power Value kinds carry references too: `triggerAmount` ("that much damage", "that many counters"), `triggeringCount` (how many were in a `oneOrMore` group), `triggering` with `property` (the triggering object's power / toughness / mana value, last known), `sacrificed` / `costPaid` (what was paid as a cost), `doneThisWay` (how many an earlier step acted on), `replaced` (inside a replacement: the event's amount), `noted` (a snapshot), `var` X. #### "Whenever this creature is dealt damage, put that many +1/+1 counters on it." **Spiteful Hydra** — printed text: > Whenever this creature is dealt damage, put that many +1/+1 counters on it. ```json { "id": "spiteful-hydra", "name": "Spiteful Hydra", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Hydra" ], "colors": [ "G" ], "keywords": [], "keywordAbilities": [], "manaCost": "{3}{G}", "types": [ "Creature" ], "power": 3, "toughness": 4, "text": "Whenever this creature is dealt damage, put that many +1/+1 counters on it.", "abilities": [ { "kind": "triggered", "trigger": { "event": "isDealtDamage", "filter": { "self": true } }, "effects": [ { "effect": "addCounters", "target": { "of": "object", "mode": "self" }, "counter": "+1/+1", "amount": { "kind": "triggerAmount" } } ] } ] } ``` The engine reads it back as: “Whenever Spiteful Hydra is dealt damage, put that many +1/+1 counters on Spiteful Hydra.” `triggerAmount` is the damage actually dealt in the triggering event. #### "Sacrifice another creature: You gain life equal to the sacrificed creature's toughness." **Bone Harvester** — printed text: > Sacrifice another creature: You gain life equal to the sacrificed creature's toughness. ```json { "id": "bone-harvester", "name": "Bone Harvester", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Zombie", "Cleric" ], "colors": [ "B" ], "keywords": [], "keywordAbilities": [], "manaCost": "{1}{B}", "types": [ "Creature" ], "power": 1, "toughness": 2, "text": "Sacrifice another creature: You gain life equal to the sacrificed creature's toughness.", "abilities": [ { "kind": "activated", "cost": { "sacrifice": { "of": "object", "mode": "choose", "filter": { "types": [ "Creature" ], "other": true } } }, "effects": [ { "effect": "gainLife", "who": "you", "amount": { "kind": "sacrificed", "property": "toughness" } } ] } ] } ``` The engine reads it back as: “Sacrifice another creature: You gain life equal to the sacrificed creature's toughness.” The cost's `sacrifice` is a selection (not a target); `{ "kind": "sacrificed", "property": "toughness" }` reads it as it last existed. ### Every reference value, one line each Generated from the schema: a value that is not in these tables does not exist. #### `of` — what a selection picks | of | Meaning | |---|---| | `object` | Cards and permanents in any zone (battlefield by default; `zone` / `zones` / `allZones` say where). | | `player` | Players. `player` narrows the candidates (`eachOpponent` = "target opponent"), `exceptPlayer` removes some. | | `spell` | A spell on the stack ("counter target spell"); `spell: { controller, filter }` narrows it. | | `ability` | An activated or triggered ability on the stack; `ability: { controller, kind, source }` narrows it. | | `spellOrAbility` | A spell or an ability on the stack ("counter target spell or ability", "change the target of …"). | | `any` | "Any target": a creature, player, planeswalker or battle (CR 115.4). `playerFilter: "opponent"` restricts only the player half; `permanents: true` makes the object half any permanent. | #### `mode` — how a selection is made (TargetDef) | mode | Meaning | |---|---| | `chosen` | A **target** (the default): picked as the spell or ability is put on the stack, checked again on resolution; an illegal target is not acted on and a spell whose targets are all illegal does nothing (CR 608.2b). Printed word: "target". Hexproof, shroud, ward and protection apply. | | `choose` | Picked **as the effect resolves** — not a target, so hexproof / shroud / ward don't apply and nothing fizzles. Printed: "choose a …", "a creature card from your graveyard", "of their choice". `chooser` says who picks when it isn't the controller. | | `all` | Every object matching `zone` × `player` × `filter` at resolution. Printed: "each", "all". | | `self` | The source itself — the card whose ability this is ("~", "this creature"). | | `random` | Sampled at random on resolution (`max` = how many distinct objects). Printed: "at random". With `of: "any"` a legal random target is declared while casting (CR 115.6). | | `host` | The object the source is attached to: "enchanted creature", "equipped creature", "fortified land". | | `triggering` | The object whose event triggered this ability — the creature that died, the card that entered, the spell that was cast; read with last known information once it has left its zone (CR 603.10, 608.2h). With `oneOrMore` it is the whole simultaneous group. Printed: "it", "that creature", "that spell". | | `created` | The tokens (objects) created earlier in this same resolution: "create a 1/1 … It gains haste". | | `convoked` | The creatures that convoked this spell (CR 702.51), as they were then — "each creature that convoked this spell connives". | | `linked` | The cards linked to the source — exiled with it by an `exile` / `moveTo` with `link: true`, by `exileUntilSourceLeaves`, by a `link` effect or by a replacement with `link: true` (CR 607.2a): "the exiled card", "cards exiled with ~". | | `paired` | The creature the source is paired with (soulbond). | | `top` | The top card(s) of a library, or the topmost matching card(s) of a graveyard: `zone` picks the pile, `player` whose, `max` how many; `position: "bottom"` reads the other end. | | `affected` | What the **previous effect step** of this ability acted on ("it", "them", "that creature", "those cards" right after an action); `span: N` unions the last N steps. The everyday back-reference inside one resolution. | | `replaced` | Inside a replacement's `instead` / `then`: the object the replaced event would have affected (its player form is the selector `replacedPlayer`). | | `replacedSource` | Inside a damage replacement: the source of the replaced damage (its controller is the selector `damageSourceController`). | | `triggeringOther` | The **other** object of the triggering event: for `blocks` the creature blocked, for `becomesBlocked` the blocker, for `dealsDamage` the permanent dealt damage, for `isDealtDamage` the damage's source, for `becomesTarget` (with `of` spell / ability / spellOrAbility) the spell or ability that targeted. Narrow it with `trigger.other`. Printed: "that creature" (the other one). | | `about` | Inside a delayed (or reflexive) trigger's effects: the object(s) it was set up about, fixed when it was created by `delayedTrigger.about` / `reflexiveTrigger.about` ("when that creature dies this turn", "return it at the beginning of the next end step"). After a zone change the new object no longer counts (CR 400.7), except the one whose zone change triggered it. | | `thisWay` | The objects actually acted on by earlier effects of this resolution, by `action` (sacrificed, milled, destroyed, exiled, discarded, returned, …), followed across their own zone change; `filter` reads their characteristics at the time of the action. Printed: "the cards milled this way", "each creature destroyed this way". | | `costPaid` | With `action: "sacrificed"`: the objects sacrificed to pay the cost of this spell or ability, as they last existed (CR 601.2h, 608.2h): "the sacrificed creature" of "As an additional cost to cast this spell, sacrifice a creature". | | `attacked` | The player, planeswalker or battle being attacked by the creature `attacker` names (`self` or `triggering`): "the player or planeswalker it's attacking". | | `grantor` | The permanent that granted this triggered ability, for as long as that same permanent remains on the battlefield. Grothama, All-Devouring uses this to identify which Grothama the attacker may fight. | #### `mode` of a player target (PlayerTargetDef) | mode | Meaning | |---|---| | `chosen` | A **target** player, declared as the spell or ability is put on the stack ("target player", "target opponent" with `player: "eachOpponent"`). The default. | | `choose` | A player picked on resolution, not targeted ("an opponent", "choose a player"). | | `all` | Every candidate player ("each opponent"). | | `random` | A candidate picked at random on resolution ("an opponent chosen at random"). | | `triggering` | The player whose action or step triggered the ability ("that player" of "whenever an opponent draws a card"). | | `about` | Inside a delayed trigger: the player it was set up about ("that player"). | | `affected` | The player(s) of the previous selection (`span` unions several). | #### Player selectors (`who`, `player`, `chooser`, `exceptPlayer`, a value's `who` …) | selector | Meaning | |---|---| | `you` | The ability's controller ("you"). The default nearly everywhere. | | `controller` | Also the ability's controller — the same player as `you`. | | `abilityController` | Inside a condition tested for each candidate player (`where`): the controller of the ability itself, not the candidate (CR 113.8, 608.2h). | | `sourceController` | The controller of the source object — not the player activating it when any player may activate the ability ("its controller", CR 109.5, 602.2). | | `owner` | The owner of the source card ("its owner" when the source is the subject). | | `eachOpponent` | Every opponent of the controller (in team games, the other team). As a candidate set: "target opponent", "an opponent". | | `eachPlayer` | Every player, in turn order from the active player. | | `target` | The player declared by this effect's player target (`target` / `playerTarget` with `of: "player"`) — "target player draws two cards". | | `triggeringPlayer` | The player whose action or step triggered the ability: the caster, the drawer, the player whose upkeep it is, the attacking player. | | `defendingPlayer` | The player the source is attacking (fixed when the attack trigger fired); in a `cantAttack` `unless` condition, the defender being considered. | | `attackingPlayer` | In a `cantBlock` `unless` condition, the controller of the attacking creature being considered ("can't block unless defending player controls more creatures than attacking player"). | | `activePlayer` | The player whose turn it is (CR 102.1, 500.1); printed as "that player" after "during an opponent's turn". | | `replacedPlayer` | Inside a replacement: the player the replaced event would have affected (damaged, drawing, gaining life …). | | `damageSourceController` | Inside a damage replacement: the controller of the replaced damage's source. | | `causeController` | In a trigger with `causedBy`: the controller of the spell or ability that caused the triggering event ("that opponent" of "a spell or ability an opponent controls destroys …"). | | `affectedController` | The controller of what the previous step acted on (its last known controller if it has left the battlefield; a countered spell's controller). Structured form `{ kind, span }` unions the last N selections. | | `affectedOwner` | The owner of what the previous step acted on ("its owner" after "exile target creature"). | | `triggeringController` | The (last known) controller of the object that triggered the ability ("its controller" of "whenever a creature dies"). | | `triggeringOwner` | The owner of the object that triggered the ability. | | `triggeringOtherController` | The controller of the event's other object (the creature blocked, the permanent dealt damage), by last known information. | | `triggeringOtherOwner` | The owner of the event's other object. | | `current` | The player being processed by an enclosing per-player step — `forEachPlayer`, `unlessPays`, `optional` / `villainousChoice` with several players, a `choose` with `who` (CR 608.2h). Printed: "that player", "they". | | `previousPlayer` | The player(s) of the preceding non-target player selection — after `{ effect: "choose", kind: "object", target: { of: "player", mode: "choose", … } }`, "that player". | | `mostLife` | Each player with the most life (ties included). | | `leastLife` | Each player with the least life (ties included). | | `mostCardsInHand` | Each player with the most cards in hand (ties included). | | `fewestCardsInHand` | Each player with the fewest cards in hand (ties included). | | `enchantedPlayer` | The player the source Aura (a Curse) is attached to (CR 303.4). | | `yourTeam` | You and your teammates (CR 810.2); outside team games, just you. | | `chosenPlayer` | The player chosen for the source — by `chooseAsEnters` (`kind: "player"`) or a remembered `choose` (CR 607.2d): "the chosen player". | | `playerToYourLeft` | The nearest player still in the game to your left — the next player in turn order (CR 101.4: turn order passes to the left); with two players, your opponent. | | `playerToYourRight` | The nearest player still in the game to your right — the previous player in turn order (CR 101.4); with two players, your opponent. | | `attackedPlayers` | In an attack trigger, the players the triggering creature(s) attack directly — for a `oneOrMore` group, every player one of them attacks ("you and those players"); never a player whose planeswalker or battle is attacked. | | `attackingOpponents` | In an attack trigger: your opponents who control the attacking creatures ("each opponent attacking that player does the same"). | | `attackedBySourceThisTurn` | Each player this same permanent was declared as attacking directly this turn. Angel of Destiny uses this history at your end step, including attacks from additional combat phases. | | `attackedBySourceLastCombat` | The player this same permanent was declared as attacking directly in your previous combat phase. If it last attacked a planeswalker or battle, or sat out that combat, the selection is empty. | Any selector may also be written as an object that narrows it — `{ "kind": , … }`: | Field | Type | Required | Description | |---|---|---|---| | `kind` | `"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"` | yes | Which kind of choice is made | | `span` | `number` | no | affectedController / affectedOwner: union the previous N selections | | `where` | `ConditionDef` | no | CR 608.2h: keep the candidates for whom this condition holds, with "you" rebound to each candidate ("each opponent who controls a creature", "each player who cast a spell this turn") | | `except` | `"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 | Remove this selection ("each player other than that player") | | `most` | `ValueDef` | no | Keep the candidates whose value (evaluated as that player) is the greatest, ties included ("the player who controls the most creatures") | | `fewest` | `ValueDef` | no | Keep the candidates whose value is the least, ties included | "Each opponent who controls a creature" = `{ "kind": "eachOpponent", "where": { "kind": "controls", "filter": { "types": ["Creature"] } } }`; "each player other than that player" = `{ "kind": "eachPlayer", "except": "triggeringPlayer" }`; "the player who controls the most creatures" = `{ "kind": "eachPlayer", "most": { "kind": "count", "filter": { "types": ["Creature"], "controller": "you" } } }` (`where` and the value are read *as each candidate*, so "you" there is the candidate). #### Filter relations: `ObjectFilter.controller` and `owner` | controller | Meaning | |---|---| | `you` | Controlled (owned) by you, the ability's controller. | | `opponent` | Controlled (owned) by an opponent of yours. | | `any` | Anyone — the same as leaving the field out. | | `notYou` | Not you: the printed "you don't control" / "you don't own" (every other player; the same as `opponent` outside team games). | | `affectedController` | Controlled by the controller of what the previous step acted on ("creatures that player controls" after "destroy target creature"). | | `triggeringController` | Controlled by the controller of the object that triggered the ability. | | `current` | Controlled (owned) by the player an enclosing per-player step is processing (`forEachPlayer`, …): "each creature that player controls". | | `notCurrent` | Not controlled by that processed player. | | `yourTeam` | Controlled by you or a teammate (CR 810.2). | | `previousPlayer` | Controlled by the player(s) of the preceding non-target player selection ("choose an opponent … creatures that player controls"). | | `chosenPlayer` | Controlled by the player chosen for the source ("creatures the chosen player controls"). | | `enchantedPlayer` | Controlled by the player the source Aura is attached to ("creatures enchanted player controls", CR 303.4). | `owner` takes `you`, `opponent`, `any`, `notYou`, `current` with the same meanings. #### Filter fields that relate an object to something else | Field | Type | Required | Description | |---|---|---|---| | `tappedForSourceThisTurn` | `"crew" \| "saddle"` | no | CR 702.122, 702.171, 400.7: this incarnation tapped to crew or saddle this source incarnation this turn | | `attackingPlayer` | `"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" \| { kind: "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"; span?: number; where?: ConditionDef; except?: any; most?: ValueDef; fewest?: ValueDef }` | no | Attacking this player directly, excluding attacks on their planeswalkers or battles (CR 508.1b, 508.6) | | `attackingPlaneswalkerControlledBy` | `"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 | Attacking a planeswalker controlled by this player; excludes attacks on players or battles (CR 508.1b) | | `bandedWithSource` | `boolean` | no | CR 702.22c-f: a different attacking creature in the source's current band; leaving combat removes membership | | `self` | `boolean` | no | Only the source itself | | `other` | `boolean` | no | Anything except the source ("another") | | `otherThanTrigger` | `boolean` | no | Exclude the object that caused the trigger, rather than the ability's source (CR 603.10a, 608.2h) | | `nameOf` | `"self" \| "affected"` | no | Shares the source's name ("self"), or the name of the preceding single object selection ("affected": "a creature card with the same name as that creature", CR 201.2) | | `host` | `boolean` | no | The object the source is attached to | | `attachedToSource` | `boolean` | no | Attached to the source ("Auras attached to ~") | | `attachedToReference` | `"affected" \| "triggering" \| "triggeringOther"` | no | Attached to the preceding selected object or the triggering event's object/other object: Equipment/Auras attached to that creature (CR 301.5, 303.4, 608.2c) | | `attachedTo` | `ObjectFilter` | no | CR 301.5, 303.4, 701.3: attached to a battlefield permanent matching this host filter; does not select or target the host | | `sharesWithHost` | `"creatureType" \| "color" \| "cardType"` | no | Shares this characteristic with the source's attachment host (CR 303.4, 301.5) | | `attachedToHost` | `boolean` | no | Is (or is not) attached to the source's host | | `notAffected` | `boolean` | no | Exclude objects in the latest affected selection: the rest (CR 608.2c-d) | | `notChosenSubtype` | `boolean \| string` | no | Does not have the chosen creature type; changeling has every creature type (CR 205.3m, 702.73) | | `chosenSubtype` | `boolean \| string` | no | Choice in the resolving ability, falling back to the source; true uses the default kind key, a string selects a named key (CR 608.2d) | | `chosenColor` | `boolean \| string` | no | Choice in the resolving ability, falling back to the source; true uses the default kind key, a string selects a named key (CR 608.2d) | | `chosenParity` | `boolean \| string` | no | Mana value has the chosen odd/even quality; zero is even (CR 107.1) | | `chosenPowerParity` | `boolean \| string` | no | Power has the chosen odd/even quality ("each creature with power of the chosen quality"); zero is even (CR 107.1, 208.1) | | `chosenKind` | `boolean \| string` | no | CR 608.2d: matches the chosen land or nonland kind | | `chosenType` | `boolean \| string` | no | Matches the chosen card type (CR 205.2, 608.2d) | | `chosenName` | `boolean \| string` | no | Choice in the resolving ability, falling back to the source; true uses the default kind key, a string selects a named key (CR 608.2d) | | `chosenBy` | `"controller" \| "owner"` | no | CR 101.4, 608.2d: with several choosers (choose with collect), chosenColor / chosenName / chosenType / chosenSubtype / notChosenSubtype read the answer of this object's controller (a card's owner off the battlefield) or owner — "only the color its controller chose" | | `comparedToSource` | `{ property: "power" \| "toughness" \| "manaValue"; op: "<" \| "<=" \| ">" \| ">=" \| "==" }` | no | Compare a property with the source's ("creature with lesser power", "greater mana value than ~") | | `comparedToTrigger` | `{ property: "power" \| "toughness" \| "manaValue"; op: "<" \| "<=" \| ">" \| ">=" \| "==" }` | no | Compare a property with the object that caused the trigger; death/leaves events use its battlefield snapshot (CR 603.10a, 608.2h) | | `attachedToSameHost` | `boolean` | no | Attached to the same object the source is attached to | | `linkedToSource` | `boolean` | no | Cards exiled with / linked to the source (imprint, "the exiled card") | | `sharesWithSource` | `"creatureType" \| "cardType" \| "color" \| "name"` | no | Shares a creature type / card type / color / name with the source | | `sharesWithSacrificed` | `"creatureType" \| "cardType" \| "color" \| "name"` | no | CR 601.2h, 602.2b, 608.2h: shares the characteristic with the object sacrificed to pay this spell's or ability's cost, as it last existed on the battlefield (Pyre of Heroes: "a creature card that shares a creature type with the sacrificed creature"); with any of them when several were sacrificed, never when none was | | `sharesWithTarget` | `"creatureType" \| "cardType" \| "color" \| "name"` | no | Shares a creature type / card type / color / name with the ability's first chosen target (radiance) | | `sharesWith` | `{ property: "creatureType" \| "cardType" \| "permanentType" \| "color" \| "name" \| "manaValue" \| "controller"; with?: TargetDef; negate?: boolean }` | no | CR 608.2h: shares the property with an object of the selection reference — { mode: "self" } the source, { mode: "affected" } / { mode: "triggering" } "that creature" / "it", { mode: "host" } the enchanted permanent, a declared target slot. Generalises sharesWithSource / sharesWithHost / sharesWithTarget; negate = "doesn't share". Never matches the referenced object itself | | `comparedTo` | `{ property: "power" \| "toughness" \| "manaValue" \| "powerPlusToughness"; op: "<" \| "<=" \| ">" \| ">=" \| "=="; with?: TargetDef; offset?: number }` | no | CR 608.2h: compare a characteristic with every object of the selection reference ("creatures with power less than that creature's power"); `offset` is added to theirs ("at least 2 greater"). Generalises comparedToSource / comparedToTrigger | | `attachedToSelection` | `TargetDef` | no | CR 301.5, 303.4: attached to an object of the selection reference ("all Equipment attached to that creature" = { mode: "affected" }). Generalises attachedToSource / attachedToReference | | `inSelection` | `TargetDef` | no | Is one of the objects of the selection reference (the same incarnation, CR 400.7) — with anyOf it unions a declared target with the objects related to it: "target creature and each other creature that shares a creature type with it" destroyed as one event | | `combatWith` | `{ relation: "blocking" \| "blockedBy" \| "attacking" \| "attackedBy"; of?: TargetDef }` | no | CR 506.4, 509.1: in this combat relation to an object of the selection reference — blocking it, blocked by it, attacking it (a planeswalker or battle), attacked by it | | `enteredThisTurnUnder` | `"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.6a, 400.7: entered this turn under this player's control, independent of current control | | `dealtDamageThisTurn` | `boolean` | no | CR 120.4, 608.2b: this incarnation dealt positive damage this turn | | `dealtDamageToThisTurn` | `"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 120.4, 400.7, 608.2b: this incarnation dealt positive damage to this player earlier this turn | | `dealtCombatDamageToThisTurn` | `"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 510.2, 400.7, 608.2b: this incarnation dealt positive combat damage to this player earlier this turn ("a creature … that dealt combat damage to you this turn") | | `counterPlacedThisTurnBy` | `"you"` | no | You put a counter on this incarnation this turn; remains true after removal (CR 122.6, 608.2b) | | `damagedBySource` | `boolean` | no | Was dealt damage by this incarnation of the source this turn (CR 400.7, 603.10a; "a creature dealt damage this way") | | `damagedThisTurnBy` | `ObjectFilter` | no | CR 120.1, 400.7, 608.2h: this incarnation was dealt damage this turn by a source matching this filter as the source was when it dealt the damage — "another creature dealt damage this turn by a Spider you controlled" is { subtypes: ["Spider"], controller: "you" } (Shelob, Child of Ungoliant) | #### `action` — what an earlier step actually did (`mode: "thisWay"`, `doneThisWay.of`) | action | Meaning | |---|---| | `sacrificed` | Permanents sacrificed by earlier steps ("the sacrificed creature", "for each creature sacrificed this way"). | | `milled` | Cards milled (and cards a surveil put into the graveyard). | | `destroyed` | Permanents destroyed (now in the graveyard: add `zone: "graveyard"` to act on the cards). | | `exiled` | Objects exiled ("the exiled card", "return the exiled cards"). | | `discarded` | Cards discarded. | | `returned` | Cards returned to hand. | | `putIntoLibrary` | Cards a `moveTo` put into a library, and cards a surveil kept on top. | | `tapped` | Permanents tapped. | | `untapped` | Permanents untapped. | | `damaged` | Objects and players dealt damage ("each creature dealt damage this way"). | | `drawn` | Cards drawn. | | `revealed` | Cards revealed. | | `countersPlaced` | Counters put on objects — counted per counter, not per object. | | `countersRemoved` | Counters removed — counted per counter. | | `amassed` | The Army an amass put counters on (or created): "the amassed Army", "the Army you amassed" (CR 701.47a), read as it is now while it stays on the battlefield. | | `countered` | Spells countered, with their characteristics on the stack. | | `phasedOut` | Permanents that phased out directly this way ("for each creature that phased out this way", CR 702.26). | | `searched` | A player action, not objects: each player who actually searched a library, once per search (CR 701.19 — "each player who searched their library this way shuffles"). Read it with `doneThisWay.by`; it selects no objects. | | `created` | Tokens created ("if you created fewer than two tokens this way"). | #### Durations (`duration`) | duration | Meaning | |---|---| | `instant` | No lasting duration of its own: read as the effect's default (end of turn for continuous changes). Prefer omitting `duration` or writing `endOfTurn`. | | `endOfTurn` | Until end of turn (expires in the cleanup step). The default for one-shot layer effects. | | `endOfCombat` | Until end of combat (ends as the end-of-combat step ends). | | `endOfAdditionalCombat` | Through the additional combat phase created earlier in the same resolution, ending as that combat's end-of-combat step ends ("that combat", CR 500.8, 506.1; Illusionist's Gambit). | | `untilYourNextTurn` | Until your next turn begins. | | `untilEndOfYourNextTurn` | Through your next turn; expires in that turn's cleanup step (an extra turn counts). | | `untilEndOfNextTurn` | Until the end of the next turn, whoever's it is. | | `untilStackEmpty` | Until the stack is empty (the next time a player would get priority with an empty stack). | | `untilYourNextEndStep` | Until your next end step begins. | | `untilYourNextUpkeep` | Until your next upkeep begins. | | `permanent` | For the rest of the game while the object stays where it is (a zone change makes a new object and ends it, CR 400.7). Printed changes with no stated duration. | | `untilSourceLeaves` | Until the source leaves the battlefield ("until ~ leaves the battlefield"). | | `whileYouControlSource` | For as long as you control the source; ends for good the moment you don't (CR 611.2b). | | `whileYourTurn` | For as long as it is your turn; does nothing if it isn't your turn when the effect resolves. | | `perpetual` | Perpetually (Alchemy): survives zone changes, in every zone, for the rest of the game. | | `controllersNextTurnEnd` | (restrict only) Applies only during the affected object's controller's next turn, fixed on resolution. | | `whileSource` | `{ "whileSource": }` — for as long as the original source stays on the battlefield and matches the filter ("for as long as ~ remains tapped": `{ "tapped": true }`). Ends permanently when it stops matching. | | `whileTarget` | `{ "whileTarget": }` — for as long as the selected object stays and matches the filter ("for as long as that creature has a +1/+1 counter on it"). With `whileSource` both must hold. | | `untilEvent` | `{ "untilEvent": }` — until the described event happens, matched as a trigger of the source with its controller fixed on resolution ("until an opponent becomes the monarch": `{ "event": "becameMonarch", "by": "opponent" }`). | The filter of `whileSource` / `whileTarget` (a live subset of ObjectFilter): | Field | Type | Required | Description | |---|---|---|---| | `controller` | `"you" \| "opponent" \| "any" \| "notYou"` | no | Controller relative to the fixed player who created the effect | | `tapped` | `boolean` | no | The tracked permanent remains tapped or untapped | | `hasCounter` | `string` | no | At least one counter of this kind remains on the tracked permanent | | `enchanted` | `boolean` | no | Whether at least one Aura is attached to the tracked permanent | | `comparedToSource` | `{ property: "power" \| "toughness" \| "manaValue"; op: "<" \| "<=" \| ">" \| ">=" \| "==" }` | no | A live characteristic comparison to the original source | #### Counters A counter kind is any string: `addCounters` / `removeCounters` / `moveCounters` / `entersWithCounters` / cost `removeCounters` / filter `hasCounter` all take the kind's name, and `any` means any kind in filters and removal. Kinds the engine gives rules meaning: - `+1/+1` and `-1/-1` change power and toughness (layer 7c) and annihilate in pairs (CR 704.5q); `addCounters` defaults to `+1/+1`. - `loyalty` (planeswalkers, `loyalty` costs), `defense` (battles), `lore` (Sagas — chapter abilities trigger as lore counters are added), `time` (suspend, vanishing, time travel), `fade` (fading), `age` (cumulative upkeep), `level` (level up), `charge` and the like are counted by the abilities that read them (`countersOnSource`, `hasCounter` + `minCounters`). - `stun`: the permanent stays tapped and a stun counter is removed instead of untapping (CR 122.1d). `shield`: if the permanent would be dealt damage or destroyed, remove a shield counter instead (CR 122.1c). - Keyword counters (CR 122.1b) grant their keyword while on the permanent: `flying`, `first strike`, `double strike`, `deathtouch`, `haste`, `hexproof`, `indestructible`, `lifelink`, `menace`, `reach`, `shadow`, `trample`, `vigilance`, `decayed`, `exalted`. - Player counters (poison, energy, experience, rad, …) are not object counters: `poisonCounters` / `playerCounters` effects, the `playerCounters` value and cost `payCounters`. Counter events are replaceable and triggerable: the replacement `{ "replaces": "event", "event": "putCounters", … }` (with `counter`, `by`, `from`, `add`, `multiply`, `prevent`) and the trigger `countersPlaced` (with `counter`, `placedBy`, `eachCounter`). #### Zones - `battlefield` — Permanents. The default zone for filters and targets. - `hand` — Hidden; owner-visible. "discard", "return to hand", "from your hand". - `graveyard` — Public, ordered. "dies" = battlefield → graveyard; reanimation reads from here. - `library` — Hidden, ordered. Top / bottom positions via `position`; `mode: "top"` targets the top card(s). - `exile` — Public. Linked exile (`link`, `linkedToSource`) remembers what a card exiled. - `stack` — Spells and abilities waiting to resolve; `of: "spell"` targets live here. - `command` — Emblems, commanders, dungeons; `eminence` abilities work from here. ## 7. Worked examples (Oracle text → JSON) Taken from the stock library; each is a complete, valid card. Defaults (`schemaVersion`, `game`, `source: "stock"`, empty arrays) are omitted for brevity. ### Temptation Witness Oracle text: Engine reads it as: Whenever the Ring tempts you, you gain 2 life. ```json { "id": "iter49-ringwatch", "name": "Temptation Witness", "types": [ "Creature" ], "power": 1, "toughness": 3, "text": "", "abilities": [ { "kind": "triggered", "trigger": { "event": "ringTempted", "by": "you" }, "effects": [ { "effect": "gainLife", "amount": 2 } ] } ] } ``` ### Copy Test Oracle text: Engine reads it as: Copy target spell. You may choose new targets for the copy. ```json { "id": "iter31-copy", "name": "Copy Test", "types": [ "Instant" ], "manaCost": "{U}", "text": "", "abilities": [ { "kind": "spell", "effects": [ { "effect": "copySpell", "target": { "of": "spell", "mode": "chosen" } } ] } ] } ``` ### Filter Aura Oracle text: Enchant permanent Engine reads it as: Enchant permanent ```json { "id": "iter68-aura", "name": "Filter Aura", "types": [ "Enchantment" ], "subtypes": [ "Aura" ], "manaCost": "{0}", "keywordAbilities": [ { "keyword": "enchant", "target": { "of": "object", "mode": "chosen" } } ], "text": "Enchant permanent" } ``` ### Filter Equipment Oracle text: Engine reads it as: Equip {0} ```json { "id": "iter68-equipment", "name": "Filter Equipment", "types": [ "Artifact" ], "subtypes": [ "Equipment" ], "manaCost": "{0}", "keywordAbilities": [ { "keyword": "equip", "cost": { "mana": "{0}" } } ], "text": "" } ``` ### Loyal Walker Witness Oracle text: +1: You gain 1 life. Engine reads it as: +1: You gain 1 life. ```json { "id": "iter108-walker", "name": "Loyal Walker Witness", "supertypes": [ "Legendary" ], "types": [ "Planeswalker" ], "subtypes": [ "Teferi" ], "manaCost": "{0}", "loyalty": 3, "text": "+1: You gain 1 life.", "abilities": [ { "kind": "loyalty", "loyaltyCost": 1, "effects": [ { "effect": "gainLife", "who": "you", "amount": 1 } ] } ] } ``` ### Tale of Three Oracle text: I — Draw a card. II — Put a +1/+1 counter on target creature you control. III — Create a 2/2 green Bear creature token. Engine reads it as: I — Draw a card. · II — Put a +1/+1 counter on target creature you control. · III — Create a 2/2 green Bear creature token. ```json { "id": "tale-of-three", "name": "Tale of Three", "layout": "saga", "types": [ "Enchantment" ], "subtypes": [ "Saga" ], "manaCost": "{2}{G}", "colors": [ "G" ], "text": "I — Draw a card. II — Put a +1/+1 counter on target creature you control. III — Create a 2/2 green Bear creature token.", "abilities": [ { "kind": "triggered", "trigger": { "event": "chapter", "chapter": 1 }, "effects": [ { "effect": "drawCards", "who": "you", "amount": 1 } ] }, { "kind": "triggered", "trigger": { "event": "chapter", "chapter": 2 }, "effects": [ { "effect": "addCounters", "target": { "of": "object", "mode": "chosen", "filter": { "types": [ "Creature" ], "controller": "you" } }, "counter": "+1/+1", "amount": 1 } ] }, { "kind": "triggered", "trigger": { "event": "chapter", "chapter": 3 }, "effects": [ { "effect": "createToken", "who": "you", "token": { "name": "Bear", "types": [ "Creature" ], "subtypes": [ "Bear" ], "colors": [ "G" ], "power": 2, "toughness": 2 }, "amount": 1 } ] } ] } ``` ### Iter62 class Oracle text: Engine reads it as: When Iter62 class becomes level 2, draw two cards. · {0}: Level 2 · {0}: Level 3 ```json { "id": "iter62-class", "name": "Iter62 class", "layout": "class", "types": [ "Enchantment" ], "subtypes": [ "Class" ], "manaCost": "{0}", "text": "", "abilities": [ { "kind": "triggered", "trigger": { "event": "levelGained", "filter": { "self": true }, "level": 2 }, "effects": [ { "effect": "drawCards", "amount": 2 } ] } ], "classLevels": [ { "level": 2, "cost": { "mana": "{0}" } }, { "level": 3, "cost": { "mana": "{0}" } } ] } ``` ### Modal Witness Oracle text: Engine reads it as: Choose up to X — • You gain 2 life. • Each opponent loses 1 life. ```json { "id": "iter49-modal", "name": "Modal Witness", "types": [ "Instant" ], "manaCost": "{X}", "text": "", "abilities": [ { "kind": "spell", "modes": [ { "label": "You gain 2 life", "effects": [ { "effect": "gainLife", "amount": 2 } ] }, { "label": "Each opponent loses 1 life", "effects": [ { "effect": "loseLife", "who": "eachOpponent", "amount": 1 } ] } ], "chooseMin": 0, "chooseMax": { "kind": "var", "name": "X" } } ] } ``` ### Glorious Anthem Oracle text: Creatures you control get +1/+1. Engine reads it as: Creatures you control get +1/+1. ```json { "id": "glorious-anthem", "name": "Glorious Anthem", "types": [ "Enchantment" ], "manaCost": "{1}{W}{W}", "colors": [ "W" ], "text": "Creatures you control get +1/+1.", "abilities": [ { "kind": "static", "effect": { "type": "modifyPT", "to": { "of": "object", "mode": "all", "filter": { "types": [ "Creature" ], "controller": "you" } }, "power": 1, "toughness": 1 } } ] } ``` ### Iter99 Draw Doubler Oracle text: Engine reads it as: If you would draw a card, you draw twice that many cards instead. ```json { "id": "iter99-draw-doubler", "name": "Iter99 Draw Doubler", "types": [ "Enchantment" ], "text": "", "abilities": [ { "kind": "replacement", "replacement": { "replaces": "event", "event": "draw", "toPlayer": "you", "multiply": 2 } } ] } ``` ### Steamflogger Temp Oracle text: {6}, {T}: This creature assembles a Contraption. (Put the top card of your Contraption deck face up onto one of your sprockets.) Engine reads it as: {6}, {T}: Assemble a Contraption. ```json { "id": "steamflogger-temp", "name": "Steamflogger Temp", "types": [ "Creature" ], "subtypes": [ "Goblin", "Rigger" ], "manaCost": "{1}{R}", "colors": [ "R" ], "power": 2, "toughness": 1, "text": "{6}, {T}: This creature assembles a Contraption. (Put the top card of your Contraption deck face up onto one of your sprockets.)", "abilities": [ { "kind": "activated", "cost": { "mana": "{6}", "tapSelf": true }, "effects": [ { "effect": "assembleContraption", "who": "you" } ] } ] } ``` ### Event Probe treasures Oracle text: Engine reads it as: Create two Treasure tokens. ```json { "id": "iter37-treasures", "name": "Event Probe treasures", "types": [ "Instant" ], "manaCost": "{0}", "text": "", "abilities": [ { "kind": "spell", "effects": [ { "effect": "createToken", "token": { "name": "Treasure", "tokenDefId": "token-treasure" }, "amount": 2 } ] } ] } ``` ## 6 (continued). Full reference ### 6.10 Costs (`CostDef`) Used by activated abilities (`cost`), `mayPay` / `unlessPays`, keyword abilities and `additionalCost`. Any combination of parts; an empty object is a free cost. | Field | Type | Required | Description | |---|---|---|---| | `oneOf` | `CostDef[]` | no | Announce one alternative payment for this cost (CR 118.9, 601.2b). Use this field alone; each branch is a complete cost | | `chooseX` | `{ min?: number; max?: ValueDef }` | no | CR 107.3b, 601.2b: bounds on announced X. Evaluate max before paying costs, independently of affordability | | `mana` | `string` | no | Mana cost string, e.g. {2}{R} | | `ownManaCost` | `boolean` | no | "Pay its mana cost" (CR 118.12, 202.3): the source's own mana cost, read as the payment is made; a source with no mana cost can't pay it (CR 118.6) | | `genericAmount` | `ValueDef` | no | Computed generic mana added to mana, fixed when a resolution-time cost is paid: "unless you pay {1} for each card in your hand" (CR 107.3, 608.2h) | | `tapSelf` | `boolean` | no | {T} | | `untapSelf` | `boolean` | no | {Q} | | `unattachSelf` | `boolean` | no | CR 701.3d, 118.11, 601.2h: unattach this permanent as payment; an unattached permanent cannot pay this cost | | `payLife` | `ValueDef` | no | Pay this much life; { kind: "var", name: "X" } for "pay X life" (X is announced as the spell is cast) | | `getPoison` | `ValueDef` | no | The payer gets this many poison counters as the payment: "Ward—Get five poison counters" (The Serpent Society; CR 702.21a, 118.11) | | `othersGainLife` | `{ amount: ValueDef; who: "anOpponent" \| "eachOtherPlayer"; perChoice?: number }` | no | CR 118.3, 118.9: other players gain life as payment — "you may have an opponent gain 3 life" (anOpponent: the payer chooses one), "have each other player gain 6 life" (eachOtherPlayer). perChoice: an opponent is chosen separately for each that much life (cumulative upkeep's "An opponent gains 1 life", CR 702.24a) | | `draw` | `ValueDef` | no | CR 121.1, 118.11, 702.24a: draw this many cards as payment ("Cumulative upkeep—Draw a card") | | `addMana` | `string` | no | CR 106.1, 118.11, 702.24a: add this mana to your mana pool as payment ("Cumulative upkeep—Add {R}") | | `opponentCreatesToken` | `{ token: object; count: ValueDef }` | no | CR 118.11, 111.1, 702.24a: an opponent the payer chooses creates this many tokens as payment ("Cumulative upkeep—Have an opponent create a 1/1 red Survivor creature token") | | `opponentCounter` | `{ counter: string; amount: ValueDef; perChoice?: number }` | no | CR 118.11, 122.1, 702.24a: put counters on a creature an opponent controls, chosen by the payer, as payment ("Cumulative upkeep—Put a +1/+1 counter on a creature an opponent controls") | | `damageFromSource` | `ValueDef` | no | CR 118.12, 120.3: punisher payment "unless its controller has ~ deal 6 damage to them" — the source (last known information) deals this much damage to the payer as the payment; always payable, done even if the damage is prevented | | `sacrificeSelf` | `boolean` | no | Sacrifice the source ("Sacrifice ~") | | `sacrificeTogether` | `ObjectFilter[]` | no | CR 118.10, 601.2h: sacrifice one distinct controlled permanent for each filter, simultaneously; one Swamp Forest cannot pay both requirements | | `sacrifice` | `TargetDef` | no | Sacrifice another permanent matching this ("sacrifice X creatures": min / max = X) | | `returnToHand` | `TargetDef` | no | Return matching permanents you control to their owners' hands as a cost; selection does not target (CR 118.11, 601.2h) | | `discard` | `ValueDef` | no | Discard this many cards; { kind: "var", name: "X" } for "discard X cards" | | `discardRandom` | `boolean` | no | Discard the required cards at random as a cost (CR 701.9b, 118.11) | | `reveal` | `ObjectFilter` | no | Reveal one matching card from your hand as a cost; it remains in hand (CR 701.20a, 118.11) | | `revealCards` | `{ filter?: ObjectFilter; count: ValueDef; sharesColor?: boolean }` | no | Reveal this many matching cards from your hand as a cost; they remain in hand (CR 701.20a, 118.11, 601.2h). "Reveal X blue cards from your hand" (count X); "Reveal two cards from your hand that share a color" (sharesColor) | | `discardHand` | `boolean` | no | Discard your hand | | `discardSelf` | `boolean` | no | Discard this card (transmute) | | `addCountersSelf` | `{ counter: string; amount: ValueDef }` | no | CR 118.11, 122.1, 601.2h: put counters on this permanent to pay a cost; apply counter replacement effects | | `removeCounters` | `{ counter?: string; amount: ValueDef; from?: ObjectFilter; anyNumber?: boolean }` | no | Remove counters as payment without targeting; omitted counter permits any kinds, from distributes among controlled permanents (CR 122.1, 601.2h) | | `mill` | `ValueDef` | no | Mill this many cards as payment; requires enough cards in the library (CR 701.17, 601.2h) | | `exertSelf` | `boolean` | no | Exert the source as a cost; skip the exerting player's next untap step (CR 701.43) | | `revealSelf` | `boolean` | no | Reveal this card from hand as a cost (CR 701.20, 602.2a) | | `revealChoice` | `boolean \| string` | no | CR 101.4, 607.2d: "Reveal the player you chose:" — reveal the value secretly chosen for this source; payable only while that secret choice is recorded. true reveals the "player" key; a string names another choice key (Stalking Leonin, Guardian Archon) | | `tapOthers` | `{ filter?: ObjectFilter; count?: ValueDef; totalPower?: number; includeSelf?: boolean; anyNumber?: boolean }` | no | Tap matching untapped controlled permanents as payment (CR 118.11, 601.2h) | | `untapOthers` | `{ filter?: ObjectFilter; count: ValueDef }` | no | CR 118.11, 601.2h: choose this many tapped controlled permanents without targeting and untap them as payment. Untap replacement effects still apply | | `exileSelfFromGraveyard` | `boolean` | no | Exile the source from your graveyard (abilities activated from the graveyard) | | `exileGraveyard` | `boolean` | no | CR 118.12, 406.1: exile every card in the payer's graveyard ("unless its controller exiles all cards from their graveyard"); payable even when it is empty | | `exileTop` | `ValueDef` | no | CR 401.2, 118.12: exile this many cards from the top of your library as payment ("Exile the top card of your library: …"); payable only with that many cards in the library | | `payCounters` | `{ counter: string; amount: ValueDef }` | no | Pay player counters: "Pay {E}{E}" → counter "energy", amount 2 | | `exileOthers` | `{ filter?: ObjectFilter; zones: ("battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command")[]; includeSelf?: boolean; count?: ValueDef; anyNumber?: boolean; totalManaValue?: number; shareCardType?: boolean; minDistinctTypes?: number; topmost?: boolean }` | no | Exile other cards from the zones (escape, craft, "exile a card from your hand", "exile X cards from your graveyard": count = X) | | `moveCards` | `{ from: "graveyard" \| "hand"; to: "hand" \| "library"; position?: "top" \| "bottom"; filter?: ObjectFilter; count?: number }` | no | CR 118.12, 400.1: move cards you own between your zones as a payment — "return a basic land card from your graveyard to your hand", "put a card from your graveyard on the bottom of your library" (count default 1; the payer chooses, and orders several going to the library) | | `exileSelf` | `boolean` | no | Exile this object from wherever it is ("Exile ~: …") | | `collectEvidence` | `ValueDef` | no | Collect evidence N: exile cards with total mana value N+ from your graveyard | | `forage` | `boolean` | no | Forage: exile three cards from your graveyard or sacrifice a Food | | `behold` | `string` | no | Behold a : choose one you control or reveal one from your hand | | `returnUnblockedAttacker` | `boolean` | no | Return an unblocked attacker you control to hand (ninjutsu) | | `discardMatching` | `ObjectFilter` | no | Discard a card matching the filter (retrace: a land card) | | `linkedToGraveyard` | `ObjectFilter` | no | CR 607.2a, 602.2b: put a card exiled with the source that matches this filter into its owner's graveyard ({} = any such card): "Put a creature card exiled with Shelob into its owner's graveyard:" is { types: ["Creature"] } | | `blight` | `ValueDef` | no | Put N -1/-1 counters on a creature you control | | `waterbend` | `boolean` | no | Waterbend: artifacts and creatures you control may be tapped to pay {1} each of the mana | | `xManaColor` | `"W" \| "U" \| "B" \| "R" \| "G"` | no | CR 107.3: "Spend only black mana on X" — each {X} in `mana` is paid with mana of this colour | | `manaColor` | `"W" \| "U" \| "B" \| "R" \| "G" \| "chosen"` | no | CR 106.6, 602.2b: "Spend only mana of the chosen color to activate this ability" — all mana spent on this cost (generic and increases included) must be of this colour; chosen = the source's chosen colour | ### 6.11 Keyword abilities (`KeywordAbilityDef`, discriminator `keyword`) Parametrised keywords go in `keywordAbilities[]`; the engine enforces them natively. - `optionalAdditionalCost` — You may pay this additional cost as you cast the spell; its payment is remembered (CR 118.8, 601.2b). Fields: `cost`: CostDef — The cost (CostDef); `entryCounters?`: ({ counter: string; amount: ValueDef })[] — The permanent enters with these additional counters if this cost was paid. - `alternativeCost` — CR 118.9 / 601.2f–h: replace the mana cost with this cost; additional costs still apply. Optional condition and origin-zone permission. Later abilities ask whether it was used with the castWith condition (alternative: "alternativeCost"). Fields: `cost`: CostDef — The cost (CostDef); `condition?`: ConditionDef — A ConditionDef that must hold; `from?`: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command" — Zone the card may be cast from for this alternative cost; `label?`: string — Label shown for this choice; `manaCostLess?`: ValueDef — Instead of a fixed mana payment, pay this card's own mana cost reduced by this much generic mana, worked out as it is cast (colored symbols are never reduced), plus anything in `cost`. "During an opponent's combat phase, you may cast this for {1} less for each attacking creature; if you do, …" is { cost: {}, manaCostLess: { kind: "count", filter: { types: ["Creature"], attacking: true } }, condition: … } with a castWith: "alternativeCost" condition on the rider. - `cycling` — CR 702.29: pay the cost and discard this card to draw; typecycling instead searches for a card matching the filter. Multiple types in the filter are conjunctive. Fields: `cost`: CostDef — The cost (CostDef); `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together). - `flashback` — e.g. “Flashback {1}”. Fields: `cost`: CostDef — The cost (CostDef); `costIsManaCost?`: boolean — Use the card's own mana cost for flashback (CR 702.34, 118.6); no mana cost is unpayable. - `kicker` — e.g. “Kicker {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `crew` — e.g. “Crew 1”. Fields: `amount`: number — How many / how much (integer or ValueDef); `oncePerTurn?`: boolean — CR 602.5b, 702.122: "Crew 1. Activate only once each turn." — this crew ability can be activated only once each turn. - `equip` — e.g. “Equip {1}”. Fields: `cost`: CostDef — The cost (CostDef); `filter?`: ObjectFilter — Which objects (ObjectFilter; set fields AND together); `costModifiers?`: ({ amount: any; reduceMana?: string; perValue?: ValueDef; condition?: ConditionDef; targets?: TargetDef; matchingTargetCount?: number })[] — "Equip {N}. This ability costs … to activate …": the equip ability's own cost change (CR 602.2b, 601.2f); `oncePerTurn?`: boolean — CR 602.5b, 702.6: "Equip {0}. Activate only once each turn." — this equip ability can be activated only once each turn. - `fortify` — CR 702.67: attach this Fortification to target land you control. Activate only as a sorcery. Fields: `cost`: CostDef — The cost (CostDef). - `enchant` — CR 702.5, 303.4: an Aura's legal target and host restriction, including enchant noncommander creature via isCommander: false. A target zone names where the host is: "enchant creature card in a graveyard" (CR 303.4a) is target { zone: "graveyard", filter: creature }. Fields: `target`: TargetDef — What it acts on (TargetDef). - `ward` — Ward: counter an opposing targeting spell or ability unless its controller pays this cost, including non-mana costs (CR 702.21). Fields: `cost`: CostDef — The cost (CostDef). - `protection` — e.g. “Protection from (nothing)”. Fields: `from`: { filter?: object; colors?: string[]; types?: string[]; subtypes?: string[]; everything?: boolean; allColors?: boolean; ownColors?: boolean; colorsAmong?: object; player?: any; fixedPlayers?: string[]; doesntRemove?: object; colorsNotInCommanderIdentity?: boolean; monocolored?: boolean; multicolored?: boolean; colorless?: boolean; chosenColor?: boolean | string; chosenType?: boolean | string } — What a protection ability protects from. - `regenerate` — e.g. “{1}: Regenerate ~”. Fields: `cost`: CostDef — The cost (CostDef). - `landwalk` — CR 702.14: unblockable if defending player controls a land of this quality, e.g. Desert, Snow Forest, Legendary Land or Nonbasic Land. Fields: `landType`: string — The land type of this landwalk ("Swamp", "Forest" …); `chosenLandType?`: boolean | string — CR 702.14, 608.2d: "landwalk of the chosen type" — the land type chosen as the granting effect resolved (this key; true = landType) is appended to landType ("" or a qualifier such as "Snow") when the grant is made. - `prowess` — e.g. “Prowess”. No fields. - `exalted` — e.g. “Exalted”. No fields. - `buyback` — e.g. “Buyback {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `morph` — e.g. “Morph {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `disguise` — e.g. “Disguise {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `unearth` — e.g. “Unearth {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `madness` — e.g. “Madness {1}”. Fields: `cost`: CostDef — The cost (CostDef); `costIsManaCost?`: boolean — "The madness cost is equal to its mana cost" (CR 702.35, 118.6): the card's own mana cost; no mana cost is unpayable. - `echo` — e.g. “Echo {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `bushido` — e.g. “Bushido 1”. Fields: `amount`: number | { kind: "var"; name: string } | { kind: "count"; digSubset?: "looked" | "picked" | "rest"; of?: "object" | "player"; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; filter?: ObjectFilter; player?: any } | { kind: "doneThisWay"; of: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; filter?: ObjectFilter; distinctOwners?: boolean; by?: any } | { kind: "playerAggregate"; op: "max" | "min"; players?: any; value: ValueDef } | … (60 options) — CR 702.45a, 608.2h: bushido X, computed when its triggered ability resolves. - `toxic` — e.g. “Toxic 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `afflict` — e.g. “Afflict 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `undying` — e.g. “Undying”. No fields. - `persist` — e.g. “Persist”. No fields. - `convoke` — e.g. “Convoke”. No fields. - `suspend` — Suspend N—[cost]: exile from hand with N time counters; cast free when the last is removed. Suspend X—{X}[cost] (amount: { kind: "var", name: "X" }, cost.chooseX.min 1): X is announced as it is suspended and that many time counters are put on it (CR 702.62a, 107.3b). Fields: `amount`: number | { kind: "var"; name: "X" } — How many / how much (integer or ValueDef); `cost`: CostDef — The cost (CostDef). - `storm` — Copy this spell for each spell cast before it this turn. No fields. - `cascade` — e.g. “Cascade”. No fields. - `bestow` — May be cast as an Aura with enchant creature for this cost. Fields: `cost`: CostDef — The cost (CostDef). - `mutate` — May be cast onto a non-Human creature you own, merging with it. Fields: `cost`: CostDef — The cost (CostDef). - `specialize` — Specialize: pay this mana cost and discard a card; change into a form allowed by that card's colors or basic land types. Sorcery speed. Fields: `cost`: CostDef — The cost (CostDef); `onlyIf?`: ConditionDef — A ConditionDef that must hold; `from?`: "graveyard" — Where / what it comes from; `costModifiers?`: object[] — This keyword's own activation-cost changes ("this ability costs {1} less to activate for each …"). - `levelUp` — Put a level counter on this (sorcery speed); see `levels`. Fields: `cost`: CostDef — The cost (CostDef). - `foretell` — Pay {2} on your turn to exile face down; cast later for this cost. Fields: `cost`: CostDef — The cost (CostDef); `manaCostLess?`: number — The foretell cost is the mana cost of the face cast reduced by this much generic mana (Dream Devourer); `cost` is then {}. - `plot` — Exile from hand for this cost (sorcery speed); cast free as a sorcery on a later turn. Fields: `cost`: CostDef — The cost (CostDef). - `escape` — Cast from your graveyard for this cost plus exiling N other cards from it. Fields: `cost`: CostDef — The cost (CostDef); `exileCount?`: number — How many other cards from the graveyard must be exiled to escape; `exileAnyNumber?`: boolean — "Exile any number of other cards from your graveyard with four or more card types among them" (Nethergoyf): the player chooses any number of other graveyard cards; minCardTypes is the number of card types they must have among them; `minCardTypes?`: number — With exileAnyNumber: the exiled cards have at least this many card types among them (CR 205.2a; Nethergoyf: 4); `costIsManaCost?`: boolean — "The escape cost is equal to the card's mana cost plus exile N other cards from your graveyard" (CR 702.138, 118.6): the card's own mana cost (cost holds only other parts); no mana cost is unpayable. - `retrace` — Cast from your graveyard by also discarding a land card. No fields. - `disturb` — Cast from your graveyard transformed for this cost. Fields: `cost`: CostDef — The cost (CostDef). - `aftermath` — This half can be cast only from the graveyard, then is exiled. No fields. - `fuse` — Cast both halves of a split card from hand as one spell. No fields. - `overload` — Cast for this cost; each "target" becomes "each". Fields: `cost`: CostDef — The cost (CostDef). - `rebound` — Cast from hand → exiled as it resolves; cast free at your next upkeep. No fields. - `miracle` — May cast for this cost when drawn as the first card this turn. Fields: `cost`: CostDef — The cost (CostDef). - `warp` — Cast for this cost; exiled at the next end step; may be cast from exile later. Fields: `cost`: CostDef — The cost (CostDef). - `impending` — Impending N—cost: enters with N time counters and isn't a creature until they're gone. Fields: `amount`: number — How many / how much (integer or ValueDef); `cost`: CostDef — The cost (CostDef). - `prototype` — Cast for a different mana cost with different P/T (and colors). Fields: `cost`: CostDef — The cost (CostDef); `power`: number — The prototype's power; `toughness`: number — The prototype's toughness; `colors?`: string[] — The prototype's colors. - `blitz` — Haste, "when it dies, draw a card", sacrificed at the next end step. Fields: `cost`: CostDef — The cost (CostDef); `costIsManaCost?`: boolean — "The blitz cost is equal to its mana cost" (CR 702.152, 118.6): the spell's own mana cost; no mana cost is unpayable. - `dash` — Haste; returned to hand at the next end step. Fields: `cost`: CostDef — The cost (CostDef). - `evoke` — Sacrificed when it enters. Fields: `cost`: CostDef — The cost (CostDef). - `megamorph` — Morph that turns face up with a +1/+1 counter. Fields: `cost`: CostDef — The cost (CostDef). - `ninjutsu` — Return an unblocked attacker → this enters tapped and attacking. Fields: `cost`: CostDef — The cost (CostDef); `commander?`: boolean — Commander ninjutsu (also from the command zone). - `sneak` — Cast during declare blockers by returning an unblocked attacker; enters tapped and attacking. Fields: `cost`: CostDef — The cost (CostDef). - `multikicker` — Kicker any number of times. Fields: `cost`: CostDef — The cost (CostDef). - `replicate` — Pay any number of times; copy the spell that many times. Fields: `cost`: CostDef — The cost (CostDef); `costIsManaCost?`: boolean — "The replicate cost is equal to its mana cost" (CR 702.56, 118.6): the spell's own mana cost; no mana cost is unpayable. - `squad` — Pay any number of times; that many token copies when it enters. Fields: `cost`: CostDef — The cost (CostDef). - `strive` — Costs this much more for each target beyond the first. Fields: `cost`: CostDef — The cost (CostDef). - `entwine` — Choose all modes if you pay this. Fields: `cost`: CostDef — The cost (CostDef). - `spree` — Each mode has its own additional cost (ModeDef.cost). No fields. - `tiered` — Tiered (CR 702.182): the spell's modes are tiers — exactly one is chosen (chooseMin / chooseMax 1) and that mode's additional cost (ModeDef.cost) is paid. No fields. - `offspring` — Pay to get a 1/1 token copy when it enters. Fields: `cost`: CostDef — The cost (CostDef). - `gift` — Promise an opponent a gift; they get it before the spell's other effects. Fields: `gift`: "card" | "fish" | "food" | "treasure" | "tappedFish" | "extraTurn" | "twoTappedFish" | "clue" | "octopus" — What the opponent is promised (card, fish, food, treasure, tappedFish, extraTurn, twoTappedFish, clue, octopus); `description?`: string — Display text for this option. - `bargain` — May sacrifice an artifact, enchantment or token as you cast it. No fields. - `casualty` — May sacrifice a creature with power N+ to copy the spell. Fields: `amount`: number | "X" — The power the sacrificed creature needs (CR 702.153a); "X": the caster chooses X as they cast and the creature needs power X or greater (Ob Nixilis, the Adversary); `except?`: { keywords?: string[]; keywordAbilities?: KeywordAbilityDef[]; abilities?: any[]; addTypes?: string[]; addSubtypes?: string[]; setTypes?: string[]; setSubtypes?: string[]; removeSubtypes?: string[]; colors?: string[]; addColors?: string[]; power?: ValueDef; toughness?: ValueDef; loyalty?: ValueDef; notLegendary?: boolean; legendary?: boolean; name?: string; noManaCost?: boolean } — CR 707.9: how the copy differs — "The copy isn't legendary and has starting loyalty X" is { notLegendary: true, loyalty: { kind: "var", name: "X" } }. - `delve` — Each card exiled from your graveyard pays {1}. No fields. - `improvise` — Tapped artifacts pay {1} each. No fields. - `affinity` — Affinity for [text] (CR 702.41): costs {1} less for each permanent you control matching the filter. Fields: `filter`: ObjectFilter — Which objects (ObjectFilter; set fields AND together). - `splitSecond` — While on the stack, players can't cast spells or activate non-mana abilities. No fields. - `cumulativeUpkeep` — Age counter at upkeep; pay once per counter or sacrifice. Fields: `cost`: CostDef — The cost (CostDef). - `vanishing` — CR 702.63: optional entry time counters; upkeep removes one if present; removal of the last triggers sacrifice. No amount means no entry counters. Fields: `amount?`: number — How many / how much (integer or ValueDef). - `fading` — Fade counters; remove one each upkeep; sacrifice when you can't. Fields: `amount`: number — How many / how much (integer or ValueDef). - `flanking` — e.g. “Flanking”. No fields. - `soulbond` — e.g. “Soulbond”. No fields. - `backup` — e.g. “Backup 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `mentor` — e.g. “Mentor”. No fields. - `evolve` — e.g. “Evolve”. No fields. - `modular` — e.g. “Modular 1”. Fields: `amount`: number — How many / how much (integer or ValueDef); `sunburst?`: boolean — Modular—Sunburst: counters equal to the number of colors of mana spent. - `devour` — CR 702.82: may sacrifice matching permanents as it enters; N +1/+1 counters for each. Fields: `amount`: number — How many / how much (integer or ValueDef); `filter?`: ObjectFilter — CR 702.82c: permanents to sacrifice instead of creatures, e.g. artifacts or lands. - `bloodthirst` — e.g. “Bloodthirst 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `myriad` — e.g. “Myriad”. No fields. - `mobilize` — e.g. “Mobilize 1”. Fields: `amount`: number | ValueDef — N, or X computed as the attack trigger resolves ("Mobilize X, where X is the number of creature cards in your graveyard", CR 608.2h). - `encore` — e.g. “Encore {1}”. Fields: `cost`: CostDef — The cost (CostDef); `costIsManaCost?`: boolean — "Its encore cost is equal to its mana cost" (CR 702.141, 118.6): the card's own mana cost; no mana cost is unpayable; `costIsManaValue?`: boolean — "Encore {X}, where X is its mana value" (CR 702.141, 202.3): generic mana equal to the card's mana value. - `embalm` — e.g. “Embalm {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `eternalize` — e.g. “Eternalize {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `dredge` — e.g. “Dredge 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `boast` — e.g. “Boast {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `saddle` — e.g. “Saddle 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `station` — Tap another creature → charge counters equal to its power; thresholds in stationLevels. No fields. - `livingWeapon` — e.g. “Living weapon”. No fields. - `jobSelect` — e.g. “Job select”. No fields. - `reconfigure` — e.g. “Reconfigure {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `firebending` — e.g. “Firebending 1”. Fields: `amount`: number | ValueDef — N, or X computed as the attack trigger resolves ("Firebending X, where X is this creature's power", CR 608.2h). - `hexproofFrom` — e.g. “Hexproof from (nothing)”. Fields: `from`: { filter?: object; colors?: string[]; types?: string[]; subtypes?: string[]; everything?: boolean; allColors?: boolean; ownColors?: boolean; colorsAmong?: object; player?: any; fixedPlayers?: string[]; doesntRemove?: object; colorsNotInCommanderIdentity?: boolean; monocolored?: boolean; multicolored?: boolean; colorless?: boolean; chosenColor?: boolean | string; chosenType?: boolean | string } — What it has hexproof from (colors, types, a filter …). - `companion` — Companion — [condition] (CR 702.139): `restriction` is the printed condition, `condition` the same rule as deck validation enforces it. Fields: `restriction`: string — The printed companion condition, verbatim; `condition?`: { kind: "permanentManaValueAtMost"; max: number } | { kind: "deckSizeAboveMinimum"; amount: number } | { kind: "creatureTypes"; subtypes: string[] } | { kind: "noRepeatedManaSymbols" } | { kind: "permanentsHaveActivatedAbility" } | … (9 options) — A companion's deck-building condition, checked against the starting deck (CR 702.139a-b). - `partner` — CR 702.124: a partner ability; grouped variants pair only with their matching group. Fields: `with?`: string — "Partner with ": the partner's exact name; `background?`: boolean — "Choose a Background" instead of partner; `doctorsCompanion?`: boolean — "Doctor's companion" instead of partner; `group?`: "Friends forever" | "Character select" | "Survivors" | "Father & son" — CR 702.124i: Partner—[text]; both legendary commanders must have the same group. Distinct from plain partner and the other partner variants. - `readAhead` — e.g. “Read ahead”. No fields. - `startYourEngines` — e.g. “Start your engines”. No fields. - `ascend` — CR 702.131b-d: while on the battlefield, ten or more permanents grant your city's blessing immediately and permanently. No fields. - `phasing` — e.g. “Phasing”. No fields. - `exert` — You may exert this creature as it attacks (it won't untap during your next untap step). Fields: `onlyIf?`: ConditionDef — CR 701.43, 508.1: condition on exerting as it attacks, such as not exerted this turn; `effects?`: EffectDef[] — CR 603.11, 607.2h: When you do is a linked triggered ability of this permanent; exerting through another ability does not trigger it. - `awaken` — e.g. “Awaken 1—{1}”. Fields: `amount`: number — How many / how much (integer or ValueDef); `cost`: CostDef — The cost (CostDef). - `emerge` — e.g. “Emerge {1}”. Fields: `cost`: CostDef — The cost (CostDef); `costIsManaCost?`: boolean — "The emerge cost is equal to its mana cost" (CR 702.119, 118.6): the spell's own mana cost, reduced by the sacrificed creature's mana value; no mana cost is unpayable. - `jumpStart` — e.g. “Jump start”. No fields. - `beamMeUp` — Beam me up: you may cast this card from your graveyard for this cost if you also return a creature you control to its owner's hand (an additional cost, CR 118.8); the spell is exiled instead of going anywhere else when it would leave the stack (as flashback, CR 702.34a). Fields: `cost`: CostDef — The cost (CostDef). - `surge` — e.g. “Surge {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `spectacle` — e.g. “Spectacle {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `prowl` — e.g. “Prowl {1}”. Fields: `cost`: CostDef — The cost (CostDef); `subtypes?`: string[] — Subtypes, e.g. ["Elf", "Warrior"]. - `freerunning` — e.g. “Freerunning {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `cleave` — e.g. “Cleave {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `escalate` — e.g. “Escalate {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `webSlinging` — e.g. “Web slinging {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `harmonize` — e.g. “Harmonize {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `moreThanMeetsTheEye` — e.g. “More than meets the eye {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `assist` — e.g. “Assist”. No fields. - `recover` — e.g. “Recover {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `craft` — Craft with [materials] {cost}: exile this and the materials; return it transformed (sorcery speed). Fields: `cost`: CostDef — The cost (CostDef); `materials`: { filter?: ObjectFilter; count?: number; shareCardType?: boolean } — What must be exiled to craft: `{ filter?, count?, shareCardType? }`. - `annihilator` — e.g. “Annihilator 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `rampage` — e.g. “Rampage 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `amplify` — e.g. “Amplify 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `graft` — e.g. “Graft 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `tribute` — e.g. “Tribute 1 (if not paid: )”. Fields: `amount`: number — How many / how much (integer or ValueDef); `effects`: EffectDef[] — The effects, resolved in order (EffectDef[]). - `ripple` — e.g. “Ripple 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `hideaway` — e.g. “Hideaway 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `champion` — e.g. “Champion a creature”. Fields: `filter`: ObjectFilter — Which objects (ObjectFilter; set fields AND together). - `ravenous` — e.g. “Ravenous”. No fields. - `riot` — e.g. “Riot”. No fields. - `unleash` — e.g. “Unleash”. No fields. - `enlist` — e.g. “Enlist”. No fields. - `decayed` — e.g. “Decayed”. No fields. - `melee` — e.g. “Melee”. No fields. - `training` — e.g. “Training”. No fields. - `provoke` — e.g. “Provoke”. No fields. - `haunt` — e.g. “Haunt”. No fields. - `conspire` — e.g. “Conspire”. No fields. - `epic` — e.g. “Epic”. No fields. - `cipher` — e.g. “Cipher”. No fields. - `livingMetal` — e.g. “Living metal”. No fields. - `forMirrodin` — e.g. “For mirrodin”. No fields. - `afterlife` — e.g. “Afterlife 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `fabricate` — e.g. “Fabricate 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `outlast` — e.g. “Outlast {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `renown` — e.g. “Renown 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `monstrosity` — e.g. “{1}: Monstrosity 1”. Fields: `amount`: number | { kind: "var"; name: string } | { kind: "count"; digSubset?: "looked" | "picked" | "rest"; of?: "object" | "player"; zone?: "battlefield" | "hand" | "graveyard" | "library" | "exile" | "stack" | "command"; filter?: ObjectFilter; player?: any } | { kind: "doneThisWay"; of: "sacrificed" | "milled" | "destroyed" | "exiled" | "discarded" | "returned" | "putIntoLibrary" | "tapped" | "untapped" | "damaged" | "drawn" | "revealed" | "countersPlaced" | "countersRemoved" | "amassed" | "countered" | "phasedOut" | "searched" | "created"; filter?: ObjectFilter; distinctOwners?: boolean; by?: any } | { kind: "playerAggregate"; op: "max" | "min"; players?: any; value: ValueDef } | … (60 options) — N, or { kind: "var", name: "X" } for "Monstrosity X" with {X} in the cost; `cost`: CostDef — The cost (CostDef); `costModifiers?`: object[] — This keyword's own activation-cost changes ("this ability costs {1} less to activate for each …"). - `adapt` — e.g. “{1}: Adapt 1”. Fields: `amount`: number — How many / how much (integer or ValueDef); `cost`: CostDef — The cost (CostDef); `costModifiers?`: object[] — This keyword's own activation-cost changes ("this ability costs {1} less to activate for each …"). - `scavenge` — e.g. “Scavenge {1}”. Fields: `cost`: CostDef — The cost (CostDef); `costIsManaCost?`: boolean — "The scavenge cost is equal to its mana cost" (CR 702.97, 118.6): the card's own mana cost; no mana cost is unpayable. - `transmute` — e.g. “Transmute {1}”. Fields: `cost`: CostDef — The cost (CostDef). - `reinforce` — Reinforce N—[cost] (CR 702.77a): [cost], discard this card from your hand: put N +1/+1 counters on target creature (instant speed). Fields: `amount`: number — N: the +1/+1 counters put on target creature; `cost`: { oneOf?: CostDef[]; chooseX?: object; mana?: string; ownManaCost?: boolean; genericAmount?: ValueDef; tapSelf?: boolean; untapSelf?: boolean; unattachSelf?: boolean; payLife?: ValueDef; getPoison?: ValueDef; othersGainLife?: object; draw?: ValueDef; addMana?: string; opponentCreatesToken?: object; opponentCounter?: object; damageFromSource?: ValueDef; sacrificeSelf?: boolean; sacrificeTogether?: ObjectFilter[]; sacrifice?: TargetDef; returnToHand?: TargetDef; discard?: ValueDef; discardRandom?: boolean; reveal?: ObjectFilter; revealCards?: object; discardHand?: boolean; discardSelf?: boolean; addCountersSelf?: object; removeCounters?: object; mill?: ValueDef; exertSelf?: boolean; revealSelf?: boolean; revealChoice?: boolean | string; tapOthers?: object; untapOthers?: object; exileSelfFromGraveyard?: boolean; exileGraveyard?: boolean; exileTop?: ValueDef; payCounters?: object; exileOthers?: object; moveCards?: object; exileSelf?: boolean; collectEvidence?: ValueDef; forage?: boolean; behold?: string; returnUnblockedAttacker?: boolean; discardMatching?: ObjectFilter; linkedToGraveyard?: ObjectFilter; blight?: ValueDef; waterbend?: boolean; xManaColor?: "W" | "U" | "B" | "R" | "G"; manaColor?: "W" | "U" | "B" | "R" | "G" | "chosen" } — The cost paid with discarding this card. - `umbraArmor` — e.g. “Umbra armor”. No fields. - `exploit` — e.g. “Exploit”. No fields. - `ingest` — e.g. “Ingest”. No fields. - `dethrone` — e.g. “Dethrone”. No fields. - `extort` — e.g. “Extort”. No fields. - `poisonous` — e.g. “Poisonous 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `frenzy` — e.g. “Frenzy 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `absorb` — e.g. “Absorb 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `soulshift` — e.g. “Soulshift 1”. Fields: `amount`: number — How many / how much (integer or ValueDef). - `offering` — CR 702.48: the caster may sacrifice one matching permanent as an additional cost, cast the spell as though it had flash, and reduce its total cost by the offered permanent's mana cost. Fields: `subtype`: string — The offered permanent's type or subtype, such as Artifact or Rat. - `gravestorm` — e.g. “Gravestorm”. No fields. - `stickerKicker` — Optional additional cost; if paid you get {TK} and may put a sticker on the creature as it enters. Fields: `cost`: CostDef — The cost (CostDef). - `mayhem` — Mayhem: cast from your graveyard for this cost if you discarded it this turn. Fields: `cost`: CostDef — The cost (CostDef). - `teamwork` — Teamwork N: optional additional cost — tap creatures with total power N or more. Fields: `amount`: number — How many / how much (integer or ValueDef). - `waterbend` — Additional cost paid by mana or by tapping artifacts/creatures ({1} each); optional for "you may waterbend". Fields: `cost`: CostDef — The cost (CostDef); `optional?`: boolean — "You may": the player chooses whether to do it. - `splice` — Splice onto [quality] (a subtype name or an object filter): reveal from hand while casting such a spell and pay the cost to add this card's effects. Fields: `onto`: string | ObjectFilter — What the spell splices onto (a subtype such as "Arcane", or a filter); `cost`: CostDef — The cost (CostDef). - `storied` — Storied: three or more artifacts, legendaries and/or Sagas give you an enduring story for the rest of the game. No fields. - `banding` — Banding (CR 702.22). No fields. - `bandsWithOther` — Bands with other [quality] (CR 702.22b). Fields: `filter`: ObjectFilter — Which objects (ObjectFilter; set fields AND together). - `compleated` — Compleated: enters with two fewer loyalty counters if life was paid for its Phyrexian mana. No fields. - `demonstrate` — Demonstrate: when cast you may copy it; if you do, a chosen opponent also copies it. No fields. - `undaunted` — Undaunted: costs {1} less for each opponent. No fields. **Simple keywords** (plain strings in `keywords[]`): "Flying", "Reach", "Vigilance", "Haste", "Trample", "Lifelink", "Deathtouch", "Flash", "Defender", "Menace", "First strike", "Double strike", "Indestructible", "Hexproof", "Shroud", "Shadow", "Horsemanship", "Fear", "Intimidate", "Skulk", "Infect", "Wither", "Daybound", "Nightbound", "Can't be blocked", "Can't block", "Can't attack", "Can't be countered", "Must attack", "Doesn't untap", "Changeling", "Devoid", "Partner", "Can be your commander", "Look at top card", "Decayed", "Banding", "Rampage", "Provoke", "Unleash", "Ingest", "Melee", "Riot", "Training". Protection / hexproof-from / landwalk with parameters use the keyword abilities above. ### 6.12 Layouts and other definitions Layouts (`layout`): - `normal` — A single-faced card. - `transform` — Double-faced card that transforms; `faces[0]` front, `faces[1]` back. - `modal_dfc` — Modal double-faced card: cast either face. - `adventure` — Creature with an Adventure half in `faces[1]`. - `split` — Two halves in `faces`, each castable (fuse / aftermath via keyword abilities). - `flip` — Kamigawa flip card; the flipped half is `faces[1]`. - `saga` — Saga enchantment with `chapter` triggers. - `token` — A token definition that `createToken` can reference by `tokenDefId`. - `class` — Class enchantment with `classLevels[]`. - `leveler` — Level-up creature with `levels[]` bands and a `levelUp` keyword ability. - `meld` — Meld half with `meld: { partner, into }`. - `emblem` — An emblem definition (command zone). - `prepare` — Prepare creature; `faces[1]` is the attached spell. - `dungeon` — A dungeon with `rooms[]`. - `host` — Unstable host creature with a `banner` ability. - `augment` — Unstable augment card with an `augment` block. - `stickers` — Unfinity sticker sheet (`stickers`). **ClassLevelDef** | Field | Type | Required | Description | |---|---|---|---| | `level` | `number` | yes | The level this entry grants (2, 3, …) | | `cost` | `{ oneOf?: CostDef[]; chooseX?: object; mana?: string; ownManaCost?: boolean; genericAmount?: ValueDef; tapSelf?: boolean; untapSelf?: boolean; unattachSelf?: boolean; payLife?: ValueDef; getPoison?: ValueDef; othersGainLife?: object; draw?: ValueDef; addMana?: string; opponentCreatesToken?: object; opponentCounter?: object; damageFromSource?: ValueDef; sacrificeSelf?: boolean; sacrificeTogether?: ObjectFilter[]; sacrifice?: TargetDef; returnToHand?: TargetDef; discard?: ValueDef; discardRandom?: boolean; reveal?: ObjectFilter; revealCards?: object; discardHand?: boolean; discardSelf?: boolean; addCountersSelf?: object; removeCounters?: object; mill?: ValueDef; exertSelf?: boolean; revealSelf?: boolean; revealChoice?: boolean \| string; tapOthers?: object; untapOthers?: object; exileSelfFromGraveyard?: boolean; exileGraveyard?: boolean; exileTop?: ValueDef; payCounters?: object; exileOthers?: object; moveCards?: object; exileSelf?: boolean; collectEvidence?: ValueDef; forage?: boolean; behold?: string; returnUnblockedAttacker?: boolean; discardMatching?: ObjectFilter; linkedToGraveyard?: ObjectFilter; blight?: ValueDef; waterbend?: boolean; xManaColor?: "W" \| "U" \| "B" \| "R" \| "G"; manaColor?: "W" \| "U" \| "B" \| "R" \| "G" \| "chosen" }` | yes | Cost to gain this level (sorcery speed, from the previous level) | | `abilities` | `AbilityDef[]` | no | Abilities (AbilityDef[]), the same shapes as a card's own | | `keywords` | `string[]` | no | Plain keyword strings granted at this level | **LevelBandDef** | Field | Type | Required | Description | |---|---|---|---| | `min` | `number` | yes | Minimum number of selections / required amount | | `max` | `number` | no | Omit for "LEVEL N+" | | `power` | `number \| string` | no | Power (a number, or a string such as "*" for characteristic-defining values) | | `toughness` | `number \| string` | no | Toughness (a number, or a string such as "*" for characteristic-defining values) | | `types` | `string[]` | no | Types the object has in this band (station: ["Artifact", "Creature"]) | | `keywords` | `string[]` | no | Plain keyword strings granted at this level | | `keywordAbilities` | `KeywordAbilityDef[]` | no | Parametrised keyword abilities granted at this level | | `abilities` | `AbilityDef[]` | no | Abilities (AbilityDef[]), the same shapes as a card's own | **MeldDef** | Field | Type | Required | Description | |---|---|---|---| | `partner` | `string` | yes | Name of the card this melds with | | `into` | `string` | yes | Library id of the melded card definition | **DungeonRoomDef** | Field | Type | Required | Description | |---|---|---|---| | `name` | `string` | yes | Printed name. On an ability: its ability word ("Hellfire Retribution"), shown in the English rendering, on the stack and in the log | | `effects` | `EffectDef[]` | yes | The effects, resolved in order (EffectDef[]) | | `next` | `number[]` | yes | Indices of the rooms reachable from this one (empty = final room) | **AugmentDef** | Field | Type | Required | Description | |---|---|---|---| | `cost` | `{ oneOf?: CostDef[]; chooseX?: object; mana?: string; ownManaCost?: boolean; genericAmount?: ValueDef; tapSelf?: boolean; untapSelf?: boolean; unattachSelf?: boolean; payLife?: ValueDef; getPoison?: ValueDef; othersGainLife?: object; draw?: ValueDef; addMana?: string; opponentCreatesToken?: object; opponentCounter?: object; damageFromSource?: ValueDef; sacrificeSelf?: boolean; sacrificeTogether?: ObjectFilter[]; sacrifice?: TargetDef; returnToHand?: TargetDef; discard?: ValueDef; discardRandom?: boolean; reveal?: ObjectFilter; revealCards?: object; discardHand?: boolean; discardSelf?: boolean; addCountersSelf?: object; removeCounters?: object; mill?: ValueDef; exertSelf?: boolean; revealSelf?: boolean; revealChoice?: boolean \| string; tapOthers?: object; untapOthers?: object; exileSelfFromGraveyard?: boolean; exileGraveyard?: boolean; exileTop?: ValueDef; payCounters?: object; exileOthers?: object; moveCards?: object; exileSelf?: boolean; collectEvidence?: ValueDef; forage?: boolean; behold?: string; returnUnblockedAttacker?: boolean; discardMatching?: ObjectFilter; linkedToGraveyard?: ObjectFilter; blight?: ValueDef; waterbend?: boolean; xManaColor?: "W" \| "U" \| "B" \| "R" \| "G"; manaColor?: "W" \| "U" \| "B" \| "R" \| "G" \| "chosen" }` | yes | Augment cost (paid from hand, reveal; sorcery speed) | | `head` | `{ kind: "triggered"; trigger: TriggerDef; optional?: boolean } \| { kind: "activated"; cost: CostDef; timing?: "instant" \| "sorcery" }` | yes | The head that replaces the host's "When this creature enters," banner | | `power` | `number` | yes | Power modifier ("+1") | | `toughness` | `number` | yes | Toughness modifier ("+2") | | `instantSpeed` | `boolean` | no | The augment can be combined at instant speed | **StickerSheetDef** | Field | Type | Required | Description | |---|---|---|---| | `names` | `string[]` | yes | Name sticker words | | `artCount` | `number` | yes | Number of art stickers | | `abilities` | `({ cost: number; text: string; keywords?: string[]; keywordAbilities?: KeywordAbilityDef[]; abilities?: AbilityDef[] })[]` | yes | The sheet's ability stickers: each with its ticket cost, its text and the keywords / abilities it grants | | `pt` | `({ cost: number; power: number; toughness: number })[]` | yes | Power/toughness stickers: each `{ cost, power, toughness }` | **TokenSpec** (inline in `createToken.token`) | Field | Type | Required | Description | |---|---|---|---| **ChoiceSpec** (`chooseAsEnters[]`) | Field | Type | Required | Description | |---|---|---|---| | `who` | `"eachPlayer"` | no | CR 101.4, 614.12: each player publicly chooses a named option in APNAP order. A choseOption condition with who reads that player's answer for this source | | `opponentsOnly` | `boolean` | no | Choose an opponent of the ability controller (CR 102.2, 608.2d) | | `kind` | `"option" \| "creatureType" \| "color" \| "cardName" \| "basicLandType" \| "landType" \| "cardType" \| "landNonland" \| "oddEven" \| "number" \| "player"` | yes | CR 608.2d: option selects one of the explicit named options; collect retains each player's answer | | `from` | `ObjectFilter` | no | Choose only colors of matching objects (CR 105.1, 608.2d) | | `zone` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | Zone containing the color sources; defaults to battlefield (CR 400.1) | | `excludePreviouslyChosen` | `boolean` | no | Exclude earlier values chosen by this source object; reset on zone changes (CR 608.2d, 400.7) | | `options` | `string[]` | no | Explicit legal values, such as a printed list of card names (CR 608.2d) | | `exclude` | `string[]` | no | Forbidden choice values; colors use W/U/B/R/G codes (CR 608.2d) | | `filter` | `{ types?: string[]; notTypes?: string[]; anyTypes?: string[] }` | no | Printed card-type restrictions on a card name (CR 201.4a) | | `key` | `string` | no | Storage key when several choices share a kind | | `secret` | `boolean` | no | CR 101.4, 607.2d: the choice is made without showing it to the other players; a revealChoice cost makes it public (Emissary of Grudges, Guardian Archon) | | `beforeGame` | `"commander"` | no | "If ~ is your commander, choose a color before the game begins." (CR 903.3, 103.6): made as the game begins, before the opening hands, for a commander (Clara Oswald); stored like an as-enters choice | | `label` | `string` | no | Label shown for this choice | | `min` | `number` | no | Minimum number of selections / required amount | | `max` | `number` | no | Maximum number of selections | ### 6.13 Zones Zone names appear in `TargetDef.zone`, `ObjectFilter` lookups, `moveTo.destination`, `searchLibrary.destination`, `castFrom` and `zoneChange` triggers. Default lookups are on the battlefield. - `battlefield` — Permanents. The default zone for filters and targets. - `hand` — Hidden; owner-visible. "discard", "return to hand", "from your hand". - `graveyard` — Public, ordered. "dies" = battlefield → graveyard; reanimation reads from here. - `library` — Hidden, ordered. Top / bottom positions via `position`; `mode: "top"` targets the top card(s). - `exile` — Public. Linked exile (`link`, `linkedToSource`) remembers what a card exiled. - `stack` — Spells and abilities waiting to resolve; `of: "spell"` targets live here. - `command` — Emblems, commanders, dungeons; `eminence` abilities work from here. ## 8. Common mistakes - **Using "all" when the text says "target".** `mode: "all"` never prompts and can't be responded to with a different target; "target creature" must be `mode: "chosen"` (the default). - **Using "chosen" for resolution-time choices.** "Return a creature card from your graveyard to your hand" does not target: use `mode: "choose"` with `zone: "graveyard"`. - **Declaring a combination unsupported.** "Exile a card at random from an opponent's hand" is not a missing primitive: `exile` takes any TargetDef, and `mode: "random"` × `zone: "hand"` × `player: "target"` + `playerTarget` compose like every other selection (see the selection algebra under **Filters & targets**). Build the combination and validate it before saying the engine cannot do something. - **Calling a conditional discount impossible.** "If ~ is cast during an opponent's combat phase, you may reduce its cost by {1} for each attacking creature; it returns to your hand at the next end step when cast this way" is an `alternativeCost` keyword: `{ keyword: "alternativeCost", cost: {}, manaCostLess: { kind: "count", filter: { types: ["Creature"], attacking: true } }, condition: { kind: "all", conditions: [{ kind: "not", condition: { kind: "isYourTurn" } }, { kind: "phase", is: "combat" }] } }` — the mana cost is reduced as it is cast (generic mana only) — and the rider is an enters trigger with `condition: { kind: "castWith", alternative: "alternativeCost" }` creating a `delayedTrigger` at the next `endStep` that moves it to `hand`. A permanent discount is a `costModifier` static with `filter: { self: true }`. - **A modal trigger without `effects`.** A `triggered` ability's `effects` is required even when everything happens in `modes`: write `"effects": []`. The gate refuses the card with "abilities.N.effects — Required" (on a multi-face card, "faces.0.abilities.N.effects"). - **Forgetting `filter.self` on "when ~ enters".** `{ event: "enters" }` alone triggers for *every* object entering; add `filter: { self: true }`. - **Forgetting `by: "you"` on turn-based triggers.** "At the beginning of your upkeep" is `{ event: "upkeep", by: "you" }`; without `by` the engine treats it as each player's upkeep. - **Writing a static as a one-shot.** "Creatures you control get +1/+1" is a `static` `modifyPT`, not a `spell` effect with `duration: "permanent"`. - **Splitting one layered ability into several statics.** Humility-style text (lose abilities *and* set P/T) must be one static with two `effects`, or the parts can separate under CR 613.6. - **Splitting one simultaneous action into several effects.** "Deals 1 damage to each opponent and each creature they control", "destroy target artifact and target enchantment", "put a +1/+1 counter and a lifelink counter on it" and "you and that player each create three tokens" are each **one** event: use one effect with a compound target (`anyOf`, several target slots on the same effect, or a combined filter), never two effects in sequence. Two effects make two events, so lifelink gains twice, enrage and "one or more" triggers fire twice, and a regeneration shield or indestructible granted by the first part changes the second. Printed "then" / separate sentences *are* sequential and stay separate effects. - **"If you do" / "when you do" on the action, not the answer.** "You may sacrifice a creature. If you do, …" gates on the sacrifice actually happening (`optional` + `ifYouDo`), not on the player answering yes; with nothing to sacrifice, the rest doesn't happen. - **Widening a filter.** "Nonbasic land" is `{ types: ["Land"], notSupertypes: ["Basic"] }`, not `{ types: ["Land"] }`. The engine enforces what you wrote. - **Leaving `who` to default on opponent effects.** "Each opponent loses 2 life" needs `who: "eachOpponent"`; the default is you. - **Hard-coding derived numbers.** "Draw cards equal to the number of Elves you control" must be a `count` value, never a constant guessed from the test board. - **Keywords as text.** "Flying" belongs in `keywords`, not in a `grantKeyword` static on itself, and not only in `text` (which is display only). - **Auras without `enchant`, Equipment without `equip`,** Sagas without `chapter` triggers, planeswalkers without `loyalty`: the lint warnings say so — fix them before saving. - **Dumping a clause into `unparsed` when its timing is clear.** "When this enters, attach an Aura from your hand at no cost" has a trigger the engine can run; if the action really were inexpressible it would be a `tableRuling` *effect* inside that trigger, not an `unparsed` line. `unparsed` is for text with no capturable timing at all. - **Pausing play for a format rule.** "You may have cards of any color in a deck with ~ as commander" is a deck-construction sentence: a standalone `tableRuling` with `onDemand: true`, never a step that interrupts casting. - **Dropping the ability word.** "Totality — Remove all counters …" keeps `name: "Totality"` on the ability so the stack and the log can name it. - **The card acting where the text names someone else.** "When a creature deals combat damage to ~, it deals that much damage to itself" — the *creature* deals the damage. `dealDamage` is dealt by the card unless `from` says otherwise: `from: { of: "object", mode: "triggeringOther" }` (the trigger's other object, named on the trigger with `other: { types: ["Creature"] }`), and the recipient is `target: { of: "object", mode: "triggeringOther" }` too. The engine's reading "it deals that much damage to itself" with the card as "it" is a different card — the Studio's read-back resolves each side's pronouns before comparing them. - **A step trigger for an event.** "When declaring ~ as an attacker" / "whenever ~ attacks" is `{ event: "attacks", filter: { self: true } }` — not `declareAttackersStep` or `beginCombat` (those fire with no attack at all) and not `youAttack` (you attacking with anything). - **"That much damage" as excess.** `triggerAmount` is the damage the trigger saw; `excessDamageThisWay` is only the part beyond lethal. - **A mode where the `of` goes.** `target: { of: "triggeringOther" }` is wrong twice over: `of` says *what kind of thing* is selected (object / player / spell / any) and `mode` says *which one* — `{ of: "object", mode: "triggeringOther" }`. - **Text where a structure belongs.** An ability is an object `{ kind: … }`, an effect an object `{ effect: … }`, a token a complete object; a sentence, or the JSON of one as a *string*, is refused by the gate with the string shown back. - **Rewording `text` to satisfy the gate.** The printed text is the card as the player has it. When the engine's reading differs, change the abilities; the Studio notices when the text changes between attempts. - **The token's text on the creating card.** "Create a 1/1 red Devil creature token with 'When this creature dies, it deals 1 damage to any target'" is one `createToken` whose `token.abilities` holds the dies trigger — not a second ability of the card that creates it. A `tokenDefId` alone (`{ "name": "Devil", "tokenDefId": "devil" }`) reads back as "a Devil token" and fails the comparison: write the inline spec in full and add the link on top (see **Tokens**). - **A token card with a mana cost.** A token card is `layout: "token"` with no `manaCost`; its `id` is the lower-case name and the server renames it to `custom::` on save, re-pointing the `tokenDefId` of the cards that name it. - **Inventing a native id.** `{ "effect": "native", "id": "magic.myNewThing" }` is rejected on save and at the deal: only the ids the server registers exist (the `native` page of each kind lists them with their params). A clause nothing implements is a `tableRuling` step, never a made-up native. - **Approximating.** If a clause cannot be expressed, climb the honesty ladder (tableRuling step → on-demand ruling → `unparsed`) and move on. A partially enforced card is honest; a wrong card is not. ## 9. Custom mechanics and the honesty ladder Custom cards bring clauses no printed card has. The engine is built so those clauses are **played, not approximated**: first look for the primitive that says exactly what the text says, then fall down the honesty ladder only as far as you must. **1. Say it with the vocabulary.** Most "custom" text is ordinary rules text with a new combination. Primitives people miss: - **The selection algebra** — every action's `target` composes `mode` (chosen / choose / all / random / top / back-references) × `zone` × `player` (+ `playerTarget`) × `filter` × `min` / `max` × `chooser` independently. "Exile a card at random from an opponent's hand", "destroy a land chosen at random", "put a creature card at random from your graveyard onto the battlefield" need no new primitive; see **Filters & targets**. - **`name` on any ability** — the printed ability word ("Hellfire Retribution — …"). The English rendering prefixes it, the stack reads ": Hellfire Retribution", the game log too; the Studio's Flow shows it as the pipeline title. Name every custom ability that is printed with a word. - **Choosing one die result** ? "Roll two d6 and choose one result. ? equal to that result. Then ? equal to the other result" is `{ effect: "rollDie", amount: 2, sides: 6, chooseResult: true, results: [], then: [...] }` with `{ kind: "dieResult", of: "chosen" }` / `of: "other"` (CR 706.3, 608.2d). - **Repeat this process** ? wrap the process in `{ effect: "repeat", process: true, effects: [...] }` and put `{ effect: "repeatProcess" }` where the text says "repeat this process" (inside an `if` / `ifDone` / `clash` / `mayPay` branch for "If you do / If you win, repeat this process"); `optional: true` is "You may repeat this process any number of times" (CR 608.2c-d). - **Type-changing statics** — "Demon, Devil, and Imp creatures you own have all of those types" is `{ type: "addTypes", to: { mode: "all", filter: { types: ["Creature"], subtypes: ["Demon","Devil","Imp"], owner: "you" } }, subtypes: ["Demon","Devil","Imp"] }`. - **`shareAttachments`** (static) — "Equipment and Auras attached to your commander are treated as if they were attached to ~ as well": `{ type: "shareAttachments", to: { mode: "all", filter: { isCommander: true, controller: "you", other: true } } }` (`with` defaults to the source). Host statics, host-mode effects and host filters then apply to both. - **`playerRule` `manaAsAnyColor` / `manaAsAnyType`** with a spell `filter` — "Demon, Devil, and Imp spells can be cast with mana of any color". - **Free attach / put onto the battlefield attached** — `attach` with `what: { mode: "choose", filter: {…} }`, or `moveTo` … `destination: "battlefield", attachedTo: { mode: "self" }` for an Aura from hand. Offer alternatives as `modes` on the trigger. - **Enchanted player** (Curses, CR 303.4) — the `enchantedPlayer` player selector ("enchanted player draws a card"), trigger `damageTo: "enchantedPlayer"` and the attack-recipient relation `enchantedPlayer` resolve to the player the Aura is attached to. "Whenever a player attacks enchanted player with one or more creatures" is `attacks` + `oneOrMore` + `by: "any"` with the enchanted-player recipient. - **Your team** (CR 810.2) — the `yourTeam` player selector and filter `controller: "yourTeam"` ("creatures your team controls"). Outside Two-Headed Giant it is exactly you. - **"A spell or ability an opponent controls causes you to discard"** (CR 701.9a) — `discards` (and `zoneChange`: Sacred Ground) trigger with `causedBy: "opponent"`; the engine records the controller of the resolving spell or ability, and discards paid as costs have no cause. The same cause on a replacement — `{ replaces: "event", event: "toGraveyard", to: self, discarded: true, causedBy: "opponent", zone: "battlefield" }` — is Obstinate Baloth's "put it onto the battlefield instead of putting it into your graveyard". - **"Exile cards until you exile a …"** — `digTop` with `until: { subtypes: [...] }`, `restTo: "exile"`, and `picks: [{ take: 1, order: "first", filter, then: [...] }]` to act on the found card. - **Life or other payments measured at resolution** — `mayPay` with `cost: { payLife: { kind: "affected", property: "manaValue" } }`; the engine fixes the number as the ability resolves and asks "Pay 5 life?". - **"Put it into the command zone; it costs {2} less"** — `moveTo` … `destination: "command", link: true`, a `playerRule` `castLinkedExile` (or `playLinkedExile`) so the linked card may be cast from there (no commander tax), and a `costModifier` with `filter: { linkedToSource: true }, amount: -2`. - **"You may have the damage dealt to another creature instead" (once per turn)** — a damage replacement with `optional: true`, `firstEachTurn: true` and `redirectTo: { mode: "choose", filter: {…} }`; the controller picks the recipient as the damage would be dealt. - **"When ~ becomes the target of a spell or ability, you may change that target"** — a `becomesTarget` trigger (`filter: { self: true }`, `onceEachTurn: true`, `optional: true`) whose `retarget` targets `{ of: "spellOrAbility", mode: "triggeringOther" }` with `to: { mode: "choose", filter: {…} }`. - **"When your commander dies"** — `{ event: "dies", filter: { isCommander: true, controller: "you", other: true } }`; permanent self-changes use `modifyPT` / `grantAbility` with `duration: "permanent"`. - **"End the turn."** — `{ "effect": "endTurn" }` (CR 716): exiles every object on the stack including the card itself, removes all creatures from combat, checks state-based actions and skips straight to the cleanup step — "at the beginning of the end step" abilities do not trigger that turn. Later effects of the same spell still resolve ("End the turn. At the beginning of your next end step, you lose the game."). - **"This ability triggers only once."** — `trigger.onlyOnce: true`: once per object across turns and controllers; leaving and returning makes a new object that can trigger again (CR 400.7). `onceEachTurn` is the per-turn limiter. - **Trigger limits** — `trigger.maxTriggersPerTurn` limits total triggers to the stated count each turn. A campaign Augment can use `trigger.oncePerBattle` to track its use on a physical card even if it leaves and returns. - **"Its owner puts it on their choice of the top or bottom of their library"** — `moveTo` … `destination: "library", position: { chooser: "owner" }`; "put it on *your* choice of the top or bottom of its owner's library" is `position: { chooser: "you" }`. The chooser is asked as the effect resolves, once per owner's library. - **"~ assigns no combat damage this turn"** — `restrict` … `restriction: "assignsNoCombatDamage", duration: "endOfTurn"`: the creature stays attacking or blocking and deals no combat damage (CR 510.1), unlike removing it from combat. - **"Target creature can't be blocked this turn except by Walls" / "It can't be blocked by creatures of that color this turn"** — `restrict` … `restriction: "cantBeBlocked"` with `exceptBy: { subtypes: ["Wall"] }` or `by: { colors: … }` (CR 509.1b): only the matching blockers are forbidden (or allowed); the filters read the resolving ability (its chosen color / player), and a `mode: "all"` set stays dynamic (CR 611.2c). - **"The player or planeswalker it's attacking" / "… that creature is attacking"** — the target `{ of: "any", mode: "attacked" }` (CR 506.2, 508.1b): in an attack trigger, the player, planeswalker or battle the attacker was attacking when it attacked (it still applies after the attacker leaves combat; a permanent that changed zones is a new object, CR 400.7); otherwise what the source (`attacker: "self"`, the default) or the triggering creature (`attacker: "triggering"`) is attacking now ("Whenever this creature becomes blocked, it deals 1 damage to the player or planeswalker it's attacking"). `filter` names the permanent half (`{ "types": ["Planeswalker"] }`). - **"Players can't gain life this turn"** — the one-shot `playerRule` with `rule: "cantGainLife"`, `who: "eachPlayer"`, `duration: "endOfTurn"` (CR 119.7). - **"Target unblocked attacking creature becomes blocked"** — `{ effect: "becomeBlocked", target }` (CR 509.1h): the attacker becomes blocked with no blockers, its "becomes blocked" abilities trigger, and without trample it assigns no combat damage. - **"Shuffle the cards from your hand into your library, then draw that many cards"** — putting cards into a library is a recorded action: `moveTo` … `destination: "library"` then `{ "kind": "doneThisWay", "of": "putIntoLibrary" }`. For "each player shuffles …, then draws that many", give the count `filter: { owner: "current" }` so each player counts the recorded cards they own — the same composition serves "each player discards their hand, then draws that many" (`of: "discarded"`). - **"If it shares a creature type with ~, you may reveal it. If you do, …"** (kinship) — the looked-at card is the previous selection; test it with `{ kind: "affectedMatches", filter: { sharesWithSource: "creatureType" } }` and nest the optional and its rider inside the `if`. - **"Choose one that hasn't been chosen (this turn) —" on a trigger** — `modeHistory: "game"` / `"turn"` on the triggered ability (the same field activated abilities use): modes already chosen by this object are no longer offered, recorded as the ability goes on the stack. A head with two event alternatives ("Whenever ~ attacks or becomes the target of a spell, choose one —") is two triggered abilities sharing the same `modes`. - **"Exile it with three time counters on it and it gains suspend"** — `exile`, `addCounters` (`counter: "time"`) and `{ "effect": "suspendCard", "target": … }` on the exiled card (`thisWay: exiled`): the card is a suspended card (CR 702.62c) whose owner removes a counter each upkeep and casts it free when the last leaves. "If it doesn't have suspend, it gains suspend" is the same effect — a card in exile with time counters is suspended either way. - **"The exiled card" after an exile cost** — `{ "of": "object", "mode": "thisWay", "action": "exiled" }`: the engine seeds a resolution's "exiled this way" set with the cards exiled to pay that activation or spell (CR 607.2c), so "{2}, Exile a nonland card from your hand: Put four time counters on the exiled card" acts on this activation's card, never on cards exiled by earlier activations. - **"Return it to the battlefield under an opponent's control"** — `moveTo` … `controller: "opponent"`: the controller picks an opponent as the effect resolves (CR 608.2d); with one opponent nothing is asked. - **"If enchanted creature would be destroyed or exiled, instead …"** — one replacement watching two events: `{ replaces: "event", event: "destroy", orEvents: [{ event: "leavesBattlefield", toZone: "exile" }], to: { of: "object", mode: "host" }, instead: [...] }` (CR 614.1a). `toZone` tells exile apart from every other way of leaving (hand, library, graveyard); "destroyed" is the destroy event (CR 701.8, lethal damage included) — not a sacrifice, not 0 toughness. With no `zone` written the creature never leaves and the program runs instead. "Transform ~, then that creature phases out" puts `transform` first: an Aura that transformed into a creature is no longer an Aura, so it doesn't phase out with the creature (CR 702.26g) and becomes unattached (CR 704.5p). - **"If ~ would leave the battlefield, return it to the battlefield under an opponent's control instead"** — a `leavesBattlefield` replacement on `self` whose `instead` is `moveTo` the `replaced` permanent with `destination: "battlefield", controller: "opponent"`: it never goes to another zone (no dies or leaves abilities trigger), but it returns as a new object (CR 400.7) — damage, counters, Auras and effects on it are gone and its enters abilities trigger. It applies again to the next event (CR 614.5), so the card keeps changing hands. "Target opponent" in a replacement is an opponent of the controller's choice — static abilities and their replacement effects don't target (CR 115.1). - **"~ deals 0 combat damage to its owner"** — `{ replaces: "event", event: "damage", from: { of: "object", mode: "self" }, toPlayer: "owner", damageKind: "combat", set: 0 }`: a replacement, not prevention (CR 615), so "damage can't be prevented" doesn't stop it; trample still assigns past its blockers and the part assigned to its owner becomes 0 (CR 120.8: 0 damage is no damage). Damage to the owner's planeswalkers and to other players is dealt normally. - **"These counters can't be put on ~ by any other means"** — a `putCounters` replacement `{ to: { of: "object", mode: "self" }, counter: "adaptation", from: { of: "object", mode: "all", filter: { other: true } }, prevent: true }`, read back as "Adaptation counters can't be put on ~ except by its own abilities": proliferate and every other spell or ability are stopped. A transforming permanent keeps its counters (it doesn't become a new object, CR 712.18), so "the back face begins with as many counters as the front face had" needs nothing at all. - **"Gains protection from the card type of your choice"** — `{ effect: "choose", kind: "cardType", options: ["Artifact", "Creature", …], inline: true }` followed by `grantKeywordAbility` with `keywordAbility: { keyword: "protection", from: { chosenType: true } }`; the type is fixed as it resolves (CR 608.2d). "Until the next turn ends" is `duration: "untilEndOfNextTurn"`, "until the stack resolves" is `untilStackEmpty` (it ends the next time a player would receive priority with an empty stack), and "Once per turn" is `oncePerTurn: true` on the activated ability. - **"Crews Vehicles as though its power were 2 greater"** — the static `{ type: "crewPowerBonus", to, amount: 2 }`, with `saddle: true` for "saddles Mounts and crews Vehicles …" (the Pilot tokens); crew and saddle totals read the bonus (CR 702.122, 702.172). - **"When ~ dies, … return it to the battlefield"** — plain `moveTo` … `target: { mode: "self" }`: the engine binds a self reference after a dies / leaves / exiled / sacrificed / discarded / cycled head to the card in the zone the event moved it to and finds nothing once it has moved again (CR 400.7f) — a response that exiles the card from the graveyard makes the return do nothing, without any extra vocabulary. - **"Ward—Pay life equal to this creature's power"** — a ward cost is any `cost`, not only mana: `{ keyword: "ward", cost: { payLife: { kind: "sourcePower" } } }` (likewise `discard`, `sacrifice`, …). "This creature" in the cost is the warded permanent — the engine fixes the amount in *its* context as the ward trigger resolves (CR 702.21a), so a 7-power Wurm asks for seven life whatever targeted it. - **"Conjure a random card from ~'s spellbook" / "Draft a card from ~'s spellbook"** — the card's `spellbook` field holds the names (stock cards carry curated data; a custom card lists its own); `draft` offers three, `{ "effect": "conjure", "choices": [...], "chooseAtRandom": true, "destination": "hand" }` picks one uniformly. A two-faced card is named by its front face or its full "Front // Back" name — both resolve. - **"Choose target creature you control and target creature you don't control. … Then those creatures fight each other."** — a *declared* target: the declaring sentence is `{ "effect": "choose", "kind": "object", "selections": [A, B] }` (one target: `"target": A`) where every selector is `mode: "chosen"` with a `slot` ("declared-1", "declared-2"); each later clause names the same creature by repeating the selector with its slot — `fight` with `what: A` and `target: B`, a conditional pump on A — and the engine prompts once per slot (CR 601.2c), whether or not the clause that first names it runs. "That creature's power" with nothing acted on yet is `{ "kind": "aggregate", "op": "sum", "property": "power", "target": A }` — a value may read any selection (a slot, `affected`, `triggering`, `host`, `self`) and never prompts; a chosen target inside a value must carry a slot the ability declares. - **"Reveal cards from the top of your library until you reveal a nonland card. That creature gets +X/-X until end of turn, where X is that card's mana value. Put all cards revealed this way on the bottom of your library in any order."** — `digTop` with `until`, `reveal`, `restTo: "bottom"`, `restOrder: "chosen"` and one pick `{ take: 1, order: "first", filter, then: [...] }`: the continuation runs with the found card as `affected` (`{ kind: "affected", property: "manaValue" }`) and, left in the library, the card goes to the bottom with the rest; "~ deals damage to any target equal to that card's mana value" inside the pick is a real target of the spell — the engine declares targets inside dig picks while casting. - **Tiered** — `{ "keyword": "tiered" }` plus a spell ability with `chooseMin: 1, chooseMax: 1` whose `modes` each carry a `cost` (`"Thundara — {3} — …"`): exactly one tier is chosen as the spell is cast and its mana is paid on top of the mana cost (CR 702.182); spree uses the same mode costs with one-or-more. - **"Triple target creature's power and toughness until end of turn"** — `{ "effect": "double", "what": "powerAndToughness", "factor": 3, … }`: +X/+X where X is twice the current value (CR 701.10); `factor` works for counters the same way. - **"You may cast this spell as though it had flash if you pay {2} more to cast it"** — the `castAsFlash` player rule with `extraCost: { mana: "{2}" }` (and `filter: { self: true }`): the surcharge is part of the total cost only when the permission is what allows the cast — at sorcery speed the spell costs its printed mana (CR 601.2f). - **"Flashback {8}{B}{B}. This spell costs {X} less to cast this way, where X is …"** — the keyword plus a static `costModifier` on `{ self: true }` under `condition: { kind: "castWith", alternative: "flashback" }` with `amount` −max(0, X): the engine reads the way the spell would be cast while checking whether it can be cast at all, so the reduced flashback is offered when it is affordable. "The greatest mana value of a commander you own on the battlefield or in the command zone" is an `aggregate` over two `sets` (one description, two zones). - **"Target opponent exiles cards from the top of their library until they exile a nonland card. You may cast that card without paying its mana cost."** — the same `digTop` with `who` naming the examining player (`"target"` + a player target, `"eachOpponent"`, `"eachPlayer"`, `"affectedController"` for "its controller" after "destroy target creature"): the digger owns the library and finds the card; the pick's `then` runs for *your* benefit (`castFree` by the effect's controller), and "they may cast that card" is `castFree` … `who: "current"` — inside a per-player examination `current` is the digger (CR 608.2h). "You may cast any number of spells from among those nonland cards" after an each-opponent dig is one `castFree` over `{ mode: "choose", action: "exiled", zone: "exile", filter: { notTypes: ["Land"] }, max: "any" }`; `chooser: "thatPlayer"` makes the digger's find enter under their control (Polymorph), `controller: "you"` on the pick takes it (Curse of Unbinding); `link: true` makes every card the examination exiles a card "exiled with" the source. - **"Flashback—{1}{U}, Pay 3 life." / "Kicker—{2}{R}, Sacrifice a land." / "Equip—Pay {3} or remove a counter from this Equipment."** — a keyword's `cost` is a complete cost, not only mana (CR 118.2): `{ mana: "{1}{U}", payLife: 3 }`, `{ mana, sacrifice: {…} }`, `{ oneOf: [{ mana: "{3}" }, { removeCounters: { amount: 1 } }] }`, `{ reveal: { colors: ["W"] } }` (Morph—Reveal a white card), `{ payCounters: { counter: "energy", amount: 3 } }`. - **Beam me up** — `{ keyword: "beamMeUp", cost }`: cast from your graveyard for that cost if you also return a creature you control to its owner's hand (the return is an additional cost, CR 118.8), then the spell is exiled as it leaves the stack (as flashback); the permission is offered only while you control a creature to return. - **"If this ability has been activated four or more times this turn, …"** — `{ kind: "activationsThisTurn" }`: the resolving activated ability's activations this turn, counting this one (CR 602.2, 608.2h) — compare it, or use it as an amount. - **"It deals that much damage to each other opponent"** — a player target's `exceptPlayer`: `{ of: "player", mode: "all", player: "eachOpponent", exceptPlayer: "triggeringPlayer" }` is every opponent but the one the ability triggered for; any player selector may be excluded. - **Excess damage (CR 120.4a)** — the engine measures damage beyond lethal as it is dealt (toughness less damage already marked, one from a deathtouch source, loyalty, defense). `dealDamage` … `excessTo: "controller"` is "Excess damage is dealt to that creature's controller instead" (the creature is dealt only lethal; its controller the rest, at the same time); `{ kind: "excessDamageThisWay" }` is "the amount of excess damage dealt this way" and, compared with 0, "if excess damage was dealt this way". - **"At end of combat, if this creature attacked or blocked this combat, remove a +1/+0 counter from it"** — `{ kind: "sourceThisTurn", did: "attackedOrBlocked", combat: true }` reads this combat phase only (CR 506.1; a second combat starts clean); every "+X/+Y" counter kind changes power and toughness by X and Y per counter (CR 122.1a). **"This ability can't cause the total number of +1/+0 counters on this creature to be greater than four"** is `addCounters` … `maxTotal: 4`: an "up to X" choice is bounded by the room left and a fixed amount is cut to it. - **"That creature is a black Zombie in addition to its other colors and types"** — after a return to the battlefield, `becomeType` (`subtypes: ["Zombie"]`) and `becomeColor` (`colors: ["B"]`) on `{ mode: "created" }` with `duration: "permanent"` — "is" after an entry is the same characteristic-setting effect as "becomes". - **"… until this card is cast from exile" / "until an opponent becomes the monarch"** — an event-bound duration: `duration: { untilEvent: { event: "castSpell", filter: { self: true }, from: "exile" } }` (any trigger spec; `{ event: "becameMonarch", by: "opponent" }`). The engine screens events against the effect's source with its controller fixed on resolution and ends the effect the moment the event happens (CR 611.2a) — it never restarts. Pair it with **"You may cast this card for as long as it remains exiled"** after an "Exile this card from your hand" cost: `exileMayPlay` on `{ mode: "thisWay", action: "exiled" }` with `until: "forever"` (and `castOnly`) — the card the cost exiled is this payment's exiled card (CR 400.7i), and a card already in exile keeps its identity. - **"Draw a card and reveal it."** — `drawCards` … `reveal: true`: the drawn card is revealed and becomes the latest selection, so "remove a number of loyalty counters equal to that card's mana value" reads `{ kind: "affected", property: "manaValue" }` and "if it's a land card, discard it" is `if` + `affectedMatches` + `discard` … `cards: { mode: "affected" }`. - **"Target player can't play lands this turn" / "Your opponents can't gain life this turn" / "that player can't gain life for the rest of the game" / "The "legend rule" doesn't apply to permanents you control this turn"** — the one-shot `{ "effect": "playerRule", rule, who | target, duration }` takes the prohibitions of the static `playerRule` (`cantGainLife`, `cantLoseLife`, `lifeCantChange`, `cantLoseGame`, `cantWinGame`, `cantSearchLibraries`, `cantPlayLands`, `cantDrawCards`, `ignoreLegendRule`); the affected players are fixed on resolution and the rule lasts this turn, until your next turn or (`"permanent"`) the rest of the game (CR 611.2a, 611.2c). Consecutive prohibitions print as one sentence joined by "and". - **"The next instant or sorcery spell you cast this turn has storm" / "… has cascade" / "… has convoke" / "… has affinity for artifacts"** — `{ "effect": "nextSpellHas", filter, keywordAbility }`: until end of turn the next matching spell its controller casts has the keyword ability, already while being cast (cost aids apply, CR 601.2f), and its cast triggers trigger; each such effect is used up by one spell and non-matching spells don't use it (CR 611.2). Two of them print "the next instant spell and the next sorcery spell you cast this turn each have cascade". - **"The next spell you cast this turn costs {1} less to cast" / "Face-down spells you cast this turn cost {1} less to cast" / "Until your next turn, … spells that player casts cost {2} less to cast"** — `{ "effect": "costModifier", amount, filter, next, who | target, duration }`: a resolved spell or ability changes the generic cost of matching spells the affected players cast (signed amount, negative = less), fixed on resolution, until end of turn or until your next turn (CR 601.2f, 611.2a). With `next` each affected player's next matching spell uses it up.- **"Clash with an opponent. If you win, …. Otherwise, that player gains control of enchanted creature."** — the `clash` branches run with the clashing opponent as `current`: "that player" there is `{ of: "player", mode: "all", player: "current" }` (the earlier selections stay the history — "that creature's controller" after a damage sentence still means the creature's controller). - **"If you've committed a crime this turn" / "if you haven't cast a spell from your hand this turn"** — turn history `{ "kind": "thisTurn", "event": "crimesCommitted" }` counts crimes (one per spell, ability or trigger that targets an opponent, anything they control or a card in their graveyard, CR 700.13); "a spell from your hand" is the cast snapshot's `filter: { "castFrom": "hand" }` (CR 601.2a). - **"Clash with an opponent. If you win, …. Otherwise, that player gains control of enchanted creature."** — the `clash` branches run with the clashing opponent as `current`: "that player" there is `{ of: "player", mode: "all", player: "current" }` (the earlier selections stay the history — "that creature's controller" after a damage sentence still means the creature's controller).- **"You may reveal cards from the top of your library until you reveal a creature card. (If you do, ) put that card …"** and **"Sacrifice ~. If you do, reveal cards from the top of your library until …. Put that card …"** — an optional examination is `optional` → `digTop`; a conditional one is `ifDone` with the whole examination (its disposition sentences included) in the branch. - **"Whenever you tap a land for mana, add an additional {G}" / "Whenever enchanted land is tapped for mana, its controller adds …" / "Whenever a player taps a land for mana, that player adds one mana of any type that land produced"** — the trigger event `tappedForMana` (CR 605.1b): a permanent's {T} mana ability resolved; `filter` names the tapped permanent (`{ host: true }` for the enchanted land, `{ subtypes: ["Swamp"] }`), `by` who tapped it, and the context carries the mana it made — `{ "effect": "addMana", "mana": "{produced}" }` is "one mana of any type that land produced", `who: "triggeringController"` its controller. A targetless trigger that adds mana is itself a mana ability: it resolves at once, never on the stack, and the payment planner counts it (one enchanted Forest pays {1}{G}); anything else triggering on the event — "remove a +1/+1 counter from this creature", Manabarbs' damage — goes on the stack like any trigger. A plain tap that gained extra mana can no longer be taken back. - **"If you tap a permanent for mana, it produces twice as much of that mana instead" / "If a land is tapped for mana, it produces {B} instead of any other type and amount" / "… produces colorless mana instead of any other type"** (Mana Reflection, Contamination, Damping Sphere, Reality Twist, Pale Moon) — a mana-production replacement (CR 614.1a, 106.1): `{ "replaces": "event", "event": "addMana", "tappedForMana": true, … }` with `from` naming the tapped permanent (`{ filter: { types: ["Land"] } }`), `by`/`toPlayer` whose tap ("you tap" is `by: "you"`; "a land is tapped" is `toPlayer: "eachPlayer"`) and one of four shapes: `manaMultiply: 2` (twice as much of *that* mana — the colors stay), `manaExact: "{B}"` ("instead of any other type and amount" — the whole production is replaced), `manaColor: "C"` ("instead of any other type" — the amount stays; `"any"` is "a color of your choice"), or `manaExact: "{any}{any}{any}"` with `manaOneColor: true` ("three mana of a color of your choice"); `minAmount: 2` is "tapped for two or more mana". A list ("Plains produce {R}, Swamps produce {W}, …") is one replacement per subtype; "Until end of turn, if you tap a land for mana, …" is the same replacement as an `{ "effect": "replacement", "duration": "endOfTurn" }` one-shot. The engine replaces the production itself — not a trigger after it — so the payment planner offers the replaced mana (a Forest under Contamination pays {B} only; Mana Reflection's Sol Ring pays {C}{C}{C}{C}), "twice as much" of a multi-color choice is decided before doubling, and only the tapped permanent's own production is replaced — a triggered mana ability's mana (Wild Growth's {G}) is the Aura's, not the land's, and stays as printed. - **"Return it to the battlefield. It's an Aura enchantment with enchant creature you control and "…", and it loses all other abilities."** (Bronzehide Lion, Old-Growth Troll, Harold and Bob) — `moveTo` … `as: [ … ]`: continuous effects applied to each entering permanent (`{ mode: "affected" }`) *as it enters*, before it chooses what to enchant and before its enters triggers (CR 303.4f, 611.2a) — so it returns as an Aura, picks a legal host as it enters, and with nothing to enchant goes to the graveyard by state-based action (CR 704.5m). Order the parts as the card does: `becomeType` … `replace: true`, then `loseAbilities` ("loses all other abilities"), then `grantKeywordAbility` enchant and the quoted `grantAbility` — later grants outlast the loss (CR 613.7). A quoted static ("Enchanted Forest has '{T}: Add {G}{G}' and '…'") is the Aura's own static; the enchanted permanent named with a subtype is one permanent. - **"All creatures able to block ~ do so"** (Lure, Taunting Elf, Nemesis Mask's "equipped creature", Noble Quarry's "~ or enchanted creature") — the static part `{ type: "lure", to: }` (CR 509.1c): one blocking requirement per creature able to block the affected attacker, maximised with every other requirement at declare blockers — no able creature may be left out, an unable (tapped) creature is never required, and the lured attacker is assigned before other attackers. `blockers` narrows the kind: "All Walls able to block ~ do so" is `blockers: { subtypes: ["Wall"] }`. A trailing "…, and all creatures able to block it do so" is one more part of the same static; the one-shot "All creatures able to block target creature this turn do so" stays the `mustBlock` effect with `attacker`. - **"This creature loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {W} to end this effect."** (Licids) — three primitives, not one card-shaped effect. `loseAbility` … `ability: "this"` removes the resolving ability from its source (CR 613.1f), leaving an inert slot so the other printed abilities keep their indices; `becomeType` … `replace: true` makes it an Aura and `grantKeywordAbility` gives it `enchant creature`; `attach` puts it on the target, so its "Enchanted creature …" statics reach the host. All of it sits inside `{ "effect": "endable", "cost": { "mana": "{W}" }, "then": [ … ] }` (CR 116.2c): every continuous effect `then` creates is one group, and the controller (or `who`) may take the **end effect** special action whenever they have priority and can pay — the group ends at once, the creature stops being an Aura and comes unattached by state-based action (CR 704.5n); an Aura-Licid whose host leaves goes to the graveyard (CR 704.5m). Durations inside `then` are `"permanent"`. - **"If another Human died under your control this turn" / "if an opponent cast a blue spell this turn" / "if a card left your graveyard this turn" / "if a +1/+1 counter was put on a creature you control this turn" / "as long as a creature attacked this combat"** — turn history is one algebra, not a phrase list: a `thisTurn` value is *event* × look-back `filter` × `who` × `counter` × `combat` × `lastTurn`, compared with `compare`. The engine logs every object event this turn with the object's characteristics **as the event happened** (CR 608.2h — a Human that died as a Human counts even if it is now a Zombie token elsewhere; an entering permanent's snapshot is its final characteristics after layers), so `filter` works on *every* object event: `creaturesDied`, `permanentsEntered`, `permanentsLeft`, `permanentsDestroyed`, `permanentsSacrificed`, `spellsCast`, `spellsCountered`, `cardsDrawn`, `cardsDiscarded`, `cardsExiled`, `cardsLeftGraveyard`, `cardsToGraveyard`, `permanentsToHand`, `creaturesAttacked`, `tokensCreated`, `countersPlaced` / `countersRemoved` (with `counter` for the kind). `who` is the player each event is attributed to (controller for enters / dies / left, caster for spells, owner for graveyard and hand events, the placer for counters); `{ "other": true }` in the filter is "another" (not the source); "an opponent cast three or more spells" is one opponent's count — `{ "kind": "anyOpponent", "condition": { … "who": "you" … } }` — while "an opponent cast a spell" may sum with `who: "eachOpponent"`. `combat: true` restricts to the current combat phase (CR 506.1, 500.8): a creature attacking again in an additional combat counts for that combat but not twice for the turn. Player-only events (`lifeGained`, `lifeLost`, `librariesSearched`, `diceRolled`, …) take `who` but no filter. - **"Each opponent who controls a creature …" / "each player who cast a spell this turn …" / "the player who controls the most creatures …" / "each player other than that player …" / "if a player has seven or more cards in hand"** — players are a selection algebra too. Any player selector has a structured form `{ "kind": , "where": , "except": , "most": , "fewest": }` (CR 608.2h: `where` and the values are read *as each candidate* — "you" inside them is that player): `{ "kind": "eachOpponent", "where": { "kind": "controls", "filter": { "types": ["Creature"] }, "min": 1 } }`, `{ "kind": "eachPlayer", "most": { "kind": "count", "filter": { "types": ["Creature"] }, "player": "you" } }` (ties included — `mostLife` / `mostCardsInHand` are its special cases), `{ "kind": "eachPlayer", "except": "you" }`. The condition `{ "kind": "anyPlayer", "who"?, "condition", "all"? }` is "a player …" / "each player …" over any set the same way (`anyOpponent` is its opponents-only case). Printed back: "each opponent who controls a creature", "the player who controls the most creatures", "a player has seven or more cards in hand". - **"If it was dealt damage this turn" / "an opponent was dealt 3 or more damage this turn" / "noncombat damage was dealt to an opponent this turn" / "damage from a red source" / "if excess damage was dealt this turn"** — `{ "kind": "damageDealt", "to"?, "from"?, "damageKind"?, "excess"?, "combat"?, "lastTurn"? }`: the damage actually dealt this turn (CR 120.1, after prevention and replacement) from the engine's damage log, narrowed by recipient (`to`: a player selector, or an object reference compared by identity — `{ "mode": "self" }` / `{ "mode": "affected" }` / `{ "mode": "triggering" }`; the same incarnation, so a dies trigger's "it" reads the creature that died, CR 400.7), source (`from`: a look-back filter on the source — `{ "self": true }` for "by this creature", `{ "colors": ["R"] }` for "a red source"), `damageKind` ("combat" / "noncombat"), `excess: true` (damage beyond lethal, CR 120.4a) and `combat: true` ("this combat"). It generalises `damageDealtToOpponents`, the `damagedThisTurn` / `dealtDamageThisTurn` flags and the resolution-scoped `excessDamageThisWay`; compare it with 0 for "was dealt damage" / "wasn't dealt damage". - **"Each other creature that shares a creature type with it" / "creatures with power less than that creature's power" / "all Equipment attached to it" / "each creature blocking it"** — filters relative to a selection reference, one field each (CR 608.2h): `sharesWith: { "property": "creatureType" | "cardType" | "permanentType" | "color" | "name" | "manaValue" | "controller", "with": , "negate"? }`, `comparedTo: { "property": "power" | "toughness" | "manaValue" | "powerPlusToughness", "op", "with": , "offset"? }`, `attachedToSelection: `, `combatWith: { "relation": "blocking" | "blockedBy" | "attacking" | "attackedBy", "of": }`. The reference is any selection — `{ "mode": "self" }`, `{ "mode": "affected" }` ("it" / "that creature" after an action), `{ "mode": "triggering" }`, `{ "mode": "host" }`, or a declared target slot (`{ "mode": "chosen", "slot": "that", … }` — the slot makes it a target of the spell, announced once and read by every clause). They subsume `sharesWithSource` / `sharesWithHost` / `sharesWithTarget`, `comparedToSource` / `comparedToTrigger`, `attachedToSource` / `attachedToReference`. A host destroyed earlier in the same resolution still identifies "Equipment attached to it" (the engine keeps the last attachment when a host leaves). - **"That creature's controller draws a card" (after "becomes blocked by a creature") / "that permanent's controller or that player creates a token" / "that player may copy this spell and may choose a new target for that copy" / "that creature's controller creates a token that's a copy of it" / "each player amasses Rats X" / "target opponent sacrifices a creature. If they can't, …" / "for each opponent who controls a creature, …"** — every slot that names a player takes the same `PlayerSelector`, never a closed list: `triggeringOtherController` / `triggeringOtherOwner` are the controller / owner of the event's *other* object (the blocker, the permanent dealt damage, by last known information, CR 603.10); `affectedController` after an "any target" is that player when the reference is a player (the Chain and Chandra wording "that player or that planeswalker's controller"); `copySpell.controller`, `createTokenCopy.who`, `amass.who`, `forEachPlayer.players` and the `ifDone` sacrifice's `who` accept any selector (`copySpell` keeps `"chosenOpponent"` for Demonstrate's resolution-time choice; a resolving spell can copy itself, CR 608.2 — the copy goes on the stack under the named player's control and they may retarget it; a copy token's creator controls it, CR 111.2; `amass` reads its amount as each amassing player). Printed back: "that creature's controller", "that player copies this spell and may choose a new target for that copy", "its controller creates a token that's a copy of …", "each player amasses Rats X", "If they can't, …", "for each opponent who controls a creature, …". - **"You gain 1 life for each card drawn this way" / "for each card revealed this way" / "for each counter put on a creature this way" / "for each counter removed this way"** — the this-way algebra covers draws, reveals and counters too: `{ "kind": "doneThisWay", "of": "drawn" | "revealed" | "countersPlaced" | "countersRemoved", "filter"? }` (CR 609.3 — only what *this* resolution actually did; the counter actions count counters, not objects, so two counters on one creature are 2), and `{ "mode": "thisWay", "action": "drawn" | "revealed" }` selects those cards ("exile the cards revealed this way"). - **"You gain hexproof until your next turn" / "Target player gains shroud until end of turn" / "You gain protection from everything until your next turn" / "You have protection from each of your opponents" / "You have protection from the chosen card name"** — a player can have hexproof, shroud and protection (CR 702.11d, 702.18d, 702.16b–e). A one-shot `grantKeyword` (or `grantKeywordAbility` with a `protection` keyword ability) whose target is a player gives that player the keyword for the `duration`; a static "You have protection from …" is the static part `{ "type": "playerProtection", "who", "from": }` (filters read from the source's controller: "each of your opponents" is `{ "filter": { "controller": "opponent" } }`, "the chosen card name" is `{ "filter": { "chosenName": true } }`). A player with shroud can't be the target of spells or abilities; hexproof stops only opponents' spells and abilities; protection stops targeting by matching spells and abilities, makes Auras from matching sources fall off (a Curse is put into its owner's graveyard), and prevents damage from matching sources unless damage can't be prevented. - **"Until your next turn, your life total can't change and you gain protection from everything. All permanents you control phase out"** (Teferi's Protection) — a `playerRule` effect (`lifeCantChange`, `duration: "untilYourNextTurn"`), a `grantKeyword` "Protection from everything" to `{ "of": "player", "mode": "all", "player": "you" }` with the same duration, and `phaseOut` over `{ "of": "object", "mode": "all", "filter": { "controller": "you" } }`. Auras, Equipment and Fortifications attached to a permanent that phases out phase out indirectly with it, whoever controls them, and phase in only along with it (CR 702.26g–h); everything that phased out directly under a player's control phases in as their untap step begins (CR 702.26a). - **"Spells and abilities your opponents control can't cause their controller to search their library" / "You control your opponents while they're searching their libraries" / "While an opponent is searching their library, they exile each card they find. You may play those cards for as long as they remain exiled, and you may spend mana as though it were mana of any color to cast them"** (Ashiok, Dream Render; Opposition Agent) — the static `playerRule` `cantSearchOwnLibrary` (a search their own effects would make of their own library doesn't happen: an optional one can't be chosen, a mandatory one still shuffles, other effects of the instruction still happen; CR 101.2, 701.23); the static `{ "type": "controlWhileSearching", "who": "eachOpponent" }` (the source's controller makes the choices of those players' searches of their own libraries — what they find, within the instruction, CR 722.2, 722.5, 701.23b; the most recent one applies, CR 722.1a); and the replacement `{ "replaces": "event", "event": "searchLibrary", "toPlayer": "eachOpponent", "ownLibrary": true, "zone": "exile", "then": [{ "effect": "exileMayPlay", "who": "you", "target": { "of": "object", "mode": "affected" }, "until": "forever", "anyMana": "color" }] }` (every card the search finds is exiled instead of going where the instruction puts it — the instruction's other effects and its shuffle still happen but can't see those cards; with several, the player controlling the search picks one, CR 616.1). - **"Flip a coin. If you win the flip, destroy target artifact" / "Clash with an opponent. If you win, …target…" / "Roll a d20. 1—10 | Destroy target creature"** — a target inside a `flipCoin`, `clash` or `rollDie` branch is chosen as the spell is cast or the ability is put on the stack, before the flip or roll (CR 601.2c, 603.3d); every die band shares the same target slot, and the spell fizzles if that target becomes illegal. - **"Create a 1/1 token that's attacking" / "…tapped and attacking"** — `createToken` (and `createTokenCopy`) with `attacking` puts the token onto the battlefield attacking but untapped; add `tapped: true` for "tapped and attacking" (CR 508.4). - **"You may cast it from your graveyard" / "you may cast this card from your graveyard" / "−2: You may cast target red instant or sorcery card from your graveyard"** (Oskar, Syrix, Sproutback Trudge, Chandra) — `castFree` with `payCost: true` casts the card during resolution *paying* its mana cost and additional costs (cost modifiers apply; the effect itself permits the zone and timing is ignored, CR 608.2g, 601.2f–h); if it can't be paid, nothing happens. A self / triggering card in the graveyard carries `zone: "graveyard"` ("cast it from your graveyard"). - **"The owner of target nonland permanent puts it into their library second from the top or on the bottom"** — `moveTo` library with `position: { "chooser": "owner", "options": [{ "fromTop": 2 }, "bottom"] }`: the owner picks one of the listed places (CR 401.4, 608.2d). - **"This ability also triggers if this card is in exile" / "… in your graveyard"** (Accident-Prone Apprentice, Albiorix, Steady Tortoise) — `triggersFrom` as a list (`["battlefield", "exile"]`): the triggered ability functions on the battlefield and in each listed zone (CR 113.6, 113.6k). - **"Return this creature and another target creature to their owners' hands" / "Return enchanted creature and this Aura to their owners' hands"** (Coastal Wizard, Lady Sun, Disappear) — `moveTo` hand with `andSelf: true`: the source moves together with the selected objects (CR 608.2c). - **"This ability costs {1} less to activate for each legendary creature you control" / "{2} less … if you control a Desert" / "{1}{U} less … during your turn" / "X less …, where X is your devotion to Abzan" / "{2} less … if it targets a creature with power 2 or less"** — an activated ability's own cost change is `costModifiers: [{ "amount", "reduceMana"?, "perValue"?, "condition"?, "targets"? }]` on the activated ability, and on the `equip`, `monstrosity`, `adapt` and `specialize` keyword abilities ("Equip {3}. This ability costs {1} less to activate for each other Equipment you control"). `amount` is the signed generic change per unit (negative reduces; a value for "X less, where X is …" is `-1 × max(0, X)`), `perValue` scales it, `condition` gates it (`isYourTurn` for "during your turn"), `reduceMana` is a colored part ("{1}{U} less" is `amount: -1, reduceMana: "{U}"`; beyond the cost's pips of that color the reduction comes off generic, CR 118.7), and `targets` applies it once when any announced target matches (CR 601.2c). Every change, together with all other activation cost changes, is totalled before the zero floor (CR 601.2f, 602.2b); legality checks before targets accept a target-dependent ability if its other costs are payable, and the payment then decides. - **"Whenever one or more creature cards are put into your graveyard from your library, put one of them onto the battlefield"** — a `oneOrMore` `zoneChange` trigger whose effect selects `{ "of": "object", "mode": "choose", "among": "triggering", "zone": "graveyard", "min": 1, "max": 1 }` (CR 603.2c, 608.2d): the choice is made on resolution among the cards of the triggering group that are still where the event put them; "put them onto the battlefield" is `mode: "triggering"` (the whole group). - **"Sacrifice a creature: … If the sacrificed creature was a Human, put a +1/+1 counter on this creature."** — an `if` effect with `{ "kind": "costPaidMatches", "cost": "sacrifice", "noun": "creature", "filter": { "subtypes": ["Human"] } }` (CR 601.2h, 608.2h): the objects sacrificed to pay the spell's or ability's cost are remembered as they last existed on the battlefield, and the condition holds when exactly one was sacrificed and it matches the filter. `noun` only picks the printed word ("the sacrificed permanent was an artifact"); a colour-only filter prints "was red". - **Prismatic (Arena, Alchemy)** — "Mana of any type can be spent to cast prismatic spells." It is the keyword `"Prismatic"` in `keywords`, printed or granted; "It perpetually gains prismatic" after a conjure is `grantKeyword` with `keyword: "Prismatic"`, `duration: "perpetual"` on the `affected` card. While casting, every mana symbol of the spell's cost (and additional costs paid as part of casting) can be paid with mana of any type, including colorless, as with spending mana as though it were any type (CR 609.4b analogue); the amount is unchanged, and mana-spending restrictions on the mana itself still apply. Losing prismatic (perpetually or by losing all abilities in a hidden zone) removes the permission. - **"Conjure a duplicate of target creature card … The duplicate perpetually gains …"** — `conjure` with `copyOf`, then any effect on `{ "of": "object", "mode": "created" }`: conjure records the conjured cards like created tokens, so "the duplicate(s)" names exactly them. - **"Untap target creature an opponent controls and gain control of it until end of turn. … When you lose control of the creature, tap it."** (Ray of Command, Magus of the Unseen, Ogre Geargrabber) — `untap` then `gainControl` on `affected`, and `{ "effect": "delayedTrigger", "about": { "of": "object", "mode": "affected" }, "trigger": { "event": "controlLost" }, "once": true, "effects": [{ "effect": "tap", "target": { "of": "object", "mode": "about" } }] }` (CR 603.7c). `controlLost` fires for the player who stopped controlling the permanent — when a control effect ends or another player gains control — and when it leaves the battlefield under their control. - **Chain cycle: "… Then that player or that permanent's controller may sacrifice a land of their choice. If the player does, they may copy this spell and may choose a new target for that copy."** — `mayPay` with `who: "affectedController"` (a player target is its own "controller") whose `then` is an `optional` with the same `who` around `copySpell` with `controller: "affectedController"` (CR 707.10c): the copy is controlled by the player who paid. - **Cast origin of a spell** — CR 601.2a: object filter `castFrom: ` / `notCastFrom: ` ("counter target spell cast from a graveyard", "target spell that wasn't cast from its owner's hand"). Also filters turn-history cast snapshots: `{ "kind": "thisTurn", "event": "spellsCast", "who": "you", "filter": { "castFrom": "hand" } }` reads "a spell from your hand"; `notCastFrom` reads "spells you've cast from anywhere other than your hand". A spell copied directly on the stack has no cast origin. When an ability copies a card in exile and lets you cast the copy, the cast originates in exile. Zethi’s attack uses `copyCard` with `optional: true` and `payManaCost: true`. Its controller chooses which copies to cast and their order during resolution. - **"… as you cast this spell"** — a cast-time snapshot (CR 601.2i, 608.2h): `{ "kind": "asCast", "value": }` ("where X is the number of creatures on the battlefield as you cast this spell"; with a divided amount the value is read while casting, 601.2d) or `{ "kind": "asCast", "condition": }` ("if you controlled a Faerie as you cast this spell"). Recorded when casting completes, kept by the permanent the spell becomes, inherited by copies (707.10); false / 0 for an object that wasn't cast. "You revealed a Dragon card" (the optional additional cost `reveal`) is `{ "kind": "revealedToCast", "filter": { "subtypes": ["Dragon"] } }`, typically `asCast` of `any` [revealedToCast, controls]. - **"Whenever you put one or more +1/+1 counters on a creature" / "Whenever you put a counter on a creature you don't control"** — the `countersPlaced` trigger with `placedBy: "you"` (any `Relation`), alongside `counter`, `eachCounter` and the subject `filter` (CR 122.1, 609.4): the placer is the controller of the spell or ability whose effect or cost put the counters, which need not be the permanent's controller, so an opponent's effect putting counters on your creature doesn't trigger it. - **"Counter target spell that targets a creature you control" / "… spell or ability that targets you or a creature you control"** — the stack-object target field `stackTargets: { object?: ObjectFilter, player?: Relation }` on `of: "spell" | "spellOrAbility"` targets (CR 115.10, 601.2c): the spell or ability must currently target at least one matching permanent (relative to this ability, so `{ self: true }` is "that targets this creature") or matching player; either part suffices. It is rechecked on resolution like any target restriction (CR 608.2b). - **"Counter target spell unless its controller pays {1} and 1 life" / "… discards their hand" / "… If they do, surveil 2"** — `counterUnlessPays` takes `cost: CostDef` instead of the generic-mana `amount` for any other payment, made by the spell's controller as the effect resolves (CR 118.12, 608.2c), and `ifPaid: EffectDef[]` for "If they do, …", run for the counterspell's controller when the payment is made. - **"Put your choice of a +1/+1, first strike, or trample counter on it"** ? `addCounters.counter` may be a list of counter kinds; the controller chooses one kind for each recipient as the effect resolves (CR 122.1, 608.2d). - **"For each kind of counter on target permanent or player, give that permanent or player another counter of that kind"** ? `addCounterEachKind` adds one counter of every kind already on the target (poison included), with no choice and without proliferating (CR 122.1, 701.34); an `of: "any"` target with `permanents: true` reads "target permanent or player" (CR 115.4). - **"Add one mana of any color among legendary permanents you control" / "For each color among permanents you control, add one mana of that color"** — `addMana` with `mana: "{any}"` and `colorsAmong: { filter, zone?, who?, each? }` (CR 105.1, 106.1a, 608.2h): the colors are those of the matching objects as the ability resolves (`zone: "graveyard", who: "you"` for "legendary creature cards in your graveyard"); with `each: true` one mana of every such color is added. With no such color it adds no mana (CR 106.5). - **"With toughness less than or equal to the number of Islands you control"** — `minToughnessValue` / `maxToughnessValue` on a filter, the toughness twins of `minPowerValue` / `maxPowerValue` (CR 208.1, 608.2h), evaluated for each candidate; "less than" is `{ kind: "math", op: "-", a: …, b: 1 }`. - **"The revealed card's power" / "the exiled card's mana value"** — `{ kind: "costPaid", cost: "reveal" | "exile", property, noun: "card" }`, like `sacrifice` / `discard`: the single card revealed or exiled to pay the cost, with its characteristics as the cost was paid (CR 601.2h, 602.2b, 608.2h). - **"Unless you pay {1} for each card in your hand" / "unless that player pays {X}, where X is this creature's power"** — a resolution-time cost's `genericAmount` value is computed as the instruction resolves and added to its generic mana (CR 107.3, 608.2h). "Counter target spell unless its controller pays {X}, where X is its mana value" reads the targeted spell itself. - **Rooms and doors (Duskmourn)** — a Room is a `layout: "split"` card whose two faces have the Room subtype; each face is a door. On the battlefield the permanent has only the characteristics (name, mana cost, colors, abilities) of its unlocked doors (CR 709.5). Casting one half puts the Room onto the battlefield with that door unlocked; a Room put onto the battlefield any other way has both doors locked. Unlocking a locked door is a sorcery-speed special action that pays that door's mana cost and doesn't use the stack. "When you unlock this door, …" is the trigger `{ "event": "doorUnlocked", "thisDoor": true }` on that face (it also triggers when the door unlocks as the Room enters after being cast); `roomUnlocked` fires once every door is unlocked. "Unlock a locked door of target Room you control" is `{ "effect": "unlockDoor", "target": … }`; "Lock or unlock a door of …" adds `lockOrUnlock: true`. The value `{ "kind": "unlockedDoors", "who": "you" }` counts unlocked doors among Rooms that player controls. - **"As this creature enters, "** — the replacement `{ "replaces": "asEnters", "effects": [...], "condition"?: … }` (CR 614.1c, 614.12): the effects are performed as part of the entry event, before the permanent is on the battlefield, so "sacrifice any number of permanents" / "exile all other creatures" can never select the entering permanent itself. Its own `entersWithCounters` reads the results in the same context: "It enters with a +1/+1 counter on it for each creature sacrificed this way" is `amount: { kind: "doneThisWay", of: "sacrificed" }`. With `condition` the action happens only if it holds as it would enter. - **Day and night set on entry** — "If it's neither day nor night, it becomes day as this creature enters" is `asEnters` with `condition: { kind: "dayNight", is: "neither" }` and the effect `{ "effect": "setDayNight", "to": "day" }` (CR 730.1); `setDayNight` is also "It becomes night." on a spell. "Whenever day becomes night or night becomes day" is the trigger event `dayNightChanges` (CR 730.2): it doesn't trigger the first time the game becomes day or night from neither, unlike `becomesDay` / `becomesNight`. - **"If X is 2 or less, it enters tapped" / "If X is 5 or more, it enters with an additional X +1/+1 counters"** — an `enters` event replacement or `entersWithCounters` with a `compare` condition on `{ kind: "var", name: "X" }`: X is the value chosen for the spell that became this permanent (CR 107.3m), 0 when it wasn't cast. - **"As this creature enters, you may … If you do, it enters with …"** — `asEnters` with an `optional` effect, plus `entersWithCounters` whose `condition` is `{ kind: "compare", a: { kind: "doneThisWay", of: "returned" }, op: ">=", b: 1 }` (or a `any` of that and another condition for "If you do or if you control a Dragon"). "Twice that many" is `{ kind: "math", op: "*", a: 2, b: { kind: "doneThisWay", of: "sacrificed" } }`; "roll X d6 … equal to the total of those results" is `{ kind: "dieResult", of: "total" }`. - **"When you cast a creature spell, that creature enters with an additional +1/+1 counter … on it"** — `{ "effect": "spellEntersWith", "target": { "of": "object", "mode": "triggering" }, "additional": true, "counters": [{ "counter": "+1/+1", "amount": 1 }, …], "tapped"?: true }` (CR 614.1c, 122.6): the counters join the permanent's own entry counters if that spell resolves; a spell that leaves the stack any other way is a new object (CR 400.7) and the effect is lost. Amounts are read as the effect resolves, with "it" being that spell ("where X is the number of colors of mana spent to cast it"). Usually the body of a `oneTimeBoon`. - **"This turn, each creature you control enters with an additional +1/+1 counter on it"** — a floating `{ "effect": "replacement", "duration": "endOfTurn", "replacement": { "replaces": "event", "event": "enters", "to": { "of": "object", "mode": "all", "filter": { … } }, "enterCounters": [{ "counter": "+1/+1", "amount": 1 }] } }` (CR 614.1c, 122.6): every matching object entering while it lasts — cast, put onto the battlefield, or a token — gets those counters on top of its own entry counters. - **"When this creature enters, if the gift was promised, …" / "If the gift wasn't promised, …"** — `{ "kind": "compare", "a": { "kind": "var", "name": "gift" }, "op": ">=", "b": 1 }` (or `"==", 0`) on the permanent's own trigger (CR 702.174): the permanent remembers whether its gift was promised as it was cast; a permanent that wasn't cast, or that changed zones since, never had a gift promised. - **"Whenever one or more cards leave your graveyard" / "Whenever you discard one or more cards" / "those creatures"** — `oneOrMore: true` groups matching objects from one simultaneous event, including `zoneChange`, `exiled`, `discards`, `sacrificed`, `tokenCreated`, `blocks` and `unblocked` (CR 603.2c). Mill, discard, sacrifice and multi-card exile costs preserve that boundary; two separate instructions still produce separate events. `{ "of": "object", "mode": "triggering" }` selects every member of that group, never a later object with the same id after another zone change (CR 400.7). `{ "kind": "triggeringCount" }` is the original group's size, even if a member leaves before resolution; `triggerAmount` remains the damage amount. `youAttack` also retains its declared attackers, excluding creatures later put onto the battlefield attacking. `perPlayer: true` groups discards, sacrifices and token creation by acting player, or attacks by attacked player. Batch conditions are checked after all members are collected; delayed triggers and additional-trigger effects retain the same whole group. - **"Whenever you play a land" / "whenever you activate an ability that isn't a mana ability" / "whenever a creature crews a Vehicle" / "whenever ~ phases out" / "whenever an opponent shuffles their library" / "whenever a spell or ability you control counters a spell"** — trigger events, each fired by the engine at the exact rules moment: `landPlayed` is the special action of playing a land (CR 305.1 — not "a land enters", which a put-onto-the-battlefield also fires), with `by`, a land `filter`, and `from` / `notFrom` for "from exile" / "from anywhere other than your hand"; `activatesAbility` fires after an activated ability is put on the stack (CR 602.2; mana abilities, CR 605, fire it too, so "that isn't a mana ability" is `abilityKind: "nonMana"` and the intervening "…, if it isn't a mana ability, …" is the trigger condition `{ "kind": "triggeringAbilityKind", "abilityKind": "nonMana" }` (CR 603.4); "copy that ability" is `copyAbility` with `{ "of": "ability", "mode": "triggeringOther" }`; and `abilityKind` also narrows to `loyalty` / `boast` / `exhaust` / `ninjutsu` / `powerUp` / `crew` / `saddle` / `cycling`; `filter` is the source, which must be on the battlefield unless it is `self`, CR 109.2); `crews` / `saddles` fire once per creature tapped to pay a Crew / Saddle cost (CR 702.122, 702.171) with the Vehicle / Mount as the trigger's other object (`triggeringOther`); `phasedOut` fires for each permanent that phases out, directly or indirectly with its host (CR 702.26d), and is seen by everything that was on the battlefield just before; `shufflesLibrary` fires whenever a player shuffles their library during the game (CR 701.24 — not the opening shuffle); `countered` fires when a spell is countered (CR 701.6a) with the countering spell or ability's controller as `by` and the countered spell as the triggering object. Printed back in the card's own words, including the merged "Whenever you play a land or cast a spell". - **"Whenever you attack with one or more Zombies"** — "Whenever you attack with one or more …" is `attacks` with `by: "you"` and `oneOrMore: true` (CR 508.1, 603.2c), and "twice that much life" is `{ "kind": "math", "op": "*", "a": 2, "b": { "kind": "triggeringCount" } }`. `triggeringOtherController` pays or is dealt damage as "that creature's controller" (CR 109.4). - **"~ has all activated abilities of all creature cards in all graveyards" / "gains all abilities of those creatures until end of turn"** — `gainAbilitiesOf`, a static (`{ type: "gainAbilitiesOf", to, from, kinds?: ["activated" | "triggered" | "static" | "keyword"] }`, layer 6) or a one-shot with a `target` and a `duration` (Necrotic Ooze, Experiment Kraj, Quicksilver Elemental): `from` is any selection — a zone set, a chosen target, the linked exiled cards (`{ mode: "linked", zone: "exile" }`); each gained ability refers to the object that has it, and nothing gains abilities from itself.- **"If it's the first combat phase of the turn" / "… of your turn"** — the condition `{ "kind": "phase", "is": "firstCombat" }` / `"firstCombatYourTurn"`: true only during the first combat phase begun this turn (CR 500.8, 506.1), so an added combat phase is never "first" and "untap … After this phase, there is an additional combat phase" can't loop; a skipped combat phase never began. Use it as an intervening-if trigger `condition` (CR 603.4) or inside `if` ("If it's the first combat phase of the turn, there is an additional combat phase after this phase"). - **"Separate them into two piles. An opponent chooses one. Put one pile into your hand and the other into your graveyard"** — `separatePiles` over any selection (`target`: the top cards of a library with `mode: "top"`, a graveyard, "those cards" with `mode: "affected"`), with `separator` (who divides: `"you"` / `"opponent"`), `chooser` (who picks), `faceDown` for "a face-down pile and a face-up pile", `reveal`, and per-pile programs `chosen` / `rest` whose `mode: "affected"` is "those cards" (Fact or Fiction, Bend or Break, Brilliant Ultimatum). - **"If enchanted creature would be destroyed, instead transform ~, unattach it, then that creature phases out" / "if ~ would die, instead …" / "if enchanted creature would be exiled, instead …"** — a zone-change replacement whose `instead` is a *program* and which names no `zone`: the move does not happen and the effects run in its place (no dies / leaves triggers fire for a move that never happened, CR 700.4). `{ "replaces": "event", "event": "dies" | "leavesBattlefield" | "toGraveyard", "to": …, "instead": [ … ], "then"?: [ … ] }`; `toZone: "exile"` on `leavesBattlefield` is "would be exiled". - **"Counters can't be put on ~ except by its own abilities" / "these counters can't be put on it by any other means"** — a `putCounters` replacement with `from` (the source of the placing effect): `{ "replaces": "event", "event": "putCounters", "to": { "mode": "self" }, "counter": "adaptation", "from": { "of": "object", "mode": "all", "filter": { "other": true } }, "prevent": true }`. - **"Until the next turn ends" / "until the stack is empty"** — the durations `untilEndOfNextTurn` (whoever's turn it is) and `untilStackEmpty` (the next time a player would receive priority with nothing on the stack). - **"Players can't untap more than two permanents during their untap steps" / "Each spell costs at least {3} to cast" / "Creatures entering the battlefield don't cause abilities to trigger"** — the statics `untapLimit` (`amount`, a `filter` for "more than one land", `who`; the active player picks which untap — Static Orb, Winter Orb, Smoke), `costFloor` (`amount`, spell `filter`, `who` — Trinisphere) and `suppressTriggers` (`events: ["enters" | "dies"]`, a permanent `filter` — Torpor Orb, Hushbringer). - **"No more than two creatures can attack you each combat" / "Creatures can't attack you unless their controller pays {2} for each creature they control that's attacking you" / "you may reselect which player or permanent target attacking creature is attacking"** — the static `attackLimit` (`amount`, `defending`; attacks on that player's planeswalkers don't count, and without `defending` it limits every attacker — Crawlspace, Silent Arbiter); `cantAttack` with `unlessPays` (a cost per creature attacking one of `defending`, with `planeswalkers` also their planeswalkers; `genericAmount` for "{X}, where X is …" — Ghostly Prison, Propaganda, Sphere of Safety): the attacking player pays the total while declaring attackers, or declares again (CR 508.1d, 508.1g-i); and the effect `reselectAttack` (Misleading Signpost: any player other than the creature's controller, or their planeswalker or battle, ignoring attack restrictions and costs; no attack trigger). - **"If this card is in your opening hand, you may begin the game with it on the battlefield" / "You may reveal this card from your opening hand. If you do, …" / "… you may exile it. If you do, …"** — the ability kind `openingHand` (CR 103.6): `action: "battlefield"` (default), `"reveal"` or `"exile"`, a `condition` read when the choice is offered ("if you're not the starting player"), `counters` it begins the game with (Gemstone Caverns' luck counter) and `then` effects that follow at once ("If you do, exile a card from your hand"). The Leylines, the Chancellors. - **"Whenever an opponent draws a card except the first one they draw in each of their draw steps"** — the `drawsCard` trigger's `exceptFirstInDrawStep: true` (Orcish Bowmasters). **"Choose a color. Add an amount of mana of that color equal to your devotion to that color"** — `devotion` with `colors: ["chosen"]` (Nykthos). **"The number of colors in your commander's color identity"** — `{ kind: "commanderIdentityColors" }` (War Room; 0 outside Commander). **"Spend this mana only to cast a creature spell of the chosen type. That spell can't be countered"** — a mana restriction with `uncounterable: true` (Cavern of Souls, Boseiju). **"Draw that many cards minus one"** — `discard` … `drawDiscardedOffset` (Dark Deal). **"Cast it by paying life equal to its mana value rather than paying its mana cost"** — `castFree` … `payLife: { "kind": "affected", "property": "manaValue" }` (Anrakyr the Traveller; always offered as a choice). **"An artifact card with mana cost {0} or {1}"** — the filter `manaCosts: ["{0}", "{1}"]` (Urza's Saga; a card with {X} or no cost does not match). - **"with toughness X or less" / "with total power 6 or less" / "with different names" / "with equal toughness"** — computed bounds and group constraints on a selection. `filter.minToughnessValue` / `maxToughnessValue` take any value (a var, `noted`, a count), resolved when the filter is checked (CR 208.1, 608.2h). On a `target`, `maxTotalPower` caps the chosen objects' summed power, `distinctBy` (`name` / `manaValue` / `controller` / `power`) requires pairwise-different values, and `equalBy` (`toughness` / `power` / `manaValue`) requires one shared value; all are validated on the whole selection when it is made (CR 601.2c, 608.2d), so an illegal group is refused rather than trimmed. - **"Casualty X. The copy isn't legendary and has starting loyalty X." / "If a card you didn't control would be put into an opponent's graveyard from anywhere, exile it instead. During your turn, you may play cards exiled with ~. If you cast a spell this way, pay life equal to its mana value rather than pay its mana cost." / "Whenever an opponent loses life for the first time during each of their turns"** — `{ keyword: "casualty", amount: "X", except: { notLegendary: true, loyalty: { kind: "var", name: "X" } } }`: the caster picks X as they cast (up to the sacrificed creature's power) and the copy is made with the `except` (CR 707.9; `copySpell` takes the same `except`) — Ob Nixilis, the Adversary. An event replacement `toGraveyard` with `to: { mode: "all", filter: { isToken: false, owner: "opponent", controller: "opponent" } }`, `zone: "exile"` and `link: true` exiles the card "with" the source (CR 400.7), and a static `playerRule` `playLinkedExile` with `condition: { kind: "isYourTurn" }` and `payLife: { kind: "affected", property: "manaValue" }` plays those cards for life instead of mana — a mandatory alternative cost (CR 118.9), lands free — Valgavoth, Terror Eater (the same `payLife` on `playFromLibrary` is Bolas's Citadel). A `lifeLost` trigger with `by: "opponent"`, `firstEachTurn: true` and `eventCondition: { kind: "anyPlayer", who: "triggeringPlayer", condition: { kind: "isYourTurn" } }` fires once per opponent's own turn, counting losses before the source arrived (CR 603.2) — Valgavoth, Harrower of Souls. - **"for each of its colors" / "the number of times ~ has mutated" / "your highest commander tax"** — values: `{ "kind": "affected", "property": "colors" }` counts the colors of the object an earlier effect acted on, using last-known information once it has left (CR 105.2, 608.2h); `{ "kind": "triggering", "property": "colors" }` counts the triggering spell's or permanent's colors; `timesMutated` is the number of creature cards merged under the source (CR 702.140); `{ "kind": "commanderTax", "op": "max", "who": "you" }` is {2} per previous cast from the command zone, highest among that player's commanders (CR 903.8). **1b. A registered native ability — only the ids this server ships.** `{ "effect": "native", "id": "", "params": { … }, "text": "" }` (also `{ "type": "native", "layer": "L6" }` as a static part, `{ "kind": "native" }` as a value or a condition, and `filter.native`) names an ability **implemented in the engine** by the game module — cards still contain no code, and a card naming an id the running engine doesn't know is rejected when it is saved and when a game is dealt. The ids that exist are listed, with their `params`, on the `native` page of each kind (`https://drawstep.xyz/wiki/mtg/effects/native.md`, `statics/native.md`, `values/native.md`, `conditions/native.md`) — generated from the registry itself; today: `magic.keepOnePerTypeSacrificeRest` ("for each player, choose one artifact, one creature, one enchantment and one planeswalker they control; then each player sacrifices all other nonland permanents they control" — Tragic Arrogance, Cataclysm). **Never invent an id**: a clause the vocabulary cannot say and no registered native implements goes to rung 2, not to a made-up native. A native that several cards need graduates to a vocabulary node (the engine's own extensibility plan, `research/10-extensibility.md`). - **"Counter target spell … If it was a legendary spell, …" / "for each spell countered this way"** — `{ "kind": "doneThisWay", "of": "countered" }` (with an optional `filter`) reads the spell this effect countered as it last existed on the stack (CR 701.6a, 608.2h). Only spells count; countering an ability isn't recorded, and a spell that couldn't be countered wasn't countered this way. - A spell's `stackRules` apply to that spell and its copies. Use an optional `condition` with the appropriate rules (`cantCounter`, `cantPreventDamage`, `cantCopy`, `splitSecond`). A copy uses its own controller and keeps its announced X and kicker payments. Use `castAnotherNamedSpell` when a resolving spell asks whether its controller cast another spell of a given name this game. For a spell that must come from its controller's hand, use `{ kind: "castFrom", zone: "hand", owner: "you" }`. - **Entry and attachment choices.** The Mimeoplasm's `entersAsCopy.exilePairForCounters` lets its controller exile two creature cards from any graveyards and choose which one to copy. The other card supplies the counter amount in exile. Sanctuary Blade's `asAttaches` stores its color on the Equipment when it attaches to a different creature. A protection grant reads that stored color. - **Casting and activation costs.** For Wayta, `matchingTargetCount` counts distinct targets matching the modifier. For Tezzeret, `firstOfPermanentType` counts earlier activations by that player, including mana abilities. Marshland Bloodcaster's `nextSpellHas` grants an alternative cost using the mana value of the spell being cast. A completed cast uses up the grant even when the player pays normally. - **Multiplayer resolution.** Use `forEachPlayer.atAnnouncement` when a spell or reflexive trigger declares a target for each eligible opponent. Use `shufflePermanentsAndReveal.battlefieldGroups` when each owner's shuffled permanents determine how many cards they reveal and each group of card types enters together across all players. Auras can enchant permanents from an earlier group. - For a choice each player makes as a permanent enters, use an option choice with `who: "eachPlayer"`. A static ability can select controllers by their `choseOption` condition. Each permanent keeps its own choices. - When another sacrifice must share a card type with a permanent just sacrificed, compare against the sacrificed permanent's battlefield characteristics using `sharesWith` and `thisWay`. Use `doneThisWay` with a player selector to check which opponent sacrificed. - For a printed limit on copies in a deck, keep the sentence in the card's Oracle text. The deck builder and validator enforce the self-named allowance. Reserve `tableRuling` for decisions players actually need to adjudicate during play. - For a ceiling on base power or toughness, use `maxBasePower` or `maxBaseToughness`. Combine the two filters with `anyOf` when either characteristic can qualify. Counters and other bonuses to current power or toughness do not change the base values. - For a death-or-command trigger such as Reyhan's, use `fromZones` to distinguish a direct move from the battlefield. Test counters on the departing creature and read the count from its last known state. - Use `boastActivationLimit` for a static change to how many times a creature can boast. Its normal attack requirement and activation costs still apply. After a `discover` effect, `var: discoverDifference` gives the discover number minus the mana value of the card discovered, or zero when no card was discovered. - **"Cast this spell only before the combat damage step"** — spell `onlyIf: { "kind": "phase", "is": "beforeCombatDamage" }`: the beginning phase, the precombat main phase, or the beginning of combat, declare attackers or declare blockers step, while no combat damage step has begun this turn (CR 510); the postcombat main phase and end step never qualify. - **"Seek … from among the top ten cards of your library, then shuffle"** — `seek` with `fromTop` (the candidates are only the top N cards as the effect starts; seeking puts random matching ones into your hand) and `shuffle: true` (shuffle afterwards, CR 701.24). **2. One step the table carries out: the `tableRuling` effect.** When a clause's *timing* is clear (a trigger, an activation, one step of a resolution) but its *action* is not in the vocabulary, keep the ability automated and put `{ "effect": "tableRuling", "text": "" }` where the step belongs (`prompts` adds questions whose answers the table records). The engine runs the trigger, the costs, the targets and the other effects, pauses at that step with the printed text, records the table's outcome and continues. In strict enforced play the step is inert and the card is flagged — never resolved by guesswork. **3. Not a game action: an on-demand table ruling.** Deck-construction and format sentences ("You may have creatures of these types of any color in a deck with ~ as commander") are checked when the deck is built, not during play. Write a standalone `{ "kind": "tableRuling", "ruling": "formatReference", "onDemand": true, "text": "" }` ability: it never pauses casting, entry or resolution; the table records it when someone asks. **4. Last resort: `unparsed`.** Only text that rewrites how *other* cards work with no capturable timing goes verbatim into `unparsed[]`; the card is then shown as partially enforced. Say in your note which rung you used. **No template cards.** A custom card is built from its own printed text, clause by clause, with the primitives above — never by copying another player's card that "looks similar": two cards that share a name or a mechanic routinely differ in a word ("each turn" vs "each combat", "exile" vs "reveal"), and the engine read-back is the check that the JSON says what *this* card says. ## 10. How a card is drawn (display only) Everything under `appearance` is **display only** — the engine never reads it. It decides how the Studio's renderer draws the card: which frame, in which colour treatment, with what art framing, plus flavor text and credits. Leave it out and the card still looks right: the renderer infers a frame from the card's colours, types and layout. **Frame style (`appearance.frame.style`).** Three families are built in and drawn procedurally — `classic`, `modern` and `etched` — original Drawstep designs that work for every layout. A *frame pack* replaces the drawn frame with full-card images: - `"pack:community:"` — one of the **community packs** the server ships in its frames bundle (open **Frame → Frame library** in the Studio to see them, with each pack's credit). They are fan-made recreations of printed Magic frames (M15, 8th Edition, Masterpiece, box-topper …), kept outside the code as unofficial Fan Content so they can be credited or removed on request. - `"pack:"` — a pack **you imported** (Frame library → *Import a pack*). Imported layers are uploaded to your account only; you vouch for the rights to them. A pack is a folder: a `pack.json` beside PNG / WebP images. For each layout it lists one full-card image per colour treatment — the frame with a transparent window where the art goes — optionally a stats plate per treatment, and the `regions` (`[x, y, w, h]` as fractions of the card) where the renderer writes the name and mana cost (`title`), the `type` line, the rules and flavor (`text`), power/toughness or loyalty (`stats`) and the artist / collector line (`foot`). A missing layout falls back to `standard`; a two-colour treatment without its own layer falls back to its first colour, then gold (`M`), then `*`. The full format is documented in `tools/frames/README.md` in the repository; `npm run frames:build` converts Magic Set Editor templates into packs. **Treatment (`frame.treatment`).** Normally derived from the card: `W U B R G`, a hybrid pair such as `WU`, `M` gold for three or more colours, `C` colourless, `A` artifact, `L` land, `V` vehicle. Set it only to override — a colourless-cost card that should look red, a land that should use its colour. **Variant (`frame.variant`).** `standard` (a windowed art box), `extendedArt` (art to the card edges), `fullArt` (the whole card is art behind translucent panels), `borderless`. **Layout (`frame.layout`)** overrides the frame geometry (planeswalker, saga, adventure, split, transform, modal, class, leveler, battle, vehicle, token, basicLand) and is almost never needed — it follows from the card's `layout` and types. **Flavor, artist, collector.** `flavor` is printed in italics under the rules text, `artist` at the bottom left, `collector` ("12/60 · My Cube") at the bottom right. Multi-face cards put per-face `art`, `flavor` and `artist` in `appearance.faces[]` (same order as the card's `faces`; entry 0 is the front). **Art.** The picture is cropped to the frame's **art window**, so compose for that shape: a wide landscape for standard frames, tall for portrait or full-art frames, subject centred, nothing important within 10% of the edges. Pictures should show only the scene — no lettering, borders, mana symbols or card parts; the renderer adds all of those (and image generators botch text). The Studio's art editor crops and positions the picture; the assistant's `generate_image` follows the same rules automatically and picks the output size from the window. **Colour pips, not letters.** Wherever the Studio asks for a colour it shows the five mana pips; in JSON the letters stay `W U B R G` (blue is `U`), as on printed cards. **Fields of `appearance`** | Field | Type | Required | Description | |---|---|---|---| | `frame` | `{ style?: string; treatment?: string; variant?: "standard" \| "extendedArt" \| "fullArt" \| "borderless"; layout?: "standard" \| "planeswalker" \| "saga" \| "adventure" \| "split" \| "transform" \| "modal" \| "class" \| "leveler" \| "battle" \| "vehicle" \| "token" \| "basicLand" }` | no | | | `flavor` | `string` | no | Flavor text, printed in italics under the rules text | | `artist` | `string` | no | Illustration credit, printed at the bottom | | `collector` | `string` | no | Small print at the bottom right, e.g. "12/60 · My Cube" | | `faces` | `({ art?: string; image?: string; flavor?: string; artist?: string })[]` | no | Per-face art, full-card image and flavor for cards with more than one face (same order as `faces`; entry 0 is the front) | **Fields of `appearance.frame`** | Field | Type | Required | Description | |---|---|---|---| | `style` | `string` | no | Frame family: "classic", "modern" or "etched" (built in), "pack:" for a frame pack imported by the player, or "pack:community:" for one of the server's community packs (list them with the Frame library; e.g. "pack:community:m15"). Default classic | | `treatment` | `string` | no | Colour treatment override: W U B R G, two letters for a hybrid pair (WU), M gold, C colourless, A artifact, L land, V vehicle. Default: from the card's colours and types | | `variant` | `"standard" \| "extendedArt" \| "fullArt" \| "borderless"` | no | Art framing: a standard window, art to the card edges, full art behind translucent panels, or borderless full art | | `layout` | `"standard" \| "planeswalker" \| "saga" \| "adventure" \| "split" \| "transform" \| "modal" \| "class" \| "leveler" \| "battle" \| "vehicle" \| "token" \| "basicLand"` | no | Frame layout override; default from the card's layout and types | ## 11. Tokens and token cards A token is made by an effect; a **token card** is a card of its own that *is* that token — its art, its frame, its abilities — which your decks list and the table deals whenever one of your cards creates it. This page covers both: how a `createToken` effect describes what it makes, when to link it to a token card, and how an outside assistant writes the pair. **1. The token is described inside the effect.** The engine has no catalogue of "a 1/1 Soldier": every `createToken` carries a complete `token` object. ```json { "effect": "createToken", "who": "you", "amount": 2, "token": { "name": "Soldier", "types": ["Creature"], "subtypes": ["Soldier"], "colors": ["W"], "power": 1, "toughness": 1, "keywords": ["Vigilance"] } } ``` - `types` defaults to `["Creature"]`; `subtypes`; `colors` (omit or `[]` for colorless); `supertypes` (`["Legendary"]`); `power` / `toughness` — integers or values ("X/X" is `{ "kind": "var", "name": "X" }` on both; "with power and toughness each equal to the number of …" is a `count`, read once as the token is created, CR 111.3); `keywords` (plain ones); `keywordAbilities` (parametrised ones — `enchant`, `equip`, `ward`); `withCounters` ("enters with a +1/+1 counter"). - The token's quoted text — a 1/1 Devil "with 'When this creature dies, it deals 1 damage to any target'", a Treasure's "{T}, Sacrifice this artifact: …" — is the **token's own `abilities`** (the same ability objects a card has, with `filter: { "self": true }` meaning the token), never an ability of the creating card. `abilitiesInFollowingSentence: true` prints them as a following "It has …" sentence. Named tokens such as a Treasure are printed by name; the read-back prints an inline creature token in full ("a 1/1 red Devil creature token with …"), which is the line the Studio holds against the printed text. - The effect's own fields: `amount` (a value — "for each …" is a `count`); `tapped`; `attacking` (`true`, or `"defendingPlayer"`; "tapped and attacking" sets both); `who` / `target` (the player who creates it — "target opponent creates"); `attachedTo` ("create … attached to target creature"); and `token: { "oneOf": [ … ], "chooseAtRandom": true, "excludeControlled": true }` for "create a Food token or a Treasure token" / "one of the following at random you don't already control". - "Create a token that's a copy of …" is `createTokenCopy` (with `except` for "except it's …", `haste`, `tapped`, `attacking`) — a copy of the object, never a `createToken` with the original's characteristics typed in. **2. Predefined tokens the engine ships.** Treasure, Food, Clue, Map and Incubator are the engine's own definitions: name them with `tokenDefId` and nothing else — `{ "name": "Treasure", "tokenDefId": "token-treasure" }` — and the token has its printed ability at the table. The ids are `token-treasure`, `token-food`, `token-clue`, `token-map`, `token-incubator` (the `incubate` effect uses it itself), `token-monster-role` and `token-spirit` (a 1/1 white Spirit with flying). Every other named token — Blood, Powerstone, Gold, Junk, the other Roles — is written inline with its ability spelled out; the read-back still prints it by name. **3. Token cards — your own token definitions.** In the Studio, **New token** in the library panel (or the **Token** box in the Frame panel) makes a card with `layout: "token"` and no `manaCost`: a face, art, a frame, and the token's abilities written exactly as on any card. Its id is assigned when it is saved — `custom::`, say `custom:ed6ec723:devil` — and from then on it is in three places: the **Your token cards…** picker on every `createToken` block, which writes the `tokenDefId` link and fills the spec from the card; the **Tokens** zone of the deck builder, where it is offered first for each creating card in the deck ("Add your token card"); and the table, where a linked `createToken` deals the token card itself — its art, its abilities — rather than the inline spec. **Link and inline, not link or inline.** Always write the inline spec: it is what the read-back prints (a `tokenDefId` with no `types` prints only as "a Devil token"), what a replacement's `tokenFilter` inspects, and what the engine falls back to when the token card is not at the table (deleted, or never shared with that table). Add `tokenDefId` on top when a token card exists or is written alongside; at the table the token card's abilities win over the inline ones, so keep them the same. **4. Writing the pair from outside (ChatGPT, Claude, Gemini …).** An outside assistant cannot know the id a token card will be given, so it writes the reference by name and the server reconciles it on save: - **The token card**: a normal card object with `"layout": "token"`, an `id` that is the lower-case name (`"devil"`), **no `manaCost`**, its `types` / `subtypes` / `colors` / `power` / `toughness` / `keywords`, its `text` and its `abilities`. - **The creating card**: `createToken` with the full inline spec **and** `"tokenDefId": "devil"` — the same slug (`"Devil"`, `"devil-token"` and `"Devil Token"` all resolve; a `custom:…` id you already have is kept as written). - Return both as **two JSON objects** in separate ```json fences; the Studio's **Import** opens one tab each. Save them in either order: when a card is saved the server rewrites every `tokenDefId` that is not a stock id to your token card with that id, that slug or that name (minus "token"), and saving a token card re-links the cards you saved before it. A reference nothing matches is left as written and the inline spec is used (the Studio's picker shows it as "(not in your library)"). - A token the creating card could describe in a line (a vanilla 1/1 Soldier, a 2/2 Zombie) needs no token card; one is worth making when the token has art of its own, text of its own, or several of your cards create it. **Worked example — a creature and the Devil it creates.** Both validate as written; together they are what an outside assistant hands back for the printed card. ```json { "id": "devil", "name": "Devil", "source": "custom", "layout": "token", "types": ["Creature"], "subtypes": ["Devil"], "colors": ["R"], "power": 1, "toughness": 1, "text": "When this creature dies, it deals 1 damage to any target.", "abilities": [ { "kind": "triggered", "trigger": { "event": "dies", "filter": { "self": true } }, "effects": [ { "effect": "dealDamage", "target": { "of": "any" }, "amount": 1 } ] } ] } ``` ```json { "id": "avernus-kennelmaster", "name": "Avernus Kennelmaster", "source": "custom", "layout": "normal", "types": ["Creature"], "subtypes": ["Devil", "Shaman"], "manaCost": "{2}{R}", "colors": ["R"], "power": 2, "toughness": 2, "text": "When Avernus Kennelmaster enters, create a 1/1 red Devil creature token with \"When this creature dies, it deals 1 damage to any target.\"", "abilities": [ { "kind": "triggered", "trigger": { "event": "enters", "filter": { "self": true } }, "effects": [ { "effect": "createToken", "who": "you", "amount": 1, "token": { "name": "Devil", "tokenDefId": "devil", "types": ["Creature"], "subtypes": ["Devil"], "colors": ["R"], "power": 1, "toughness": 1, "abilities": [ { "kind": "triggered", "trigger": { "event": "dies", "filter": { "self": true } }, "effects": [ { "effect": "dealDamage", "target": { "of": "any" }, "amount": 1 } ] } ] } } ] } ] } ``` The engine reads the creating card back as “When Avernus Kennelmaster enters, create a 1/1 red Devil creature token with "When this token dies, it deals 1 damage to any target."” — the printed line, which is what Import checks. Once both are saved, `tokenDefId` is the Devil card's id, the deck builder offers the Devil card for the Kennelmaster, and the table deals it with the Devil's own art. **Tokens in a deck.** The deck builder's **Tokens** zone lists the token cards and stock token proxies a deck wants — display and proxies only; the game creates tokens from the cards' effects. Every custom card you own, token cards included, is in the pool of any table you sit at. ## 12. Cookbook: complex custom cards Patterns for the custom cards that stretch the rules — each a complete card that the engine's gate accepts and its renderer reads back (shown under the JSON), so you can copy the shape and change the details. When a pattern here does not cover a clause, compose it from the axes on **Filters & targets** (`https://drawstep.xyz/wiki/mtg/targets.md`) and **Relationships & references** (`https://drawstep.xyz/wiki/mtg/references.md`), and only then climb the honesty ladder on **Custom mechanics** (`https://drawstep.xyz/wiki/mtg/custom-mechanics.md`: a `tableRuling` step for a clause no primitive expresses — never an approximation). ### Replacing how a permanent leaves the battlefield, by destination Zone-change replacements (CR 614.1a, 614.6) are `{ "replaces": "event", "event": …, "to": , "zone": }`. `event` picks the move: `leavesBattlefield` (any exit — narrow it by destination with `toZone`: "if ~ would be **exiled**" = `toZone: "exile"`), `dies` (battlefield → graveyard), `toGraveyard` (from anywhere — `fromZone` narrows the origin, `discarded` only discards), `enters`. `zone` (+ `position` / `shuffle` for a library) is where it goes instead; `instead: [effects]` with no `zone` replaces the move with other effects (`mode: "replaced"` is the permanent that would have moved — a `moveTo` of it back to the battlefield returns it as a new object); `orEvents` lets one replacement watch several events ("would be destroyed **or exiled**"); `link: true` makes a card moved to exile "exiled with" the source. Shorthands: `diesToExile`, `toGraveyard` with `instead`. #### "If this creature would be exiled, return it to its owner's hand instead." **Slippery Familiar** — printed text: > If this creature would be exiled, return it to its owner's hand instead. ```json { "id": "slippery-familiar", "name": "Slippery Familiar", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Spirit" ], "colors": [ "U" ], "keywords": [], "keywordAbilities": [], "manaCost": "{1}{U}", "types": [ "Creature" ], "power": 2, "toughness": 1, "text": "If this creature would be exiled, return it to its owner's hand instead.", "abilities": [ { "kind": "replacement", "replacement": { "replaces": "event", "event": "leavesBattlefield", "to": { "of": "object", "mode": "self" }, "toZone": "exile", "zone": "hand" } } ] } ``` The engine reads it back as: “If Slippery Familiar would be exiled, return it to its owner's hand instead.” `event: "leavesBattlefield"` + `toZone: "exile"` matches only an exile; dying, bouncing or being put into a library are not replaced. #### "If a nontoken creature an opponent controls would die, exile it instead." **Warden of the Pale Gate** — printed text: > If a nontoken creature an opponent controls would die, exile it instead. ```json { "id": "warden-of-the-pale-gate", "name": "Warden of the Pale Gate", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Spirit", "Cleric" ], "colors": [ "W", "B" ], "keywords": [], "keywordAbilities": [], "manaCost": "{2}{W}{B}", "types": [ "Creature" ], "power": 3, "toughness": 4, "text": "If a nontoken creature an opponent controls would die, exile it instead.", "abilities": [ { "kind": "replacement", "replacement": { "replaces": "event", "event": "dies", "to": { "of": "object", "mode": "all", "filter": { "types": [ "Creature" ], "controller": "opponent", "isToken": false } }, "zone": "exile" } } ] } ``` The engine reads it back as: “If a nontoken creature an opponent controls would die, exile it instead.” `to` is a group (`mode: "all"` + filter); the replacement applies to each matching creature as it would die. #### "If this card would be put into a graveyard from anywhere, shuffle it into its owner's library instead." **Endless Tide** — printed text: > If this card would be put into a graveyard from anywhere, shuffle it into its owner's library instead. ```json { "id": "endless-tide", "name": "Endless Tide", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Elemental" ], "colors": [ "U" ], "keywords": [], "keywordAbilities": [], "manaCost": "{4}{U}{U}", "types": [ "Creature" ], "power": 5, "toughness": 5, "text": "If this card would be put into a graveyard from anywhere, shuffle it into its owner's library instead.", "abilities": [ { "kind": "replacement", "replacement": { "replaces": "toGraveyard", "instead": "shuffleIntoLibrary" } } ] } ``` The engine reads it back as: “If Endless Tide would be put into a graveyard from anywhere, shuffle it into its owner's library instead.” The `toGraveyard` shorthand covers every origin (hand, library, stack, battlefield). #### "If enchanted creature would be destroyed or exiled, instead it phases out." **Veil of Second Chances** — printed text: > Enchant creature > If enchanted creature would be destroyed or exiled, instead it phases out. ```json { "id": "veil-of-second-chances", "name": "Veil of Second Chances", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Aura" ], "colors": [ "W" ], "keywords": [], "keywordAbilities": [ { "keyword": "enchant", "target": { "of": "object", "filter": { "types": [ "Creature" ] } } } ], "manaCost": "{1}{W}", "types": [ "Enchantment" ], "text": "Enchant creature\nIf enchanted creature would be destroyed or exiled, instead it phases out.", "abilities": [ { "kind": "replacement", "replacement": { "replaces": "event", "event": "destroy", "orEvents": [ { "event": "leavesBattlefield", "toZone": "exile" } ], "to": { "of": "object", "mode": "host" }, "instead": [ { "effect": "phaseOut", "target": { "of": "object", "mode": "replaced" } } ] } } ] } ``` The engine reads it back as: “Enchant creature” · “If enchanted creature would be destroyed or exiled, instead that creature phases out.” One replacement, two events: `event: "destroy"` plus `orEvents: [{ "event": "leavesBattlefield", "toZone": "exile" }]` (every other match and result field is shared; it still applies once per event). `instead` with no `zone` replaces the event with effects; `mode: "replaced"` is the creature that would have been destroyed or exiled. #### "If this creature would leave the battlefield, return it to the battlefield under an opponent's control instead." **Wandering Revenant** — printed text: > If this creature would leave the battlefield, return it to the battlefield under an opponent's control instead. ```json { "id": "wandering-revenant", "name": "Wandering Revenant", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Spirit" ], "colors": [ "B" ], "keywords": [], "keywordAbilities": [], "manaCost": "{3}{B}", "types": [ "Creature" ], "power": 4, "toughness": 4, "text": "If this creature would leave the battlefield, return it to the battlefield under an opponent's control instead.", "abilities": [ { "kind": "replacement", "replacement": { "replaces": "event", "event": "leavesBattlefield", "to": { "of": "object", "mode": "self" }, "instead": [ { "effect": "moveTo", "target": { "of": "object", "mode": "replaced" }, "destination": "battlefield", "controller": "opponent" } ] } } ] } ``` The engine reads it back as: “If Wandering Revenant would leave the battlefield, return it to the battlefield under an opponent's control instead.” `instead` with a `moveTo` of the replaced permanent back to the battlefield: it returns as a new object (CR 400.7 — counters, damage and attachments are gone) under the control of an opponent its controller chooses. ### Returning cards under someone else's control `moveTo` with `destination: "battlefield"` takes `controller`: `you` (default), `owner`, or `opponent` (an opponent the controller chooses as the effect resolves); `tapped`, `attacking`, `withCounters`, `transformed` and `as` (continuous effects applied as it enters) shape the entry. `gainControl` changes control of a permanent already on the battlefield (`controller` = a player target; a `duration` bounds it); `exchangeControl` swaps two. #### "When this creature dies, return it to the battlefield under the control of an opponent of your choice." **Restless Gift** — printed text: > When this creature dies, return it to the battlefield under the control of an opponent of your choice. ```json { "id": "restless-gift", "name": "Restless Gift", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Spirit" ], "colors": [ "B" ], "keywords": [], "keywordAbilities": [], "manaCost": "{1}{B}", "types": [ "Creature" ], "power": 3, "toughness": 2, "text": "When this creature dies, return it to the battlefield under the control of an opponent of your choice.", "abilities": [ { "kind": "triggered", "trigger": { "event": "dies", "filter": { "self": true } }, "effects": [ { "effect": "moveTo", "target": { "of": "object", "mode": "triggering", "zone": "graveyard" }, "destination": "battlefield", "controller": "opponent" } ] } ] } ``` The engine reads it back as: “When Restless Gift dies, return that card to the battlefield under an opponent's control.” The dying card is the triggering object, now in the graveyard (`mode: "triggering"`, `zone: "graveyard"`); `controller: "opponent"` asks for the opponent on resolution. #### "Gain control of target creature for as long as you control this creature." **Puppeteer of Rust** — printed text: > When this creature enters, gain control of target creature an opponent controls for as long as you control this creature. ```json { "id": "puppeteer-of-rust", "name": "Puppeteer of Rust", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Human", "Wizard" ], "colors": [ "U" ], "keywords": [], "keywordAbilities": [], "manaCost": "{3}{U}{U}", "types": [ "Creature" ], "power": 2, "toughness": 3, "text": "When this creature enters, gain control of target creature an opponent controls for as long as you control this creature.", "abilities": [ { "kind": "triggered", "trigger": { "event": "enters", "filter": { "self": true } }, "effects": [ { "effect": "gainControl", "target": { "of": "object", "mode": "chosen", "filter": { "types": [ "Creature" ], "controller": "opponent" } }, "duration": "whileYouControlSource" } ] } ] } ``` The engine reads it back as: “When Puppeteer of Rust enters, gain control of target creature an opponent controls for as long as you control Puppeteer of Rust.” The `whileYouControlSource` duration ends the control change for good the moment you stop controlling the source. ### Counters: extra counters, more counters, counters as conditions Counter placement is an event you can replace (`event: "putCounters"` with `counter`, `by`, `from`, `add` / `multiply` / `prevent`), and entering with counters is `entersWithCounters` (on the card itself) or `event: "enters"` with `enterCounters` (for a group). Counters read back through `hasCounter` + `minCounters` (filters and `objectMatches` conditions), `countersOnSource` (a value) and the `countersPlaced` trigger. The full list of counter kinds with rules meaning is on **Relationships & references**. #### "Each other creature you control enters with an additional +1/+1 counter on it." **Training Grounds Matron** — printed text: > Each other creature you control enters with an additional +1/+1 counter on it. ```json { "id": "training-grounds-matron", "name": "Training Grounds Matron", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Human", "Druid" ], "colors": [ "G", "W" ], "keywords": [], "keywordAbilities": [], "manaCost": "{1}{G}{W}", "types": [ "Creature" ], "power": 2, "toughness": 3, "text": "Each other creature you control enters with an additional +1/+1 counter on it.", "abilities": [ { "kind": "replacement", "replacement": { "replaces": "event", "event": "enters", "to": { "of": "object", "mode": "all", "filter": { "types": [ "Creature" ], "controller": "you", "other": true } }, "enterCounters": [ { "counter": "+1/+1", "amount": 1 } ] } } ] } ``` The engine reads it back as: “Each other creature you control enters with an additional +1/+1 counter on it.” An `enters` replacement over a group with `enterCounters`; it applies before enters triggers see the creature. #### "If one or more +1/+1 counters would be put on a creature you control, that many plus one are put on it instead." **Thickening Bark** — printed text: > If one or more +1/+1 counters would be put on a creature you control, that many plus one +1/+1 counters are put on it instead. ```json { "id": "thickening-bark", "name": "Thickening Bark", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [ "G" ], "keywords": [], "keywordAbilities": [], "manaCost": "{G}", "types": [ "Enchantment" ], "text": "If one or more +1/+1 counters would be put on a creature you control, that many plus one +1/+1 counters are put on it instead.", "abilities": [ { "kind": "replacement", "replacement": { "replaces": "event", "event": "putCounters", "to": { "of": "object", "mode": "all", "filter": { "types": [ "Creature" ], "controller": "you" } }, "counter": "+1/+1", "add": 1 } } ] } ``` The engine reads it back as: “If one or more +1/+1 counters would be put on a creature you control, that many plus one +1/+1 counters are put on it instead.” `putCounters` with `counter` narrows the kind; `add: 1` is "that many plus one". #### "Oath counters can't be put on this creature except by its own abilities." **Oathbound Sentinel** — printed text: > At the beginning of your upkeep, put an oath counter on this creature. > Oath counters can't be put on this creature except by its own abilities. > This creature gets +1/+1 for each oath counter on it. ```json { "id": "oathbound-sentinel", "name": "Oathbound Sentinel", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Human", "Knight" ], "colors": [ "W" ], "keywords": [], "keywordAbilities": [], "manaCost": "{2}{W}", "types": [ "Creature" ], "power": 2, "toughness": 3, "text": "At the beginning of your upkeep, put an oath counter on this creature.\nOath counters can't be put on this creature except by its own abilities.\nThis creature gets +1/+1 for each oath counter on it.", "abilities": [ { "kind": "triggered", "trigger": { "event": "upkeep", "by": "you" }, "effects": [ { "effect": "addCounters", "target": { "of": "object", "mode": "self" }, "counter": "oath", "amount": 1 } ] }, { "kind": "replacement", "replacement": { "replaces": "event", "event": "putCounters", "to": { "of": "object", "mode": "self" }, "counter": "oath", "from": { "of": "object", "mode": "all", "filter": { "other": true } }, "prevent": true } }, { "kind": "static", "effect": { "type": "modifyPT", "to": { "of": "object", "mode": "self" }, "power": { "kind": "countersOnSource", "counter": "oath" }, "toughness": { "kind": "countersOnSource", "counter": "oath" } } } ] } ``` The engine reads it back as: “At the beginning of your upkeep, put an oath counter on Oathbound Sentinel.” · “Oath counters can't be put on Oathbound Sentinel except by its own abilities.” · “Oathbound Sentinel gets +1/+1 for each oath counter on it.” A `putCounters` replacement on the source (`to: self`) for one `counter` kind with `prevent: true`, restricted by `from` to sources other than this one: proliferate and every other spell or ability are stopped, its own upkeep trigger still adds them. ### Damage by recipient: "if ~ would deal combat damage to its owner" Damage is replaceable per event (`event: "damage"`) with `from` (whose damage — `{ "mode": "self" }` for the source's own), `to` / `toPlayer` (who would be dealt it — any player selector: `owner` is the source's owner, `you` its controller), `damageKind` (combat / noncombat) and the result: `set` (the amount becomes this), `prevent` / `preventAmount` / `preventAllBut`, `multiply`, `add`, `half`, `redirectTo`. A card that may change hands names its owner, not "you", when the owner is meant. #### "If this creature would deal combat damage to its owner, it deals 0 damage to that player instead." **Turncoat Ogre** — printed text: > This creature attacks each combat if able. > If this creature would deal combat damage to its owner, it deals 0 damage to that player instead. ```json { "id": "turncoat-ogre", "name": "Turncoat Ogre", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Ogre", "Mercenary" ], "colors": [ "R" ], "keywords": [], "keywordAbilities": [], "manaCost": "{2}{R}", "types": [ "Creature" ], "power": 4, "toughness": 3, "text": "This creature attacks each combat if able.\nIf this creature would deal combat damage to its owner, it deals 0 damage to that player instead.", "abilities": [ { "kind": "static", "effect": { "type": "mustAttack", "to": { "of": "object", "mode": "self" } } }, { "kind": "replacement", "replacement": { "replaces": "event", "event": "damage", "from": { "of": "object", "mode": "self" }, "toPlayer": "owner", "damageKind": "combat", "set": 0 } } ] } ``` The engine reads it back as: “Turncoat Ogre attacks each combat if able.” · “If Turncoat Ogre would deal combat damage to its owner, it deals 0 damage to that player instead.” `from` self, `toPlayer: "owner"`, `damageKind: "combat"`, `set: 0` — the owner is fixed by the card, whoever controls it now. ### Forcing attacks and blocks Statics: `mustAttack` ("attacks each combat if able"), `mustBlock`, `lure` ("all creatures able to block ~ do so", `blockers` narrows who must), `goaded`, `cantAttack` / `cantBlock` (with `unless`), `evasion`, `mustBeBlocked`. One-shots: `restrict` (`mustAttack` — with `defending` for "attacks that player" — `mustBlock`, `mustBeBlocked`, `cantAttack`, `cantBlock`, … for a `duration`), `mustBlock` with `attacker` ("blocks ~ this turn if able"), `goad`. The engine maximises requirements without breaking restrictions (CR 508.1d, 509.1c). #### "Whenever this creature attacks, target creature an opponent controls blocks it this turn if able." **Taunting Duelist** — printed text: > Whenever this creature attacks, target creature an opponent controls blocks it this turn if able. ```json { "id": "taunting-duelist", "name": "Taunting Duelist", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Human", "Warrior" ], "colors": [ "R" ], "keywords": [], "keywordAbilities": [], "manaCost": "{2}{R}", "types": [ "Creature" ], "power": 3, "toughness": 2, "text": "Whenever this creature attacks, target creature an opponent controls blocks it this turn if able.", "abilities": [ { "kind": "triggered", "trigger": { "event": "attacks", "filter": { "self": true } }, "effects": [ { "effect": "mustBlock", "target": { "of": "object", "mode": "chosen", "filter": { "types": [ "Creature" ], "controller": "opponent" } }, "attacker": { "of": "object", "mode": "self" }, "duration": "endOfTurn" } ] } ] } ``` The engine reads it back as: “Whenever Taunting Duelist attacks, target creature an opponent controls blocks Taunting Duelist this turn if able.” `mustBlock.attacker` names which attacker the target must block (the source); filter `controller: "opponent"` keeps the target on the defending side. #### "Creatures your opponents control attack each combat if able. All creatures able to block this creature do so." **Beacon of Provocation** — printed text: > Creatures your opponents control attack each combat if able. > All creatures able to block this creature do so. ```json { "id": "beacon-of-provocation", "name": "Beacon of Provocation", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Elemental" ], "colors": [ "R" ], "keywords": [], "keywordAbilities": [], "manaCost": "{3}{R}", "types": [ "Creature" ], "power": 2, "toughness": 5, "text": "Creatures your opponents control attack each combat if able.\nAll creatures able to block this creature do so.", "abilities": [ { "kind": "static", "effect": { "type": "mustAttack", "to": { "of": "object", "mode": "all", "filter": { "types": [ "Creature" ], "controller": "opponent" } } } }, { "kind": "static", "effect": { "type": "lure", "to": { "of": "object", "mode": "self" } } } ] } ``` The engine reads it back as: “Creatures your opponents control attack each combat if able.” · “All creatures able to block Beacon of Provocation do so.” Two statics: `mustAttack` over a group and `lure` on the source. #### "This creature attacks each combat if able and must be blocked if able." **Rampaging Juggernaut** — printed text: > This creature attacks each combat if able. > This creature must be blocked if able. ```json { "id": "rampaging-juggernaut", "name": "Rampaging Juggernaut", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Juggernaut" ], "colors": [], "keywords": [], "keywordAbilities": [], "manaCost": "{4}", "types": [ "Artifact", "Creature" ], "power": 5, "toughness": 3, "text": "This creature attacks each combat if able.\nThis creature must be blocked if able.", "abilities": [ { "kind": "static", "effect": { "type": "mustAttack", "to": { "of": "object", "mode": "self" } } }, { "kind": "static", "effect": { "type": "mustBeBlocked", "to": { "of": "object", "mode": "self" } } } ] } ``` The engine reads it back as: “Rampaging Juggernaut attacks each combat if able.” · “Rampaging Juggernaut must be blocked if able.” `mustAttack` binds its controller (whoever that is now); `mustBeBlocked` puts the requirement on the defending player — at least one of their creatures blocks it if any can (CR 509.1c). ### Transforming, and what carries over A transforming card is `layout: "transform"` with `faces[0]` (front) and `faces[1]` (back), each with its own characteristics and `abilities`; the card's top-level fields mirror the front. `{ "effect": "transform" }` turns it over (`target` defaults to the source). It stays **the same object** (CR 712.18): counters, damage, attachments, "until end of turn" effects and its controller carry over — so the back face reads state the front face built up (counters via `countersOnSource`, a noted choice via `remember`). `moveTo` with `transformed: true` puts it onto the battlefield back face up; the `transformed` trigger fires when it turns. #### A front face that grows, and a back face that spends what it grew **Moonlit Cub** — printed text: > At the beginning of your end step, put a +1/+1 counter on this creature. Then if it has three or more +1/+1 counters on it, transform it. ```json { "id": "moonlit-cub", "name": "Moonlit Cub", "source": "custom", "layout": "transform", "supertypes": [], "subtypes": [ "Wolf" ], "colors": [ "G" ], "keywords": [], "keywordAbilities": [], "manaCost": "{1}{G}", "types": [ "Creature" ], "power": 2, "toughness": 2, "text": "At the beginning of your end step, put a +1/+1 counter on this creature. Then if it has three or more +1/+1 counters on it, transform it.", "abilities": [ { "kind": "triggered", "trigger": { "event": "endStep", "by": "you" }, "effects": [ { "effect": "addCounters", "target": { "of": "object", "mode": "self" }, "counter": "+1/+1", "amount": 1 }, { "effect": "if", "condition": { "kind": "objectMatches", "object": "source", "filter": { "hasCounter": "+1/+1", "minCounters": 3 } }, "then": [ { "effect": "transform" } ] } ] } ], "faces": [ { "name": "Moonlit Cub", "manaCost": "{1}{G}", "colors": [ "G" ], "types": [ "Creature" ], "subtypes": [ "Wolf" ], "power": 2, "toughness": 2, "text": "At the beginning of your end step, put a +1/+1 counter on this creature. Then if it has three or more +1/+1 counters on it, transform it.", "abilities": [ { "kind": "triggered", "trigger": { "event": "endStep", "by": "you" }, "effects": [ { "effect": "addCounters", "target": { "of": "object", "mode": "self" }, "counter": "+1/+1", "amount": 1 }, { "effect": "if", "condition": { "kind": "objectMatches", "object": "source", "filter": { "hasCounter": "+1/+1", "minCounters": 3 } }, "then": [ { "effect": "transform" } ] } ] } ] }, { "name": "Moonlit Alpha", "colors": [ "G" ], "types": [ "Creature" ], "subtypes": [ "Wolf" ], "power": 4, "toughness": 4, "text": "Whenever this creature attacks, it deals damage equal to the number of +1/+1 counters on it to defending player.", "abilities": [ { "kind": "triggered", "trigger": { "event": "attacks", "filter": { "self": true } }, "effects": [ { "effect": "dealDamage", "target": { "of": "player", "mode": "all", "player": "defendingPlayer" }, "amount": { "kind": "countersOnSource", "counter": "+1/+1" } } ] } ] } ] } ``` The engine reads it back as: “At the beginning of your end step, put a +1/+1 counter on Moonlit Cub. If Moonlit Cub has three or more +1/+1 counters on it, transform Moonlit Cub.” · “— Moonlit Alpha —” · “Whenever Moonlit Alpha attacks, it deals damage equal to the number of +1/+1 counters on it to defending player.” The front's end-step trigger checks the source's own counters (`objectMatches` + `hasCounter` / `minCounters`) and transforms; the back face reads the same counters with `countersOnSource`. ### Phasing `{ "effect": "phaseOut", "target": … }` phases permanents out (with their attachments); they phase in during their controller's next untap step and are treated as though they don't exist meanwhile (CR 702.26). The keyword ability `{ "keyword": "phasing" }` phases the card in or out each untap step. Filters can find them with `phasedOut`; triggers `phasedOut` / `phasedIn` fire on the change; `duration` values never restart when a permanent phases in (CR 702.26f). #### "{1}{W}: Another target creature you control phases out." **Veil Keeper** — printed text: > {1}{W}: Another target creature you control phases out. ```json { "id": "veil-keeper", "name": "Veil Keeper", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Human", "Wizard" ], "colors": [ "W" ], "keywords": [], "keywordAbilities": [], "manaCost": "{1}{W}", "types": [ "Creature" ], "power": 1, "toughness": 3, "text": "{1}{W}: Another target creature you control phases out.", "abilities": [ { "kind": "activated", "cost": { "mana": "{1}{W}" }, "effects": [ { "effect": "phaseOut", "target": { "of": "object", "mode": "chosen", "filter": { "types": [ "Creature" ], "controller": "you", "other": true } } } ] } ] } ``` The engine reads it back as: “{1}{W}: Another target creature you control phases out.” A plain `phaseOut` on a declared target. ### Protection and hexproof from a choice Protection is the keyword ability `{ "keyword": "protection", "from": { … } }` (colors, types, `filter`, `everything`, or a choice: `chosenColor: true`); `hexproofFrom` takes the same spec. Granted for a while: the effect `grantKeywordAbility`; granted continuously: the static `grantKeywordAbility`. The choice comes from `chooseAsEnters` on the card, or from a `choose` step (`kind: "color"`, `inline: true` for "of your choice") earlier in the same resolution. #### "As this creature enters, choose a color. This creature has protection from the chosen color." **Prismatic Sentinel** — printed text: > As this creature enters, choose a color. > This creature has protection from the chosen color. ```json { "id": "prismatic-sentinel", "name": "Prismatic Sentinel", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Human", "Knight" ], "colors": [ "W" ], "keywords": [], "keywordAbilities": [], "manaCost": "{2}{W}", "types": [ "Creature" ], "power": 2, "toughness": 2, "text": "As this creature enters, choose a color.\nThis creature has protection from the chosen color.", "chooseAsEnters": [ { "kind": "color" } ], "abilities": [ { "kind": "static", "effect": { "type": "grantKeywordAbility", "to": { "of": "object", "mode": "self" }, "keywordAbility": { "keyword": "protection", "from": { "chosenColor": true } } } } ] } ``` The engine reads it back as: “As Prismatic Sentinel enters, choose a color.” · “Prismatic Sentinel has protection from the chosen color.” The color is chosen once, as it enters; the static reads it with `chosenColor: true`. #### "{W}: Target creature you control gains protection from the color of your choice until end of turn." **Shrine Acolyte** — printed text: > {W}: Target creature you control gains protection from the color of your choice until end of turn. ```json { "id": "shrine-acolyte", "name": "Shrine Acolyte", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Human", "Cleric" ], "colors": [ "W" ], "keywords": [], "keywordAbilities": [], "manaCost": "{W}", "types": [ "Creature" ], "power": 1, "toughness": 1, "text": "{W}: Target creature you control gains protection from the color of your choice until end of turn.", "abilities": [ { "kind": "activated", "cost": { "mana": "{W}" }, "effects": [ { "effect": "choose", "kind": "color", "inline": true }, { "effect": "grantKeywordAbility", "target": { "of": "object", "mode": "chosen", "filter": { "types": [ "Creature" ], "controller": "you" } }, "keywordAbility": { "keyword": "protection", "from": { "chosenColor": true } }, "duration": "endOfTurn" } ] } ] } ``` The engine reads it back as: “{W}: Target creature you control gains protection from the color of your choice until end of turn.” `choose` with `inline: true` (printed "of your choice") resolves first; the grant reads it. #### "Remove a +1/+1 counter: This creature gains protection from your choice of artifacts, creatures or enchantments until end of turn." **Adaptive Bulwark** — printed text: > This creature enters with two +1/+1 counters on it. > Remove a +1/+1 counter from this creature: It gains protection from your choice of artifacts, creatures, or enchantments until end of turn. Activate only once each turn. ```json { "id": "adaptive-bulwark", "name": "Adaptive Bulwark", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [ "Elemental" ], "colors": [ "G" ], "keywords": [], "keywordAbilities": [], "manaCost": "{3}{G}", "types": [ "Creature" ], "power": 3, "toughness": 3, "text": "This creature enters with two +1/+1 counters on it.\nRemove a +1/+1 counter from this creature: It gains protection from your choice of artifacts, creatures, or enchantments until end of turn. Activate only once each turn.", "abilities": [ { "kind": "replacement", "replacement": { "replaces": "entersWithCounters", "counter": "+1/+1", "amount": 2 } }, { "kind": "activated", "cost": { "removeCounters": { "counter": "+1/+1", "amount": 1 } }, "oncePerTurn": true, "effects": [ { "effect": "choose", "kind": "cardType", "options": [ "Artifact", "Creature", "Enchantment" ], "inline": true }, { "effect": "grantKeywordAbility", "target": { "of": "object", "mode": "self" }, "keywordAbility": { "keyword": "protection", "from": { "chosenType": true } }, "duration": "endOfTurn" } ] } ] } ``` The engine reads it back as: “Adaptive Bulwark enters with two +1/+1 counters on it.” · “Remove a +1/+1 counter from Adaptive Bulwark: it gains protection from your choice of artifacts, creatures, or enchantments until end of turn. Activate only once each turn.” A card-type choice limited by `options`, read by `protection.from.chosenType`; `oncePerTurn` is "activate only once each turn". ### "Until …" and "for as long as …" durations Every continuous one-shot takes `duration`: the named ones (`endOfTurn`, `untilYourNextTurn`, `untilEndOfYourNextTurn`, `untilSourceLeaves`, `whileYouControlSource`, `perpetual`, …) and three conditional forms — `{ "whileSource": }` ("for as long as ~ remains tapped"), `{ "whileTarget": }` ("for as long as that creature has a +1/+1 counter on it") and `{ "untilEvent": }` ("until an opponent becomes the monarch"). A conditional duration that stops holding ends for good (CR 611.2b). Every value is listed on **Relationships & references**. #### "{T}: Target creature can't block for as long as this artifact remains tapped." **Rusted Manacles** — printed text: > You may choose not to untap this artifact during your untap step. > {T}: Target creature can't block for as long as this artifact remains tapped. ```json { "id": "rusted-manacles", "name": "Rusted Manacles", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [], "keywords": [], "keywordAbilities": [], "manaCost": "{2}", "types": [ "Artifact" ], "text": "You may choose not to untap this artifact during your untap step.\n{T}: Target creature can't block for as long as this artifact remains tapped.", "abilities": [ { "kind": "static", "effect": { "type": "optionalUntap", "to": { "of": "object", "mode": "self" } } }, { "kind": "activated", "cost": { "tapSelf": true }, "effects": [ { "effect": "restrict", "target": { "of": "object", "mode": "chosen", "filter": { "types": [ "Creature" ] } }, "restriction": "cantBlock", "duration": { "whileSource": { "tapped": true } } } ] } ] } ``` The engine reads it back as: “You may choose not to untap Rusted Manacles during your untap step.” · “{T}: Target creature can't block for as long as Rusted Manacles remains tapped.” `{ "whileSource": { "tapped": true } }` checks the source continuously; you may choose not to untap it. #### "Creatures you control get +1/+0 until an opponent becomes the monarch." **Usurper's Rally** — printed text: > You become the monarch. Creatures you control get +1/+0 until an opponent becomes the monarch. ```json { "id": "usurper-s-rally", "name": "Usurper's Rally", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [ "R" ], "keywords": [], "keywordAbilities": [], "manaCost": "{1}{R}", "types": [ "Sorcery" ], "text": "You become the monarch. Creatures you control get +1/+0 until an opponent becomes the monarch.", "abilities": [ { "kind": "spell", "effects": [ { "effect": "becomeMonarch", "who": "you" }, { "effect": "modifyPT", "target": { "of": "object", "mode": "all", "filter": { "types": [ "Creature" ], "controller": "you" } }, "power": 1, "toughness": 0, "duration": { "untilEvent": { "event": "becameMonarch", "by": "opponent" } } } ] } ] } ``` The engine reads it back as: “You become the monarch, then creatures you control get +1/+0 until an opponent becomes the monarch.” `untilEvent` is an ordinary TriggerDef matched as a trigger of the source. #### "Target creature can't attack or block until your next turn." **Binding Glare** — printed text: > Target creature can't attack or block until your next turn. ```json { "id": "binding-glare", "name": "Binding Glare", "source": "custom", "layout": "normal", "supertypes": [], "subtypes": [], "colors": [ "W" ], "keywords": [], "keywordAbilities": [], "manaCost": "{W}", "types": [ "Instant" ], "text": "Target creature can't attack or block until your next turn.", "abilities": [ { "kind": "spell", "effects": [ { "effect": "restrict", "target": { "of": "object", "mode": "chosen", "filter": { "types": [ "Creature" ] } }, "restriction": "cantAttackOrBlock", "duration": "untilYourNextTurn" } ] } ] } ``` The engine reads it back as: “Target creature can't attack or block until your next turn.” `restrict` with `cantAttackOrBlock` and `untilYourNextTurn`. --- # Drawstep — Magic: The Gathering: table model Generated from Drawstep's game registry (engine id `mtg`). Wiki page: https://drawstep.xyz/wiki/mtg · this document: https://drawstep.xyz/wiki/drawstep-mtg-ai-pack.md · the card-logic reference (abilities, effects, the output contract and worked examples): https://drawstep.xyz/wiki/mtg/ai-pack. Full rules enforcement: the engine casts spells, resolves the stack, runs triggers and replacement effects, applies the layer system and prompts players for every choice. Every card is declarative JSON in the vocabulary documented here. ## Zones | Zone | Label | Kind | Visibility | Notes | |---|---|---|---|---| | `library` | Deck | pile | hidden | ordered | | `hand` | Hand | hand | owner | | | `battlefield` | Battlefield | surface | public | rows: Creatures, Planeswalkers, Battles, Artifacts, Enchantments, Spells, Lands | | `graveyard` | Graveyard | pile | public | ordered | | `exile` | Exile | pile | public | | | `command` | Command zone | row | public | | | `sideboard` | Sideboard | pile | owner | | Hand zone: `hand` · library: `library` · main surface: `battlefield` · discard: `graveyard`. Seats: 1 / 2 / 3 / 4 / 5 / 6. ## Counters - `life` — Life, starts at 20 (primary) - `poison` — Poison, starts at 0 - `energy` — Energy, starts at 0 ## Phases Untap → Upkeep → Draw → Main 1 → Combat → Main 2 → End ## Deck rules A deck list is `{ "name", "engine": "mtg", "format", "zones": { "": ["", …] } }`; copies are repeated ids. Formats: | Format | Zones (min–max, allowed types) | Max copies | Notes | |---|---|---|---| | Commander | Main deck (`main`): 98–99; Command zone (`command`): 1–2, Legendary; Sideboard (`side`): 0+; Companion (`companion`): 0–1; Scheme deck (`schemes`): 0+, Scheme | 1 | Main deck and command zone together (`main` + `command`): exactly 100 · singleton · life 40 · legality: commander | | Standard | Main deck (`main`): 60+; Sideboard (`side`): 0–15; Companion (`companion`): 0–1; Scheme deck (`schemes`): 0+, Scheme | 4 | legality: standard | | Pioneer | Main deck (`main`): 60+; Sideboard (`side`): 0–15; Companion (`companion`): 0–1; Scheme deck (`schemes`): 0+, Scheme | 4 | legality: pioneer | | Modern | Main deck (`main`): 60+; Sideboard (`side`): 0–15; Companion (`companion`): 0–1; Scheme deck (`schemes`): 0+, Scheme | 4 | legality: modern | | Legacy | Main deck (`main`): 60+; Sideboard (`side`): 0–15; Companion (`companion`): 0–1; Scheme deck (`schemes`): 0+, Scheme | 4 | legality: legacy | | Vintage | Main deck (`main`): 60+; Sideboard (`side`): 0–15; Companion (`companion`): 0–1; Scheme deck (`schemes`): 0+, Scheme | 4 | legality: vintage | | Pauper | Main deck (`main`): 60+; Sideboard (`side`): 0–15; Companion (`companion`): 0–1; Scheme deck (`schemes`): 0+, Scheme | 4 | legality: pauper | | Custom | Main deck (`main`): 1+; Sideboard (`side`): 0–15; Companion (`companion`): 0–1; Scheme deck (`schemes`): 0+, Scheme | 99 | | ## Card adapter Types: Creature, Land, Instant, Sorcery, Artifact, Enchantment, Planeswalker, Battle · resource: Mana value · stats: Power / toughness · colors: White, Blue, Black, Red, Green.