# Drawstep engine · Effects · `gainAbilitiesOf` > Gain abilities of — CR 611.2c, 613.1f: "gains all activated abilities of target creature until end of turn" — the targets have the from objects' abilities (fixed on resolution) for the duration; each gained ability refers to the object that has it. 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#gainAbilitiesOf ## Where it goes One step of an ability's `effects[]` (a spell's, a trigger's, an activated ability's, a mode's): `{ "effect": "gainAbilitiesOf", … }`. Steps resolve in order. Printed words that point here (search aliases): gains all activated abilities of target creature until end of turn gains all abilities of those creatures. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `target` | `TargetDef` | yes | What it acts on (TargetDef) | | `from` | `TargetDef` | yes | The objects whose abilities are gained, as they exist on resolution (a chosen target, the linked exiled cards, a zone set) | | `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 | | `duration` | `Duration` | no | CR 611.2a-b, 702.26f: continuous-effect duration. Conditional source/target filters are ANDed, identities and you are fixed on resolution, and failure ends the effect permanently. untilEndOfYourNextTurn lasts through your next turn's end step and expires at cleanup; whileYourTurn ends when another player becomes active and cannot start on an opponent's turn. untilYourNextEndStep / untilYourNextUpkeep end as that step begins; endOfCombat ends as the end-combat step ends (CR 511.2); endOfAdditionalCombat lasts through the additional combat phase created before it resolved, ending as that combat's end-combat step ends (CR 500.8, 506.1 — "that combat"). untilEvent ends when the described event happens. perpetual survives zone changes | | `chooseKeyword` | `boolean` | no | Each recipient gains up to one keyword ability of its controller's choice | ## Minimal form ```json {"effect":"gainAbilitiesOf","target":{"of":"object","mode":"chosen","filter":{"types":["Creature"]}},"from":{"of":"object","among":"triggering","random":true,"playerOwns":true,"playerFilter":"opponent","sharedBy":"creatureType","permanents":true}} ``` The engine reads that minimal form as: “target creature gains all abilities of target permanent chosen at random that share a creature type until end of turn”. ## Stock examples - **Grell Philosopher** — “Aberrant Tinkering — When this creature enters and at the beginning of your upkeep, each Horror you control gains all activated abilities of target artifact an opponent controls until end of turn.” ```json {"effect":"gainAbilitiesOf","target":{"of":"object","mode":"all","filter":{"subtypes":["Horror"],"controller":"you"}},"from":{"of":"object","mode":"chosen","filter":{"types":["Artifact"],"controller":"opponent"}},"kinds":["activated"],"spendAsAny":{"colors":["U"]},"duration":"endOfTurn"} ``` ## 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 - [Start here](https://drawstep.xyz/wiki/mtg/start.md) — the rules, the output contract and the index of every primitive