# Drawstep AI pack (Magic) — part 1 of 15: Core > Read first: your role and the rules, the output contract, the self-check, card anatomy, how the engine reads a card, the translating method, the ability kinds, every vocabulary name with its page URL, common mistakes. Pack index: https://drawstep.xyz/wiki/mtg/pack.md · next: https://drawstep.xyz/wiki/mtg/pack/references.md · everything in one document: https://drawstep.xyz/wiki/drawstep-mtg-ai-pack.md. Generated from Drawstep's card schema; field names and discriminators are exact. ## 1. Your role and the rules 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. Self-check before you answer Before you answer, read your JSON back the way the Studio will (it 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 and the exact difference is shown to the user, who will paste it back to you): - **Numbers**: every number in the printed line (damage, counters, P/T, "two cards") appears in the ability; "that much damage" is `amount: { kind: "triggerAmount" }`, not excess damage. - **Qualifiers survive**: *target* (`mode: "chosen"`), *may* (`optional`), *opponent*, *up to* (`min: 0`), *at random*, *nontoken* (`isToken: false`), *nonlegendary* / *noncreature* / *nonland* / *nonbasic* (`notSupertypes` / `notTypes`), *other* / *another* (`other: true`), *you control* (`controller: "you"`), *tapped*, *attacking*, *blocking*, *combat damage* (`damageKind: "combat"`), *instead* (a replacement), *once each turn*, *exile* vs *destroy* vs *sacrifice*, the zone words (*graveyard*, *library*, *hand*). - **Who acts**: "a creature deals combat damage to ~, **it** deals that much damage to itself" — the creature deals the damage, not ~. The actor of `dealDamage` is its `from` target: `from: { of: "object", mode: "triggeringOther" }` for the trigger's other object (name it on the trigger: `other: { types: ["Creature"] }`), `mode: "triggering"` for the object that caused the trigger. A player who acts is `who`. - **Who is affected**: "to itself" / "to that creature" is `target: { of: "object", mode: "triggeringOther" }` (the trigger's other object); the card itself is `mode: "self"`; "any target" is `{ of: "any" }`. - **When**: "when ~ attacks" / "when declaring ~ as an attacker" is the event `attacks` with `filter: { self: true }` — not a step trigger (`declareAttackersStep`, `beginCombat`) and not `youAttack` (you attacking with anything). "Whenever ~ is dealt damage" is `isDealtDamage` with `filter: { self: true }`; "whenever ~ deals damage" is `dealsDamage`. - **The printed text is sacred**: `text` is the card as printed, line for line, with real line breaks. Never reword it to make the engine's reading match — change the abilities. - **Shape**: every ability is an object `{ "kind": … }`, every effect an object `{ "effect": … }`, a token a complete object (`name`, `types`, `power`, `toughness`, `colors`, `subtypes`, its own `abilities`); never a sentence or a JSON string in their place. `of` says what kind of thing is selected (`object` / `player` / `spell` / `any`); *which* one is `mode`. - **Tokens**: the token's quoted text is in `token.abilities`, not on the creating card; a `tokenDefId` never stands alone (it reads back as "a Devil token" and loses the 1/1, the colour and the text) — the inline spec is always written, the link added on top. A token card has `layout: "token"` and no `manaCost`. - **Required lists**: a `triggered` ability always has `effects` — `[]` when every action is in `modes` (a modal "choose one" trigger). A multi-face card's `faces[i]` each carry their own complete `abilities`; check every face, not just the first. - **Before you call something impossible**: search the vocabulary index first. Cost changes in particular are covered: "this spell costs {N} less" (always) is a `costModifier` static with `filter: { self: true }`; "you may cast it for {1} less for each …" / "if cast during …, it costs less" is an `alternativeCost` keyword with `manaCostLess` (a value) and `condition`, and a rider "when cast this way" checks `{ kind: "castWith", alternative: "alternativeCost" }`. Only a clause that truly has no primitive climbs the honesty ladder (a `tableRuling` step inside the ability that owns it). ## If a link will not open Every document here is public plain text that answers any HTTP GET — no account, no JavaScript, no rate limit. A link that "fails to open" is your browsing tool's own rule, not this site: some tools (ChatGPT's among them) open a URL only when it is written in the player's message or already in their search index, so a link found inside a page can be refused. Then: (1) use a page whose address the player's message gives — the prompt the Studio writes lists the core and every pack part, and the pack part named on each row of the vocabulary index has every field of every name of its kind; (2) otherwise ask the player to paste the exact URL you need into the chat — an address in their message opens; (3) or ask them to attach the reference as a file (https://drawstep.xyz/llms-full.txt, saved as a `.md`) and the JSON Schema (https://drawstep.xyz/card.schema.json). Never fill a gap from memory or a guess. ## Card anatomy — 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`. ## 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. ## 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**. ## 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`. ## Vocabulary index Names only — each name's page (`https://drawstep.xyz/wiki/mtg//.md`) has its fields, its minimal form and stock examples, and the pack part named on its row has every field of every name of the kind. A name that is not here does not exist. - **Ability kinds** — topic https://drawstep.xyz/wiki/mtg/abilities.md; one page each at `https://drawstep.xyz/wiki/mtg/abilities/.md`; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/core.md: spell, tableRuling, openingHand, triggered, activated, loyalty, static, replacement - **Effects** — topic https://drawstep.xyz/wiki/mtg/effects.md; one page each at `https://drawstep.xyz/wiki/mtg/effects/.md`; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/effects-1.md, https://drawstep.xyz/wiki/mtg/pack/effects-2.md, https://drawstep.xyz/wiki/mtg/pack/effects-3.md: native, tableRuling, drawCards, discard, mill, scry, surveil, dealDamage, setLife, redistributeLife, exchangeLife, exchangeLifeWithStat, duelReveal, gainLife, loseLife, destroy, exile, bounce, moveTo, sacrifice, tap, untap, removeFromCombat, reselectAttack, endTurn, endCombat, suspendCard, plotCard, addCounters, tapOrUntap, removeCounters, modifyPT, grantKeyword, createToken, createTokenCopy, addMana, manaDoesntEmpty, loseUnspentMana, searchLibrary, shuffle, shufflePermanentsAndReveal, exchangeZones, fight, counterSpell, counterUnlessPays, gainControl, gainControlEachOthers, attach, transform, flip, regenerate, preventDamage, cantPrevent, digTop, separatePiles, becomeCopy, becomeType, removeTypes, becomeColor, loseAbilities, loseAbility, endable, removeKeyword, removeKeywordAbilities, grantAbility, grantKeywordAbility, gainAbilitiesOf, setPT, exchangeBasePower, switchPT, becomeBlocked, restrict, cantCast, mustBlock, controlDeclarations, playerRule, copyNextWithXMana, copyBoundStackObject, nextSpellCantBeCountered, nextSpellHas, costModifier, poisonCounters, playerCounters, removePlayerCounters, proliferate, addCounterEachKind, populate, createEmblem, winGame, loseGame, cascade, castAsFlash, playFromGraveyard, castFreeFromZone, castFree, exileMayPlay, meld, gainClassLevel, double, designate, adapt, goad, unlockDoor, suspect, detain, skipNextUntap, explore, connive, amass, bolster, blight, endure, cloak, collectEvidence, earthbend, airbend, moveCounters, discover, manifestDread, clash, flipCoin, rollDie, vote, joinForces, temptingOffer, parley, fromOutsideGame, incubate, tokenCopyPerOpponent, venture, choose, noteValue, guess, repeat, repeatProcess, forEachObject, forEachPlayer, forEachCardType, pair, unattach, extraTurn, additionalCombat, additionalPhase, skipStep, becomeMonarch, setDayNight, temptRing, takeInitiative, phaseOut, exchangeControl, startEngines, ascend, conjure, seek, draft, perpetualManaCost, intensify, specialize, unspecialize, oneTimeBoon, spellEntersWith, heist, openAttraction, rollToVisit, claimPrize, assembleContraption, reassembleContraption, moveContraption, crank, advanceCrank, setInMotion, chooseSelfOrOthers, abandon, putSticker, combineAugment, empower, timeTravel, recruit, assimilate, fateseal, manifest, turnFaceUp, turnFaceDown, investigate, exileUntilSourceLeaves, flicker, retarget, copyAbility, copySpell, copyCard, link, ripple, encode, reflexiveTrigger, delayedTrigger, replacement, reveal, if, ifDone, villainousChoice, optional, mayPay, unlessPays - **Static effects** — topic https://drawstep.xyz/wiki/mtg/statics.md; one page each at `https://drawstep.xyz/wiki/mtg/statics/.md`; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/statics-replacements-1.md, https://drawstep.xyz/wiki/mtg/pack/statics-replacements-2.md: native, grantKeyword, removeKeyword, removeKeywordAbilities, cantHaveKeyword, loseAllAbilities, loseAbility, grantAbility, grantKeywordAbility, gainAbilitiesOf, modifyPT, setPT, switchPT, addTypes, setTypes, removeTypes, addColors, setColors, changeColorWord, evasion, cantBlock, blockCapacity, blockAsThough, ignoreLandwalk, cantAttack, attackWithDefender, attackAsHaste, mustAttack, mustAttackWithCreature, goaded, mustBlock, mustBeBlocked, lure, cantActivate, cantCrew, cantPayLife, cantBeTargeted, cantTransform, cantBeCountered, cantBeSacrificed, cantGetCounters, cantPrevent, damageAsThough, cantCast, cantEnterBattlefield, abilityCostModifier, activationCostModifier, damageByToughness, assignDamageAsUnblocked, crewPowerBonus, crewWithToughness, activateAsHaste, boastActivationLimit, loyaltyActivationLimit, activateAsInstant, damageNotRemoved, untapDuringOthersUntap, untapLimit, attackLimit, blockLimit, costFloor, suppressTriggers, optionalUntap, countersPersist, doesntUntap, cantUntap, triggersTwice, gainControl, costModifier, spellsHave, revealFirstDraw, playerRule, playerProtection, controlWhileSearching, shareAttachments, spendManaAsAny, retainMana - **Player rules (static `playerRule`)** — topic https://drawstep.xyz/wiki/mtg/statics.md; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/statics-replacements-1.md, https://drawstep.xyz/wiki/mtg/pack/statics-replacements-2.md: 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 - **Replacements** — topic https://drawstep.xyz/wiki/mtg/replacements.md; one page each at `https://drawstep.xyz/wiki/mtg/replacements/.md`; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/statics-replacements-1.md, https://drawstep.xyz/wiki/mtg/pack/statics-replacements-2.md: entersTapped, entersUntapped, entersWithCounters, entersUnlessSacrifice, asEnters, asAttaches, turnedFaceUp, preventDamage, diesToExile, entersAsCopyOfHost, entersAsCopy, draw, toGraveyard, entersDesignated, lifeGain, damageDealt, event - **Trigger events** — topic https://drawstep.xyz/wiki/mtg/triggers.md; one page each at `https://drawstep.xyz/wiki/mtg/triggers/.md`; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/triggers-conditions.md: 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 - **Conditions** — topic https://drawstep.xyz/wiki/mtg/conditions.md; one page each at `https://drawstep.xyz/wiki/mtg/conditions/.md`; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/triggers-conditions.md: native, kicked, bargained, costPaidMatches, choseOption, guessedRight, triggeringOtherInZone, triggeringMatches, triggeringAbilityKind, compare, controls, playerIs, isYourTurn, isDefendingPlayer, attackedThisStep, fullParty, sourceTapped, sourceAttacking, sourceInZone, resolutionOrdinal, dayNight, hasDesignation, sourceThisTurn, sourceAbilityActivatedThisTurn, sourceDealtDamage, sourceAboveInGraveyard, controlsSourcePlaneswalker, castDuringYourTurn, castAfterExile, castDuringOpponentTurn, castDuringMainPhase, anotherSpellCastThisTurn, castOrdinal, castAnotherNamedSpell, castFrom, wasCast, castWith, asCast, revealedToCast, playerHas, anyOpponent, anyPlayer, opponentComparison, phase, topCard, affectedMatches, sourceIs, objectMatches, startingPlayer, completedDungeon, all, any, not - **Value kinds** — topic https://drawstep.xyz/wiki/mtg/values.md; one page each at `https://drawstep.xyz/wiki/mtg/values/.md`; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/values-costs.md: var, count, doneThisWay, playerAggregate, triggerAmount, triggeringCount, affectedCount, devoured, counterKinds, countersAmong, costPaid, blockers, sourcePower, sourceToughness, intensity, affected, sacrificed, countersOnSource, activationsThisTurn, excessDamageThisWay, damageDealt, lifeTotal, chosenNumber, votes, ringTemptations, playerCounters, unspentMana, stormCount, spellsCastLastTurn, turnsTaken, classLevel, thisTurn, cardTypesIn, partySize, domain, unlockedDoors, devotion, commanderIdentityColors, manaSpent, timesPaid, aggregate, triggering, startingLife, poison, speed, timesMutated, commanderTax, commanderCasts, noted, maxSameName, distinct, dieResult, handSize, sharedCreatureTypeMax, targetsChosen, replaced, math, native, asCast - **Target modes (`target.mode`)** — topic https://drawstep.xyz/wiki/mtg/references.md; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/references.md: chosen, choose, all, self, random, host, triggering, created, convoked, linked, paired, top, affected, replaced, replacedSource, triggeringOther, about, thisWay, costPaid, attacked, grantor - **Player target modes (`playerTarget.mode`)** — topic https://drawstep.xyz/wiki/mtg/references.md; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/references.md: chosen, choose, all, random, triggering, about, affected - **Player selectors (`who`, `target.player`, `chooser`)** — topic https://drawstep.xyz/wiki/mtg/references.md; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/references.md: 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 - **Keyword abilities** — topic https://drawstep.xyz/wiki/mtg/keywords.md; one page each at `https://drawstep.xyz/wiki/mtg/keywords/.md`; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/keywords.md: optionalAdditionalCost, alternativeCost, cycling, flashback, kicker, crew, equip, fortify, enchant, ward, protection, regenerate, landwalk, prowess, exalted, buyback, morph, disguise, unearth, madness, echo, bushido, toxic, afflict, undying, persist, convoke, suspend, storm, cascade, bestow, mutate, specialize, levelUp, foretell, plot, escape, retrace, disturb, aftermath, fuse, overload, rebound, miracle, warp, impending, prototype, blitz, dash, evoke, megamorph, ninjutsu, sneak, multikicker, replicate, squad, strive, entwine, spree, tiered, offspring, gift, bargain, casualty, delve, improvise, affinity, splitSecond, cumulativeUpkeep, vanishing, fading, flanking, soulbond, backup, mentor, evolve, modular, devour, bloodthirst, myriad, mobilize, encore, embalm, eternalize, dredge, boast, saddle, station, livingWeapon, jobSelect, reconfigure, firebending, hexproofFrom, companion, partner, readAhead, startYourEngines, ascend, phasing, exert, awaken, emerge, jumpStart, beamMeUp, surge, spectacle, prowl, freerunning, cleave, escalate, webSlinging, harmonize, moreThanMeetsTheEye, assist, recover, craft, annihilator, rampage, amplify, graft, tribute, ripple, hideaway, champion, ravenous, riot, unleash, enlist, decayed, melee, training, provoke, haunt, conspire, epic, cipher, livingMetal, forMirrodin, afterlife, fabricate, outlast, renown, monstrosity, adapt, scavenge, transmute, reinforce, umbraArmor, exploit, ingest, dethrone, extort, poisonous, frenzy, absorb, soulshift, offering, gravestorm, stickerKicker, mayhem, teamwork, waterbend, splice, storied, banding, bandsWithOther, compleated, demonstrate, undaunted - **Simple keywords (strings in `keywords[]`)** — topic https://drawstep.xyz/wiki/mtg/keywords.md; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/keywords.md: 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 - **Cost parts** — topic https://drawstep.xyz/wiki/mtg/costs.md; one page each at `https://drawstep.xyz/wiki/mtg/costs/.md`; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/values-costs.md: oneOf, chooseX, mana, ownManaCost, genericAmount, tapSelf, untapSelf, unattachSelf, payLife, getPoison, othersGainLife, draw, addMana, opponentCreatesToken, opponentCounter, damageFromSource, sacrificeSelf, sacrificeTogether, sacrifice, returnToHand, discard, discardRandom, reveal, revealCards, discardHand, discardSelf, addCountersSelf, removeCounters, mill, exertSelf, revealSelf, revealChoice, tapOthers, untapOthers, exileSelfFromGraveyard, exileGraveyard, exileTop, payCounters, exileOthers, moveCards, exileSelf, collectEvidence, forage, behold, returnUnblockedAttacker, discardMatching, linkedToGraveyard, blight, waterbend, xManaColor, manaColor - **Layouts** — topic https://drawstep.xyz/wiki/mtg/layouts.md; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/layouts-tokens.md: normal, transform, modal_dfc, adventure, split, flip, saga, token, class, leveler, meld, emblem, prepare, dungeon, host, augment, stickers - **Zones** — topic https://drawstep.xyz/wiki/mtg/zones.md; all fields in pack part https://drawstep.xyz/wiki/mtg/pack/layouts-tokens.md: battlefield, hand, graveyard, library, exile, stack, command ## 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.