# Drawstep engine · Statics & layers · `playerRule` > Player rule — A rule applying to players: "You have hexproof", "You have no maximum hand size", "Your opponents can't gain life". 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#playerRule ## Where it goes The `effect` of a static ability (or one of its `effects`): `{ "kind": "static", "effect": { "type": "playerRule", … } }`. Applied continuously through the layer system. Printed words that point here (search aliases): you have hexproof no maximum hand size can't lose each opponent can cast spells only any time they could cast a sorcery play lands and cast spells from the top of your library pay life equal to its mana value spells and abilities your opponents control can't cause their controller to search their library ashiok. ## Fields | Field | Type | Required | Description | |---|---|---|---| | `who` | `"you" \| "controller" \| "abilityController" \| "sourceController" \| "owner" \| "eachOpponent" \| "eachPlayer" \| "target" \| "triggeringPlayer" \| "defendingPlayer" \| "attackingPlayer" \| "activePlayer" \| "re …` | yes | Which players the rule applies to (you / eachOpponent / eachPlayer) | | `rule` | `"hexproof" \| "shroud" \| "noMaxHandSize" \| "maxHandSize" \| "maxHandSizeModifier" \| "ignoreLegendRule" \| "cantGainLife" \| "cantLoseLife" \| "cantLoseGame" \| "cantWinGame" \| "cantSearchLibraries" \| "cantS …` | yes | CR 402.2, 514.1, 613.11: maxHandSize sets a timestamp-ordered limit using amount. CR 704.5a: cantLoseForZeroLife blocks only the loss for 0 or less life. CR 101.2, 701.23: cantSearchOwnLibrary — spells and abilities these players control can't cause them to search their own library (others' effects still can; a mandatory search still shuffles). CR 101.2, 305.2: cantPlayLands overrides all land-play permissions. castWithoutPaying: "You may cast spells from your hand without paying their mana costs" (Omniscience) — matching spells cast from `from` (any zone they may be cast from when omitted) have an alternative cost of no mana; additional costs are paid and X is 0 (CR 118.9, 107.3b). playLinkedExile / castLinkedExile: play / cast cards linked to ~ (exiled with it, or moved to the command zone by it) from where they lie (CR 601.3). manaAsAnyColor / manaAsAnyType: these players may spend mana as though it were mana of any color / any type to cast spells matching the filter (CR 609.4b). topCardRevealed: "play with the top card of your library revealed" — every player sees it; lookAtTopCard: "you may look at the top card of your library any time" — only that player sees it (pair it with playFromLibrary for "… you may cast it"). handsRevealed: "players play with their hands revealed" (Revelation) / "your opponents play with their hands revealed" (Telepathy) — the affected players' hands are public (CR 400.2, 701.20a; no rule outcome changes). castOnlyAsSorcery: "each opponent can cast spells only any time they could cast a sorcery" — only during their own main phase with an empty stack and nothing resolving, overriding flash and castAsFlash permissions; abilities and land plays are unaffected (CR 307.1, 608.2g) | | `amount` | `ValueDef` | no | For maxHandSize: the size to set (CR 402.2, 613.11). For maxHandSizeModifier / additionalLands: the change (e.g. -2 / 1). For additionalVotes: optional extra votes while voting (CR 701.38) | | `filter` | `ObjectFilter` | no | For castAsFlash / playFromGraveyard / playFromLibrary / castFromExile / playLinkedExile / castLinkedExile / manaAsAnyColor / manaAsAnyType: matching cards with normal costs and timing (CR 305.1, 401.5, 601.3, 702.8). Self filters function in their permitted zone (CR 113.6m). For ignoreLegendRule: exempt permanents (CR 704.5j). cantPlayLands prohibits land plays (CR 305.2b) | | `extraCost` | `CostDef` | no | For castAsFlash: the additional cost of using the permission — "You may cast this spell as though it had flash if you pay {2} more to cast it" (CR 601.2f). Charged only when the spell is cast at a time it could not otherwise be cast; a permission without extraCost makes the surcharge moot. For playFromGraveyard / playFromLibrary: an additional cost of each spell cast using the permission — "You may cast this card from your graveyard by discarding a card in addition to paying its other costs" / "You may cast spells from the top of your library by sacrificing a nonland permanent in addition to paying their other costs" (CR 601.2b, 601.2f-h, 118.8); never charged for a land play or a cast another permission allows | | `alternative` | `"bestow" \| "blitz" \| "dash" \| "mutate" \| "sneak" \| "warp"` | no | For playFromGraveyard: matching cards may be cast from the graveyard only with this alternative-cost keyword ability — "You may cast this card from your graveyard using its blitz ability" (CR 118.9, 601.2b, 601.2f). Neither the mana cost nor another alternative cost may be paid under it, and lands can't be played with it | | `genericDiscount` | `number` | no | Reduce the generic cost by this much only when this graveyard casting permission is used | | `landEntersTapped` | `boolean` | no | A land played using this graveyard permission enters tapped | | `spellEnters` | `{ tapped?: boolean; counter?: string; amount?: number; additional?: boolean; filter?: ObjectFilter; haste?: boolean }` | no | For playFromGraveyard / playFromLibrary / castLinkedExile: "If you cast a spell this way, that creature enters with a finality counter on it / that artifact enters tapped" — a replacement effect on the permanent a spell cast using this permission becomes (CR 614.1c, 614.12, 400.7) | | `from` | `"battlefield" \| "hand" \| "graveyard" \| "library" \| "exile" \| "stack" \| "command"` | no | For castWithoutPaying: the zone the spells are cast from ("from your hand"); omitted, any zone they may be cast from (CR 601.2a). For cantPlayLands: only land cards played from this zone ("Your opponents can't play land cards from graveyards"; CR 305.2) | | `flash` | `boolean` | no | For castWithoutPaying: spells cast without paying their mana costs this way may be cast as though they had flash (Aluren; CR 702.8, 601.3) | | `cleanupSacrifice` | `boolean` | no | For a self castAsFlash permission: "If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step" (Armor of Thorns; CR 307.1, 514.3a, 603.7) — whatever allowed the cast at that time | | `payLife` | `ValueDef` | no | For playLinkedExile / castLinkedExile / playFromLibrary / castFromExile: spells cast under this permission are cast by paying this much life rather than their mana cost (CR 118.9) — "If you cast a spell this way, pay life equal to its mana value rather than pay its mana cost" is { kind: "affected", property: "manaValue" } (Valgavoth, Terror Eater; Bolas's Citadel). A mandatory alternative cost: the mana cost can't be paid instead, additional costs (kicker, casualty) are still paid, and lands played this way cost nothing | | `free` | `boolean` | no | For playFromLibrary (CR 118.9, 601.2b): spells cast under this permission are cast without paying their mana cost — a mandatory free alternative cost ("Once during each of your turns, you may cast a spell from your hand or the top of your library without paying its mana cost", One with the Multiverse). Additional costs are still paid and X is 0 (CR 107.3b) | | `castOnly` | `boolean` | no | For playFromGraveyard: spells only — "you may cast … from your graveyard" never lets a land be played (CR 305.1, 601.3) | | `oncePerTurn` | `boolean \| "eachTurn"` | no | For playFromGraveyard / playFromLibrary: "Once during each of your turns, you may cast …" (Lurrus, Karador) — only during the affected player's own turns, one spell per turn per source object (CR 400.7); "eachTurn" is "Once each turn, you may cast …" (Assemble the Players) — on any player's turn. For playLinkedExile / castLinkedExile: one land or one spell each turn per player (Share the Spoils ruling). A spell cast under another permission (flashback, escape, an unlimited permission) doesn't use it, and it never permits a land play (CR 601.3) | | `ownTurnOnly` | `boolean` | no | CR 500.1, 601.3: "During each player's turn, that player may …" (Share the Spoils) — the permission works only during the affected player's own turn, and never during another's. "During your turn" is the static's isYourTurn condition instead | | `anyMana` | `"color" \| "type"` | no | CR 609.4b: spells cast under this permission may spend mana as though it were mana of any color ("and they may spend mana as though it were mana of any color to cast that spell", Share the Spoils) or any type ("mana of any type can be spent to cast those spells", Tinybones). For castFromExile / playLinkedExile / castLinkedExile | | `whenUsed` | `EffectDef[]` | no | CR 603.12: "When they do, …" — a reflexive trigger each time the affected player plays a land or casts a spell under this linked-exile permission (Share the Spoils); the effects read that player as you | | `castTargetFilter` | `ObjectFilter` | no | CR 601.3e, 601.2e: a self castAsFlash permission checked against announced targets; at least one must match. Normal sorcery timing remains available | | `graveyardReplacement` | `"exile"` | no | CR 614.1a, 400.7g: exile a spell cast using this graveyard permission if it would enter a graveyard from the stack ("If a spell cast this way would be put into your graveyard, exile it instead"); requires playFromGraveyard and castOnly | ## Minimal form ```json {"type":"playerRule","who":"you","rule":"hexproof","graveyardReplacement":"exile"} ``` The engine reads that minimal form as: “you have hexproof”. ## Stock examples - **Crucible of Worlds** — “” ```json {"type":"playerRule","who":"you","rule":"playFromGraveyard","filter":{"types":["Land"]}} ``` - **Draw Lock** — “” ```json {"type":"playerRule","who":"eachPlayer","rule":"cantDrawCards"} ``` - **Spell Limit** — “” ```json {"type":"playerRule","who":"eachPlayer","rule":"oneSpellPerTurn"} ``` ## 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 - [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