# Drawstep — start here (for AI assistants writing card JSON) > Drawstep is an online card table whose rules engine plays **custom Magic: The Gathering cards** from a declarative JSON definition — the same engine, the same enforcement as a printed card. A player has asked you to write that JSON for their card. This page is everything you need to begin; it links to one page per primitive so you fetch only what the card uses. 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. Machine index: https://drawstep.xyz/llms.txt. The whole reference in parts under 100 KB each: https://drawstep.xyz/wiki/mtg/pack.md (core first: https://drawstep.xyz/wiki/mtg/pack/core.md); in one large document: https://drawstep.xyz/wiki/drawstep-mtg-ai-pack.md. The card format as JSON Schema: https://drawstep.xyz/card.schema.json. ## How to work 1. Read the card's **name, mana cost, type line, rules text and stats** exactly as given (from the text or the image). Keep the rules text verbatim for `text`. 2. For every printed line decide what it is (keyword · triggered · activated · static · replacement · the spell's own effect) — the method is on the [translating](https://drawstep.xyz/wiki/mtg/translating.md) page. 3. For each clause **fetch the page of the primitive** you intend to use — `https://drawstep.xyz/wiki/mtg//.md` (the index below lists every name; `https://drawstep.xyz/wiki/mtg//index.md` lists them with one line each) — and use its fields exactly. Selections (`target`, `filter`, players, zones) are on the [targets](https://drawstep.xyz/wiki/mtg/targets.md) page; how one part of the card refers to another ("it", "that creature", "that player", "the exiled card", "the chosen color", "that much") is on the [relationships & references](https://drawstep.xyz/wiki/mtg/references.md) page, with every mode, selector and duration explained; complete validated cards for the hard patterns are in the [cookbook](https://drawstep.xyz/wiki/mtg/cookbook.md). A clause no printed card has is usually a composition of those axes; the [custom mechanics](https://drawstep.xyz/wiki/mtg/custom-mechanics.md) page lists the primitives people miss with the printed wording each answers. 4. Write the complete card as one JSON object (output contract below), run the self-check, and answer with the JSON in a single ```json fence. A card that creates a token the player wants as a card of its own is **two** objects — the token card (`layout: "token"`) and the creating card linking it with `tokenDefId` — each in its own fence; the [tokens](https://drawstep.xyz/wiki/mtg/tokens.md) page has the pair worked out. 5. The player pastes your answer into **Card Studio → Import**, which validates it with the engine's own gate and reads it back in English. If something is refused they will paste the Studio's message back to you: fix the JSON it names and return the **complete** corrected object. 6. **Say what you could not do.** If a clause has no primitive after you searched the index and composed the axes, keep it honest — a `tableRuling` step where its timing is clear, else the line verbatim in `unparsed` — and tell the player in one sentence which clause and why. Never claim a construct exists that this site does not list; if you could not fetch a page, say so instead of guessing. ## 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. ## Rules 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). ## 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. ## 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). ## Vocabulary index Names only — the page of a name has its fields, its minimal form and stock examples; the pack part on its row has every field of every name of the kind. A name that is not here does not exist: never invent one. - **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 ## Topic pages - [How the engine reads a card](https://drawstep.xyz/wiki/mtg/overview.md) — Zones, the stack, layers, triggers, the replacement pipeline and decision prompts — what happens to your JSON at the table. - [Card anatomy](https://drawstep.xyz/wiki/mtg/anatomy.md) — Every top-level field of a card definition: type, whether it is required, what it means and the values it accepts. - [Abilities](https://drawstep.xyz/wiki/mtg/abilities.md) — The six ability kinds — spell, triggered, activated, loyalty, static, replacement — and their fields. - [Effects](https://drawstep.xyz/wiki/mtg/effects.md) — Every one-shot effect the engine can resolve, with its fields, defaults and examples from stock cards. - [Triggers](https://drawstep.xyz/wiki/mtg/triggers.md) — Trigger events and the fields that narrow them: who, which object, intervening conditions. - [Statics & layers](https://drawstep.xyz/wiki/mtg/statics.md) — Continuous effects and the CR 613 layer each one applies in. - [Replacements](https://drawstep.xyz/wiki/mtg/replacements.md) — Effects that rewrite an event before it happens: enters tapped, enters with counters, exile instead of dying, … - [Conditions](https://drawstep.xyz/wiki/mtg/conditions.md) — “If”, “as long as” and intervening-if clauses, composable with all / any / not. - [Values](https://drawstep.xyz/wiki/mtg/values.md) — Numbers: constants, X, counts and derived quantities such as devotion, domain or turn history. - [Filters & targets](https://drawstep.xyz/wiki/mtg/targets.md) — How to say which objects or players an effect acts on, and when the engine prompts for a target. - [Relationships & references](https://drawstep.xyz/wiki/mtg/references.md) — How one part of a card refers to another — it, that creature, that player, the exiled card, the chosen color, that much — with a validated card for each pattern, and every mode, player selector, relation, duration, action and counter explained. - [Costs](https://drawstep.xyz/wiki/mtg/costs.md) — Mana, tapping, sacrificing, life, counters and every other cost part. - [Keyword abilities & simple keywords](https://drawstep.xyz/wiki/mtg/keywords.md) — Parametrised keywords (cycling, kicker, ward, …) and the plain keyword strings the engine understands. - [Layouts & multi-face cards](https://drawstep.xyz/wiki/mtg/layouts.md) — Transform, modal DFCs, adventures, split cards, Sagas, Classes, levelers, meld, prepare, dungeons and the Un-set layouts. - [Zones](https://drawstep.xyz/wiki/mtg/zones.md) — The seven zones a card can be in, and how zone words appear in filters, targets and effects. - [Translating a card step by step](https://drawstep.xyz/wiki/mtg/translating.md) — The method: split the Oracle text, pick ability kinds, map clauses to blocks, targets vs. choices, durations, validate, playtest. - [Custom mechanics](https://drawstep.xyz/wiki/mtg/custom-mechanics.md) — How the engine leaves room for mechanics no printed card has: the primitives people miss, named abilities, registered natives, table-resolved steps, on-demand format rulings, and a fully custom partner pair as a worked example. - [Cookbook: complex custom cards](https://drawstep.xyz/wiki/mtg/cookbook.md) — Complete, engine-validated cards for the patterns custom cards need: leave-the-battlefield replacements by destination, returns under another player's control, counters, forced attacks and blocks, transform with carried state, phasing, protection choices and every kind of "until …". - [Tokens & token cards](https://drawstep.xyz/wiki/mtg/tokens.md) — The token spec inside createToken, the engine's predefined tokens, token cards designed in the Studio and used in decks, and how to write a creating card and its token card as a pair. - [Working with an outside AI](https://drawstep.xyz/wiki/mtg/ai-workflow.md) — Have ChatGPT, Claude, Gemini or any chat write a card from this wiki: the start page and per-primitive pages it reads, the Studio's Import that checks the answer with the engine, and the feedback to paste back. - [Common mistakes](https://drawstep.xyz/wiki/mtg/mistakes.md) — What goes wrong most often when converting cards, and how to spot it in the Explain view. Common mistakes, with the fix for each: https://drawstep.xyz/wiki/mtg/mistakes.md.