# Drawstep AI pack (Magic) — part 12 of 15: Layouts, zones, tokens, appearance > Layouts and multi-face cards, zones, tokens and token cards, the display-only appearance block. Pack index: https://drawstep.xyz/wiki/mtg/pack.md · previous: https://drawstep.xyz/wiki/mtg/pack/keywords.md · next: https://drawstep.xyz/wiki/mtg/pack/custom-mechanics.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. ## Layouts and other definitions Layouts (`layout`): - `normal` — A single-faced card. - `transform` — Double-faced card that transforms; `faces[0]` front, `faces[1]` back. - `modal_dfc` — Modal double-faced card: cast either face. - `adventure` — Creature with an Adventure half in `faces[1]`. - `split` — Two halves in `faces`, each castable (fuse / aftermath via keyword abilities). - `flip` — Kamigawa flip card; the flipped half is `faces[1]`. - `saga` — Saga enchantment with `chapter` triggers. - `token` — A token definition that `createToken` can reference by `tokenDefId`. - `class` — Class enchantment with `classLevels[]`. - `leveler` — Level-up creature with `levels[]` bands and a `levelUp` keyword ability. - `meld` — Meld half with `meld: { partner, into }`. - `emblem` — An emblem definition (command zone). - `prepare` — Prepare creature; `faces[1]` is the attached spell. - `dungeon` — A dungeon with `rooms[]`. - `host` — Unstable host creature with a `banner` ability. - `augment` — Unstable augment card with an `augment` block. - `stickers` — Unfinity sticker sheet (`stickers`). **ClassLevelDef** | Field | Type | Required | Description | |---|---|---|---| | `level` | `number` | yes | The level this entry grants (2, 3, …) | | `cost` | `{ oneOf?: CostDef[]; chooseX?: object; mana?: string; ownManaCost?: boolean; genericAmount?: ValueDef; tapSelf?: boolean; untapSelf?: boolean; unattachSelf?: boolean; payLife?: ValueDef; getPoison?: ValueDef; othersGainLife?: object; draw?: ValueDef; addMana?: string; opponentCreatesToken?: object; opponentCounter?: object; damageFromSource?: ValueDef; sacrificeSelf?: boolean; sacrificeTogether?: ObjectFilter[]; sacrifice?: TargetDef; returnToHand?: TargetDef; discard?: ValueDef; discardRandom?: boolean; reveal?: ObjectFilter; revealCards?: object; discardHand?: boolean; discardSelf?: boolean; addCountersSelf?: object; removeCounters?: object; mill?: ValueDef; exertSelf?: boolean; revealSelf?: boolean; revealChoice?: boolean \| string; tapOthers?: object; untapOthers?: object; exileSelfFromGraveyard?: boolean; exileGraveyard?: boolean; exileTop?: ValueDef; payCounters?: object; exileOthers?: object; moveCards?: object; exileSelf?: boolean; collectEvidence?: ValueDef; forage?: boolean; behold?: string; returnUnblockedAttacker?: boolean; discardMatching?: ObjectFilter; linkedToGraveyard?: ObjectFilter; blight?: ValueDef; waterbend?: boolean; xManaColor?: "W" \| "U" \| "B" \| "R" \| "G"; manaColor?: "W" \| "U" \| "B" \| "R" \| "G" \| "chosen" }` | yes | Cost to gain this level (sorcery speed, from the previous level) | | `abilities` | `AbilityDef[]` | no | Abilities (AbilityDef[]), the same shapes as a card's own | | `keywords` | `string[]` | no | Plain keyword strings granted at this level | **LevelBandDef** | Field | Type | Required | Description | |---|---|---|---| | `min` | `number` | yes | Minimum number of selections / required amount | | `max` | `number` | no | Omit for "LEVEL N+" | | `power` | `number \| string` | no | Power (a number, or a string such as "*" for characteristic-defining values) | | `toughness` | `number \| string` | no | Toughness (a number, or a string such as "*" for characteristic-defining values) | | `types` | `string[]` | no | Types the object has in this band (station: ["Artifact", "Creature"]) | | `keywords` | `string[]` | no | Plain keyword strings granted at this level | | `keywordAbilities` | `KeywordAbilityDef[]` | no | Parametrised keyword abilities granted at this level | | `abilities` | `AbilityDef[]` | no | Abilities (AbilityDef[]), the same shapes as a card's own | **MeldDef** | Field | Type | Required | Description | |---|---|---|---| | `partner` | `string` | yes | Name of the card this melds with | | `into` | `string` | yes | Library id of the melded card definition | **DungeonRoomDef** | Field | Type | Required | Description | |---|---|---|---| | `name` | `string` | yes | Printed name. On an ability: its ability word ("Hellfire Retribution"), shown in the English rendering, on the stack and in the log | | `effects` | `EffectDef[]` | yes | The effects, resolved in order (EffectDef[]) | | `next` | `number[]` | yes | Indices of the rooms reachable from this one (empty = final room) | **AugmentDef** | Field | Type | Required | Description | |---|---|---|---| | `cost` | `{ oneOf?: CostDef[]; chooseX?: object; mana?: string; ownManaCost?: boolean; genericAmount?: ValueDef; tapSelf?: boolean; untapSelf?: boolean; unattachSelf?: boolean; payLife?: ValueDef; getPoison?: ValueDef; othersGainLife?: object; draw?: ValueDef; addMana?: string; opponentCreatesToken?: object; opponentCounter?: object; damageFromSource?: ValueDef; sacrificeSelf?: boolean; sacrificeTogether?: ObjectFilter[]; sacrifice?: TargetDef; returnToHand?: TargetDef; discard?: ValueDef; discardRandom?: boolean; reveal?: ObjectFilter; revealCards?: object; discardHand?: boolean; discardSelf?: boolean; addCountersSelf?: object; removeCounters?: object; mill?: ValueDef; exertSelf?: boolean; revealSelf?: boolean; revealChoice?: boolean \| string; tapOthers?: object; untapOthers?: object; exileSelfFromGraveyard?: boolean; exileGraveyard?: boolean; exileTop?: ValueDef; payCounters?: object; exileOthers?: object; moveCards?: object; exileSelf?: boolean; collectEvidence?: ValueDef; forage?: boolean; behold?: string; returnUnblockedAttacker?: boolean; discardMatching?: ObjectFilter; linkedToGraveyard?: ObjectFilter; blight?: ValueDef; waterbend?: boolean; xManaColor?: "W" \| "U" \| "B" \| "R" \| "G"; manaColor?: "W" \| "U" \| "B" \| "R" \| "G" \| "chosen" }` | yes | Augment cost (paid from hand, reveal; sorcery speed) | | `head` | `{ kind: "triggered"; trigger: TriggerDef; optional?: boolean } \| { kind: "activated"; cost: CostDef; timing?: "instant" \| "sorcery" }` | yes | The head that replaces the host's "When this creature enters," banner | | `power` | `number` | yes | Power modifier ("+1") | | `toughness` | `number` | yes | Toughness modifier ("+2") | | `instantSpeed` | `boolean` | no | The augment can be combined at instant speed | **StickerSheetDef** | Field | Type | Required | Description | |---|---|---|---| | `names` | `string[]` | yes | Name sticker words | | `artCount` | `number` | yes | Number of art stickers | | `abilities` | `({ cost: number; text: string; keywords?: string[]; keywordAbilities?: KeywordAbilityDef[]; abilities?: AbilityDef[] })[]` | yes | The sheet's ability stickers: each with its ticket cost, its text and the keywords / abilities it grants | | `pt` | `({ cost: number; power: number; toughness: number })[]` | yes | Power/toughness stickers: each `{ cost, power, toughness }` | **TokenSpec** (inline in `createToken.token`) | Field | Type | Required | Description | |---|---|---|---| **ChoiceSpec** (`chooseAsEnters[]`) | Field | Type | Required | Description | |---|---|---|---| | `who` | `"eachPlayer"` | no | CR 101.4, 614.12: each player publicly chooses a named option in APNAP order. A choseOption condition with who reads that player's answer for this source | | `opponentsOnly` | `boolean` | no | Choose an opponent of the ability controller (CR 102.2, 608.2d) | | `kind` | `"option" \| "creatureType" \| "color" \| "cardName" \| "basicLandType" \| "landType" \| "cardType" \| "landNonland" \| "oddEven" \| "number" \| "player"` | yes | CR 608.2d: option selects one of the explicit named options; collect retains each player's answer | | `from` | `ObjectFilter` | no | Choose only colors of matching objects (CR 105.1, 608.2d) | | `zone` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | Zone containing the color sources; defaults to battlefield (CR 400.1) | | `excludePreviouslyChosen` | `boolean` | no | Exclude earlier values chosen by this source object; reset on zone changes (CR 608.2d, 400.7) | | `options` | `string[]` | no | Explicit legal values, such as a printed list of card names (CR 608.2d) | | `exclude` | `string[]` | no | Forbidden choice values; colors use W/U/B/R/G codes (CR 608.2d) | | `filter` | `{ types?: string[]; notTypes?: string[]; anyTypes?: string[] }` | no | Printed card-type restrictions on a card name (CR 201.4a) | | `key` | `string` | no | Storage key when several choices share a kind | | `secret` | `boolean` | no | CR 101.4, 607.2d: the choice is made without showing it to the other players; a revealChoice cost makes it public (Emissary of Grudges, Guardian Archon) | | `beforeGame` | `"commander"` | no | "If ~ is your commander, choose a color before the game begins." (CR 903.3, 103.6): made as the game begins, before the opening hands, for a commander (Clara Oswald); stored like an as-enters choice | | `label` | `string` | no | Label shown for this choice | | `min` | `number` | no | Minimum number of selections / required amount | | `max` | `number` | no | Maximum number of selections | ## Zones Zone names appear in `TargetDef.zone`, `ObjectFilter` lookups, `moveTo.destination`, `searchLibrary.destination`, `castFrom` and `zoneChange` triggers. Default lookups are on the battlefield. - `battlefield` — Permanents. The default zone for filters and targets. - `hand` — Hidden; owner-visible. "discard", "return to hand", "from your hand". - `graveyard` — Public, ordered. "dies" = battlefield → graveyard; reanimation reads from here. - `library` — Hidden, ordered. Top / bottom positions via `position`; `mode: "top"` targets the top card(s). - `exile` — Public. Linked exile (`link`, `linkedToSource`) remembers what a card exiled. - `stack` — Spells and abilities waiting to resolve; `of: "spell"` targets live here. - `command` — Emblems, commanders, dungeons; `eminence` abilities work from here. ## Tokens and token cards A token is made by an effect; a **token card** is a card of its own that *is* that token — its art, its frame, its abilities — which your decks list and the table deals whenever one of your cards creates it. This page covers both: how a `createToken` effect describes what it makes, when to link it to a token card, and how an outside assistant writes the pair. **1. The token is described inside the effect.** The engine has no catalogue of "a 1/1 Soldier": every `createToken` carries a complete `token` object. ```json { "effect": "createToken", "who": "you", "amount": 2, "token": { "name": "Soldier", "types": ["Creature"], "subtypes": ["Soldier"], "colors": ["W"], "power": 1, "toughness": 1, "keywords": ["Vigilance"] } } ``` - `types` defaults to `["Creature"]`; `subtypes`; `colors` (omit or `[]` for colorless); `supertypes` (`["Legendary"]`); `power` / `toughness` — integers or values ("X/X" is `{ "kind": "var", "name": "X" }` on both; "with power and toughness each equal to the number of …" is a `count`, read once as the token is created, CR 111.3); `keywords` (plain ones); `keywordAbilities` (parametrised ones — `enchant`, `equip`, `ward`); `withCounters` ("enters with a +1/+1 counter"). - The token's quoted text — a 1/1 Devil "with 'When this creature dies, it deals 1 damage to any target'", a Treasure's "{T}, Sacrifice this artifact: …" — is the **token's own `abilities`** (the same ability objects a card has, with `filter: { "self": true }` meaning the token), never an ability of the creating card. `abilitiesInFollowingSentence: true` prints them as a following "It has …" sentence. Named tokens such as a Treasure are printed by name; the read-back prints an inline creature token in full ("a 1/1 red Devil creature token with …"), which is the line the Studio holds against the printed text. - The effect's own fields: `amount` (a value — "for each …" is a `count`); `tapped`; `attacking` (`true`, or `"defendingPlayer"`; "tapped and attacking" sets both); `who` / `target` (the player who creates it — "target opponent creates"); `attachedTo` ("create … attached to target creature"); and `token: { "oneOf": [ … ], "chooseAtRandom": true, "excludeControlled": true }` for "create a Food token or a Treasure token" / "one of the following at random you don't already control". - "Create a token that's a copy of …" is `createTokenCopy` (with `except` for "except it's …", `haste`, `tapped`, `attacking`) — a copy of the object, never a `createToken` with the original's characteristics typed in. **2. Predefined tokens the engine ships.** Treasure, Food, Clue, Map and Incubator are the engine's own definitions: name them with `tokenDefId` and nothing else — `{ "name": "Treasure", "tokenDefId": "token-treasure" }` — and the token has its printed ability at the table. The ids are `token-treasure`, `token-food`, `token-clue`, `token-map`, `token-incubator` (the `incubate` effect uses it itself), `token-monster-role` and `token-spirit` (a 1/1 white Spirit with flying). Every other named token — Blood, Powerstone, Gold, Junk, the other Roles — is written inline with its ability spelled out; the read-back still prints it by name. **3. Token cards — your own token definitions.** In the Studio, **New token** in the library panel (or the **Token** box in the Frame panel) makes a card with `layout: "token"` and no `manaCost`: a face, art, a frame, and the token's abilities written exactly as on any card. Its id is assigned when it is saved — `custom::`, say `custom:ed6ec723:devil` — and from then on it is in three places: the **Your token cards…** picker on every `createToken` block, which writes the `tokenDefId` link and fills the spec from the card; the **Tokens** zone of the deck builder, where it is offered first for each creating card in the deck ("Add your token card"); and the table, where a linked `createToken` deals the token card itself — its art, its abilities — rather than the inline spec. **Link and inline, not link or inline.** Always write the inline spec: it is what the read-back prints (a `tokenDefId` with no `types` prints only as "a Devil token"), what a replacement's `tokenFilter` inspects, and what the engine falls back to when the token card is not at the table (deleted, or never shared with that table). Add `tokenDefId` on top when a token card exists or is written alongside; at the table the token card's abilities win over the inline ones, so keep them the same. **4. Writing the pair from outside (ChatGPT, Claude, Gemini …).** An outside assistant cannot know the id a token card will be given, so it writes the reference by name and the server reconciles it on save: - **The token card**: a normal card object with `"layout": "token"`, an `id` that is the lower-case name (`"devil"`), **no `manaCost`**, its `types` / `subtypes` / `colors` / `power` / `toughness` / `keywords`, its `text` and its `abilities`. - **The creating card**: `createToken` with the full inline spec **and** `"tokenDefId": "devil"` — the same slug (`"Devil"`, `"devil-token"` and `"Devil Token"` all resolve; a `custom:…` id you already have is kept as written). - Return both as **two JSON objects** in separate ```json fences; the Studio's **Import** opens one tab each. Save them in either order: when a card is saved the server rewrites every `tokenDefId` that is not a stock id to your token card with that id, that slug or that name (minus "token"), and saving a token card re-links the cards you saved before it. A reference nothing matches is left as written and the inline spec is used (the Studio's picker shows it as "(not in your library)"). - A token the creating card could describe in a line (a vanilla 1/1 Soldier, a 2/2 Zombie) needs no token card; one is worth making when the token has art of its own, text of its own, or several of your cards create it. **Worked example — a creature and the Devil it creates.** Both validate as written; together they are what an outside assistant hands back for the printed card. ```json { "id": "devil", "name": "Devil", "source": "custom", "layout": "token", "types": ["Creature"], "subtypes": ["Devil"], "colors": ["R"], "power": 1, "toughness": 1, "text": "When this creature dies, it deals 1 damage to any target.", "abilities": [ { "kind": "triggered", "trigger": { "event": "dies", "filter": { "self": true } }, "effects": [ { "effect": "dealDamage", "target": { "of": "any" }, "amount": 1 } ] } ] } ``` ```json { "id": "avernus-kennelmaster", "name": "Avernus Kennelmaster", "source": "custom", "layout": "normal", "types": ["Creature"], "subtypes": ["Devil", "Shaman"], "manaCost": "{2}{R}", "colors": ["R"], "power": 2, "toughness": 2, "text": "When Avernus Kennelmaster enters, create a 1/1 red Devil creature token with \"When this creature dies, it deals 1 damage to any target.\"", "abilities": [ { "kind": "triggered", "trigger": { "event": "enters", "filter": { "self": true } }, "effects": [ { "effect": "createToken", "who": "you", "amount": 1, "token": { "name": "Devil", "tokenDefId": "devil", "types": ["Creature"], "subtypes": ["Devil"], "colors": ["R"], "power": 1, "toughness": 1, "abilities": [ { "kind": "triggered", "trigger": { "event": "dies", "filter": { "self": true } }, "effects": [ { "effect": "dealDamage", "target": { "of": "any" }, "amount": 1 } ] } ] } } ] } ] } ``` The engine reads the creating card back as “When Avernus Kennelmaster enters, create a 1/1 red Devil creature token with "When this token dies, it deals 1 damage to any target."” — the printed line, which is what Import checks. Once both are saved, `tokenDefId` is the Devil card's id, the deck builder offers the Devil card for the Kennelmaster, and the table deals it with the Devil's own art. **Tokens in a deck.** The deck builder's **Tokens** zone lists the token cards and stock token proxies a deck wants — display and proxies only; the game creates tokens from the cards' effects. Every custom card you own, token cards included, is in the pool of any table you sit at. ## How a card is drawn (`appearance`, display only) Everything under `appearance` is **display only** — the engine never reads it. It decides how the Studio's renderer draws the card: which frame, in which colour treatment, with what art framing, plus flavor text and credits. Leave it out and the card still looks right: the renderer infers a frame from the card's colours, types and layout. **Frame style (`appearance.frame.style`).** Three families are built in and drawn procedurally — `classic`, `modern` and `etched` — original Drawstep designs that work for every layout. A *frame pack* replaces the drawn frame with full-card images: - `"pack:community:"` — one of the **community packs** the server ships in its frames bundle (open **Frame → Frame library** in the Studio to see them, with each pack's credit). They are fan-made recreations of printed Magic frames (M15, 8th Edition, Masterpiece, box-topper …), kept outside the code as unofficial Fan Content so they can be credited or removed on request. - `"pack:"` — a pack **you imported** (Frame library → *Import a pack*). Imported layers are uploaded to your account only; you vouch for the rights to them. A pack is a folder: a `pack.json` beside PNG / WebP images. For each layout it lists one full-card image per colour treatment — the frame with a transparent window where the art goes — optionally a stats plate per treatment, and the `regions` (`[x, y, w, h]` as fractions of the card) where the renderer writes the name and mana cost (`title`), the `type` line, the rules and flavor (`text`), power/toughness or loyalty (`stats`) and the artist / collector line (`foot`). A missing layout falls back to `standard`; a two-colour treatment without its own layer falls back to its first colour, then gold (`M`), then `*`. The full format is documented in `tools/frames/README.md` in the repository; `npm run frames:build` converts Magic Set Editor templates into packs. **Treatment (`frame.treatment`).** Normally derived from the card: `W U B R G`, a hybrid pair such as `WU`, `M` gold for three or more colours, `C` colourless, `A` artifact, `L` land, `V` vehicle. Set it only to override — a colourless-cost card that should look red, a land that should use its colour. **Variant (`frame.variant`).** `standard` (a windowed art box), `extendedArt` (art to the card edges), `fullArt` (the whole card is art behind translucent panels), `borderless`. **Layout (`frame.layout`)** overrides the frame geometry (planeswalker, saga, adventure, split, transform, modal, class, leveler, battle, vehicle, token, basicLand) and is almost never needed — it follows from the card's `layout` and types. **Flavor, artist, collector.** `flavor` is printed in italics under the rules text, `artist` at the bottom left, `collector` ("12/60 · My Cube") at the bottom right. Multi-face cards put per-face `art`, `flavor` and `artist` in `appearance.faces[]` (same order as the card's `faces`; entry 0 is the front). **Art.** The picture is cropped to the frame's **art window**, so compose for that shape: a wide landscape for standard frames, tall for portrait or full-art frames, subject centred, nothing important within 10% of the edges. Pictures should show only the scene — no lettering, borders, mana symbols or card parts; the renderer adds all of those (and image generators botch text). The Studio's art editor crops and positions the picture; the assistant's `generate_image` follows the same rules automatically and picks the output size from the window. **Colour pips, not letters.** Wherever the Studio asks for a colour it shows the five mana pips; in JSON the letters stay `W U B R G` (blue is `U`), as on printed cards. **Fields of `appearance`** | Field | Type | Required | Description | |---|---|---|---| | `frame` | `{ style?: string; treatment?: string; variant?: "standard" \| "extendedArt" \| "fullArt" \| "borderless"; layout?: "standard" \| "planeswalker" \| "saga" \| "adventure" \| "split" \| "transform" \| "modal" \| "class" \| "leveler" \| "battle" \| "vehicle" \| "token" \| "basicLand" }` | no | | | `flavor` | `string` | no | Flavor text, printed in italics under the rules text | | `artist` | `string` | no | Illustration credit, printed at the bottom | | `collector` | `string` | no | Small print at the bottom right, e.g. "12/60 · My Cube" | | `faces` | `({ art?: string; image?: string; flavor?: string; artist?: string })[]` | no | Per-face art, full-card image and flavor for cards with more than one face (same order as `faces`; entry 0 is the front) | **Fields of `appearance.frame`** | Field | Type | Required | Description | |---|---|---|---| | `style` | `string` | no | Frame family: "classic", "modern" or "etched" (built in), "pack:" for a frame pack imported by the player, or "pack:community:" for one of the server's community packs (list them with the Frame library; e.g. "pack:community:m15"). Default classic | | `treatment` | `string` | no | Colour treatment override: W U B R G, two letters for a hybrid pair (WU), M gold, C colourless, A artifact, L land, V vehicle. Default: from the card's colours and types | | `variant` | `"standard" \| "extendedArt" \| "fullArt" \| "borderless"` | no | Art framing: a standard window, art to the card edges, full art behind translucent panels, or borderless full art | | `layout` | `"standard" \| "planeswalker" \| "saga" \| "adventure" \| "split" \| "transform" \| "modal" \| "class" \| "leveler" \| "battle" \| "vehicle" \| "token" \| "basicLand"` | no | Frame layout override; default from the card's layout and types |