# Drawstep engine wiki — Filters & targets > How to say which objects or players an effect acts on, and when the engine prompts for a target. Engine: Magic: The Gathering (`mtg`). Page: https://drawstep.xyz/wiki/mtg/targets · Raw Markdown: https://drawstep.xyz/wiki/mtg/targets.md · Complete AI pack (every topic in one document, with the output contract and worked examples): https://drawstep.xyz/wiki/drawstep-mtg-ai-pack.md. This page is generated from Drawstep's card schema; field names and discriminators are exact. A card definition is one JSON object; anything the vocabulary cannot express goes verbatim into `unparsed` instead of being approximated. ## Targets & filters **TargetDef** — what an effect acts on. | Field | Type | Required | Description | |---|---|---|---| | `of` | `"object" \| "player" \| "spell" \| "ability" \| "spellOrAbility" \| "any"` | yes | What kind of thing is selected | | `slot` | `string` | no | Shared declaration: identical slot names refer to one target group across clauses, even across intervening choices (CR 601.2c) | | `mode` | `"chosen" \| "choose" \| "all" \| "self" \| "random" \| "host" \| "triggering" \| "created" \| "convoked" \| "linked" \| "paired" \| "top" \| "affected" \| "replaced" \| "replacedSource" \| "triggeringOther" \| "about" \| "thisWay" \| "costPaid" \| "attacked" \| "grantor"` | no | chosen = player picks a target (targeting prompt at cast/activation); choose = picked as the effect resolves, not a target; all = every match; self; random = sample on resolution, except of any declares a legal random target during casting (CR 115.6, 601.2c); host = what the source is attached to; triggering = the object that caused the trigger; created = objects this resolution created; linked = cards exiled with the source; paired = soulbond partner; thisWay = objects actually acted on by earlier effects (action specifies which; filter reads action-time characteristics); costPaid (action sacrificed) = the objects sacrificed to pay this spell's or ability's cost — "the sacrificed creature", "that card" after "Sacrifice another creature:" — followed into the zone they went to, and copied as they last existed on the battlefield (CR 601.2h, 400.7, 608.2h); top = the top card(s) of a library, or the topmost matching graveyard card(s) (CR 401.4, 404.1; zone selects the ordered pile, player says whose); affected = what the previous effect applied to ("those creatures", "it"); replaced / replacedSource = inside a replacement effect, the object the replaced event would have affected / the source of the replaced damage; triggeringOther = the other object of the triggering event (the creature blocked / blocking / dealt damage — "that creature"; for a becomesTarget trigger with of spell / ability / spellOrAbility, the spell or ability that targeted — "change that target"); about = inside a delayed trigger's effects, the object(s) the delayed trigger is about ("that creature" fixed when it was created; a new object after a zone change no longer counts, except the one whose zone change triggered it) | | `action` | `"sacrificed" \| "milled" \| "destroyed" \| "exiled" \| "discarded" \| "returned" \| "putIntoLibrary" \| "tapped" \| "untapped" \| "damaged" \| "drawn" \| "revealed" \| "countersPlaced" \| "countersRemoved" \| "amassed" \| "countered" \| "phasedOut" \| "searched" \| "created"` | no | mode thisWay or choose/action: successful earlier actions, tracking resulting object identities across their own zone changes (CR 400.7) | | `among` | `"triggering"` | no | mode choose: pick among the triggering event's group instead of the zone ("put one of them onto the battlefield" after a oneOrMore trigger; CR 603.2c, 608.2d) | | `chooser` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "replacedPlayer" \| "damageSourceController" \| "causeController" \| "affectedController" \| "affectedOwner" \| "triggeringController" \| "triggeringOwner" \| "triggeringOtherController" \| "triggeringOtherOwner" \| "current" \| "previousPlayer" \| "mostLife" \| "leastLife" \| "mostCardsInHand" \| "fewestCardsInHand" \| "enchantedPlayer" \| "yourTeam" \| "chosenPlayer" \| "playerToYourLeft" \| "playerToYourRight" \| "attackedPlayers" \| "attackingOpponents" \| "attackedBySourceThisTurn" \| "attackedBySourceLastCombat" \| object` | no | CR 601.2c, 603.3d, 608.2d: player making a selection, including targets explicitly chosen by another player; defaults to controller | | `random` | `true` | no | With mode chosen: "target creature an opponent controls chosen at random" — still a target (declared as the spell is cast or the ability is put on the stack, rechecked on resolution) but picked at random among the legal candidates (CR 601.2c, 603.3d, 608.2b) | | `zone` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | Zone to look in (default battlefield) | | `allZones` | `boolean` | no | Select card objects across every in-game zone, excluding tokens; for Arena perpetual effects on all cards you own | | `position` | `"top" \| "bottom"` | no | mode top: read this end of the library or graveyard; graveyard filters select the top matching cards (CR 401.2, 404.3) | | `filter` | `ObjectFilter` | no | Which objects (ObjectFilter; set fields AND together) | | `player` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "replacedPlayer" \| "damageSourceController" \| "causeController" \| "affectedController" \| "affectedOwner" \| "triggeringController" \| "triggeringOwner" \| "triggeringOtherController" \| "triggeringOtherOwner" \| "current" \| "previousPlayer" \| "mostLife" \| "leastLife" \| "mostCardsInHand" \| "fewestCardsInHand" \| "enchantedPlayer" \| "yourTeam" \| "chosenPlayer" \| "playerToYourLeft" \| "playerToYourRight" \| "attackedPlayers" \| "attackingOpponents" \| "attackedBySourceThisTurn" \| "attackedBySourceLastCombat" \| object` | no | Candidate players when of = player; for object zones: controllers on battlefield, owners elsewhere. target reads playerTarget in the current effect slot | | `playerOwns` | `true` | no | CR 108.3, 110.2: with player, a battlefield selection is the permanents those players own rather than control ("all artifacts target player owns") | | `exceptPlayer` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "replacedPlayer" \| "damageSourceController" \| "causeController" \| "affectedController" \| "affectedOwner" \| "triggeringController" \| "triggeringOwner" \| "triggeringOtherController" \| "triggeringOtherOwner" \| "current" \| "previousPlayer" \| "mostLife" \| "leastLife" \| "mostCardsInHand" \| "fewestCardsInHand" \| "enchantedPlayer" \| "yourTeam" \| "chosenPlayer" \| "playerToYourLeft" \| "playerToYourRight" \| "attackedPlayers" \| "attackingOpponents" \| "attackedBySourceThisTurn" \| "attackedBySourceLastCombat" \| object` | no | of = player: players removed from the candidates — "each other opponent" is eachOpponent except triggeringPlayer (CR 608.2h) | | `playerFilter` | `"opponent"` | no | CR 115.4, 601.2c: restrict only the player half of an any target to opponents | | `sameZoneOwner` | `boolean` | no | CR 400.3, 601.2c: all selected cards belong to one player's zone | | `maxTotalManaValue` | `ValueDef` | no | CR 202.3, 601.2c: total mana value budget for the selected group | | `maxTotalPower` | `ValueDef` | no | CR 208.1, 601.2c: total power budget for the selected group ("with total power 10 or less") | | `distinctBy` | `"name" \| "manaValue" \| "controller" \| "power"` | no | CR 601.2c, 608.2d: no two selected objects share this value ("with different names") | | `equalBy` | `"toughness" \| "power" \| "manaValue"` | no | CR 601.2c, 608.2d: every selected object has the same value ("with equal toughness") | | `sharesType` | `"card" \| "permanent"` | no | CR 205.2a, 601.2c, 608.2b: the selected objects share at least one card type / permanent type ("two target permanents that share a card type"); rechecked on resolution | | `sharedBy` | `"creatureType"` | no | CR 601.2c, 205.3m: the selected objects share a creature type — one type every one of them has, changelings having all ("two target creature cards that share a creature type") | | `zones` | `("battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command")[]` | no | CR 400.1, 115.1a, 608.2d: one selection across these zones, e.g. hand and/or graveyard. For of object, stack contributes spells including copies, represented by stack references; battlefield contributes permanents | | `playerTarget` | `PlayerTargetDef` | no | With player = target: the player target whose zone is read, in any mode (top, random, choose, all). mode chosen makes that player a target of the spell ("target opponent's hand"); mode choose picks the player on resolution ("an opponent's hand") | | `digSubset` | `"looked" \| "picked" \| "rest"` | no | Read the cards of the enclosing `digTop`: `looked` (all looked at), `picked` (taken by a pick), `rest` (the remainder) | | `span` | `number` | no | mode = affected: how many preceding effects' selections to union (default 1) | | `targetCount` | `number` | no | CR 115.7: exact announced target count of a stack object | | `targetsOnlySource` | `boolean` | no | CR 115.7: all targets are this source | | `permanents` | `true` | no | With of any: the object half is any permanent (target permanent or player, CR 115.4) | | `stackTargets` | `{ object?: ObjectFilter; player?: "you" \| "opponent" \| "any" \| "notYou" }` | no | CR 115.1, 115.10, 601.2c: a stack-object target that currently targets at least one matching object (relative to this ability) or player (relative to its controller): "target spell that targets a creature you control", "… that targets you" | | `spell` | `{ controller?: "you" \| "opponent" \| "any" \| "notYou"; filter?: ObjectFilter }` | no | Constraints on spells, including the stack branch of of object with zones. There, spell.filter overrides the common object filter; an explicit empty filter leaves spells unrestricted (CR 115.1a, 601.2c) | | `ability` | `{ controller?: "you" \| "opponent" \| "any" \| "notYou"; kind?: "activated" \| "triggered"; source?: ObjectFilter }` | no | CR 707.10: constraints on an ability on the stack, including its source | | `min` | `ValueDef` | no | Minimum selections (0 for "up to"); a value such as X ("Return X target cards") is resolved as the targets are chosen — X is announced first (CR 601.2b) | | `max` | `ValueDef \| "any"` | no | Maximum selections (mode = top: how many cards from the top; mode = random: how many distinct objects are sampled); "any" = "any number of targets" (min defaults to 0; a divided effect needs at least one) | | `differentFromEarlierTargets` | `boolean` | no | Other targets: exclude targets declared earlier in this spell or ability (CR 115.3, 601.2c) | | `attacker` | `"self" \| "triggering"` | no | mode attacked: the attacking creature (the source, or the triggering object) whose attacked player / planeswalker / battle is selected (CR 506.2, 508.1b) | | `label` | `string` | no | Prompt text shown to the player | **PlayerTargetDef** — a player target for `playerTarget` (cannot nest). | Field | Type | Required | Description | |---|---|---|---| | `slot` | `string` | no | Shared declaration: identical slot names refer to one target group across clauses (CR 601.2c) | | `mode` | `"chosen" \| "choose" \| "all" \| "random" \| "triggering" \| "about" \| "affected"` | no | chosen = targeted at cast/activation (default); choose = picked on resolution; all = every candidate; random; triggering = the player that caused the trigger; about = the player a delayed trigger is about ("that player"); affected = the previous selection | | `span` | `number` | no | How many preceding selections to union (default 1) | | `player` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "replacedPlayer" \| "damageSourceController" \| "causeController" \| "affectedController" \| "affectedOwner" \| "triggeringController" \| "triggeringOwner" \| "triggeringOtherController" \| "triggeringOtherOwner" \| "current" \| "previousPlayer" \| "mostLife" \| "leastLife" \| "mostCardsInHand" \| "fewestCardsInHand" \| "enchantedPlayer" \| "yourTeam" \| "chosenPlayer" \| "playerToYourLeft" \| "playerToYourRight" \| "attackedPlayers" \| "attackingOpponents" \| "attackedBySourceThisTurn" \| "attackedBySourceLastCombat" \| object` | no | Candidate players (default: every player) | | `exceptPlayer` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "replacedPlayer" \| "damageSourceController" \| "causeController" \| "affectedController" \| "affectedOwner" \| "triggeringController" \| "triggeringOwner" \| "triggeringOtherController" \| "triggeringOtherOwner" \| "current" \| "previousPlayer" \| "mostLife" \| "leastLife" \| "mostCardsInHand" \| "fewestCardsInHand" \| "enchantedPlayer" \| "yourTeam" \| "chosenPlayer" \| "playerToYourLeft" \| "playerToYourRight" \| "attackedPlayers" \| "attackingOpponents" \| "attackedBySourceThisTurn" \| "attackedBySourceLastCombat" \| object` | no | Players removed from the candidates — "each other opponent" is eachOpponent except triggeringPlayer (CR 608.2h) | | `random` | `true` | no | With mode chosen: "target opponent chosen at random" — still a target, picked at random among the legal candidates (CR 601.2c, 603.3d) | | `min` | `ValueDef` | no | Minimum selections (0 for "up to"); a value such as X is resolved as the targets are chosen | | `max` | `ValueDef \| "any"` | no | Maximum selections; "any" = any number of targets | | `label` | `string` | no | Prompt text shown to the player | **ObjectFilter** — characteristics; all set fields AND together. | Field | Type | Required | Description | |---|---|---|---| | `native` | `{ id: string; params?: object; text?: string }` | no | An engine-implemented predicate on the object, ANDed with the other fields | | `exclude` | `ObjectFilter` | no | CR 608.2c: exclude objects matching the whole nested filter; negates its conjunction, not each individual field | | `anyOf` | `ObjectFilter[]` | no | Outer filter AND at least one branch; branches are a union, never multiple targets (CR 601.2c). Historic (CR 700.6) uses Artifact OR Legendary OR Saga branches | | `types` | `string[]` | no | Card types the object must have (all), e.g. ["Creature"] | | `anyTypes` | `string[]` | no | At least one of these card types ("artifact or enchantment", "creature or planeswalker") | | `subtypes` | `string[]` | no | At least one of these subtypes, e.g. ["Forest"] | | `supertypes` | `string[]` | no | At least one of these supertypes, e.g. ["Basic"] | | `colors` | `string[]` | no | At least one of these colors (W,U,B,R,G) | | `notTypes` | `string[]` | no | CR 205.2: must NOT have any of these types (nonland). CR 700.6 nonhistoric composes Artifact, Legendary and Saga exclusions | | `notSubtypes` | `string[]` | no | CR 205.3, 702.73: excludes every listed subtype, including changelings; a negated subtype union | | `notSupertypes` | `string[]` | no | Negated supertypes: "nonbasic", "nonlegendary" | | `notColors` | `string[]` | no | Has none of these colors | | `colorless` | `boolean` | no | Is colorless (true) / has a color (false) | | `multicolored` | `boolean` | no | Is two or more colors | | `monocolored` | `boolean` | no | Is exactly one color | | `colorCount` | `number` | no | CR 105.2, 202.2: exactly this many colors ("that isn't all colors" = exclude { colorCount: 5 }; "exactly two colors" = 2); colorless is 0 | | `minCardTypes` | `number` | no | CR 205.2a: at least this many card types ("a card with two or more card types" = 2) | | `controller` | `"you" \| "opponent" \| "any" \| "notYou" \| "affectedController" \| "triggeringController" \| "current" \| "notCurrent" \| "yourTeam" \| "previousPlayer" \| "chosenPlayer" \| "enchantedPlayer"` | no | Who controls it, relative to you (yourTeam: you or a teammate, CR 102.3, 810.2). previousPlayer: the player(s) of the preceding non-target player selection — after { effect: "choose", kind: "object", target: { of: "player", mode: "choose", player: "mostLife" } }, "creatures that player controls" (CR 608.2d, 608.2h). chosenPlayer: the player chosen for the source ("creatures the chosen player controls", CR 607.2d). enchantedPlayer: the player the source Aura is attached to ("creatures enchanted player controls", CR 303.4) | | `owner` | `"you" \| "opponent" \| "any" \| "notYou" \| "current"` | no | Who owns it, relative to you; `current` is the player the enclosing per-player effect is acting for (CR 608.2c: "each player … draws that many" counts that player's own cards via doneThisWay + owner current) | | `kicked` | `boolean` | no | CR 702.33: kicker or multikicker was paid at least once for this spell | | `sharesColorWithTriggeringMana` | `boolean` | no | CR 105.1, 605.1b: has a color among the mana the triggering tapped-for-mana event produced ("shares a color with the mana that land produced"); colorless mana has none | | `manaSpentToCast` | `{ min?: number; max?: number; colored?: boolean }` | no | CR 601.2h: mana actually spent to cast this spell / the permanent it became (any payer, additional costs included); colored counts only W/U/B/R/G. Not cast, or a copy: none spent — "no mana was spent to cast it" is { max: 0 } | | `manaSpentFrom` | `{ types?: string[]; subtypes?: string[]; supertypes?: string[]; min?: number }` | no | CR 601.2h, 106.3: at least min (default 1) of the mana spent to cast this spell / the permanent it became was produced by a source with all the given types/subtypes/supertypes, as the source existed when it produced the mana — "if mana from a Treasure was spent to cast it" is { subtypes: ["Treasure"] }; "three or more mana from creatures" is { types: ["Creature"], min: 3 }; "if {S} was spent to cast this spell" is { supertypes: ["Snow"] }. Not cast, or a copy: none spent | | `castFrom` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | CR 601.2a: the spell was cast from this zone ("target spell cast from a graveyard"); copies were not cast | | `notCastFrom` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | CR 601.2a, 707.10: the spell wasn't cast from this zone ("that wasn't cast from its owner's hand"); copies match | | `convoked` | `boolean` | no | CR 702.51: whether one or more creatures were tapped to pay for this spell with convoke | | `enteredFrom` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | CR 400.7, 603.6a: the permanent entered the battlefield from this zone ("if it entered from your graveyard"); a resolved permanent spell entered from the stack, a token from nowhere | | `hasHybridMana` | `boolean` | no | CR 107.4e-f: mana cost has a hybrid symbol, including 2/W, C/W and W/U/P; W/P alone is not hybrid | | `manaCostContains` | `string` | no | CR 107.3, 202.1: the printed mana cost contains this symbol, e.g. X, even when X is zero | | `hasAdventure` | `boolean` | no | CR 715.1: this card has an Adventure | | `withKeyword` | `string` | no | Has this plain keyword ("Flying") | | `hasBasicLandType` | `boolean` | no | CR 205.3i, 305.6: has a basic land subtype, including nonbasic lands | | `hasNonbasicLandType` | `boolean` | no | CR 205.3i: has a land type other than Plains, Island, Swamp, Mountain and Forest (Gate, Desert, Urza's, …) | | `withKeywordAbility` | `string` | no | Has this parametrized keyword ability identifier, e.g. levelUp (CR 702.1, 702.87) | | `withoutKeywordAbility` | `string` | no | Lacks this parametrized keyword ability identifier ("each nonland card in your hand without foretell") | | `withTapAbility` | `boolean` | no | Has an activated ability with the tap symbol in its cost (CR 602.1, 107.5) | | `withAbility` | `"activated" \| "triggered" \| "mana" \| "nonManaActivated"` | no | CR 602.1, 603.1, 605.1: has an activated, triggered, mana, or nonmana activated ability, including granted and intrinsic abilities | | `withoutManaAbility` | `boolean` | no | CR 605.1: has no activated or triggered mana abilities | | `withoutAbilities` | `boolean` | no | CR 113.1, 113.10: no abilities of any kind, including keywords, granted abilities and intrinsic land abilities | | `withoutKeyword` | `string \| string[]` | no | Lacks this keyword; a list lacks every keyword in it ("Creatures without flying or islandwalk" — neither) | | `tapped` | `boolean` | no | Tapped (true) or untapped (false); on an effect that puts something onto the battlefield, it enters tapped | | `isRingBearer` | `boolean` | no | CR 701.54e (formerly 701.52e): currently a Ring-bearer on the battlefield | | `isToken` | `boolean` | no | CR 111.1: whether this object is a token; false excludes every token type | | `attacking` | `boolean` | no | Attacking (true) / not attacking (false); on an effect that creates or moves a creature, it enters attacking | | `attackingAlone` | `boolean` | no | CR 506.5: attacking and no other creature is attacking ("that's attacking alone") | | `tappedForSourceThisTurn` | `"crew" \| "saddle"` | no | CR 702.122, 702.171, 400.7: this incarnation tapped to crew or saddle this source incarnation this turn | | `attackedThisTurn` | `boolean` | no | Was declared as an attacker this turn, including after combat (CR 508.1) | | `canAttack` | `boolean` | no | CR 508.1a: could attack this turn — untapped, not prevented from attacking, and not summoning sick unless it has haste; false = couldn't attack ("except for creatures that couldn't attack" is true) | | `blockedThisTurn` | `boolean` | no | CR 509.1, 608.2b: this incarnation was declared as a blocker this turn, including after combat | | `wasBlockedThisTurn` | `boolean` | no | CR 509.1h, 608.2b: this incarnation became blocked this turn, including after blockers leave | | `attackingPlayer` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "replacedPlayer" \| "damageSourceController" \| "causeController" \| "affectedController" \| "affectedOwner" \| "triggeringController" \| "triggeringOwner" \| "triggeringOtherController" \| "triggeringOtherOwner" \| "current" \| "previousPlayer" \| "mostLife" \| "leastLife" \| "mostCardsInHand" \| "fewestCardsInHand" \| "enchantedPlayer" \| "yourTeam" \| "chosenPlayer" \| "playerToYourLeft" \| "playerToYourRight" \| "attackedPlayers" \| "attackingOpponents" \| "attackedBySourceThisTurn" \| "attackedBySourceLastCombat" \| { kind: "you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "replacedPlayer" \| "damageSourceController" \| "causeController" \| "affectedController" \| "affectedOwner" \| "triggeringController" \| "triggeringOwner" \| "triggeringOtherController" \| "triggeringOtherOwner" \| "current" \| "previousPlayer" \| "mostLife" \| "leastLife" \| "mostCardsInHand" \| "fewestCardsInHand" \| "enchantedPlayer" \| "yourTeam" \| "chosenPlayer" \| "playerToYourLeft" \| "playerToYourRight" \| "attackedPlayers" \| "attackingOpponents" \| "attackedBySourceThisTurn" \| "attackedBySourceLastCombat"; span?: number; where?: ConditionDef; except?: any; most?: ValueDef; fewest?: ValueDef }` | no | Attacking this player directly, excluding attacks on their planeswalkers or battles (CR 508.1b, 508.6) | | `attackingPlaneswalkerControlledBy` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "replacedPlayer" \| "damageSourceController" \| "causeController" \| "affectedController" \| "affectedOwner" \| "triggeringController" \| "triggeringOwner" \| "triggeringOtherController" \| "triggeringOtherOwner" \| "current" \| "previousPlayer" \| "mostLife" \| "leastLife" \| "mostCardsInHand" \| "fewestCardsInHand" \| "enchantedPlayer" \| "yourTeam" \| "chosenPlayer" \| "playerToYourLeft" \| "playerToYourRight" \| "attackedPlayers" \| "attackingOpponents" \| "attackedBySourceThisTurn" \| "attackedBySourceLastCombat" \| object` | no | Attacking a planeswalker controlled by this player; excludes attacks on players or battles (CR 508.1b) | | `blocking` | `boolean` | no | Is blocking | | `blocked` | `boolean` | no | CR 509.1h, 506.4: true selects blocked attackers, false unblocked attackers, only after blockers are declared; blocked status survives the blockers leaving combat | | `modified` | `boolean` | no | CR 700.9: a permanent with a counter, Equipment, or an Aura controlled by its own controller | | `bandedWithSource` | `boolean` | no | CR 702.22c-f: a different attacking creature in the source's current band; leaving combat removes membership | | `minPowerOrToughness` | `number` | no | Power OR toughness is at least this number (CR 208.1) | | `maxPowerOrToughness` | `number` | no | Power OR toughness is at most this number (CR 208.1) | | `minPowerPlusToughness` | `number` | no | CR 208.1: power plus toughness is at least this number | | `maxPowerPlusToughness` | `number` | no | CR 208.1: power plus toughness is at most this number ("with total power and toughness 5 or less") | | `minPower` | `number` | no | Power at least this number | | `maxBasePower` | `number` | no | CR 208.1: the base power after setting effects and before modifiers is at most this value | | `maxBaseToughness` | `number` | no | CR 208.1: the base toughness after setting effects and before modifiers is at most this value | | `basePower` | `number` | no | CR 208.1: the base power after setting effects and before modifiers is exactly this ("with base power 1"; base power and toughness 1/1 uses both fields) | | `baseToughness` | `number` | no | CR 208.1: the base toughness after setting effects and before modifiers is exactly this | | `powerAboveBase` | `boolean` | no | CR 208.1: current power is greater than the base power after setting effects ("with power greater than its base power"); false: not greater | | `maxPower` | `number` | no | Power at most this number | | `minToughness` | `number` | no | Toughness at least this number | | `maxToughness` | `number` | no | Toughness at most this number | | `minToughnessValue` | `ValueDef` | no | CR 208.1, 608.2h: computed minimum toughness; affectedController refers to the candidate | | `maxToughnessValue` | `ValueDef` | no | CR 208.1, 608.2h: computed maximum toughness ("toughness X or less"); affectedController refers to the candidate | | `minManaValueValue` | `ValueDef` | no | CR 202.3, 608.2h: contextual lower mana value bound | | `minManaValue` | `number` | no | Mana value at least this number | | `maxManaValue` | `number` | no | Mana value at most this number | | `manaValueValue` | `ValueDef` | no | Exact computed mana value (CR 202.3, 608.2h) | | `manaValues` | `number[]` | no | Allowed mana values, e.g. 2 or 3 (CR 202.3) | | `manaCosts` | `string[]` | no | The card's mana cost is exactly one of these — "an artifact card with mana cost {0} or {1}" (Urza's Saga): a card with {X} in its cost or no mana cost does not match (CR 202.1) | | `maxManaValueValue` | `ValueDef` | no | Mana value at most a computed value, such as your devotion to black (CR 202.3) | | `manaValueVar` | `string` | no | Mana value equals this variable (e.g. "X") | | `hasCounter` | `string` | no | Has a counter of this kind; any = any kind of counter (CR 122.1) | | `inZone` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | The object is in this zone: one branch of a union target across zones ("target permanent or suspended card" → anyOf [{ inZone: battlefield }, { suspended: true }] over zones battlefield and exile; CR 400.1) | | `suspended` | `boolean` | no | CR 702.62a: a suspended card (exiled with time counters under suspend) when true; false excludes them | | `withoutCounter` | `string` | no | Has no counters of this kind; any = no counters at all (CR 122.1, 608.2b) | | `self` | `boolean` | no | Only the source itself | | `other` | `boolean` | no | Anything except the source ("another") | | `otherThanTrigger` | `boolean` | no | Exclude the object that caused the trigger, rather than the ability's source (CR 603.10a, 608.2h) | | `otherThanAffected` | `boolean` | no | Exclude the object the effect is being applied to, rather than the ability's source: "Each legendary creature you control gets +1/+1 for each other legendary creature you control" (CR 608.2h, 613.4c) | | `name` | `string` | no | Exact card name | | `nameOf` | `"self" \| "affected"` | no | Shares the source's name ("self"), or the name of the preceding single object selection ("affected": "a creature card with the same name as that creature", CR 201.2) | | `host` | `boolean` | no | The object the source is attached to | | `attachedToSource` | `boolean` | no | Attached to the source ("Auras attached to ~") | | `attachedToReference` | `"affected" \| "triggering" \| "triggeringOther"` | no | Attached to the preceding selected object or the triggering event's object/other object: Equipment/Auras attached to that creature (CR 301.5, 303.4, 608.2c) | | `attachedTo` | `ObjectFilter` | no | CR 301.5, 303.4, 701.3: attached to a battlefield permanent matching this host filter; does not select or target the host | | `sharesWithHost` | `"creatureType" \| "color" \| "cardType"` | no | Shares this characteristic with the source's attachment host (CR 303.4, 301.5) | | `attachedToHost` | `boolean` | no | Is (or is not) attached to the source's host | | `enchanted` | `boolean` | no | Has (or does not have) at least one Aura attached (CR 303.4b) | | `hasAttachment` | `{ subtypes?: string[]; supertypes?: string[]; controller?: "you" \| "opponent" \| "any" \| "notYou" }` | no | CR 303.4, 301.5: has an attached Aura / Equipment (its subtypes / supertypes, and its controller relative to this ability's controller) — "creatures that are enchanted by an Aura you control", "a creature you control with a legendary Equipment attached to it". Non-recursive: the attachment is a plain characteristic set | | `enchantedByOther` | `boolean` | no | CR 303.4, 704.5m: has an attached Aura other than this ability source. Rechecked for enchant legality after attachment | | `equipped` | `boolean` | no | Has (or does not have) at least one Equipment attached (CR 301.5) | | `notAffected` | `boolean` | no | Exclude objects in the latest affected selection: the rest (CR 608.2c-d) | | `notChosenSubtype` | `boolean \| string` | no | Does not have the chosen creature type; changeling has every creature type (CR 205.3m, 702.73) | | `chosenSubtype` | `boolean \| string` | no | Choice in the resolving ability, falling back to the source; true uses the default kind key, a string selects a named key (CR 608.2d) | | `chosenColor` | `boolean \| string` | no | Choice in the resolving ability, falling back to the source; true uses the default kind key, a string selects a named key (CR 608.2d) | | `chosenParity` | `boolean \| string` | no | Mana value has the chosen odd/even quality; zero is even (CR 107.1) | | `chosenPowerParity` | `boolean \| string` | no | Power has the chosen odd/even quality ("each creature with power of the chosen quality"); zero is even (CR 107.1, 208.1) | | `manaValueParity` | `"odd" \| "even"` | no | "With an odd / even mana value": a fixed parity; zero is even (CR 202.3) | | `chosenKind` | `boolean \| string` | no | CR 608.2d: matches the chosen land or nonland kind | | `chosenType` | `boolean \| string` | no | Matches the chosen card type (CR 205.2, 608.2d) | | `chosenName` | `boolean \| string` | no | Choice in the resolving ability, falling back to the source; true uses the default kind key, a string selects a named key (CR 608.2d) | | `chosenBy` | `"controller" \| "owner"` | no | CR 101.4, 608.2d: with several choosers (choose with collect), chosenColor / chosenName / chosenType / chosenSubtype / notChosenSubtype read the answer of this object's controller (a card's owner off the battlefield) or owner — "only the color its controller chose" | | `comparedToSource` | `{ property: "power" \| "toughness" \| "manaValue"; op: "<" \| "<=" \| ">" \| ">=" \| "==" }` | no | Compare a property with the source's ("creature with lesser power", "greater mana value than ~") | | `comparedToTrigger` | `{ property: "power" \| "toughness" \| "manaValue"; op: "<" \| "<=" \| ">" \| ">=" \| "==" }` | no | Compare a property with the object that caused the trigger; death/leaves events use its battlefield snapshot (CR 603.10a, 608.2h) | | `maxManaValueVar` | `string` | no | Mana value at most this cast-time variable ("mana value X or less") | | `minManaValueVar` | `string` | no | Mana value at least this cast-time variable ("mana value X or greater") | | `minPowerValue` | `ValueDef` | no | Minimum power evaluated in context | | `maxPowerVar` | `string` | no | Power at most this cast-time variable ("power X or less") | | `maxPowerValue` | `ValueDef` | no | Computed maximum power; affectedController refers to the candidate (CR 608.2h) | | `designation` | `string` | no | Carries this designation (monstrous, renowned, suspected, saddled, goaded, paired, …) | | `withoutDesignation` | `string` | no | Lacks this designation | | `attachedToSameHost` | `boolean` | no | Attached to the same object the source is attached to | | `isCommander` | `boolean` | no | Is a commander | | `linkedToSource` | `boolean` | no | Cards exiled with / linked to the source (imprint, "the exiled card") | | `putWithSource` | `boolean` | no | CR 607.2a: put onto the battlefield with the source — the permanent its ability put there is linked to it ("the creature put onto the battlefield with this enchantment", Diabolic Servitude; "enchant creature put onto the battlefield with this Aura", Animate Dead). Same link as linkedToSource; it only prints differently | | `phasedOut` | `boolean` | no | Is phased out | | `faceDown` | `boolean` | no | Face down (CR 708) | | `sharesWithSource` | `"creatureType" \| "cardType" \| "color" \| "name"` | no | Shares a creature type / card type / color / name with the source | | `sharesWithSacrificed` | `"creatureType" \| "cardType" \| "color" \| "name"` | no | CR 601.2h, 602.2b, 608.2h: shares the characteristic with the object sacrificed to pay this spell's or ability's cost, as it last existed on the battlefield (Pyre of Heroes: "a creature card that shares a creature type with the sacrificed creature"); with any of them when several were sacrificed, never when none was | | `notSharesLandTypeWith` | `{ controller?: "you" \| "opponent" \| "any" \| "notYou" }` | no | Shares no land subtype with any battlefield land controlled by this relation (CR 205.3i, 608.2b) | | `sharesWithTarget` | `"creatureType" \| "cardType" \| "color" \| "name"` | no | Shares a creature type / card type / color / name with the ability's first chosen target (radiance) | | `sharesWith` | `{ property: "creatureType" \| "cardType" \| "permanentType" \| "color" \| "name" \| "manaValue" \| "controller"; with?: TargetDef; negate?: boolean }` | no | CR 608.2h: shares the property with an object of the selection reference — { mode: "self" } the source, { mode: "affected" } / { mode: "triggering" } "that creature" / "it", { mode: "host" } the enchanted permanent, a declared target slot. Generalises sharesWithSource / sharesWithHost / sharesWithTarget; negate = "doesn't share". Never matches the referenced object itself | | `comparedTo` | `{ property: "power" \| "toughness" \| "manaValue" \| "powerPlusToughness"; op: "<" \| "<=" \| ">" \| ">=" \| "=="; with?: TargetDef; offset?: number }` | no | CR 608.2h: compare a characteristic with every object of the selection reference ("creatures with power less than that creature's power"); `offset` is added to theirs ("at least 2 greater"). Generalises comparedToSource / comparedToTrigger | | `attachedToSelection` | `TargetDef` | no | CR 301.5, 303.4: attached to an object of the selection reference ("all Equipment attached to that creature" = { mode: "affected" }). Generalises attachedToSource / attachedToReference | | `inSelection` | `TargetDef` | no | Is one of the objects of the selection reference (the same incarnation, CR 400.7) — with anyOf it unions a declared target with the objects related to it: "target creature and each other creature that shares a creature type with it" destroyed as one event | | `targetableByTriggering` | `boolean` | no | CR 115.1, 707.10d: "that spell could target" — a legal target for each instance of the word target of the spell or ability that caused this trigger (castSpell / activatesAbility), as it now is on the stack; nothing once it has no targets or left the stack | | `targetOfTriggering` | `boolean` | no | CR 115.1, 603.2: an object the spell or ability that caused this trigger targeted as it was cast or activated (same incarnation, CR 400.7) — "each other Golem" than the one it targets is exclude targetOfTriggering | | `controllerOfTriggeringTarget` | `boolean` | no | CR 115.1, 603.2: controlled by a player who controlled an object the triggering spell or ability targeted as it was cast or activated (fixed then) — "another opponent" than the one whose permanent it targets is controller opponent with exclude controllerOfTriggeringTarget | | `combatWith` | `{ relation: "blocking" \| "blockedBy" \| "attacking" \| "attackedBy"; of?: TargetDef }` | no | CR 506.4, 509.1: in this combat relation to an object of the selection reference — blocking it, blocked by it, attacking it (a planeswalker or battle), attacked by it | | `discardedThisTurn` | `boolean` | no | Was discarded this turn (mayhem) | | `enteredGraveyardThisTurn` | `true \| "fromAnywhere" \| "fromBattlefield" \| "fromLibrary" \| "milled"` | no | Cards still in the graveyard that were put there this turn (CR 400.7, 404.3): true from anywhere ("a creature card from a graveyard that was put there this turn"), fromAnywhere the same printed "put there from anywhere this turn", fromBattlefield only from the battlefield, fromLibrary only from a library ("put there from their library this turn"), milled only by a mill action (CR 701.17a, surveil's graveyard pile included — "cards in your graveyard that were milled this turn") | | `attached` | `boolean` | no | Is (not) attached to something | | `enteredThisTurn` | `boolean` | no | CR 400.7, 603.6a, 608.2b: this incarnation entered this turn; false excludes such entries | | `alreadyOnBattlefield` | `boolean` | no | CR 614.12: "for each Angel you already control" — while a permanent's entry replacements apply, neither it nor a permanent entering at the same time matches; otherwise every battlefield permanent does | | `enteredThisTurnUnder` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "replacedPlayer" \| "damageSourceController" \| "causeController" \| "affectedController" \| "affectedOwner" \| "triggeringController" \| "triggeringOwner" \| "triggeringOtherController" \| "triggeringOtherOwner" \| "current" \| "previousPlayer" \| "mostLife" \| "leastLife" \| "mostCardsInHand" \| "fewestCardsInHand" \| "enchantedPlayer" \| "yourTeam" \| "chosenPlayer" \| "playerToYourLeft" \| "playerToYourRight" \| "attackedPlayers" \| "attackingOpponents" \| "attackedBySourceThisTurn" \| "attackedBySourceLastCombat" \| object` | no | CR 603.6a, 400.7: entered this turn under this player's control, independent of current control | | `damagedThisTurn` | `boolean` | no | Was dealt damage this turn | | `dealtDamageThisTurn` | `boolean` | no | CR 120.4, 608.2b: this incarnation dealt positive damage this turn | | `dealtDamageToThisTurn` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "replacedPlayer" \| "damageSourceController" \| "causeController" \| "affectedController" \| "affectedOwner" \| "triggeringController" \| "triggeringOwner" \| "triggeringOtherController" \| "triggeringOtherOwner" \| "current" \| "previousPlayer" \| "mostLife" \| "leastLife" \| "mostCardsInHand" \| "fewestCardsInHand" \| "enchantedPlayer" \| "yourTeam" \| "chosenPlayer" \| "playerToYourLeft" \| "playerToYourRight" \| "attackedPlayers" \| "attackingOpponents" \| "attackedBySourceThisTurn" \| "attackedBySourceLastCombat" \| object` | no | CR 120.4, 400.7, 608.2b: this incarnation dealt positive damage to this player earlier this turn | | `dealtCombatDamageToThisTurn` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "replacedPlayer" \| "damageSourceController" \| "causeController" \| "affectedController" \| "affectedOwner" \| "triggeringController" \| "triggeringOwner" \| "triggeringOtherController" \| "triggeringOtherOwner" \| "current" \| "previousPlayer" \| "mostLife" \| "leastLife" \| "mostCardsInHand" \| "fewestCardsInHand" \| "enchantedPlayer" \| "yourTeam" \| "chosenPlayer" \| "playerToYourLeft" \| "playerToYourRight" \| "attackedPlayers" \| "attackingOpponents" \| "attackedBySourceThisTurn" \| "attackedBySourceLastCombat" \| object` | no | CR 510.2, 400.7, 608.2b: this incarnation dealt positive combat damage to this player earlier this turn ("a creature … that dealt combat damage to you this turn") | | `counterPlacedThisTurnBy` | `"you"` | no | You put a counter on this incarnation this turn; remains true after removal (CR 122.6, 608.2b) | | `damagedBySource` | `boolean` | no | Was dealt damage by this incarnation of the source this turn (CR 400.7, 603.10a; "a creature dealt damage this way") | | `damagedByHost` | `boolean` | no | CR 120.1, 603.10a: was dealt damage this turn by the host of this Aura or Equipment, the creature it enchants or equips as that creature is now ("a creature dealt damage by equipped creature this turn") | | `damagedThisTurnBy` | `ObjectFilter` | no | CR 120.1, 400.7, 608.2h: this incarnation was dealt damage this turn by a source matching this filter as the source was when it dealt the damage — "another creature dealt damage this turn by a Spider you controlled" is { subtypes: ["Spider"], controller: "you" } (Shelob, Child of Ungoliant) | | `drawnThisTurn` | `boolean` | no | CR 121.1, 400.7: a card in hand its owner drew this turn and that hasn't left the hand since ("two cards in your hand drawn this turn": Sylvan Library) | | `fromStartingDeck` | `boolean` | no | Alchemy (Actualize): the card began the game in your deck (a commander is part of it, CR 903.5a); false = conjured, drafted or created cards, or another player's ("a spell that isn't from your starting deck") | | `minCounters` | `number` | no | At least this many of the hasCounter kind | | `hasSticker` | `"any" \| "name" \| "art" \| "ability" \| "pt"` | no | Has a sticker of this kind on it | | `onSprocket` | `1 \| 2 \| 3 \| "crank"` | no | Contraption on this sprocket (or the one with the CRANK! counter) | | `isHost` | `boolean` | no | A host creature without an augment | | `hasAugment` | `boolean` | no | A combined host + augment creature | **Selection algebra — a `target` is a composition, not a menu.** The engine has no "exile a random card" primitive and no "discard chosen cards" primitive. It has *actions* (`exile`, `moveTo`, `destroy`, `discard`, `sacrifice`, `bounce`, `tap`, `dealDamage`, counters, …) that each take a TargetDef, and a TargetDef is the product of independent axes. Pick a value on each axis; every action accepts the result: | Axis | Field | Values | |---|---|---| | what | `of` | `object` (cards and permanents), `player`, `spell`, `ability`, `spellOrAbility`, `any` (creature, player, planeswalker or battle) | | how it is picked | `mode` | `chosen` — a *target*, prompted when the spell or ability is put on the stack (default); `choose` — picked as the effect resolves, not a target; `all`; `random` — sampled on resolution; `top` — the top card(s) of an ordered zone; `self`; `host`; and the back-references `affected`, `triggering`, `triggeringOther`, `created`, `linked`, `paired`, `about`, `replaced`, `replacedSource`, `thisWay` | | where | `zone` / `zones` / `allZones` | `battlefield` (default), `hand`, `graveyard`, `library`, `exile`, `stack`, `command`; `zones: ["hand", "graveyard"]` is one pick across both | | whose | `player` (+ `playerTarget`) | `you` (default), `eachOpponent`, `eachPlayer`, `controller`, `owner`, `triggeringPlayer`, `defendingPlayer`, …; `"target"` reads a player target written in `playerTarget` — `mode: "chosen"` is "target opponent's hand", `mode: "choose"` is "an opponent's hand" picked on resolution. On the battlefield `player` means controller; in every other zone, owner | | all but one | `exceptPlayer` (`of: "player"`) | a player selector removed from the candidates — "each other opponent" is `player: "eachOpponent", exceptPlayer: "triggeringPlayer"`; "each other player" after a named player excludes that player the same way | | which | `filter` | any ObjectFilter — types, colours, controller, power, counters, names, …; omit it for "a card". Relations to another selection are fields too: `sharesWith: { property, with }`, `comparedTo: { property, op, with }`, `attachedToSelection`, `combatWith: { relation, of }` — `with` / `of` is any TargetDef (`{ "mode": "affected" }` "it", `{ "mode": "self" }`, a `slot`) | | how many | `min` / `max` | `max: 2` = "two", `min: 0` = "up to", `max: "any"` = "any number", a ValueDef such as X; for `random`, `max` is how many distinct objects are sampled | | who decides | `chooser` | the player making a `chosen` / `choose` pick when it is not the controller ("that player chooses", "of their choice") | | one group, several clauses | `slot` | a name shared by every `chosen` selector that means the same declared target ("Choose target creature you control and target creature you don't control. … those creatures fight each other" → the fight repeats both selectors with their slots); the engine prompts once per slot and any later clause — or a value, `{ "kind": "aggregate", "target": … }` — reads the same group (CR 601.2c) | Players compose the same way: every player selector (`who`, `player`, `chooser`, a value's `who`) may be the structured form `{ "kind": "eachOpponent" | "eachPlayer" | …, "where": , "except": , "most" | "fewest": }` — "each opponent who controls a creature", "each player other than you", "the player with the most cards in hand" — with `where` and the value read *as each candidate* (CR 608.2h). Because the axes are independent, phrases nobody wrote a primitive for are already expressible: - "Exile a card at random from an opponent's hand" → `{ "effect": "exile", "target": { "of": "object", "mode": "random", "zone": "hand", "player": "target", "playerTarget": { "of": "player", "mode": "choose", "player": "eachOpponent" } } }`. - "Target opponent exiles two cards at random from their hand" → the same with `"playerTarget": { "of": "player", "mode": "chosen", "player": "eachOpponent" }` and `"max": 2`. - "Each opponent exiles a card at random from their hand" → `"player": "eachOpponent"` and no `playerTarget`. - "Put a creature card at random from your graveyard onto the battlefield" → `{ "effect": "moveTo", "destination": "battlefield", "target": { "of": "object", "mode": "random", "zone": "graveyard", "player": "you", "filter": { "types": ["Creature"] } } }`. - "Destroy a land chosen at random" → `{ "effect": "destroy", "target": { "of": "object", "mode": "random", "filter": { "types": ["Land"] } } }` — `random` works on the battlefield too. - "Exile all cards from target player's graveyard" → `{ "effect": "exile", "target": { "of": "object", "mode": "all", "zone": "graveyard", "player": "target", "playerTarget": { "of": "player", "mode": "chosen" } } }`. - "Return a creature or Aura card from your graveyard to your hand" → `{ "effect": "bounce", "target": { "of": "object", "mode": "choose", "zone": "graveyard", "player": "you", "filter": { "anyOf": [{ "types": ["Creature"] }, { "subtypes": ["Aura"] }] } } }` — an OR across two filter fields is `anyOf` branches (each branch is a whole filter). - "Target player sacrifices an artifact of their choice" → `{ "effect": "sacrifice", "who": "target", "player": { "of": "player", "mode": "chosen" }, "target": { "of": "object", "mode": "choose", "filter": { "types": ["Artifact"] } } }` (`sacrifice` names its player target `player`). Rules of thumb: `discard.random: true` is a convenience for the discard wording ("discards a card at random") — it is not evidence that randomness belongs to discard; "a card" with no filter means any card; a player exiling, sacrificing or returning *their own* cards is said with `player` (whose zone) plus `chooser` only when someone other than the controller makes the pick. **Never declare a combination unsupported before composing it on these axes and validating it**: what the validator accepts, the engine plays, and the English rendering (Explain) shows exactly what it will do. **What the engine guarantees.** Every cell of action × mode × zone × player × filter × count is played in the engine's own test suite (the *selection matrix*: exile, bounce, moveTo to each zone, destroy, sacrifice, discard, tap, dealDamage, addCounters × chosen / choose / all / random / top × battlefield / hand / graveyard / library / exile × you / eachOpponent / eachPlayer / target × filter × 1 / 2 / any — some three thousand combinations), and each must act on exactly the objects the axes name. A combination that validates and then does nothing is a bug, not a limitation. Three details the matrix pins down: - *Counts are per player for `who`-based actions and pooled for selections.* "Each player sacrifices two creatures" / "each player discards a card" (`sacrifice`, `discard` with `who`) apply the count to each player; "exile two cards from graveyards" (a `target` with `player: "eachPlayer"`) picks two in total. - *The action adds its own eligibility rule to any selection.* `dealDamage` only ever selects creatures, planeswalkers and battles (CR 120.3) — "deals 1 damage to each permanent" harms only those, whichever mode picks them — so the filter never has to repeat the rules of the game. - *The one combination that cannot mean anything is rejected, with guidance.* A `target` (`mode: "chosen"`, declared while casting) cannot have its player half picked on resolution (`playerTarget.mode: "choose"`): the validator says so and names the three honest forms — make the player a target too (`"chosen"`: "target opponent's graveyard"), say whose with the filter (`controller` / `owner: "opponent"`), or pick the object on resolution (`mode: "choose"`). Every `mode`, player selector, filter relation, duration and `thisWay` action, one line each, and how parts of a card refer to each other: **Relationships & references** (`https://drawstep.xyz/wiki/mtg/references.md`). Selector cheat-sheet: "target creature an opponent controls" = `{ of: "object", mode: "chosen", filter: { types: ["Creature"], controller: "opponent" } }`; "any target" = `{ of: "any" }`; "each creature" = `{ of: "object", mode: "all", filter: { types: ["Creature"] } }`; "target player" = `{ of: "player", mode: "chosen" }`; "target opponent" = `{ of: "player", mode: "chosen", player: "eachOpponent" }`; "enchanted creature" = `{ of: "object", mode: "host" }`; "target creature card in your graveyard" = `{ of: "object", zone: "graveyard", filter: { types: ["Creature"], owner: "you" } }`; "target spell" = `{ of: "spell" }`; "nonbasic lands" = `{ of: "object", mode: "all", filter: { types: ["Land"], notSupertypes: ["Basic"] } }`; "up to two target creatures" = add `min: 0, max: 2`.