# Drawstep engine · Effects · `separatePiles` > Separate piles — CR 700.3: separate cards from any zone into two piles, let a player choose one, then do things with each pile ("separate them into a face-down pile and a face-up pile. An opponent chooses one of those piles. Put that pile into your hand and exile the rest"). 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#separatePiles ## Where it goes One step of an ability's `effects[]` (a spell's, a trigger's, an activated ability's, a mode's): `{ "effect": "separatePiles", … }`. Steps resolve in order. Printed words that point here (search aliases): separate them into two piles separate into a face-down pile and a face-up pile an opponent chooses one of those piles put one pile into your hand fact or fiction. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `target` | `TargetDef` | yes | The cards to separate: a graveyard selection, the top cards of a library (mode top), or "those cards" (mode affected) | | `separator` | `"you" \| "opponent"` | no | Who splits the cards into two piles (default you) | | `chooser` | `"you" \| "opponent" \| "target"` | no | Who picks a pile (default you); an opponent is chosen on resolution when there are several; target is the declared player whose permanents are separated ("… in the pile of their choice") | | `faceDown` | `boolean` | no | CR 700.3d: the first pile stays face down for a chooser who didn't separate it | | `reveal` | `boolean` | no | Reveal the set before separating it | | `chosen` | `EffectDef[]` | no | Effects on the chosen pile: target mode affected is "those cards" | | `rest` | `EffectDef[]` | no | Effects on the other pile: target mode affected is "those cards" | ## Minimal form ```json {"effect":"separatePiles","target":{"of":"object","among":"triggering","random":true,"playerOwns":true,"playerFilter":"opponent","sharedBy":"creatureType","permanents":true}} ``` The engine reads that minimal form as: “separate target permanent chosen at random that share a creature type into two piles. Choose one of those piles”. ## Stock examples - **Do or Die** — “Separate all creatures target player controls into two piles. Destroy all creatures in the pile of that player's choice. They can't be regenerated.” ```json {"effect":"separatePiles","target":{"of":"object","mode":"all","filter":{"types":["Creature"]},"player":"target","playerTarget":{"of":"player","mode":"chosen"}},"chooser":"target","chosen":[{"effect":"destroy","target":{"of":"object","mode":"affected"},"noRegenerate":true}]} ``` - **Liliana of the Veil** — “−6: Separate all permanents target player controls into two piles. That player sacrifices all permanents in the pile of their choice.” ```json {"effect":"separatePiles","target":{"of":"object","mode":"all","filter":{},"player":"target","playerTarget":{"of":"player","mode":"chosen"}},"chooser":"target","chosen":[{"effect":"sacrifice","target":{"of":"object","mode":"affected"},"who":"affectedController"}]} ``` ## 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