# Drawstep engine · Effects · `dealDamage` > Deal damage — e.g. “~ deals 1 damage to target permanent chosen at random that share a creature type”. 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/effects#dealDamage ## Where it goes One step of an ability's `effects[]` (a spell's, a trigger's, an activated ability's, a mode's): `{ "effect": "dealDamage", … }`. Steps resolve in order. Printed words that point here (search aliases): deals damage burn bolt deals that much damage to itself deals damage equal to its power. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `whenCreatureDies` | `EffectDef[]` | no | Trigger these effects once if a creature dies from this damage at the immediately following state-based action check | | `target` | `TargetDef` | yes | Who or what is dealt the damage. Whatever the mode, only creatures, planeswalkers, battles and players are ever selected (CR 120.3): the filter need not say so | | `amount` | `ValueDef` | yes | How many / how much (integer or ValueDef) | | `from` | `TargetDef` | no | The object that deals the damage instead of the source ("target creature you control deals damage equal to its power to …"); values such as sourcePower are read from it | | `divided` | `boolean` | no | "… damage divided as you choose among one, two, or three targets / any number of targets": the division is announced as the spell is cast (each target at least 1, CR 601.2d); an illegal target on resolution loses its share | | `dividedEvenly` | `boolean` | no | CR 608.2b, 608.2h: divide damage evenly, rounded down, among targets still legal on resolution; no casting-time allocation | | `excessTo` | `"controller" \| { controllerIfSourceHas: string }` | no | "Excess damage is dealt to that creature's controller instead" (CR 120.4a): each selected permanent is dealt only lethal damage (toughness less damage marked, 1 from a deathtouch source, loyalty, defense) and its controller is dealt the rest at the same time | | `and` | `({ target: TargetDef; amount: ValueDef })[]` | no | Further recipients of the same instruction (CR 120.2b, 608.2c, 603.2c): "deals 4 damage to any target and 3 damage to each of up to two other targets", "to each creature without flying and each player". The same source (`from` included) deals all of it as one simultaneous damage event: every group is selected before any damage is dealt, a recipient named twice is dealt the sum once, lifelink gains once (CR 120.3f) and each prevention effect applies once per recipient (CR 615.13) | ## Minimal form ```json {"effect":"dealDamage","target":{"of":"object","among":"triggering","random":true,"playerOwns":true,"playerFilter":"opponent","sharedBy":"creatureType","permanents":true},"amount":1} ``` The engine reads that minimal form as: “~ deals 1 damage to target permanent chosen at random that share a creature type”. ## Stock examples - **Bonecrusher Giant** — “Stomp {1}{R} — Instant — Adventure: Stomp deals 2 damage to any target.” ```json {"effect":"dealDamage","target":{"of":"any","mode":"chosen"},"amount":2} ``` - **Blue Bolt Witness** — “” ```json {"effect":"dealDamage","target":{"of":"any","mode":"chosen"},"amount":3} ``` - **Division Witness** — “” ```json {"effect":"dealDamage","target":{"of":"any","mode":"chosen","min":1,"max":2},"amount":3,"divided":true} ``` ## Related - [Effects](https://drawstep.xyz/wiki/mtg/effects.md) — the whole topic - [Filters & targets](https://drawstep.xyz/wiki/mtg/targets.md) — how `target` / `filter` select objects and players (selection algebra) - [Values](https://drawstep.xyz/wiki/mtg/values.md) — every number kind an `amount` accepts - [Effects](https://drawstep.xyz/wiki/mtg/effects.md) — the steps a nested `effects` / `then` list may contain - [Start here](https://drawstep.xyz/wiki/mtg/start.md) — the rules, the output contract and the index of every primitive