# Drawstep engine · Conditions · `objectMatches` > Object matches — CR 109.2, 303.4, 301.5, 611.3: current characteristics and zone of this source or the permanent it enchants/equips; battlefield by default. Does not select targets. 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#objectMatches ## Where it goes A condition: `{ "kind": "objectMatches", … }` — 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 | |---|---|---|---| | `object` | `"source" \| "host"` | yes | Which object is tested: the source or its host | | `filter` | `ObjectFilter` | no | 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) | ## Minimal form ```json {"kind":"objectMatches","object":"source"} ``` The engine reads that minimal form as: “~ is on the battlefield”. ## Stock examples - **Legendfire Hammer** — “Equipped creature gets +3/+0 as long as it's legendary.” ```json {"kind":"objectMatches","object":"host","filter":{"supertypes":["Legendary"]}} ``` - **Price of Loyalty** — “Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn. If mana from a Treasure was spent to cast this spell, that creature gets +2/+0 until end of turn.” ```json {"kind":"objectMatches","object":"source","filter":{"manaSpentFrom":{"subtypes":["Treasure"]}},"zone":"stack"} ``` - **Fists of the Demigod** — “As long as enchanted creature is black, it gets +1/+1 and has wither.” ```json {"kind":"objectMatches","object":"host","filter":{"colors":["B"]}} ``` ## 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