enjine 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -0
  3. data/SUPPORTED.md +31 -23
  4. data/docs/guides/card-data-format.md +106 -1
  5. data/docs/plans/dsl-gaps.md +23 -0
  6. data/docs/reference/abilities.md +46 -13
  7. data/docs/reference/costs.md +23 -6
  8. data/docs/reference/decisions.md +4 -0
  9. data/docs/reference/effects.md +108 -18
  10. data/docs/reference/filters.md +19 -2
  11. data/docs/reference/keywords.md +16 -2
  12. data/docs/reference/triggers.md +25 -6
  13. data/lib/enjine/actions/play_land.rb +3 -1
  14. data/lib/enjine/card_definition.rb +4 -3
  15. data/lib/enjine/cli/text.rb +10 -3
  16. data/lib/enjine/decisions/combat.rb +4 -2
  17. data/lib/enjine/decisions/damage_order.rb +18 -0
  18. data/lib/enjine/engine/ability_layers.rb +6 -1
  19. data/lib/enjine/engine/casting/alt_casting.rb +36 -4
  20. data/lib/enjine/engine/casting/cast_choices.rb +13 -1
  21. data/lib/enjine/engine/casting/casting.rb +24 -7
  22. data/lib/enjine/engine/casting/cost_options.rb +3 -1
  23. data/lib/enjine/engine/casting/permissions.rb +13 -14
  24. data/lib/enjine/engine/casting/target_counts.rb +14 -3
  25. data/lib/enjine/engine/casting/waterbend.rb +22 -2
  26. data/lib/enjine/engine/characteristics.rb +3 -2
  27. data/lib/enjine/engine/combat.rb +26 -7
  28. data/lib/enjine/engine/copies.rb +10 -3
  29. data/lib/enjine/engine/damage.rb +49 -0
  30. data/lib/enjine/engine/entering.rb +36 -2
  31. data/lib/enjine/engine/face_down.rb +12 -3
  32. data/lib/enjine/engine/faces.rb +14 -2
  33. data/lib/enjine/engine/follow_ups.rb +4 -1
  34. data/lib/enjine/engine/resolution.rb +46 -1
  35. data/lib/enjine/engine/rules.rb +4 -3
  36. data/lib/enjine/engine/triggers.rb +5 -15
  37. data/lib/enjine/engine/turn_history.rb +16 -1
  38. data/lib/enjine/engine/turn_structure.rb +1 -0
  39. data/lib/enjine/engine/zones.rb +5 -2
  40. data/lib/enjine/events.rb +2 -0
  41. data/lib/enjine/frames.rb +2 -2
  42. data/lib/enjine/mana.rb +3 -0
  43. data/lib/enjine/mechanics/abilities/chosen_values.rb +49 -6
  44. data/lib/enjine/mechanics/abilities/damage_replacements.rb +136 -64
  45. data/lib/enjine/mechanics/abilities/entering_choices.rb +40 -21
  46. data/lib/enjine/mechanics/abilities/play_permissions.rb +52 -20
  47. data/lib/enjine/mechanics/abilities/player_rules.rb +30 -13
  48. data/lib/enjine/mechanics/abilities/static.rb +1 -1
  49. data/lib/enjine/mechanics/card_spec.rb +54 -11
  50. data/lib/enjine/mechanics/costs/base.rb +67 -9
  51. data/lib/enjine/mechanics/costs/behold.rb +21 -5
  52. data/lib/enjine/mechanics/costs/choose_creature_type.rb +43 -0
  53. data/lib/enjine/mechanics/costs/one_of.rb +3 -0
  54. data/lib/enjine/mechanics/costs/pay_life.rb +27 -8
  55. data/lib/enjine/mechanics/costs/remove_counters.rb +8 -5
  56. data/lib/enjine/mechanics/costs/tap.rb +44 -3
  57. data/lib/enjine/mechanics/effects/base.rb +10 -2
  58. data/lib/enjine/mechanics/effects/become.rb +29 -12
  59. data/lib/enjine/mechanics/effects/copy.rb +56 -19
  60. data/lib/enjine/mechanics/effects/counters.rb +8 -2
  61. data/lib/enjine/mechanics/effects/damage.rb +11 -0
  62. data/lib/enjine/mechanics/effects/earthbend.rb +2 -1
  63. data/lib/enjine/mechanics/effects/fight.rb +11 -0
  64. data/lib/enjine/mechanics/effects/library.rb +76 -18
  65. data/lib/enjine/mechanics/effects/pay.rb +7 -4
  66. data/lib/enjine/mechanics/effects/repeat.rb +92 -0
  67. data/lib/enjine/mechanics/effects/search.rb +34 -6
  68. data/lib/enjine/mechanics/effects/tokens.rb +42 -10
  69. data/lib/enjine/mechanics/filters/base.rb +22 -12
  70. data/lib/enjine/mechanics/filters/exile.rb +27 -0
  71. data/lib/enjine/mechanics/filters/stack.rb +14 -8
  72. data/lib/enjine/mechanics/keywords/alternative_costs.rb +10 -6
  73. data/lib/enjine/mechanics/keywords/cards_have.rb +65 -0
  74. data/lib/enjine/mechanics/keywords/flags.rb +3 -1
  75. data/lib/enjine/mechanics/keywords/hideaway.rb +6 -5
  76. data/lib/enjine/mechanics/keywords/kicker.rb +24 -6
  77. data/lib/enjine/mechanics/keywords/protection.rb +24 -8
  78. data/lib/enjine/mechanics/keywords/riot.rb +13 -10
  79. data/lib/enjine/mechanics/linked.rb +32 -2
  80. data/lib/enjine/mechanics/selector.rb +32 -9
  81. data/lib/enjine/mechanics/triggers/casting.rb +15 -9
  82. data/lib/enjine/mechanics/triggers/combat.rb +32 -12
  83. data/lib/enjine/mechanics/triggers/keyword_actions.rb +17 -0
  84. data/lib/enjine/mechanics/triggers/tap_and_counters.rb +20 -9
  85. data/lib/enjine/mechanics/values.rb +10 -3
  86. data/lib/enjine/replacements.rb +3 -2
  87. data/lib/enjine/rules_monitor.rb +13 -2
  88. data/lib/enjine/version.rb +1 -1
  89. data/lib/enjine/view.rb +1 -1
  90. metadata +6 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd2564d74c91b41b13b5d630d52be4e837af582d6b030ce29658951dc1cc1061
4
- data.tar.gz: 4d7a8e15789f58b94e3033016a1c380b8bd978710f59a7b31010145b1b34b4b7
3
+ metadata.gz: ed0cfb45718455cd4fe4307ff3dc0448e6b35ac3dec499994d592e693cbbd449
4
+ data.tar.gz: 0b11d7fe352ca65fc7089b7de3719d91b3d880dfcd096d76ce17d403f5cff6ad
5
5
  SHA512:
6
- metadata.gz: 4f5476cb7fee29707c027d5b3bfeb9c9d29446faa76dd67999ce6464b1979c649048916d467fbc2db56bdcd6ee2716dacd7c78c73e694d30c6e9c2b3bc34c78f
7
- data.tar.gz: f9ac926eb54afa0426bb836a44d258e779e98f9d15a91af7a1e9faac05aac9720a4027a74da5cd6bfb3f69a460062ce5dd9307adf347f9fe5d0e7645b79e17a4
6
+ metadata.gz: bb9b6090f854e68532cd8f8a7d71436c140b906a129c8931ece0cf13d2a74ef8c4e592aa4b8cb89f2e9d21d2c5e1faeb28442a63d9e779c89b2f305c9cdbf27a
7
+ data.tar.gz: 88643e485e82366f7d32e38522e5d7e72754debe68aa912d3b989bfc021ce122e57c98ed1e81a4a384a0fb0b57f7243ddfdef579399658c7a2d874384285d73c
data/CHANGELOG.md CHANGED
@@ -8,6 +8,56 @@ change the public API; the stable surface is described in
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.5.0] - 2026-11-24
12
+
13
+ ### Added
14
+ - Casting permissions: `play_permission` `duration: "while_you_control_source"` ("for as long as you control this
15
+ creature", CR 611.2b), `during: "your_turn"` and `waterbend: "mana_value"` (cast by waterbending {X}, CR 701.67a);
16
+ `cast` and `cast_free` take `from` (e.g. `"graveyard"`), `cast` takes `exile_instead` (CR 608.2g), `cast_free` takes
17
+ `count` as an integer ("up to three").
18
+ - Ability `cards_have`: cards you own in a zone have a keyword alternative cost (flashback, harmonize, mayhem,
19
+ web_slinging or sneak) and may be cast with it ("Creature cards in your graveyard have sneak {3}{B}", CR 611.3a);
20
+ cast option `via: "alt:cards_have:<permanent>:<ref>"`.
21
+ - Costs: an optional `additional_cost` with `flash: true` ("as though it had flash if you behold a Dragon", CR 601.3c);
22
+ `choose_creature_type` before `behold` with `"subtypes": "chosen"` (CR 607.2d); `exile_from_graveyard` with
23
+ `count: "any"` and `symbols` (a mana-symbol total, CR 107.4e), and `copy_card` `of: "exiled_for_cost"`; `pay_life`
24
+ with a computed amount (`{"power": "self"}`, e.g. in ward); `remove_counters` with `self: true` and `count`.
25
+ - Card specs take `same_name_as` (a filter: "with the same name as a legendary permanent you control", CR 201.2a)
26
+ and `"subtypes": "chosen"`. `search_library` takes `battlefield_instead` (`if`, `for`).
27
+ - Triggers: `gives_gift` ("whenever you give a gift", CR 702.174c); `cast` with `owner: you | not_you` ("a spell you
28
+ don't own", CR 108.3); `attacks` with `alone: true` (CR 506.5); `counters_placed` with `nth` ("when the fourth plan
29
+ counter is put on it", CR 122.6).
30
+ - Effects, zones and loops: `repeat` (`effects`, `while`: "repeat this process", CR 608.2c), with `{"result": n,
31
+ "for": card spec}` selectors; `exile_top` `until` (`{"total_mana_value": n}` or `{"card": spec}`, CR 406.1);
32
+ `cast_free` `count: "any"`; `choose_cards` `random: true`; target filter `exiled_with` (a card this object's
33
+ abilities exiled, with `link: true` on `exile`, `choose_cards`, `dig`, `exile_top` and `exile_if_dies`, CR 607.2a);
34
+ condition `attacking` ("if it was attacking", CR 608.2h); stack filters `single_target`; effect `change_target`
35
+ (CR 115.7a); `dig` `looker: "source_controller"`.
36
+ - Statics, grants and combat: cost `{"tap": "granter"}` in a granted ability (CR 602.2b, 607.1a); `become`
37
+ `colors: "chosen"` with `hexproof_from: "chosen_color"` bound into the granted ability (CR 607.2d); keyword
38
+ `cant_become_untapped` (CR 701.26b); the `choose_card_name` ability takes `types` and `look_at_hand`, and is now
39
+ an effect too (`remember: "source"` for every resolving `choose_*`); `"name": "chosen"` in filters and in
40
+ `player_rule` `cant_activate` (CR 201.4, 602.5); `player_rule` `cant_be_attacked` with a `filter` (CR 508.1c);
41
+ statics can grant `cant_be_blocked_by`, and `become` can grant `tapping_power`; `create_token` `size` (an N/N
42
+ token, CR 707.2); riot granted by a static ability is chosen as the permanent enters (CR 614.12, 702.136b).
43
+ - Decision `damage_order` (CR 616.1): when the order of replacement and prevention effects on one damage event
44
+ changes the result, the affected player chooses it. Agents must answer this new decision kind.
45
+
46
+ ### Changed
47
+ - `choose_new_targets` and `copy_spell` targets become targets (ward and `becomes_target` trigger, CR 115.7, 707.10);
48
+ new targets of a divided spell keep each target's share (CR 115.7f); `prevent_damage` `by: "chosen_source"` may
49
+ choose spells, abilities and command-zone objects (CR 609.7a-b); tokens created attacking choose a planeswalker to
50
+ attack when there is one (CR 508.4); "copy that ability" after it left the stack copies it as it last existed.
51
+ - A hidden-away card may be looked at and played by whoever controls the permanent now (CR 702.75a); earthbend's
52
+ return ends when the land leaves for another zone; a melded permanent's mana value is its front faces' total
53
+ (CR 713.5c).
54
+
55
+ ### Fixed
56
+ - A card's colors include those of its hybrid symbols (CR 202.2d): a `{U/B}` card is black for `"colors": ["B"]`.
57
+ - "Damage can't be prevented" against a prevention effect with `then`: it still applies once without preventing
58
+ anything (CR 615.12).
59
+ - The rules monitor accepts a spell cast at instant speed through its paid flash-granting additional cost (CR 601.3c).
60
+
11
61
  ## [0.4.1] - 2026-11-22
12
62
 
13
63
  Includes 0.4.0, which was tagged but never published to RubyGems.
data/SUPPORTED.md CHANGED
@@ -50,6 +50,7 @@ Rules version: Comprehensive Rules effective 2026-11-06.
50
50
  | [`cant_be_beamed_up`](docs/reference/keywords.md#cant_be_beamed_up) | 702.196b | This creature can't be returned to its owner's hand to pay a beam me up cost. |
51
51
  | [`cant_be_blocked`](docs/reference/keywords.md#cant_be_blocked) | 509.1b | Restriction: this creature can't be blocked. |
52
52
  | [`cant_be_countered`](docs/reference/keywords.md#cant_be_countered) | 701.6a, 101.2 | This spell can't be countered: counter effects leave it on the stack. |
53
+ | [`cant_become_untapped`](docs/reference/keywords.md#cant_become_untapped) | 701.26b, 502.3, 101.2 | This permanent can't become untapped: not in its controller's untap step nor by an effect ("untap it" does nothing). |
53
54
  | [`cant_block`](docs/reference/keywords.md#cant_block) | 509.1b | Restriction: this creature can't block. |
54
55
  | [`cascade`](docs/reference/keywords.md#cascade) | 702.85a, 702.85c, 608.2g | When you cast this spell, exile cards from the top of your library until you exile a nonland card with lesser mana value. You may cast it without paying its mana cost. Then the exiled cards not cast go on the bottom of your library in a random order. |
55
56
  | [`changeling`](docs/reference/keywords.md#changeling) | 702.73a, 604.3, 205.3m, 113.6a | This object is every creature type (a characteristic-defining ability that works in all zones). |
@@ -77,7 +78,7 @@ Rules version: Comprehensive Rules effective 2026-11-06.
77
78
  | [`phasing`](docs/reference/keywords.md#phasing) | 702.26a, 702.26p, 502.1 | During each of its controller's untap steps, before they untap, it phases out if it's phased in (and phases in if it phased out under their control). |
78
79
  | [`prowess`](docs/reference/keywords.md#prowess) | 702.108a | Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn. |
79
80
  | [`reach`](docs/reference/keywords.md#reach) | 702.17b | Can block creatures with flying. |
80
- | [`riot`](docs/reference/keywords.md#riot) | 702.136a, 614.12 | As this permanent enters, its controller chooses an additional +1/+1 counter or haste (an enter_choice: `{type: "option", option: "counter" | "haste"}`). |
81
+ | [`riot`](docs/reference/keywords.md#riot) | 702.136a, 702.136b, 614.12 | As this permanent enters, its controller chooses an additional +1/+1 counter or haste (an enter_choice: `{type: "option", option: "counter" | "haste"}`). Riot granted by a static ability ("Other Spiders you control have riot") is chosen as it enters too, and haste chosen this way stays if it later loses riot. |
81
82
  | [`start_your_engines`](docs/reference/keywords.md#start_your_engines) | 702.179a, 702.179b, 702.179c, 702.179d, 704.3 | If you control this permanent and have no speed, your speed becomes 1. Once you have speed, it increases by 1 (to at most 4) once on each of your turns when one or more opponents lose life. Pair with `max_speed` abilities and the `speed` amount. |
82
83
  | [`station`](docs/reference/keywords.md#station) | 702.184a, 722.4 | An activated ability: tap another untapped creature you control to put charge counters equal to its power on this permanent. Sorcery speed. Pair with `station_symbol` abilities for what the counters unlock. |
83
84
  | [`storied`](docs/reference/keywords.md#storied) | 702.195a, 702.195b, 702.195c | While you control this permanent, once you control three or more permanents that are artifacts, Sagas and/or legendary, you have an enduring story for the rest of the game (condition `{"designation": "enduring_story"}`). |
@@ -93,7 +94,7 @@ Rules version: Comprehensive Rules effective 2026-11-06.
93
94
  | Name | Rules | Description |
94
95
  | --- | --- | --- |
95
96
  | [`activated`](docs/reference/abilities.md#activated) | 602.1, 602.2, 602.5b, 602.5d, 702.177a, 702.193a, 702.193b, 702.142a | An activated ability: announce it, choose targets, pay its costs, then it goes on the stack. `timing: "sorcery"` restricts it to sorcery speed, `"your_turn"` to your turns; `limit: "once_each_turn"` to one activation per turn, `"once"` to one activation for as long as the object exists; `only_if` to when a condition holds. `zone` ("exile", "graveyard" or "hand") makes it function only while its card is in that zone ("activate only if this card is exiled"). `exhaust: true` makes it an exhaust ability: it can be activated only once (CR 702.177a). `power_up: true` makes it a power-up ability: activate only once, and if the permanent entered this turn its cost is reduced by the permanent's mana cost (CR 702.193). `boast: true`: activate only if this creature attacked this turn and only once each turn (CR 702.142a). |
96
- | [`additional_cost`](docs/reference/abilities.md#additional_cost) | 601.2b, 601.2f, 601.2h, 118.8, 118.8b | As an additional cost to cast this spell, pay `cost` too (mana and/or chosen costs such as `sacrifice_permanent`). The spell can't be cast without it. `optional: true`: you may pay it (announced with the `choose_kicker` decision); the condition `{"cast_with": "additional_cost"}` then holds (the spell isn't kicked). |
97
+ | [`additional_cost`](docs/reference/abilities.md#additional_cost) | 601.2b, 601.2f, 601.2h, 118.8, 118.8b, 601.3c | As an additional cost to cast this spell, pay `cost` too (mana and/or chosen costs such as `sacrifice_permanent`). The spell can't be cast without it. `optional: true`: you may pay it (announced with the `choose_kicker` decision); the condition `{"cast_with": "additional_cost"}` then holds (the spell isn't kicked). With `flash: true` (optional only) you may cast it from your hand as though it had flash if you pay it: cast that way, only paying it is offered. |
97
98
  | [`additional_land_plays`](docs/reference/abilities.md#additional_land_plays) | 305.2, 305.2a, 305.2b, 604.1 | Its controller may play an additional land on each of their turns. Each instance adds one land play (CR 305.2); lands put onto the battlefield by effects don't count. |
98
99
  | [`additional_triggers`](docs/reference/abilities.md#additional_triggers) | 603.2d, 119.9, 607.2d | While this permanent is on the battlefield, a triggered ability of a permanent its controller controls triggers an additional time if it triggers because of `cause` (you_gain_life: its controller gaining life) and/or its permanent matches `of` (a filter: "triggered abilities of Allies you control", {"creature": {"other": true, "subtypes": "chosen"}}). At least one of them. |
99
100
  | [`beam_me_up`](docs/reference/abilities.md#beam_me_up) | 702.196a, 702.196b, 118.9, 601.2b, 601.2f, 601.2h | You may cast this instant or sorcery card from your graveyard for `cost` plus returning a creature you control to its owner's hand, instead of its mana cost. If you do, it's exiled whenever it would leave the stack. Offered as a cast option with `via: "beam:<ref>"`. |
@@ -101,10 +102,11 @@ Rules version: Comprehensive Rules effective 2026-11-06.
101
102
  | [`cant_be_blocked_by`](docs/reference/abilities.md#cant_be_blocked_by) | 509.1b, 509.1a | This creature can't be blocked by creatures matching `filter` (checked as blockers are declared, with their current characteristics). |
102
103
  | [`cant_be_targeted_by`](docs/reference/abilities.md#cant_be_targeted_by) | 115.4, 113.7, 702.11d | This permanent can't be the target of abilities its controller's opponents control whose source matches `abilities_from` (a card spec, e.g. {"types": ["artifact"]}). |
103
104
  | [`cant_phase_in`](docs/reference/abilities.md#cant_phase_in) | 702.26a, 502.1, 604.1 | While this permanent is on the battlefield, permanents can't phase in. |
105
+ | [`cards_have`](docs/reference/abilities.md#cards_have) | 611.3a, 604.1, 118.9, 601.2b, 702.190a | While this permanent is on the battlefield, cards you own in `zone` (graveyard (default), hand or exile) matching `cards` have the keyword alternative cost `ability` (flashback, harmonize, mayhem, web_slinging or sneak) and may be cast with it from that zone. Cast option `via: "alt:cards_have:<permanent>:<ref>"`. |
104
106
  | [`cast_restriction`](docs/reference/abilities.md#cast_restriction) | 601.3, 101.2 | This card can be cast only while `only_if` (a condition, checked for the player who would cast it) holds, whatever lets them cast it. |
105
107
  | [`chapter`](docs/reference/abilities.md#chapter) | 715.2, 715.2b, 715.2c, 715.2d, 122.6 | A Saga's chapter ability: triggers when lore counters put on it bring their number from below `chapter` to at least `chapter`. Its targets are chosen as it's put on the stack. A Saga's final chapter number is its greatest `chapter`. |
106
108
  | [`choose_basic_land_type`](docs/reference/abilities.md#choose_basic_land_type) | 614.12, 305.6, 607.2d | As this permanent enters, its controller chooses a basic land type; filters with "subtypes": "chosen" and a static ability's `"subtypes": "chosen"` use it ("this land is the chosen type"). |
107
- | [`choose_card_name`](docs/reference/abilities.md#choose_card_name) | 614.12, 614.12a, 201.4, 201.4a, 607.2 | As this permanent enters, its controller chooses a card name among the cards in the game (`not`: card types the named card mustn't have, e.g. ["land"]); abilities of it that say "the chosen name" use it. |
109
+ | [`choose_card_name`](docs/reference/abilities.md#choose_card_name) | 614.12, 614.12a, 201.4, 201.4a, 607.2, 701.20e | As this permanent enters, its controller chooses a card name among the cards in the game (`not`: card types the named card mustn't have, e.g. ["land"]; `types`: it must have one of these, ["land"] for "a land card name"); abilities of it that say "the chosen name" use it. `look_at_hand: "opponent"`: first they look at an opponent's hand. |
108
110
  | [`choose_card_type`](docs/reference/abilities.md#choose_card_type) | 614.12, 205.2a, 607.2d | As this permanent enters, its controller chooses a card type; filters with "types": "chosen" (or "not": "chosen") use it. |
109
111
  | [`choose_color`](docs/reference/abilities.md#choose_color) | 614.12, 105.4, 607.2d | As this permanent enters, its controller chooses a color; filters with "colors": "chosen" (and other abilities of it) use it. |
110
112
  | [`choose_creature_type`](docs/reference/abilities.md#choose_creature_type) | 614.12, 205.3m, 607.2d | As this permanent enters, its controller chooses a creature type; filters with "subtypes": "chosen" use it. |
@@ -115,7 +117,7 @@ Rules version: Comprehensive Rules effective 2026-11-06.
115
117
  | [`cost_reduction`](docs/reference/abilities.md#cost_reduction) | 601.2f, 118.7a, 702.41a | This spell costs `amount` generic mana less to cast, if the optional `if` condition holds when its total cost is determined (after targets are chosen). `amount` may be computed, e.g. {"count": {"each": "artifact", "controller": "you"}} for affinity for artifacts (CR 702.41a). It can't reduce colored mana or go below {0}. |
116
118
  | [`crew`](docs/reference/abilities.md#crew) | 702.122a, 702.122b, 702.122e, 301.7, 301.7a, 301.7b, 208.3, 302.6 | Crew N: tap any number of other untapped creatures you control with total power N or more (chosen one at a time; `done` once the total is enough): this permanent becomes an artifact creature until end of turn. A Vehicle has its printed power and toughness only while it's a creature. |
117
119
  | [`cycling`](docs/reference/abilities.md#cycling) | 702.29a, 702.29b, 702.29e, 702.29f, 113.6m, 602.2a | Cycling: pay `cost` and discard this card from your hand to draw a card. With `for` it is typecycling: instead search your library for a card matching `for`, reveal it, put it into your hand, then shuffle. |
118
- | [`damage_replacement`](docs/reference/abilities.md#damage_replacement) | 614.1a, 614.5, 614.9, 616.1, 616.1e, 616.1f, 120.2b | While this permanent is on the battlefield, damage from sources in `by` to recipients in `to` (both optional; `combat`: combat | noncombat) is changed: `multiply` (2 = "double that damage"), `plus` an amount ("that much damage plus 1"), or `redirect` ("self" | "attached": dealt to this permanent or the one it's attached to instead). A scope is "self", "attached" or {"each": filter, "controller": you|opponent|any, "other": bool}; `each` is optional and players match too, so {"controller": "opponent"} is "an opponent or a permanent an opponent controls". Several apply in the order the affected player would pick: redirections, then prevention, then multiplying, then adding. |
120
+ | [`damage_replacement`](docs/reference/abilities.md#damage_replacement) | 614.1a, 614.5, 614.9, 616.1, 616.1e, 616.1f, 120.2b | While this permanent is on the battlefield, damage from sources in `by` to recipients in `to` (both optional; `combat`: combat | noncombat) is changed: `multiply` (2 = "double that damage"), `plus` an amount ("that much damage plus 1"), or `redirect` ("self" | "attached": dealt to this permanent or the one it's attached to instead). A scope is "self", "attached" or {"each": filter, "controller": you|opponent|any, "other": bool}; `each` is optional and players match too, so {"controller": "opponent"} is "an opponent or a permanent an opponent controls". Redirections apply first; when the order of the others changes the result, the affected player chooses it (a damage_order decision), else prevention, then multiplying, then adding. |
119
121
  | [`damage_unpreventable`](docs/reference/abilities.md#damage_unpreventable) | 615.12 | While this permanent is on the battlefield, damage from sources in `by` to recipients in `to` (both optional; `combat`: combat | noncombat) can't be prevented: prevention effects don't reduce it and shields aren't used up. |
120
122
  | [`destroy_replacement`](docs/reference/abilities.md#destroy_replacement) | 614.1a, 614.8, 701.8a, 701.21a, 704.5f, 704.5g, 704.5h | If a permanent matching `affects` would be destroyed (by an effect, lethal damage or deathtouch), instead: all its `remove_counters` counters are removed (if given) and, with `remove_damage: true`, all damage marked on it is removed. Sacrificing isn't destroying, and 0 toughness isn't either. |
121
123
  | [`devour`](docs/reference/abilities.md#devour) | 702.82a, 702.82b, 702.82c, 614.12, 701.21a | Devour `amount`: as this permanent enters, you may sacrifice any number of permanents matching `each` (default "creature"; "land" for devour land) that you control, one at a time; it enters with `amount` +1/+1 counters for each. |
@@ -142,7 +144,7 @@ Rules version: Comprehensive Rules effective 2026-11-06.
142
144
  | [`gift`](docs/reference/abilities.md#gift) | 702.174a, 702.174b, 702.174j, 702.174k, 702.174m, 601.2b | Gift: as you cast this spell you may promise a gift to an opponent you choose (the `choose_kicker` decision, then `choose_cost` for the opponent). `{"cast_with": "gift"}` holds if you did, and the selector "gift_recipient" is that player; write the gift as the spell's first effect (or an enters trigger) under that condition. |
143
145
  | [`grants_beam_me_up`](docs/reference/abilities.md#grants_beam_me_up) | 702.196a, 702.196b, 604.1, 611.3a | While this permanent is on the battlefield, during your main phase each instant and sorcery card in your graveyard has beam me up with its mana cost as the beam me up cost; this permanent can't be the creature returned to cast a spell this way. Offered as a cast option with `via: "beam_granted:<permanent>:<ref>"`. |
144
146
  | [`harmonize`](docs/reference/abilities.md#harmonize) | 702.180a, 702.180b, 118.9, 601.2b, 601.2f, 601.2h | Harmonize: you may cast this card from your graveyard by paying `cost` and tapping up to one untapped creature you control rather than its mana cost; the total cost is reduced by generic mana equal to that creature's power. Then it's exiled whenever it would leave the stack. The creature is a `choose_cost` decision (`{type: "cost"}` without an object taps none). Cast option `via: "alt:<ref>"`. |
145
- | [`hexproof_from`](docs/reference/abilities.md#hexproof_from) | 702.11d, 702.11f, 702.11g, 115.4 | Hexproof from the quality: this permanent can't be the target of spells with the quality, or abilities from sources with it, that its controller's opponents control. The quality is a card spec (`{"colors": ["B"]}`, `{"types": ["instant"]}`, `{"color_count": {"equal": 1}}` for monocolored), or "its_colors" (hexproof from each of its colors: whatever shares a color with it). |
147
+ | [`hexproof_from`](docs/reference/abilities.md#hexproof_from) | 702.11d, 702.11f, 702.11g, 115.4, 607.2d | Hexproof from the quality: this permanent can't be the target of spells with the quality, or abilities from sources with it, that its controller's opponents control. The quality is a card spec (`{"colors": ["B"]}`, `{"types": ["instant"]}`, `{"color_count": {"equal": 1}}` for monocolored), or "its_colors" (hexproof from each of its colors: whatever shares a color with it), or "chosen_color" (the chosen color; granted by `become`, the color chosen as it resolved). |
146
148
  | [`hideaway`](docs/reference/abilities.md#hideaway) | 702.75a, 406.3, 607.2a | Hideaway `amount`: when this permanent enters, look at the top N cards of your library, exile one face down (linked: "exiled_with") and put the rest on the bottom in a random order. |
147
149
  | [`kicker`](docs/reference/abilities.md#kicker) | 702.33a, 702.33d, 702.33g, 601.2b, 601.2f, 601.2h | Kicker: as you cast this spell you may also pay `cost` (mana and/or chosen costs such as `sacrifice_permanent`). The spell is then kicked: `{"kicked": true}` conditions hold and its `kicked_targets` are used. |
148
150
  | [`look_at_top`](docs/reference/abilities.md#look_at_top) | 401.5, 604.1 | While this permanent is on the battlefield, its controller sees the top card of their library (the `library_top` of their view). |
@@ -153,7 +155,7 @@ Rules version: Comprehensive Rules effective 2026-11-06.
153
155
  | [`mayhem`](docs/reference/abilities.md#mayhem) | 702.187a, 702.187b, 702.187c, 118.9, 601.2b, 601.2f, 601.2h, 305.1 | Mayhem: as long as you discarded this card this turn, you may cast it from your graveyard by paying `cost` rather than its mana cost. Without `cost` (`"mayhem"`), you may play it from your graveyard (a land too) if you discarded it this turn. Cast option `via: "alt:<ref>"`. |
154
156
  | [`mobilize`](docs/reference/abilities.md#mobilize) | 702.181a, 508.4 | Mobilize `amount`: whenever this creature attacks, create that many 1/1 red Warrior creature tokens tapped and attacking; sacrifice them at the beginning of the next end step. |
155
157
  | [`play_from`](docs/reference/abilities.md#play_from) | 601.3, 113.6e, 113.6f, 305.1, 401.5, 122.1, 614.12, 400.11a, 400.11b, 108.3 | With `cards: "self"` (default): its owner may cast this card from `zone` (the ability functions there). With a card spec: while this permanent is on the battlefield, its controller may play their own matching cards from `zone`, or from any of `zones` ("outside": cards they own outside the game, the deck's `outside` list, CR 400.11a). `play`: "cast" (spells only, default) or "play" (lands too, using a land play). `once_each_turn`: once during each of your turns, one use shared by all its zones. `enters_with`: a permanent spell cast this way enters with these counters. Timing and costs are the usual ones. |
156
- | [`player_rule`](docs/reference/abilities.md#player_rule) | 702.11c, 115.4, 508.1c, 402.2, 514.1, 615.1, 615.1a, 704.5a, 104.3b, 701.21a, 614.17b, 101.2, 601.3, 701.6a, 119.7, 602.5, 615.12, 702.16b, 702.16e, 702.16k, 604.1, 604.2, 611.3a | While this permanent is on the battlefield (and its `if` condition holds), `rule` applies to the players in `affects` (you | opponents | each; default you). Rules: hexproof, cant_attack, no_max_hand_size, prevent_all_damage, cant_lose_for_life, cant_sacrifice, cant_cast, cant_cast_except_from_hand, spells_cant_be_countered, abilities_cant_be_countered, cant_gain_life, cant_activate, damage_cant_be_prevented, combat_damage_cant_be_prevented, protection_from_opponents. `cant_sacrifice` takes a `filter` of the permanents that can't be sacrificed, `cant_activate` may take a `filter` of the sources whose abilities can't be activated (mana abilities still can), and `cant_cast` and `spells_cant_be_countered` may take a card spec of the `spells`. The damage rules apply to all damage whichever players they name. |
158
+ | [`player_rule`](docs/reference/abilities.md#player_rule) | 702.11c, 115.4, 508.1c, 402.2, 514.1, 615.1, 615.1a, 704.5a, 104.3b, 701.21a, 614.17b, 101.2, 601.3, 701.6a, 119.7, 602.5, 615.12, 702.16b, 702.16e, 702.16k, 506.3, 604.1, 604.2, 611.3a | While this permanent is on the battlefield (and its `if` condition holds), `rule` applies to the players in `affects` (you | opponents | each; default you). Rules: hexproof, cant_attack, no_max_hand_size, prevent_all_damage, cant_lose_for_life, cant_sacrifice, cant_cast, cant_cast_except_from_hand, spells_cant_be_countered, abilities_cant_be_countered, cant_gain_life, cant_activate, damage_cant_be_prevented, combat_damage_cant_be_prevented, protection_from_opponents, cant_be_attacked. `cant_sacrifice` takes a `filter` of the permanents that can't be sacrificed, `cant_activate` may take a `filter` of the sources whose abilities can't be activated (mana abilities still can) or `name: "chosen"` (sources with the name this permanent chose, in any zone), `cant_be_attacked` takes a `filter` of the creatures that can't attack them, and `cant_cast` and `spells_cant_be_countered` may take a card spec of the `spells`. The damage rules apply to all damage whichever players they name. |
157
159
  | [`plot`](docs/reference/abilities.md#plot) | 702.170a, 702.170b, 702.170d, 116.2k | Plot `cost`: during your main phase, while the stack is empty, you may pay `cost` and exile this card from your hand (special action `{type: "special_action"}`). It becomes plotted: on a later turn you may cast it from exile without paying its mana cost, during your main phase while the stack is empty (cast option `via: "plotted"`). |
158
160
  | [`prevent_damage`](docs/reference/abilities.md#prevent_damage) | 615.1, 615.1a, 615.5, 615.6 | While this permanent is on the battlefield, all damage from sources in `by` to recipients in `to` (damage scopes as in damage_replacement, both optional; `combat`: combat | noncombat) is prevented. "To and by this creature" is two of them. `then`: effects right after it prevents damage ("prevent that damage and put that many +1/+1 counters on him"), reading {"triggering": "amount"} (the damage prevented), "object" (the source) and "player" (its controller). |
159
161
  | [`protection_from`](docs/reference/abilities.md#protection_from) | 702.16a, 702.16b, 702.16c, 702.16d, 702.16e, 702.16f, 702.16g, 702.16h, 702.16i, 702.16j, 702.16k, 704.5m, 704.5n | Protection from the quality (a card spec, "everything", "each_opponent": from each of your opponents, or "its_colors"): damage from sources with the quality is prevented, and this permanent can't be enchanted or equipped by, blocked by or targeted by anything with the quality (Auras and Equipment already attached fall off as a state-based action). |
@@ -181,17 +183,17 @@ Rules version: Comprehensive Rules effective 2026-11-06.
181
183
  | [`activates_ability`](docs/reference/triggers.md#activates_ability) | 602.2, 605.1a, 603.2, 201.4, 702.177a, 702.142b, 606.1 | A player (`controller`: you (default) | opponent | any) activates an ability that isn't a mana ability. `source`: optional filter on the source's card; `name: "chosen"`: only a source with the name chosen as this permanent entered. `exhaust: true`: only an exhaust ability ("whenever you activate an exhaust ability", CR 702.177). `boast: true`: only a boast ability ("whenever a creature you control boasts", CR 702.142b). `loyalty: true`: only a loyalty ability (CR 606). |
182
184
  | [`airbends`](docs/reference/triggers.md#airbends) | 701.65b | A player (`controller`: you (default) | opponent | any) airbends. |
183
185
  | [`any_of`](docs/reference/triggers.md#any_of) | 603.2, 603.2c | Triggers when any of the listed trigger conditions is met. |
184
- | [`attacks`](docs/reference/triggers.md#attacks) | 508.3a, 603.2 | The subject is declared as an attacker. `first_time_this_turn: true`: only the first time that creature attacks this turn (later combats of the turn don't trigger it). |
186
+ | [`attacks`](docs/reference/triggers.md#attacks) | 508.3a, 603.2, 506.5 | The subject is declared as an attacker. `first_time_this_turn: true`: only the first time that creature attacks this turn (later combats of the turn don't trigger it). `alone: true`: only when it is the only creature declared as an attacker (it triggers as the declaration is complete). |
185
187
  | [`becomes_blocked`](docs/reference/triggers.md#becomes_blocked) | 509.3c, 509.1h, 603.2e | The subject becomes blocked: once per combat when blockers are declared, even if several creatures block it. |
186
188
  | [`becomes_crewed`](docs/reference/triggers.md#becomes_crewed) | 702.122e, 603.2 | A crew ability of the subject resolves (it becomes crewed). |
187
189
  | [`becomes_level`](docs/reference/triggers.md#becomes_level) | 717.2a, 603.2 | This permanent's level becomes `level` (a class level bar's ability resolves). |
188
190
  | [`becomes_saddled`](docs/reference/triggers.md#becomes_saddled) | 702.171b, 603.2 | The subject becomes saddled (its saddle ability resolved, or an effect saddled it). |
189
191
  | [`becomes_tapped`](docs/reference/triggers.md#becomes_tapped) | 603.2e, 701.26a, 702.194a | The subject becomes tapped (for any reason: a cost, attacking, an effect). A permanent that enters tapped doesn't become tapped. `for: "teamwork"`: only when it's tapped to pay a teamwork cost (it triggers once the spell is cast). |
190
- | [`becomes_target`](docs/reference/triggers.md#becomes_target) | 115.1, 601.2c, 603.2, 603.2c | The subject becomes the target of a spell or ability (controlled by `by`: opponent | you | any (default), relative to the source's controller). One trigger per matching object targeted. |
192
+ | [`becomes_target`](docs/reference/triggers.md#becomes_target) | 115.1, 115.7, 601.2c, 603.2, 603.2c, 707.10 | The subject becomes the target of a spell or ability (controlled by `by`: opponent | you | any (default), relative to the source's controller). One trigger per matching object targeted. |
191
193
  | [`becomes_untapped`](docs/reference/triggers.md#becomes_untapped) | 603.2e, 701.26b | The subject becomes untapped (in the untap step or by an effect). A permanent that enters untapped doesn't become untapped. |
192
194
  | [`blocks`](docs/reference/triggers.md#blocks) | 509.3a, 509.3b, 509.3f, 603.2 | The subject is declared as a blocker. With `blocking`, only when the attacking creature it blocks matches that filter ("blocks a creature with flying"). {"triggering": "object"} is the blocking creature. |
193
- | [`cast`](docs/reference/triggers.md#cast) | 603.2, 601.2i, 113.6, 202.3e, 201.4, 607.2, 115.1, 601.2a, 601.2c | A player casts a spell. `controller`: you (default) | opponent | any; `spell`: creature | noncreature | instant_or_sorcery, or any spell filter, e.g. {"spell": {"subtypes": ["saga"]}} or {"one_of": [...]} for "creature or Spacecraft spell"; `name` / `mana_value`: "chosen" (the source's as-it-entered choice); `self: true`: "when you cast this spell" (it functions on the stack). `targets`: only a spell that targets something matching this filter ("self": this permanent), e.g. {"creature": {"controller": "you"}}. `from` / `not_from`: only a spell cast from (not from) that zone: hand | graveyard | exile | library | outside. `single_target: true`: only a spell with exactly one target. |
194
- | [`counters_placed`](docs/reference/triggers.md#counters_placed) | 122.6, 603.2, 603.2c | One or more counters (only `counter`, if given) are put on the subject, including the counters it enters the battlefield with. Triggers once per event, however many counters. |
195
+ | [`cast`](docs/reference/triggers.md#cast) | 603.2, 601.2i, 113.6, 202.3e, 201.4, 607.2, 115.1, 601.2a, 601.2c, 108.3 | A player casts a spell. `controller`: you (default) | opponent | any; `spell`: creature | noncreature | instant_or_sorcery, or any spell filter, e.g. {"spell": {"subtypes": ["saga"]}} or {"one_of": [...]} for "creature or Spacecraft spell"; `name` / `mana_value`: "chosen" (the source's as-it-entered choice); `self: true`: "when you cast this spell" (it functions on the stack). `targets`: only a spell that targets something matching this filter ("self": this permanent), e.g. {"creature": {"controller": "you"}}. `from` / `not_from`: only a spell cast from (not from) that zone: hand | graveyard | exile | library | outside. `single_target: true`: only a spell with exactly one target. `owner`: "not_you" only a spell you don't own, "you" only one you own. |
196
+ | [`counters_placed`](docs/reference/triggers.md#counters_placed) | 122.6, 603.2, 603.2c | One or more counters (only `counter`, if given) are put on the subject, including the counters it enters the battlefield with. Triggers once per event, however many counters. `nth` (needs `counter`): only when the Nth such counter is put on it (the event that takes it from fewer than N to N or more). |
195
197
  | [`crews_vehicle`](docs/reference/triggers.md#crews_vehicle) | 702.122b, 603.2 | The subject (a creature) crews a Vehicle: it's tapped to pay that Vehicle's crew cost. {"triggering": "object"} is the Vehicle. |
196
198
  | [`cycles`](docs/reference/triggers.md#cycles) | 702.29a, 702.29e | A player (`controller`: you (default) | opponent | any) cycles a card (activates its cycling or typecycling ability; optional `card` filter). |
197
199
  | [`deals_damage`](docs/reference/triggers.md#deals_damage) | 510.2, 603.2, 603.2c, 120.2a, 120.2b, 120.3 | The subject deals damage. `combat: true` only counts combat damage, `noncombat: true` only noncombat damage; `to`: player | opponent (of the source's controller) | creature | any (default). Triggers once per damage event (each combat damage step is one, so double strike can trigger twice). |
@@ -204,6 +206,7 @@ Rules version: Comprehensive Rules effective 2026-11-06.
204
206
  | [`faces_dilemma`](docs/reference/triggers.md#faces_dilemma) | 700.17, 700.2, 601.2b, 603.3c | A player faces a dilemma: they chose one or more modes for a spell or ability (cast, activated, or a triggered ability put on the stack). `controller`: you (default) | opponent | any. CR 700.17. |
205
207
  | [`firebends`](docs/reference/triggers.md#firebends) | 702.189b | A player (`controller`: you (default) | opponent | any) firebends. |
206
208
  | [`gains_life`](docs/reference/triggers.md#gains_life) | 119.9, 120.3f | A player gains life (once per life gain event; lifelink combat damage is one event per source). `controller`: you (default) | opponent | any. |
209
+ | [`gives_gift`](docs/reference/triggers.md#gives_gift) | 702.174c, 702.174b | A player (`controller`: you (default) | opponent | any) gives a gift: an instant or sorcery spell they control whose gift was promised resolves, or the gift triggered ability (an enters trigger under `{"cast_with": "gift"}`) of a permanent they control resolves. |
207
210
  | [`leaves_battlefield`](docs/reference/triggers.md#leaves_battlefield) | 603.6c, 603.10a, 400.7 | The subject leaves the battlefield (for any zone, or only `to` that zone). Looks back in time: the permanent is matched as it last existed (types, controller, counters). |
208
211
  | [`leaves_graveyard`](docs/reference/triggers.md#leaves_graveyard) | 603.10a, 603.2c, 404.1 | A card leaves a graveyard (whose: `controller` you (default) | opponent | any). Optional `card` filter on its card types. `batched: true` is "one or more cards leave": once per event that moves cards (one effect, cost or action), however many cards. |
209
212
  | [`loses_life`](docs/reference/triggers.md#loses_life) | 119.3, 120.3a | A player loses life (damage to a player is life loss, CR 120.3a). `controller`: you (default) | opponent | any. |
@@ -225,6 +228,7 @@ Rules version: Comprehensive Rules effective 2026-11-06.
225
228
  | [`behold`](docs/reference/costs.md#behold) | 701.4a, 701.4b, 601.2h, 602.2b, 118.3, 607.2a | Behold `count` (default 1) objects matching the card spec `card`: each a card revealed from your hand or a permanent you control, chosen while casting or activating. `exile: true` also exiles them as it becomes cast; they are then "exiled with" it (selector `exiled_with`). |
226
229
  | [`blight`](docs/reference/costs.md#blight) | 701.68a, 701.68b, 601.2h, 602.2b, 118.3 | Blight `amount`: put that many -1/-1 counters on a creature you control, chosen while casting or activating and put on it as it becomes cast. |
227
230
  | [`bottom_self_from_graveyard`](docs/reference/costs.md#bottom_self_from_graveyard) | 401.1, 113.6m, 602.2b, 118.3 | Put this card from your graveyard on the bottom of your library. An ability with this cost is activated from your graveyard. |
231
+ | [`choose_creature_type`](docs/reference/costs.md#choose_creature_type) | 601.2b, 205.3m, 607.2d | Choose a creature type as part of the cost (a `choose_cost` decision with options `{type: "cost", creature_type: t}`). The spell remembers it as its chosen type: later costs and its effects read it with `"subtypes": "chosen"`. |
228
232
  | [`discard`](docs/reference/costs.md#discard) | 701.9a, 701.9b, 601.2h, 602.2b, 118.3 | Discard `count` cards (default 1) from your hand, never this card, matching the card spec `card` if given: chosen while casting or activating and discarded as the spell or ability becomes cast. `random: true` discards them at random instead. |
229
233
  | [`discard_self`](docs/reference/costs.md#discard_self) | 701.9a, 602.2b, 113.6m, 118.3 | Discard the card the ability belongs to (it goes from your hand to your graveyard). An ability with this cost is activated from your hand. |
230
234
  | [`exert`](docs/reference/costs.md#exert) | 701.43a, 701.43b, 701.43c | Exert this permanent: it doesn't untap during your next untap step. |
@@ -235,11 +239,11 @@ Rules version: Comprehensive Rules effective 2026-11-06.
235
239
  | [`get_counters`](docs/reference/costs.md#get_counters) | 118.1, 122.1, 704.5c | You get `amount` counters of the kind `counter` (e.g. poison). It can always be paid. |
236
240
  | [`mana`](docs/reference/costs.md#mana) | 601.2g, 601.2h, 602.2b | Pay mana as part of an activation. Paid during the activation by spending mana from your pool, tapping sources one at a time. |
237
241
  | [`one_of`](docs/reference/costs.md#one_of) | 118.3, 601.2b, 601.2f, 602.2b, 118.12 | Pay one of the listed costs (two or more), chosen as the spell or ability is cast or activated (the `choose_cost_option` decision) or, for `pay` and ward, as it is paid. A cost that can't be paid can't be chosen. |
238
- | [`pay_life`](docs/reference/costs.md#pay_life) | 119.4, 119.4b, 118.3b, 601.2b, 107.3a | Pay that much life (you lose it). Only possible while your life total is at least that much. `"X"` pays the X announced for the spell or ability (at most your life total); it may be a spell's additional cost. |
239
- | [`remove_counters`](docs/reference/costs.md#remove_counters) | 602.2b, 601.2h, 118.3, 122.1 | Remove `count` counters (of kind `counter`, or any kind) from among permanents you control matching `filter` (default creature), one counter per choice. Removed as it becomes cast. |
242
+ | [`pay_life`](docs/reference/costs.md#pay_life) | 119.4, 119.4b, 118.3b, 601.2b, 107.3a, 702.21a | Pay that much life (you lose it). Only possible while your life total is at least that much. `"X"` pays the X announced for the spell or ability (at most your life total); it may be a spell's additional cost. An amount (e.g. {"power": "self"}, "pay life equal to its power") is computed as the cost is paid. |
243
+ | [`remove_counters`](docs/reference/costs.md#remove_counters) | 602.2b, 601.2h, 118.3, 122.1 | Remove `count` counters (of kind `counter`, or any kind) from among permanents you control matching `filter` (default creature), one counter per choice. Removed as it becomes cast. `self: true`: only from this permanent ("Remove two counters from Ghost-Spider"). |
240
244
  | [`sacrifice`](docs/reference/costs.md#sacrifice) | 701.21a, 602.2b, 118.3 | Sacrifice the permanent the ability belongs to (it goes to its owner's graveyard). |
241
245
  | [`sacrifice_permanent`](docs/reference/costs.md#sacrifice_permanent) | 701.21a, 601.2h, 602.2b, 118.3, 608.2h | Sacrifice `count` permanents you control matching `filter` (`other: true`: not the source). Chosen while casting or activating, sacrificed as it becomes cast; the sacrificed permanent's last known types and subtypes are remembered (condition `sacrificed`), and its power, toughness and mana value (amount `sacrificed`). |
242
- | [`tap`](docs/reference/costs.md#tap) | 107.5, 602.5a | {T} — tap the permanent the ability belongs to. Requires it to be untapped. |
246
+ | [`tap`](docs/reference/costs.md#tap) | 107.5, 602.5a, 602.2b, 607.1a, 302.6 | {T} — tap the permanent the ability belongs to. Requires it to be untapped. `{"tap": "granter"}` instead taps the permanent whose static ability granted this ability ("Tap Fishing Pole"; not {T}, so summoning sickness doesn't matter). |
243
247
  | [`tap_another_creature`](docs/reference/costs.md#tap_another_creature) | 702.184a, 601.2h, 602.2b, 302.6 | Tap another untapped creature you control, chosen while activating. A creature that came under your control this turn can be tapped this way. |
244
248
  | [`tap_permanents`](docs/reference/costs.md#tap_permanents) | 601.2h, 602.2b, 302.6, 118.3 | Tap `count` untapped permanents you control matching `filter` (default: creature), chosen while casting or activating; `other: true` excludes the source. They are tapped as they are chosen; cancelling untaps them. |
245
249
  | [`waterbend`](docs/reference/costs.md#waterbend) | 701.67a, 701.67b, 701.67c | Waterbend [cost]: pay this mana cost; for each generic mana in it you may instead tap an untapped artifact or creature you control (pay_cost option `{type: "waterbend", object: id}`). Only the waterbend cost's own generic mana can be paid this way. |
@@ -264,8 +268,10 @@ Rules version: Comprehensive Rules effective 2026-11-06.
264
268
  | [`behold`](docs/reference/effects.md#behold) | 701.4a, 701.4b, 118.3 | You behold an object matching the card spec `card`: reveal such a card from your hand or choose such a permanent you control. Under `may`, "yes" is offered only when there is one. |
265
269
  | [`bite`](docs/reference/effects.md#bite) | 120.3, 120.4, 608.2b | Each creature referenced by `from` deals damage equal to its power to each creature, planeswalker or player referenced by `to` (one damage event per source; not combat damage, and nothing is dealt back). |
266
270
  | [`blight`](docs/reference/effects.md#blight) | 701.68a, 701.68b, 701.68c | Each referenced player (default: you) blights `amount`: puts that many -1/-1 counters on a creature they control, chosen as it resolves (one `effect_choice` each, in turn order). The blighted creatures are its results. |
267
- | [`cast`](docs/reference/effects.md#cast) | 608.2g, 707.12, 707.12a, 601.2a, 601.2f | The controller may cast referenced cards (or card copies) now, while this resolves, paying their costs; timing restrictions don't apply. `to`, `for`, `not_types`, `max_mana_value`, `count`, `exile_instead` and `any_mana_type` work as for `cast_free`. |
268
- | [`cast_free`](docs/reference/effects.md#cast_free) | 608.2g, 118.9, 601.2a, 107.3b, 118.6a, 305.2a, 305.3, 406.3a | The controller may cast referenced cards without paying their mana costs while this resolves. `to` names the cards ({"result": n}), or a player for the cards in their hand (default: your hand). Only cards matching `for`/`not_types` with mana value up to `max_mana_value` (optional amount) that could be cast now (legal targets). `count`: 1 (default) or "any" (any number, one at a time). X is 0 (CR 107.3b). `play: true` ("you may play"): a land among them may be played, on your turn with a land play left (`{type: "play_land"}`). A face-down card is judged face up. |
271
+ | [`cast`](docs/reference/effects.md#cast) | 608.2g, 707.12, 707.12a, 601.2a, 601.2f | The controller may cast referenced cards (or card copies) now, while this resolves, paying their costs; timing restrictions don't apply. `to`, `from`, `for`, `not_types`, `max_mana_value`, `count`, `exile_instead` and `any_mana_type` work as for `cast_free` ("you may cast an artifact spell from your graveyard": `from: "graveyard"`). |
272
+ | [`cast_free`](docs/reference/effects.md#cast_free) | 608.2g, 118.9, 601.2a, 107.3b, 118.6a, 305.2a, 305.3, 406.3a | The controller may cast referenced cards without paying their mana costs while this resolves. `to` names the cards ({"result": n}), or a player for the cards in their hand (default: your hand), or in the zone `from` (hand | graveyard). Only cards matching `for`/`not_types` with mana value up to `max_mana_value` (optional amount) that could be cast now (legal targets). `count`: 1 (default), up to N (an integer), or "any" (any number, one at a time). X is 0 (CR 107.3b). `play: true` ("you may play"): a land among them may be played, on your turn with a land play left (`{type: "play_land"}`). A face-down card is judged face up. |
273
+ | [`change_target`](docs/reference/effects.md#change_target) | 115.7, 115.7a, 115.7e | Change the target(s) of each spell or ability on the stack `of` refers to: each target becomes another legal target you choose for that spell; if one can't, none change. |
274
+ | [`choose_card_name`](docs/reference/effects.md#choose_card_name) | 201.4, 607.2d, 608.2c | The player (`to`, default you) chooses a card name among the cards in the game (`types`: the named card has one of these; `not`: it has none of these); "the chosen name" (`name: "chosen"` in filters) reads it. `remember: "source"`: the source permanent remembers it for its other abilities. |
269
275
  | [`choose_card_type`](docs/reference/effects.md#choose_card_type) | 205.2a, 607.2d, 608.2c | The player (`to`, default you) chooses a card type; later effects of this spell or ability read it with "types": "chosen". |
270
276
  | [`choose_cards`](docs/reference/effects.md#choose_cards) | 701.20a, 701.20e, 400.7j, 608.2c, 607.2a, 118.12, 701.9a, 701.9b | You choose `count` (default 1; "any": any number) cards matching `for` from `from`: a selector (e.g. {"result": 0}, the cards an earlier effect milled) or a player's zone, {"hand": selector} / {"graveyard": selector}. `optional`: you may choose fewer. Then they are put into `put` (`discard`: from a hand, its owner discards them; `tapped` onto the battlefield, under your control; exiled cards `link`ed to the source). `look`: you look at the whole zone first; `reveal`: "chosen" reveals what you chose, "all" the whole set. `then` runs if a card was chosen, `otherwise` if none was ("if you can't"). `random: true`: the cards are picked at random (the game's random number generator) instead of chosen. |
271
277
  | [`choose_color`](docs/reference/effects.md#choose_color) | 105.4, 607.2d, 608.2c | The player (`to`, default you) chooses a color; later effects of this spell or ability read it with "colors": "chosen". |
@@ -279,14 +285,14 @@ Rules version: Comprehensive Rules effective 2026-11-06.
279
285
  | [`counter_bonus`](docs/reference/effects.md#counter_bonus) | 614.1a, 614.16, 611.2a, 122.6, 616.1 | Until end of turn, whenever one or more counters would be put on a permanent the controller controls (including counters it enters with), that many plus `amount` of each of those kinds are put on it instead. |
280
286
  | [`counter_unless_pays`](docs/reference/effects.md#counter_unless_pays) | 701.6a, 118.12a, 605.3a, 701.67a | Counter each referenced spell or ability unless its controller pays `mana` (or `waterbend`s that cost, CR 701.67a, or pays the list of costs `cost`) as this resolves (they choose, and pay like any cost; mana abilities allowed). |
281
287
  | [`create_emblem`](docs/reference/effects.md#create_emblem) | 114.1, 114.2, 114.3, 114.4, 113.6p | Each referenced player (default you) gets an emblem with the `abilities` (triggered, static or player_rule abilities). An emblem is in the command zone for the rest of the game; its abilities work there, and "this emblem" is the source of what they do. |
282
- | [`create_token`](docs/reference/effects.md#create_token) | 111.1, 111.10, 701.7a, 704.5d, 508.4, 506.3b | Create `amount` tokens under the referenced player's control (default: you). `token` is a predefined token name (Treasure, Clue, Food) or an inline card definition. `tapped: true` creates them tapped; `attacking: true` attacking (only for the attacking player during combat, CR 506.3b). |
288
+ | [`create_token`](docs/reference/effects.md#create_token) | 111.1, 111.10, 701.7a, 704.5d, 508.4, 506.3b, 707.2 | Create `amount` tokens under the referenced player's control (default: you). `token` is a predefined token name (Treasure, Clue, Food) or an inline card definition. `tapped: true` creates them tapped; `attacking: true` attacking (only for the attacking player during combat, CR 506.3b); when the defending player controls a planeswalker, the controller chooses for each token whether it attacks that player or one of their planeswalkers (CR 508.4). `size` (an amount, fixed as the effect starts) makes them N/N ("an X/X Spirit token, where X is ..."; part of their copiable values). |
283
289
  | [`create_token_copy`](docs/reference/effects.md#create_token_copy) | 707.2, 707.8, 707.9a, 707.9b, 111.1, 614.1c | For each object `of` refers to (a permanent, a card in any zone, or the source with "self"), the referenced players (default: you) each create `amount` tokens that are copies of it: its copiable values (its card as modified by other copy effects, not counters, status or other effects), with the `except` modifications. The tokens are the effect's result, for later effects such as granting haste or a delayed sacrifice. |
284
290
  | [`damage_replacement`](docs/reference/effects.md#damage_replacement) | 614.1a, 611.2a, 611.2c, 616.1 | For the `duration` (end_of_turn by default, or until_your_next_turn), damage that would be dealt to the referenced players and permanents (`to`, fixed as it resolves; with `permanents: true` also the permanents a referenced player controls as the damage is dealt) is changed: `multiply` (2 = "double that damage") or `plus` an amount (computed as it resolves). `combat`: combat | noncombat only. Doubling applies before adding. |
285
291
  | [`damage_unpreventable`](docs/reference/effects.md#damage_unpreventable) | 615.12, 611.2a | Until end of turn, damage (`combat`: combat | noncombat only) can't be prevented. |
286
292
  | [`deal_damage`](docs/reference/effects.md#deal_damage) | 120.3a, 120.3c, 120.3e, 120.6, 120.4a, 120.10 | Deal `amount` damage to each referenced creature, planeswalker or player. Damage to a player causes life loss; to a planeswalker removes loyalty counters; to a creature is marked until cleanup. {"this_way": n} naming it is the excess damage it dealt (beyond lethal damage, or a planeswalker's loyalty). |
287
293
  | [`delayed_trigger`](docs/reference/effects.md#delayed_trigger) | 603.7a, 603.7b, 603.7c, 603.7d, 603.7e | Creates a delayed triggered ability with the controller and source of the resolving spell or ability. It triggers only once, the next time `when` happens (e.g. {"step_begins": {"step": "end", "whose": "each"}} for the next end step). Its `effects` may use {"result": n} for what earlier effects of the creating list moved or created; those objects are affected only if they are still where they were put. |
288
294
  | [`destroy`](docs/reference/effects.md#destroy) | 701.8a | Destroy each referenced permanent (it goes to its owner's graveyard). |
289
- | [`dig`](docs/reference/effects.md#dig) | 701.20a, 701.20e, 401.4, 400.7j, 406.3, 607.2a | Look at the top `amount` cards of your library (`reveal: "all"`: reveal them). Take `count` (default 1; "all": every matching card, no choice; "any": any number) cards matching `for` and put them into `put` (`tapped` onto the battlefield); `optional`: you may take fewer. `reveal: "chosen"` reveals the cards taken. The rest go to `rest`: "bottom_random" (default), "bottom_any" (in an order you choose) or "graveyard". `put: "exile"` takes `face_down: true` (only you may look at them) and `link: true` (exiled with the source, CR 607.2a: hideaway). |
295
+ | [`dig`](docs/reference/effects.md#dig) | 701.20a, 701.20e, 401.4, 400.7j, 406.3, 607.2a, 702.75a | Look at the top `amount` cards of your library (`reveal: "all"`: reveal them). Take `count` (default 1; "all": every matching card, no choice; "any": any number) cards matching `for` and put them into `put` (`tapped` onto the battlefield); `optional`: you may take fewer. `reveal: "chosen"` reveals the cards taken. The rest go to `rest`: "bottom_random" (default), "bottom_any" (in an order you choose) or "graveyard". `put: "exile"` takes `face_down: true` (only you may look at them) and `link: true` (exiled with the source, CR 607.2a); `looker: "source_controller"`: whoever controls the source may look at them instead of you (hideaway, CR 702.75a). |
290
296
  | [`discard`](docs/reference/effects.md#discard) | 701.9a, 701.9b | Each referenced player discards `amount` cards of their choice (default: you). `random: true`: the cards are chosen at random (the game's random number generator), with no decision. `hand: true`: each discards their whole hand at once ("discard your hand"; how many is its amount {"this_way": n}). |
291
297
  | [`discover`](docs/reference/effects.md#discover) | 701.57a, 701.57b, 701.57c, 608.2g, 118.9 | Discover `amount`: exile cards from the top of your library until you exile a nonland card with mana value `amount` or less. You may cast it without paying its mana cost; if you don't, it goes into your hand. The other exiled cards go on the bottom of your library in a random order. |
292
298
  | [`distribute_counters`](docs/reference/effects.md#distribute_counters) | 601.2d, 608.2b, 122.1 | Put on each legal target the number of `counter` counters assigned to it as the spell or ability was cast (its `divide` amount, at least one per target). |
@@ -301,7 +307,7 @@ Rules version: Comprehensive Rules effective 2026-11-06.
301
307
  | [`exile`](docs/reference/effects.md#exile) | 406.1, 701.13a, 607.2a, 406.6, 610.3, 610.3a, 610.3b, 610.3c | Exile each referenced permanent, spell, or card in a graveyard or hand. `link: true`: the cards are exiled with the source, for its "exiled with" abilities (the `exiled_with` selector). `until_source_leaves: true`: they return to the battlefield under their owners' control when the source leaves the battlefield; if it already has, nothing is exiled. |
302
308
  | [`exile_if_dies`](docs/reference/effects.md#exile_if_dies) | 614.1a, 700.4, 611.2a, 611.2c | Until end of turn, if a referenced permanent would be put into a graveyard from the battlefield, it is exiled instead. |
303
309
  | [`exile_this_spell`](docs/reference/effects.md#exile_this_spell) | 608.2n, 406.1 | The resolving spell is exiled instead of being put into its owner's graveyard as it finishes resolving. |
304
- | [`exile_top`](docs/reference/effects.md#exile_top) | 406.1, 400.7j, 607.2a, 406.3, 406.3a | Each referenced player (default: you) exiles the top `amount` cards of their library (face up). Later effects name them with {"result": n}; `link: true` exiles them with the source. `face_down: true` exiles them face down: only the `looker` players (default: you) may look at them. |
310
+ | [`exile_top`](docs/reference/effects.md#exile_top) | 406.1, 400.7j, 607.2a, 406.3, 406.3a, 202.3, 608.2c | Each referenced player (default: you) exiles the top `amount` cards of their library (face up). Later effects name them with {"result": n}; `link: true` exiles them with the source. `face_down: true` exiles them face down: only the `looker` players (default: you) may look at them. `until` instead of `amount`: exile cards from the top one at a time until {"total_mana_value": N}: those cards have a total mana value of N or more, or {"card": card spec}: a matching card is exiled (or the library is empty). |
305
311
  | [`exile_until`](docs/reference/effects.md#exile_until) | 406.1, 701.13a, 400.7j | Each referenced player exiles cards from the top of their library until they exile a card matching `until` (or the library is empty). All exiled cards are the result. |
306
312
  | [`explore`](docs/reference/effects.md#explore) | 701.44a, 701.44b, 701.44c | Each referenced permanent explores: its controller reveals the top card of their library. A land card goes to their hand; otherwise the permanent gets a +1/+1 counter (if it's still on the battlefield) and they may put the card into their graveyard. |
307
313
  | [`extra_turn`](docs/reference/effects.md#extra_turn) | 500.7 | Each referenced player (default you) takes an extra turn after this one. Extra turns are taken most recently created first. |
@@ -319,8 +325,8 @@ Rules version: Comprehensive Rules effective 2026-11-06.
319
325
  | [`mill`](docs/reference/effects.md#mill) | 701.17a | Each referenced player puts the top `amount` cards of their library into their graveyard (default: you). |
320
326
  | [`pay`](docs/reference/effects.md#pay) | 118.12, 118.12a, 118.3, 119.4, 605.3a, 701.67a, 701.67c | You may pay `cost` (a list of costs: mana, life, discarding, sacrificing, a `one_of` choice, ...) as it resolves; `mana`, `life` and `waterbend` are shorthands for one cost. If you do, `then` happens; if you don't, `otherwise`. Paying mana works like paying a spell's cost (mana abilities may be activated; a `waterbend` cost may also be paid by tapping artifacts and creatures, CR 701.67a); a cost that can't be paid can't be chosen (CR 118.3). For another player paying, see `counter_unless_pays`. |
321
327
  | [`phase_out`](docs/reference/effects.md#phase_out) | 702.26a, 702.26b, 702.26d, 702.26g, 702.26h, 502.1, 506.4 | Each referenced permanent phases out, with the Auras and Equipment attached to it (indirectly). It phases in during the untap step of the player who controlled it as it phased out. Phasing isn't a zone change: no enters or leaves triggers. |
322
- | [`play_permission`](docs/reference/effects.md#play_permission) | 611.2a, 601.3, 305.1, 400.7, 514.2, 601.2f, 108.3, 406.3b, 609.4b | A player may play (`play: "play"`, default) or cast (`"cast"`) each referenced exiled card matching `for`/`not_types`, paying its costs and following timing rules, for `duration`: end_of_turn (default), end_of_your_next_turn, until_your_next_end_step or while_exiled. With `choose: "one_per_owner"` only one chosen card per owner. `to_player`: who may play it, "controller" (default, the effect's controller), "owner" (the card's owner) or a player selector (a face-down card: only someone who may look at it). `cost_increase`: spells cast this way cost that much generic mana more. `any_mana_type: true`: mana of any type can be spent to cast those spells. |
323
- | [`player_rule`](docs/reference/effects.md#player_rule) | 702.11c, 115.4, 508.1c, 402.2, 514.1, 615.1, 615.1a, 704.5a, 104.3b, 701.21a, 614.17b, 101.2, 601.3, 701.6a, 119.7, 602.5, 615.12, 702.16b, 702.16e, 702.16k, 611.2a, 514.2 | Each referenced player (default you) gets `rule` for the `duration`: end_of_turn (default) or until_your_next_turn (until the controller's next turn begins). Rules: hexproof, cant_attack, no_max_hand_size, prevent_all_damage, cant_lose_for_life, cant_cast, cant_cast_except_from_hand, spells_cant_be_countered, abilities_cant_be_countered, cant_gain_life, cant_activate, damage_cant_be_prevented, combat_damage_cant_be_prevented, protection_from_opponents. |
328
+ | [`play_permission`](docs/reference/effects.md#play_permission) | 611.2a, 611.2b, 601.3, 305.1, 400.7, 514.2, 601.2f, 108.3, 406.3b, 609.4b, 118.9, 701.67a | A player may play (`play: "play"`, default) or cast (`"cast"`) each referenced exiled card matching `for`/`not_types`, paying its costs and following timing rules, for `duration`: end_of_turn (default), end_of_your_next_turn, until_your_next_end_step, while_exiled or while_you_control_source ("for as long as you control this creature"). With `choose: "one_per_owner"` only one chosen card per owner. `to_player`: who may play it, "controller" (default, the effect's controller), "owner" (the card's owner) or a player selector (a face-down card: only someone who may look at it). `cost_increase`: spells cast this way cost that much generic mana more. `any_mana_type: true`: mana of any type can be spent to cast those spells. `during: "your_turn"`: only during your turn. `waterbend: "mana_value"`: cast it by waterbending {X} rather than paying its mana cost, where X is its mana value. |
329
+ | [`player_rule`](docs/reference/effects.md#player_rule) | 702.11c, 115.4, 508.1c, 402.2, 514.1, 615.1, 615.1a, 704.5a, 104.3b, 701.21a, 614.17b, 101.2, 601.3, 701.6a, 119.7, 602.5, 615.12, 702.16b, 702.16e, 702.16k, 506.3, 611.2a, 514.2 | Each referenced player (default you) gets `rule` for the `duration`: end_of_turn (default) or until_your_next_turn (until the controller's next turn begins). Rules: hexproof, cant_attack, no_max_hand_size, prevent_all_damage, cant_lose_for_life, cant_cast, cant_cast_except_from_hand, spells_cant_be_countered, abilities_cant_be_countered, cant_gain_life, cant_activate, damage_cant_be_prevented, combat_damage_cant_be_prevented, protection_from_opponents. |
324
330
  | [`plot`](docs/reference/effects.md#plot) | 702.170c, 702.170d, 406.1 | Each referenced card or spell is exiled (if it isn't already) and becomes plotted: its owner may cast it from exile without paying its mana cost during their main phase while the stack is empty, on any later turn (cast option `via: "plotted"`). |
325
331
  | [`prepare`](docs/reference/effects.md#prepare) | 723.3a, 723.3c | Each referenced permanent (default: this one) becomes prepared, if it has a prepare spell and isn't prepared already: its controller creates a copy of the prepare spell in exile and may cast that copy while the permanent stays prepared. Casting it unprepares the permanent. |
326
332
  | [`prevent_damage`](docs/reference/effects.md#prevent_damage) | 615.1, 615.3, 615.5, 615.7, 615.8, 609.7a, 611.2a, 611.2b, 611.2c | For the `duration` (end_of_turn by default, until_your_next_turn, or while_source_on_battlefield: for as long as this effect's source remains on the battlefield), damage that would be dealt to the referenced players and permanents (`to`, fixed as it resolves) or to those matching `to_each` as the damage is dealt (a damage scope seen from the controller, e.g. {"each": "creature", "controller": "you"}), and/or by the referenced sources (`by`; "chosen_source": a source the controller chooses as it resolves) is prevented (`combat`: combat | noncombat only). With `next`, it is a shield that prevents only the next that much damage; with `next_time: true` it prevents only the next damage event it applies to. `then`: effects right after it prevents damage, reading {"triggering": "amount"} (the damage prevented), "object" (the source) and "player" (its controller). |
@@ -330,8 +336,9 @@ Rules version: Comprehensive Rules effective 2026-11-06.
330
336
  | [`recruit`](docs/reference/effects.md#recruit) | 701.70a | Each referenced player (default: you) recruits: draws a card, then discards a card; if a nonland card was discarded, they create a 1/1 white Human Soldier creature token. |
331
337
  | [`reflexive_trigger`](docs/reference/effects.md#reflexive_trigger) | 603.12, 603.12a, 603.7d, 603.7e, 603.3d | Creates a reflexive triggered ability ("when you do, ...") that triggers immediately, with the controller and source of the resolving spell or ability. Its `targets` are chosen as it's put on the stack; its `effects` may name the results of earlier effects of the creating list. With `if`, it triggers only when the condition holds ("when excess damage is dealt this way"). |
332
338
  | [`remove_all_counters`](docs/reference/effects.md#remove_all_counters) | 122.8 | Remove every counter named `counter` (every counter, if no `counter` is given) from each referenced permanent. |
333
- | [`remove_counters`](docs/reference/effects.md#remove_counters) | 122.8 | Remove up to `amount` counters named `counter` from each referenced permanent. |
339
+ | [`remove_counters`](docs/reference/effects.md#remove_counters) | 122.8 | Remove up to `amount` counters named `counter` from each referenced permanent. How many were removed is {"this_way": n} ("remove a bait counter ... If you do, ..."). |
334
340
  | [`remove_damage`](docs/reference/effects.md#remove_damage) | 120.6, 514.2 | Remove all damage marked on each referenced permanent. |
341
+ | [`repeat`](docs/reference/effects.md#repeat) | 608.2c, 400.7j, 104.4b | Run `effects`, then run them again for as long as `while` (a condition) holds after a pass ("if the exiled card is a land card, repeat this process"). {"result": n} in the list and in `while` names what effect n did during the current pass. At most 100 passes. |
335
342
  | [`return_choice`](docs/reference/effects.md#return_choice) | 101.4, 400.7, 608.2c | Each referenced player (default: you) returns `count` (default 1; "any": any number) permanents they control matching `filter` to their owners' hands, chosen by them in turn order starting with the active player (not targeted); all move at once. |
336
343
  | [`return_to_battlefield`](docs/reference/effects.md#return_to_battlefield) | 400.7, 400.4a, 110.2, 111.8, 603.7c, 614.1c, 122.6, 712.11a, 712.11b, 205.1a | Put each referenced card that is in exile or a graveyard onto the battlefield under its owner's control (`under: "you"`: under the controller's), tapped if `tapped: true`. A card that is no longer in the zone it was expected in, or isn't a permanent card, stays where it is. `transformed: true`: it enters with its back face up; a card that isn't double-faced, or whose back face isn't a permanent, stays where it is. `as`: what it is as it enters, for as long as it stays (the `become` changes, without abilities): "It's an enchantment. (It's not a creature.)" is `{"set_types": ["enchantment"]}`; abilities that trigger on it entering see it so. |
337
344
  | [`return_to_hand`](docs/reference/effects.md#return_to_hand) | 400.6, 404.1, 608.2b | Return each referenced permanent, spell ("return target spell to its owner's hand"), or card in a graveyard or exile ("target creature card from your graveyard"), to its owner's hand. |
@@ -340,7 +347,7 @@ Rules version: Comprehensive Rules effective 2026-11-06.
340
347
  | [`sacrifice`](docs/reference/effects.md#sacrifice) | 701.21a | The controller sacrifices each referenced permanent they control (it goes to its owner's graveyard; it isn't destroyed, so indestructible doesn't stop it). |
341
348
  | [`sacrifice_choice`](docs/reference/effects.md#sacrifice_choice) | 701.21a, 101.4, 118.3 | Each referenced player (default: you) sacrifices `count` (default 1; "any": any number) permanents they control matching `filter`, chosen by them in turn order starting with the active player; all are sacrificed at once. The `filter`'s `controller` and `other` restrictions are relative to the effect's controller and source. |
342
349
  | [`scry`](docs/reference/effects.md#scry) | 701.22a | Look at the top `amount` cards of your library; put any number on the bottom and the rest on top in any order. |
343
- | [`search_library`](docs/reference/effects.md#search_library) | 701.23a, 701.23b, 701.23d, 701.23e, 701.20a, 701.24a, 701.24b, 118.12, 110.2a | Search your library for up to `count` cards matching `for`, then put them into your hand (or onto the battlefield, tapped if `tapped`, with `counters`; or into your graveyard) and shuffle. `put: library_top`: shuffle, then put the found card (one) on top. Computed bounds in `for` are worked out as the effect resolves. With a stated quality you may find fewer (or none); a search for just "a card" must find one if it can. `reveal` shows the found cards to every player. `searcher` names another player who searches their own library (e.g. {"controller_of": {"target": 0}}); `may: true` lets the searcher decline (then nothing is shuffled). `different_names: true`: the cards found must all have different names ("basic land cards with different names"). |
350
+ | [`search_library`](docs/reference/effects.md#search_library) | 701.23a, 701.23b, 701.23d, 701.23e, 701.20a, 701.24a, 701.24b, 118.12, 110.2a, 614.1a | Search your library for up to `count` cards matching `for`, then put them into your hand (or onto the battlefield, tapped if `tapped`, with `counters`; or into your graveyard) and shuffle. `put: library_top`: shuffle, then put the found card (one) on top. Computed bounds in `for` are worked out as the effect resolves. With a stated quality you may find fewer (or none); a search for just "a card" must find one if it can. `reveal` shows the found cards to every player. `searcher` names another player who searches their own library (e.g. {"controller_of": {"target": 0}}); `may: true` lets the searcher decline (then nothing is shuffled). `different_names: true`: the cards found must all have different names ("basic land cards with different names"). `battlefield_instead`: {"if": condition, "for": card spec}: a found card matching `for` goes onto the battlefield instead of into your hand while the condition holds. |
344
351
  | [`set_base_power_toughness`](docs/reference/effects.md#set_base_power_toughness) | 613.4b, 611.2a, 611.2b, 611.2c | Each referenced creature's base power and toughness become `power`/`toughness` (layer 7b; counters and pumps still apply), until end of turn or, with `duration: "indefinite"`, for as long as it stays on the battlefield. |
345
352
  | [`set_creature_types`](docs/reference/effects.md#set_creature_types) | 205.1a, 613.1d, 611.2c, 514.2 | Until end of turn, each referenced creature's creature types are exactly `types` (its other subtypes, such as artifact types, stay). The affected set is locked in. |
346
353
  | [`set_life`](docs/reference/effects.md#set_life) | 119.5, 119.7 | Each referenced player's life total becomes `amount` (default: you): they gain or lose the difference (so "can't gain life" and life-gain triggers apply). |
@@ -363,6 +370,7 @@ Rules version: Comprehensive Rules effective 2026-11-06.
363
370
  | [`artifact`](docs/reference/filters.md#artifact) | 115.1 | An artifact on the battlefield. |
364
371
  | [`creature`](docs/reference/filters.md#creature) | 115.1 | A creature on the battlefield. |
365
372
  | [`creature_or_planeswalker`](docs/reference/filters.md#creature_or_planeswalker) | 115.1 | A creature or planeswalker on the battlefield. |
373
+ | [`exiled_with`](docs/reference/filters.md#exiled_with) | 607.2a, 406.6, 115.1 | A card in exile that one of this object's abilities exiled (linked abilities: "the cards exiled with it"); restrict with `any_of`/`not` for its card types. |
366
374
  | [`graveyard_card`](docs/reference/filters.md#graveyard_card) | 404.1, 115.1 | A card in a graveyard (any player's, in seat order; restrict with `controller` for its owner and `any_of`/`not` for its card types). |
367
375
  | [`land`](docs/reference/filters.md#land) | 115.1 | A land on the battlefield. |
368
376
  | [`one_of`](docs/reference/filters.md#one_of) | 115.1, 109.2 | Anything at least one of the listed filters matches (each may have restrictions). |
@@ -371,7 +379,7 @@ Rules version: Comprehensive Rules effective 2026-11-06.
371
379
  | [`planeswalker`](docs/reference/filters.md#planeswalker) | 115.1 | A planeswalker on the battlefield. |
372
380
  | [`player`](docs/reference/filters.md#player) | 115.1 | A player. |
373
381
  | [`spell`](docs/reference/filters.md#spell) | 112.1, 115.1 | A spell on the stack. |
374
- | [`stack_ability`](docs/reference/filters.md#stack_ability) | 113.1b, 115.1, 605.3b, 113.7 | An activated or triggered ability on the stack. `kind`: "activated" or "triggered" for only one of them; `controller`: you | opponent; `source`: a filter its source matches (e.g. "creature", "artifact"). |
382
+ | [`stack_ability`](docs/reference/filters.md#stack_ability) | 113.1b, 115.1, 605.3b, 113.7, 115.7 | An activated or triggered ability on the stack. `kind`: "activated" or "triggered" for only one of them; `controller`: you | opponent; `source`: a filter its source matches (e.g. "creature", "artifact"); `single_target: true`: one with a single target. |
375
383
 
376
384
  ## Counters with rules
377
385
 
@@ -1372,7 +1372,7 @@ grants its abilities.
1372
1372
  | "Suspend 3—{2}{W}" (CR 702.62a) | ability `{ "suspend": { "amount": 3, "cost": "{2}{W}" } }`: the special action exiles it with three time counters whenever you could begin to cast it |
1373
1373
  | "exile it with four time counters on it. If it doesn't have suspend, it gains suspend" | effect `{ "suspend": { "to": …, "amount": 4 } }` (a spell, a card or a permanent); a card that has suspend from the start is `"keywords": ["suspend"]` |
1374
1374
  | suspended cards (CR 702.62b) | automatic: at the beginning of its owner's upkeep a time counter is removed; when the last is removed they may play it without paying its mana cost (`effect_choice` `{type: "cast"}` / `{type: "play_land"}`), and a creature spell cast this way has haste while they control it |
1375
- | "Hideaway 4" (CR 702.75a) | ability `{ "hideaway": { "amount": 4 } }`: the exiled card is `"exiled_with"` the permanent, face down, and only its controller may look at it |
1375
+ | "Hideaway 4" (CR 702.75a) | ability `{ "hideaway": { "amount": 4 } }`: the exiled card is `"exiled_with"` the permanent, face down, and only the player who controls the permanent may look at it |
1376
1376
  | "You may play the exiled card without paying its mana cost" | `{ "cast_free": { "to": "exiled_with", "play": true } }` (`play: true` also plays a land, on your turn with a land play left, CR 305.2a, 305.3) |
1377
1377
  | "look at the top N cards, exile one face down" | `{ "dig": { "amount": N, "put": "exile", "face_down": true, "link": true } }` (`link`: exiled with the source) |
1378
1378
  | "Devour land 3" (CR 702.82c) / "Devour 2" | ability `{ "devour": { "amount": 3, "each": "land" } }` / `{ "devour": { "amount": 2 } }`: as it enters, `enter_choice` `{type: "devour", object: id}` picks permanents one at a time, then `{type: "done"}`; it enters with N +1/+1 counters for each and remembers how many it devoured |
@@ -1389,6 +1389,111 @@ grants its abilities.
1389
1389
  { "foretell": { "cost": "{1}{R}" } }] }
1390
1390
  ```
1391
1391
 
1392
+ ### 4.30 Casting permissions: "for as long as you control", flash by a cost, granted sneak, costs that read the board
1393
+
1394
+ | Oracle text | Data |
1395
+ | --- | --- |
1396
+ | "You may play that card for as long as you control this creature" (CR 611.2b) | `{ "play_permission": { "to": { "result": 0 }, "duration": "while_you_control_source" } }` (ends when the source leaves or changes control; never starts if that already happened) |
1397
+ | "For as long as you control Hama, you may cast the exiled card during your turn by waterbending {X} rather than paying its mana cost, where X is its mana value" (CR 701.67a, 118.9) | the same with `"play": "cast", "during": "your_turn", "waterbend": "mana_value"` (pay_cost `{type: "waterbend", object: id}` taps an artifact or creature for {1}) |
1398
+ | "You may cast this spell as though it had flash if you behold a Dragon as an additional cost" (CR 601.3c) | `{ "additional_cost": { "cost": [{ "behold": { "card": { "subtypes": ["dragon"] } } }], "optional": true, "flash": true } }`: at instant speed only `kick` is offered |
1399
+ | "As an additional cost to cast this spell, you may choose a creature type and behold two creatures of that type" (CR 601.2b, 607.2d) | `"cost": [{ "choose_creature_type": {} }, { "behold": { "card": { "types": ["creature"], "subtypes": "chosen" }, "count": 2 } }]` with `"optional": true` (`choose_cost` option `{type: "cost", creature_type: "elf"}`; the spell remembers the type) |
1400
+ | "If this spell's additional cost was paid and the revealed card is the chosen type, put that card onto the battlefield instead" | `search_library` with `"battlefield_instead": { "if": { "cast_with": "additional_cost" }, "for": { "subtypes": "chosen" } }` |
1401
+ | "Discard a legendary card with the same name as a legendary permanent you control" (CR 201.2a) | `{ "discard": { "card": { "supertypes": ["legendary"], "same_name_as": { "permanent": { "supertypes": ["legendary"], "controller": "you" } } } } }` (a card spec relation, read for whoever pays) |
1402
+ | "Exile any number of black cards from your graveyard with fifteen or more black mana symbols among their mana costs: Copy those exiled cards. You may cast up to three of the copies without paying their mana costs." (CR 107.4e, 707.12) | cost `{ "exile_from_graveyard": { "count": "any", "card": { "colors": ["B"] }, "symbols": { "color": "B", "at_least": 15 } } }` (choose cards, `done` once enough symbols are chosen); effects `{ "copy_card": { "of": "exiled_for_cost" } }`, `{ "cast_free": { "to": { "result": 0 }, "count": 3 } }` |
1403
+ | "Whenever Bilbo attacks, you may cast an artifact, instant, or sorcery spell from your graveyard. If an instant or sorcery spell cast this way would be put into your graveyard, exile it instead." (CR 608.2g) | `{ "cast": { "from": "graveyard", "for": { "any_of": [...] }, "exile_instead": { "any_of": [{ "types": ["instant"] }, { "types": ["sorcery"] }] } } }` (`from` also on `cast_free`; `count` takes an integer: "up to N") |
1404
+ | "Creature cards in your graveyard have sneak {3}{B}. You may cast creature spells from your graveyard using their sneak abilities." (CR 611.3a) | `{ "cards_have": { "zone": "graveyard", "cards": { "types": ["creature"] }, "ability": { "sneak": { "cost": "{3}{B}" } } } }` (flashback, harmonize, mayhem, web-slinging or sneak; cast option `via: "alt:cards_have:<permanent>:<ref>"`) |
1405
+ | "Whenever you cast a spell you don't own" (CR 108.3) | trigger `{ "cast": { "owner": "not_you" } }` (`"you"`: one you own) |
1406
+ | "Ward—Pay life equal to Raubahn's power" (CR 702.21a) | `{ "ward": { "cost": [{ "pay_life": { "power": "self" } }] } }` (`pay_life` takes an amount, computed as it's paid) |
1407
+ | "Whenever you give a gift" (CR 702.174c) | trigger `{ "gives_gift": {} }`: a gift-promised instant or sorcery you control resolves, or a permanent's gift trigger (`"if": { "cast_with": "gift" }`) resolves |
1408
+ | "Remove two counters from Ghost-Spider" | `{ "remove_counters": { "count": 2, "self": true } }` |
1409
+
1410
+ A card's colors include those of its hybrid symbols (CR 202.2d), so a `{U/B}` card is a black card for `"colors": ["B"]`.
1411
+
1412
+ ```json
1413
+ { "name": "Example Bloodwater Adept", "mana_cost": "{2}{U}{B}", "types": ["creature"], "subtypes": ["human", "warlock"],
1414
+ "power": 3, "toughness": 3,
1415
+ "abilities": [{ "triggered": { "when": { "enters": {} },
1416
+ "effects": [{ "exile_top": { "amount": 1 } },
1417
+ { "play_permission": { "to": { "result": 0 }, "play": "cast",
1418
+ "duration": "while_you_control_source",
1419
+ "during": "your_turn", "waterbend": "mana_value" } }] } }] }
1420
+ ```
1421
+
1422
+ ### 4.31 Rules correctness: ordering damage effects, new targets, chosen sources, entering attacking
1423
+
1424
+ These need no new data: the shapes above play by these rules.
1425
+
1426
+ | Rule | How the engine applies it |
1427
+ | --- | --- |
1428
+ | Several replacement and prevention effects apply to one damage event (CR 616.1, 616.1e-f) | Redirections (`redirect`) apply first. When the order of the others changes the result (the damage dealt, a shield left, a `then` amount), the affected player (the player dealt damage, or the permanent's controller) gets a `damage_order` decision before the damage is dealt: options `{type: "order", order: [keys], steps: [labels], amount: n}`, one per distinct result, asked in APNAP order for combat damage. Otherwise nothing is asked and the order is prevention, multiplying, adding (statics before resolved effects). Each effect applies once; after each, the others are rechecked |
1429
+ | "Damage can't be prevented" against a prevention effect with `then` (CR 615.12) | The prevention effect still applies once: nothing is prevented, a shield (`next`, `next_time`) isn't used up, and its `then` happens with `{"triggering": "amount"}` 0, except a `reflexive_trigger` ("when damage is prevented this way") |
1430
+ | `choose_new_targets`, `copy_spell` (CR 115.7, 707.10, 702.21a) | Each new target, and each target of a copy, becomes a target of that spell or ability: ward and `becomes_target` trigger (for the spell's controller) |
1431
+ | New targets for a divided spell (CR 115.7f, 601.2d) | Each target's share of the division goes to the target that replaced it; a new target can't be another target of the same spell |
1432
+ | `prevent_damage` with `"by": "chosen_source"` (CR 609.7a-b) | The choice includes permanents, spells and abilities on the stack, objects they refer to (targets, an ability's source) and objects in the command zone. A chosen permanent spell's damage is prevented also once it is a permanent |
1433
+ | `create_token` with `attacking: true` (CR 508.4) | When the defending player controls a planeswalker, the controller chooses for each token what it attacks: an `effect_choice` of `{type: "attack", target: ref}` |
1434
+ | `copy_spell` of `{"triggering": "ability"}` after that ability left the stack (CR 707.10, 608.2h) | The engine's reading for "copy that ability" (Firebender Ascension): it is copied as it last existed on the stack, with its targets, modes and X |
1435
+
1436
+ ### 4.32 Statics, grants and combat: granted costs, bound choices, chosen names, riot grants, attacking alone
1437
+
1438
+ | Oracle text | Data |
1439
+ | --- | --- |
1440
+ | "Equipped creature has '{1}, {T}, Tap Fishing Pole: Put a bait counter on Fishing Pole.'" (CR 602.2b, 607.1a) | granted `activated` with `"cost": [{ "mana": "{1}" }, "tap", { "tap": "granter" }]` and `"to": "granter"` (the cost taps the permanent that granted this ability; not {T}, so summoning sickness doesn't matter) |
1441
+ | "remove a bait counter from this Equipment. If you do, create …" | `remove_counters`, then the effect with `"if": { "amount": { "this_way": 0 }, "at_least": 1 }` (how many were removed) |
1442
+ | "Until end of turn, ~ becomes the color of your choice and gains hexproof from that color" (CR 607.2d) | `{ "choose_color": {} }`, then `{ "become": { "colors": "chosen", "abilities": [{ "hexproof_from": "chosen_color" }], "to": "self" } }`: the color is bound into the granted ability as it resolves, so a second activation with another color adds a second hexproof (`"chosen_color"` on a permanent that chose as it entered reads its own choice) |
1443
+ | "That creature can't become untapped for as long as you control ~" (CR 701.26b) | `{ "become": { "keywords": ["cant_become_untapped"], "duration": "while_you_control_source", "to": { "target": 0 } } }` (neither the untap step nor "untap it" untaps it; `doesnt_untap` only stops the untap step); "Enchanted creature can't become untapped" is a `static` handing out the same keyword |
1444
+ | "As this artifact enters, look at an opponent's hand, then choose any card name" | `{ "choose_card_name": { "look_at_hand": "opponent" } }` (`types`: `["land"]` for "a land card name") |
1445
+ | "When this land enters, choose a land card name." (a triggered ability, linked to the land's other abilities) | effect `{ "choose_card_name": { "types": ["land"], "remember": "source" } }` (`remember: "source"` works for every resolving `choose_*`) |
1446
+ | "Activated abilities of sources with the chosen name can't be activated unless they're mana abilities" (CR 201.4, 602.5) | `{ "player_rule": { "rule": "cant_activate", "affects": "each", "name": "chosen" } }` (sources in any zone: cycling from a hand is stopped too) |
1447
+ | "Lands with the chosen name have '{T}: Add {C}.'" | `static` with `"affects": { "each": { "land": { "name": "chosen" } } }` (filter key `"name": "chosen"`) |
1448
+ | "Other Spiders you control have riot" (CR 614.12, 702.136b) | `static` with `"keywords": ["riot"]`: a Spider entering while it applies makes riot's choice as it enters (a Spider with its own riot chooses twice); haste chosen this way stays after the riot is gone |
1449
+ | "Whenever a creature you control attacks alone, it gains double strike until end of turn" (CR 506.5) | trigger `{ "attacks": { "subject": { "each": "creature", "controller": "you" }, "alone": true } }` (once attackers are declared), effect `grant` to `{ "triggering": "object" }` |
1450
+ | "Creatures with flying can't attack you" (CR 508.1c) | `{ "player_rule": { "rule": "cant_be_attacked", "filter": { "creature": { "keywords": ["flying"] } } } }` (your planeswalkers can still be attacked) |
1451
+ | "… or block creatures you control" | `static` granting creatures you control `{ "cant_be_blocked_by": { "filter": { "creature": { "keywords": ["flying"] } } } }` |
1452
+ | "Create an X/X white Spirit creature token, where X is the greatest toughness among creatures you control" | `create_token` with `"size": { "greatest_toughness": { "each": "creature", "controller": "you" } }` (the token data says 0/0) |
1453
+ | "Each creature you control with toughness greater than its power assigns combat damage equal to its toughness" (CR 510.1a) | `static` handing out `assigns_damage_by_toughness` (attacking and blocking) |
1454
+ | "This creature saddles Mounts and crews Vehicles using its toughness" gained by an effect | `become` with `"abilities": [{ "tapping_power": … }]` |
1455
+
1456
+ ```json
1457
+ { "name": "Example Lure Angler", "mana_cost": "{1}", "types": ["artifact"], "subtypes": ["equipment"],
1458
+ "abilities": [{ "static": { "affects": "attached", "abilities": [
1459
+ { "activated": { "cost": ["tap", { "tap": "granter" }],
1460
+ "effects": [{ "add_counters": { "counter": "bait", "amount": 1, "to": "granter" } }] } }] } },
1461
+ { "equip": { "cost": [{ "mana": "{1}" }] } }] }
1462
+
1463
+ ### 4.33 Loops, exiling until, cards exiled with a permanent, changing targets and the Nth counter
1464
+
1465
+ | Oracle text | Data |
1466
+ | --- | --- |
1467
+ | "[effects]. If the exiled card is a land card, repeat this process." (CR 608.2c) | `{ "repeat": { "effects": [...], "while": condition } }`: the effects run, then run again while `while` holds. Each pass has results of its own: `{ "result": n }` in the list and in `while` is what effect n did during this pass (at most 100 passes) |
1468
+ | "the exiled card is a land card" | selector `{ "result": 0, "for": { "types": ["land"] } }` (only the results matching a card spec), e.g. `"while": { "amount": { "count": { "result": 0, "for": { "types": ["land"] } } }, "at_least": 1 }` |
1469
+ | "exile a permanent card from your graveyard at random" | `{ "choose_cards": { "from": { "graveyard": "you" }, "for": { "permanent": true }, "random": true, "put": "exile" } }` |
1470
+ | "Exile cards from the top of your library until you exile cards with total mana value 4 or greater" (CR 406.1) | `{ "exile_top": { "until": { "total_mana_value": 4 } } }` (`until` replaces `amount`; the cards are the effect's result) |
1471
+ | "… until they exile a nonland card" | `{ "exile_top": { "to": "each_opponent", "until": { "card": { "not_types": ["land"] } } } }` |
1472
+ | "You may cast any number of spells from among them without paying their mana costs" | `{ "cast_free": { "to": { "result": 0 }, "count": "any" } }` |
1473
+ | "target creature card exiled with [this]" (CR 607.2a) | target filter `{ "exiled_with": { "any_of": ["creature"] } }`: a card in exile that one of this object's abilities exiled (`link: true` on `exile`, `choose_cards`, `dig`, `exile_top`; `exile_if_dies`) |
1474
+ | "Black spells you cast cost {1} less" | `{ "cost_modifier": { "spells": { "colors": ["B"] }, "reduce": 1 } }` |
1475
+ | "If it was attacking, …" (CR 608.2h) | condition `{ "attacking": { "target": 0 } }`: it's attacking, or, if it left the battlefield during this resolution, it was as it last existed |
1476
+ | "When the fourth plan counter is put on this enchantment" (CR 122.6) | trigger `{ "counters_placed": { "counter": "plan", "nth": 4 } }`: the event that takes it from fewer than four plan counters to four or more |
1477
+ | "sacrifice it. When you do, it deals 7 damage divided as you choose among one or two targets" | `[{ "sacrifice": { "to": "self" } }, { "reflexive_trigger": { "if": { "amount": { "count": { "result": 0 } }, "at_least": 1 }, "targets": [{ "filter": "any_target", "count": 2, "optional": true }], "divide": 7, "effects": [{ "distribute_damage": {} }] } }]` |
1478
+ | "target spell or ability with a single target" | `{ "one_of": [{ "spell": { "single_target": true } }, { "stack_ability": { "single_target": true } }] }` |
1479
+ | "Change the target of target spell or ability" (CR 115.7a) | `{ "change_target": { "of": { "target": 0 } } }`: you choose another legal target for each of its targets (`effect_choice` `{type: "target"}`); a target with no other legal target stays, and then none change. "You may choose new targets" is `choose_new_targets` (CR 115.7d) |
1480
+ | "Assimilate a creature card exiled with it. If you can't, exile up to one target creature." (CR 701.72b, 607.2a) | `[{ "assimilate": { "to": "exiled_with", "for": { "types": ["creature"] }, "choose": true } }, { "exile": { "to": { "target": 0 }, "link": true, "if": { "amount": { "count": { "result": 0 } }, "at_most": 0 } } }]`, with the target `{ "filter": "creature", "optional": true }` |
1481
+
1482
+ Also automatic:
1483
+ - A melded permanent's mana value is the total of its two front faces' (CR 713.5c). As the pair is melded, the second
1484
+ card's move from exile is an event of its own (`zone_changed` with `new_id: null`).
1485
+ - A hidden-away card (hideaway, CR 702.75a) may be looked at, and played, by whoever controls the permanent now
1486
+ (`dig` with `looker: "source_controller"`).
1487
+ - Earthbend's "when that land dies or is put into exile" ends when the land leaves the battlefield for any other zone.
1488
+
1489
+ ```json
1490
+ { "name": "Example Echo of the Depths", "mana_cost": "{3}{B}", "types": ["sorcery"],
1491
+ "abilities": [{ "spell": { "effects": [{ "repeat": {
1492
+ "effects": [{ "mill": { "amount": 1 } },
1493
+ { "return_to_battlefield": { "to": { "result": 0, "for": { "types": ["land"] } }, "tapped": true } }],
1494
+ "while": { "amount": { "count": { "result": 0, "for": { "types": ["land"] } } }, "at_least": 1 } } }] } }] }
1495
+ ```
1496
+
1392
1497
  ---
1393
1498
 
1394
1499
  ## 5. Worked examples
@@ -27,6 +27,29 @@ that makes the most cards exact per unit of effort (S = 1, M = 2, L = 3+, from a
27
27
  Equipment with equip), Brilliance Unleashed (its own return effect, not yet re-scripted with `as`).
28
28
  Known gap: layer 4 applies resolved type effects (in timestamp order) before statics that change types,
29
29
  whatever their timestamps (CR 613.7a wants one order for both).
30
+ - **Batch 3 done (0.5.0), engine side:** each gap is covered by real-card specs
31
+ (`spec/integration/real_cards/known_gaps_*_spec.rb`) and invented fuzz cards; the cards still need re-scripting in
32
+ deckfinder and an `enjine --verify` run before they count as exact.
33
+ - Casting and permissions (change 24 in part, cluster 2): `play_permission` `while_you_control_source`, `during`,
34
+ `waterbend` (Hama); flash by an optional additional cost (Molten Exhale); `choose_creature_type` cost and
35
+ `battlefield_instead` (Celestial Reunion); card spec `same_name_as` (Key to the Side-Door); `exile_from_graveyard`
36
+ by mana symbols and `copy_card` (Baron Helmut Zemo); `cast` from the graveyard with `exile_instead` (Bilbo);
37
+ `cards_have` (Ninja Teen level 3); `cast` trigger `owner` (Nita); computed `pay_life` in ward (Raubahn);
38
+ `remove_counters` `self`/`count` (Gwen Stacy // Ghost-Spider); `gives_gift`.
39
+ - Effects, zones and loops (changes 9 and 10): `repeat` (Sin, Spira's Punishment); `exile_top` `until`
40
+ (Improvisation Capstone); `exiled_with` targets (The Darkness Crystal, Borg Cube); `attacking` condition
41
+ (Desculpting Blast); `counters_placed` `nth` (Death to Our Enemies); `change_target` and `single_target`
42
+ (Redirect Lightning); meld mana value, hideaway under another controller, earthbend's return ending.
43
+ - Statics, grants and combat (change 30, change 27 in part, change 24): `{"tap": "granter"}` (Fishing Pole);
44
+ `colors: "chosen"` with bound `hexproof_from` (Mondo Gecko); `cant_become_untapped` (Spider-Woman);
45
+ `choose_card_name` and `"name": "chosen"` (Sorcerous Spyglass, Petrified Hamlet); granted riot (Spider-Punk);
46
+ `attacks` `alone` (Seifer Almasy); `cant_be_attacked` by filter and grantable `cant_be_blocked_by` (Storm,
47
+ Windrider); `create_token` `size` (Abzan Monument); `assigns_damage_by_toughness` (Ghalta); `tapping_power`
48
+ granted by `become`.
49
+ - Rules correctness (no new data): the `damage_order` decision (CR 616.1), unpreventable damage against prevention
50
+ with `then` (CR 615.12), new targets and copy targets becoming targets (ward, `becomes_target`), divided new
51
+ targets, chosen sources on the stack, tokens entering attacking a planeswalker, "copy that ability" by last
52
+ known information.
30
53
  - 81 cards have only a one-off gap (no change below helps them); 284 share at least one listed gap.
31
54
  - The first 4 changes (all S) make **30** cards exact; the first 20 make about **95**; the first 30
32
55
  about **150**.