# Drawstep engine · Conditions · `affectedMatches` > Affected matches — An object the previous effect of this resolution applied to (the back-reference behind target mode "affected") matches the filter: "If it's a land card, you may put it onto the battlefield" after "exile the top card of your library". `span` unions the previous N effects' selections. Engine: Magic: The Gathering (`mtg`). This is one primitive of the Drawstep card vocabulary; field names and the discriminator are exact. Wiki page: https://drawstep.xyz/wiki/mtg/conditions#affectedMatches ## Where it goes A condition: `{ "kind": "affectedMatches", … }` — in an `if` effect, a trigger's `condition` (intervening if), a static's `condition` ("as long as"), an activated ability's `onlyIf`, a replacement's `unless`. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `filter` | `ObjectFilter` | yes | Which objects (ObjectFilter; set fields AND together) | | `zone` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | A zone name (battlefield, hand, graveyard, library, exile, stack, command) | | `span` | `number` | no | How many preceding selections to union (default 1) | | `digSubset` | `"looked" \| "picked" \| "rest"` | no | Read the cards of the enclosing `digTop`: `looked` (all looked at), `picked` (taken by a pick), `rest` (the remainder) | | `quantifier` | `"any" \| "all"` | no | any (default): at least one of the referenced objects matches; all: every one does and there is at least one ("if all cards revealed this way are creature cards") | | `lastKnown` | `boolean` | no | CR 608.2h: a referenced permanent that left the battlefield is tested with its last-known controller and counters ("If you controlled that permanent, draw a card") | ## Minimal form ```json {"kind":"affectedMatches","filter":{"types":["Creature"]}} ``` The engine reads that minimal form as: “it's a creature”. ## Stock examples - **Hydroblast** — “• Counter target spell if it's red.” ```json {"kind":"affectedMatches","filter":{"colors":["R"]}} ``` - **Pyroblast** — “• Counter target spell if it's blue.” ```json {"kind":"affectedMatches","filter":{"colors":["U"]}} ``` - **Pyroblast** — “• Counter target spell if it's blue.” ```json {"kind":"affectedMatches","filter":{"colors":["U"]}} ``` ## Related - [Conditions](https://drawstep.xyz/wiki/mtg/conditions.md) — the whole topic - [Filters & targets](https://drawstep.xyz/wiki/mtg/targets.md) — how `target` / `filter` select objects and players (selection algebra) - [Start here](https://drawstep.xyz/wiki/mtg/start.md) — the rules, the output contract and the index of every primitive