# Drawstep engine · Statics & layers · `gainAbilitiesOf` > Gain abilities of — CR 613.1f: the affected objects have all abilities of the from objects as though printed on them ("has all activated abilities of all creature cards in all graveyards"); each gained ability refers to the object that has it, and nothing gains abilities from itself. 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/statics#gainAbilitiesOf ## Where it goes The `effect` of a static ability (or one of its `effects`): `{ "kind": "static", "effect": { "type": "gainAbilitiesOf", … } }`. Applied continuously through the layer system. Printed words that point here (search aliases): has all activated abilities of has all abilities of all creature cards in all graveyards necrotic ooze. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `to` | `TargetDef` | yes | What it applies to (TargetDef) | | `from` | `TargetDef` | yes | The objects whose abilities are had: a zone set ("all creature cards in all graveyards"), the linked exiled cards (mode linked), the host, … | | `kinds` | `("activated" \| "triggered" \| "static" \| "keyword")[]` | no | Which classes of abilities (default all): activated includes loyalty and mana abilities, static includes replacement effects, keyword covers simple keywords and parametrised keyword abilities | | `spendAsAny` | `{ colors?: ("W" \| "U" \| "B" \| "R" \| "G")[] }` | no | CR 609.4b, 613.1f: "You may spend mana as though it were mana of any color to activate those abilities" — the costs of the gained activated abilities may be paid with mana of any color | ## Minimal form ```json {"type":"gainAbilitiesOf","to":{"of":"object","mode":"self"},"from":{"of":"object","among":"triggering","random":true,"playerOwns":true,"playerFilter":"opponent","sharedBy":"creatureType","permanents":true}} ``` The engine reads that minimal form as: “~ has all abilities of target permanent chosen at random that share a creature type”. ## Stock examples - **Necrotic Ooze** — “As long as this creature is on the battlefield, it has all activated abilities of all creature cards in all graveyards.” ```json {"type":"gainAbilitiesOf","to":{"of":"object","mode":"self"},"from":{"of":"object","mode":"all","zone":"graveyard","filter":{"types":["Creature"]}},"kinds":["activated"]} ``` - **Trazyn the Infinite** — “Prismatic Gallery — As long as Trazyn is on the battlefield, it has all activated abilities of all artifact cards in your graveyard.” ```json {"type":"gainAbilitiesOf","to":{"of":"object","mode":"self"},"from":{"of":"object","mode":"all","zone":"graveyard","filter":{"types":["Artifact"],"owner":"you"}},"kinds":["activated"]} ``` - **Dark Impostor** — “This creature has all activated abilities of all creature cards exiled with it.” ```json {"type":"gainAbilitiesOf","to":{"of":"object","mode":"self"},"from":{"of":"object","mode":"all","zone":"exile","filter":{"types":["Creature"],"linkedToSource":true}},"kinds":["activated"]} ``` ## Related - [Statics & layers](https://drawstep.xyz/wiki/mtg/statics.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 - [Start here](https://drawstep.xyz/wiki/mtg/start.md) — the rules, the output contract and the index of every primitive