enjine 0.4.1 → 0.6.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 (158) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +196 -1
  3. data/README.md +12 -3
  4. data/SUPPORTED.md +73 -38
  5. data/docs/ARCHITECTURE.md +7 -2
  6. data/docs/MECHANICS_COVERAGE.md +10 -8
  7. data/docs/guides/api.md +2 -1
  8. data/docs/guides/card-data-format.md +146 -9
  9. data/docs/plans/dsl-gaps.md +23 -0
  10. data/docs/reference/abilities.md +299 -25
  11. data/docs/reference/costs.md +59 -6
  12. data/docs/reference/decisions.md +7 -1
  13. data/docs/reference/effects.md +200 -27
  14. data/docs/reference/filters.md +30 -3
  15. data/docs/reference/keywords.md +58 -2
  16. data/docs/reference/subtypes.md +18 -0
  17. data/docs/reference/triggers.md +94 -14
  18. data/docs/reference/types.md +20 -0
  19. data/lib/enjine/actions/play_land.rb +3 -1
  20. data/lib/enjine/actions/special_action.rb +4 -0
  21. data/lib/enjine/actions/turn_face_up.rb +25 -0
  22. data/lib/enjine/actions/unlock.rb +23 -0
  23. data/lib/enjine/card_definition.rb +54 -15
  24. data/lib/enjine/card_face_down.rb +31 -0
  25. data/lib/enjine/card_faces.rb +4 -2
  26. data/lib/enjine/card_rooms.rb +86 -0
  27. data/lib/enjine/catalog.rb +9 -3
  28. data/lib/enjine/cli/text.rb +11 -3
  29. data/lib/enjine/color_identity.rb +34 -1
  30. data/lib/enjine/decisions/casting.rb +6 -3
  31. data/lib/enjine/decisions/combat.rb +4 -2
  32. data/lib/enjine/decisions/damage_order.rb +18 -0
  33. data/lib/enjine/engine/ability_layers.rb +14 -1
  34. data/lib/enjine/engine/casting/alt_casting.rb +45 -5
  35. data/lib/enjine/engine/casting/cast_choices.rb +21 -2
  36. data/lib/enjine/engine/casting/casting.rb +42 -29
  37. data/lib/enjine/engine/casting/cost_options.rb +3 -1
  38. data/lib/enjine/engine/casting/costs.rb +8 -1
  39. data/lib/enjine/engine/casting/payment.rb +47 -9
  40. data/lib/enjine/engine/casting/permissions.rb +19 -17
  41. data/lib/enjine/engine/casting/target_counts.rb +14 -3
  42. data/lib/enjine/engine/casting/waterbend.rb +22 -2
  43. data/lib/enjine/engine/characteristics.rb +11 -11
  44. data/lib/enjine/engine/combat.rb +45 -14
  45. data/lib/enjine/engine/copies.rb +12 -4
  46. data/lib/enjine/engine/crimes.rb +46 -0
  47. data/lib/enjine/engine/damage.rb +85 -1
  48. data/lib/enjine/engine/entering.rb +36 -2
  49. data/lib/enjine/engine/face_down.rb +12 -3
  50. data/lib/enjine/engine/face_down_permanents.rb +108 -0
  51. data/lib/enjine/engine/faces.rb +20 -5
  52. data/lib/enjine/engine/follow_ups.rb +4 -1
  53. data/lib/enjine/engine/mana_sources.rb +18 -3
  54. data/lib/enjine/engine/options_memo.rb +140 -0
  55. data/lib/enjine/engine/permanent_designations.rb +29 -0
  56. data/lib/enjine/engine/resolution.rb +71 -6
  57. data/lib/enjine/engine/rooms.rb +86 -0
  58. data/lib/enjine/engine/rules.rb +6 -4
  59. data/lib/enjine/engine/state_based_actions.rb +25 -4
  60. data/lib/enjine/engine/triggers.rb +25 -20
  61. data/lib/enjine/engine/turn_history.rb +43 -5
  62. data/lib/enjine/engine/turn_structure.rb +1 -0
  63. data/lib/enjine/engine/zones.rb +37 -8
  64. data/lib/enjine/engine.rb +5 -1
  65. data/lib/enjine/events.rb +11 -0
  66. data/lib/enjine/frames.rb +5 -2
  67. data/lib/enjine/fuzz.rb +3 -0
  68. data/lib/enjine/game.rb +3 -1
  69. data/lib/enjine/mana.rb +3 -0
  70. data/lib/enjine/mechanics/abilities/chosen_values.rb +49 -6
  71. data/lib/enjine/mechanics/abilities/cost_changes.rb +32 -10
  72. data/lib/enjine/mechanics/abilities/damage_replacements.rb +137 -65
  73. data/lib/enjine/mechanics/abilities/designated.rb +57 -0
  74. data/lib/enjine/mechanics/abilities/entering_choices.rb +40 -21
  75. data/lib/enjine/mechanics/abilities/life_replacements.rb +74 -0
  76. data/lib/enjine/mechanics/abilities/mana_ability.rb +10 -4
  77. data/lib/enjine/mechanics/abilities/play_permissions.rb +52 -20
  78. data/lib/enjine/mechanics/abilities/player_rules.rb +30 -13
  79. data/lib/enjine/mechanics/abilities/stack_abilities.rb +12 -7
  80. data/lib/enjine/mechanics/abilities/static.rb +19 -6
  81. data/lib/enjine/mechanics/card_spec.rb +63 -11
  82. data/lib/enjine/mechanics/costs/base.rb +68 -9
  83. data/lib/enjine/mechanics/costs/behold.rb +28 -5
  84. data/lib/enjine/mechanics/costs/choose_creature_type.rb +43 -0
  85. data/lib/enjine/mechanics/costs/collect_evidence.rb +60 -0
  86. data/lib/enjine/mechanics/costs/exile_permanent.rb +41 -0
  87. data/lib/enjine/mechanics/costs/one_of.rb +3 -0
  88. data/lib/enjine/mechanics/costs/pay_life.rb +27 -8
  89. data/lib/enjine/mechanics/costs/remove_counters.rb +8 -5
  90. data/lib/enjine/mechanics/costs/tap.rb +44 -3
  91. data/lib/enjine/mechanics/effects/base.rb +36 -7
  92. data/lib/enjine/mechanics/effects/become.rb +29 -12
  93. data/lib/enjine/mechanics/effects/choose_cards.rb +44 -14
  94. data/lib/enjine/mechanics/effects/copy.rb +58 -21
  95. data/lib/enjine/mechanics/effects/counters.rb +18 -6
  96. data/lib/enjine/mechanics/effects/damage.rb +11 -0
  97. data/lib/enjine/mechanics/effects/delayed_triggers.rb +13 -6
  98. data/lib/enjine/mechanics/effects/earthbend.rb +2 -1
  99. data/lib/enjine/mechanics/effects/fight.rb +11 -0
  100. data/lib/enjine/mechanics/effects/library.rb +76 -18
  101. data/lib/enjine/mechanics/effects/may.rb +4 -2
  102. data/lib/enjine/mechanics/effects/pay.rb +27 -10
  103. data/lib/enjine/mechanics/effects/repeat.rb +92 -0
  104. data/lib/enjine/mechanics/effects/search.rb +34 -6
  105. data/lib/enjine/mechanics/effects/tokens.rb +42 -10
  106. data/lib/enjine/mechanics/filters/any_target.rb +6 -3
  107. data/lib/enjine/mechanics/filters/base.rb +36 -17
  108. data/lib/enjine/mechanics/filters/exile.rb +27 -0
  109. data/lib/enjine/mechanics/filters/permanents.rb +7 -0
  110. data/lib/enjine/mechanics/filters/stack.rb +14 -8
  111. data/lib/enjine/mechanics/keywords/alternative_costs.rb +80 -22
  112. data/lib/enjine/mechanics/keywords/cards_have.rb +67 -0
  113. data/lib/enjine/mechanics/keywords/craft.rb +132 -0
  114. data/lib/enjine/mechanics/keywords/cycling.rb +46 -7
  115. data/lib/enjine/mechanics/keywords/extort.rb +2 -0
  116. data/lib/enjine/mechanics/keywords/face_down.rb +165 -0
  117. data/lib/enjine/mechanics/keywords/flags.rb +3 -1
  118. data/lib/enjine/mechanics/keywords/hideaway.rb +6 -5
  119. data/lib/enjine/mechanics/keywords/impending.rb +75 -0
  120. data/lib/enjine/mechanics/keywords/increment.rb +2 -0
  121. data/lib/enjine/mechanics/keywords/infinity.rb +46 -0
  122. data/lib/enjine/mechanics/keywords/kicker.rb +24 -6
  123. data/lib/enjine/mechanics/keywords/miracle.rb +142 -0
  124. data/lib/enjine/mechanics/keywords/ninjutsu.rb +101 -0
  125. data/lib/enjine/mechanics/keywords/offspring.rb +48 -0
  126. data/lib/enjine/mechanics/keywords/persist_and_undying.rb +42 -0
  127. data/lib/enjine/mechanics/keywords/protection.rb +24 -8
  128. data/lib/enjine/mechanics/keywords/riot.rb +13 -10
  129. data/lib/enjine/mechanics/keywords/split_second.rb +29 -0
  130. data/lib/enjine/mechanics/keywords/storm_and_cascade.rb +5 -0
  131. data/lib/enjine/mechanics/keywords/void.rb +34 -0
  132. data/lib/enjine/mechanics/linked.rb +33 -3
  133. data/lib/enjine/mechanics/mana_spent.rb +1 -1
  134. data/lib/enjine/mechanics/selector.rb +62 -18
  135. data/lib/enjine/mechanics/subtypes/case.rb +68 -0
  136. data/lib/enjine/mechanics/triggers/base.rb +13 -4
  137. data/lib/enjine/mechanics/triggers/casting.rb +15 -9
  138. data/lib/enjine/mechanics/triggers/combat.rb +32 -12
  139. data/lib/enjine/mechanics/triggers/crime.rb +28 -0
  140. data/lib/enjine/mechanics/triggers/damage.rb +33 -18
  141. data/lib/enjine/mechanics/triggers/draw_and_discard.rb +19 -6
  142. data/lib/enjine/mechanics/triggers/keyword_actions.rb +17 -0
  143. data/lib/enjine/mechanics/triggers/rooms.rb +49 -0
  144. data/lib/enjine/mechanics/triggers/tap_and_counters.rb +20 -9
  145. data/lib/enjine/mechanics/triggers/zone_changes.rb +24 -9
  146. data/lib/enjine/mechanics/types/battle.rb +130 -0
  147. data/lib/enjine/mechanics/values.rb +84 -30
  148. data/lib/enjine/replacements.rb +21 -2
  149. data/lib/enjine/rules_monitor.rb +56 -71
  150. data/lib/enjine/snapshot/deep_copy.rb +23 -0
  151. data/lib/enjine/snapshot/player_checks.rb +10 -2
  152. data/lib/enjine/snapshot.rb +2 -1
  153. data/lib/enjine/state.rb +2 -2
  154. data/lib/enjine/verify.rb +10 -3
  155. data/lib/enjine/version.rb +1 -1
  156. data/lib/enjine/view.rb +50 -14
  157. data/lib/enjine.rb +1 -1
  158. metadata +34 -1
@@ -20,7 +20,7 @@ Rules: CR 602.1, CR 602.2, CR 602.5b, CR 602.5d, CR 702.177a, CR 702.193a, CR 70
20
20
  | `power_up` | true: "Power-up — [cost]: [effect]" (CR 702.193a) |
21
21
  | `boast` | true: "Boast — [cost]: [effect]" (CR 702.142a) |
22
22
  | `zone` | "exile" | "graveyard" | "hand" (CR 113.6b; default: the battlefield, or the zone a cost moves the card from) |
23
- | `cost_reduction` | {"amount": amount, "if": condition}: "this ability costs {N} less to activate" (CR 601.2f, 602.2b) |
23
+ | `cost_reduction` | {"amount": amount, "if": condition}: "this ability costs {N} less to activate" (CR 601.2f, 602.2b); the amount may name its targets ({"target": 0}) |
24
24
 
25
25
  ```json
26
26
  {
@@ -47,14 +47,15 @@ Rules: CR 602.1, CR 602.2, CR 602.5b, CR 602.5d, CR 702.177a, CR 702.193a, CR 70
47
47
 
48
48
  ## additional_cost
49
49
 
50
- 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).
50
+ 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.
51
51
 
52
- Rules: CR 601.2b, CR 601.2f, CR 601.2h, CR 118.8, CR 118.8b
52
+ Rules: CR 601.2b, CR 601.2f, CR 601.2h, CR 118.8, CR 118.8b, CR 601.3c
53
53
 
54
54
  | Parameter | Description |
55
55
  | --- | --- |
56
56
  | `cost` | list of costs |
57
57
  | `optional` | true: you may pay it |
58
+ | `flash` | true: as though it had flash if you pay it |
58
59
 
59
60
  ```json
60
61
  {
@@ -203,6 +204,35 @@ Rules: CR 702.26a, CR 502.1, CR 604.1
203
204
  "cant_phase_in"
204
205
  ```
205
206
 
207
+ ## cards_have
208
+
209
+ 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, sneak or miracle) and may be cast with it from that zone. Cast option `via: "alt:cards_have:<permanent>:<ref>"`.
210
+
211
+ Rules: CR 611.3a, CR 604.1, CR 118.9, CR 601.2b, CR 702.190a
212
+
213
+ | Parameter | Description |
214
+ | --- | --- |
215
+ | `zone` | graveyard | hand | exile |
216
+ | `cards` | card spec |
217
+ | `ability` | a keyword alternative cost, e.g. {"sneak": {"cost": "{3}{B}"}} |
218
+
219
+ ```json
220
+ {
221
+ "cards_have": {
222
+ "cards": {
223
+ "types": [
224
+ "creature"
225
+ ]
226
+ },
227
+ "ability": {
228
+ "sneak": {
229
+ "cost": "{3}{B}"
230
+ }
231
+ }
232
+ }
233
+ }
234
+ ```
235
+
206
236
  ## cast_restriction
207
237
 
208
238
  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.
@@ -268,13 +298,15 @@ Rules: CR 614.12, CR 305.6, CR 607.2d
268
298
 
269
299
  ## choose_card_name
270
300
 
271
- 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.
301
+ 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.
272
302
 
273
- Rules: CR 614.12, CR 614.12a, CR 201.4, CR 201.4a, CR 607.2
303
+ Rules: CR 614.12, CR 614.12a, CR 201.4, CR 201.4a, CR 607.2, CR 701.20e
274
304
 
275
305
  | Parameter | Description |
276
306
  | --- | --- |
277
307
  | `not` | list of card types |
308
+ | `types` | list of card types |
309
+ | `look_at_hand` | "opponent" |
278
310
 
279
311
  ```json
280
312
  {
@@ -404,7 +436,7 @@ Rules: CR 717.2a, CR 717.2b, CR 717.2d, CR 717.3, CR 602.5d
404
436
 
405
437
  ## cost_modifier
406
438
 
407
- While on the battlefield: spells cast by `caster` (you, opponent or any; default you) whose card types match `spells` ({"any_of": [types], "not": [types]}, default all spells; `subtypes` and `colors` narrow it: "Dragon spells", "red spells") cost `reduce` less or `increase` more generic mana. `from` / `not_from`: only spells cast from (not from) that zone (hand | graveyard | exile | library | outside).
439
+ While on the battlefield: spells cast by `caster` (you, opponent or any; default you) whose card types match `spells` ({"any_of": [types], "not": [types]}, default all spells; `subtypes`, `colors` and `name` narrow it: "Dragon spells", "red spells"; `"subtypes": "chosen"`: of the type chosen for this permanent, `"name": "chosen"`: with the name its source chose) cost `reduce` less or `increase` more generic mana. `from` / `not_from`: only spells cast from (not from) that zone (hand | graveyard | exile | library | outside).
408
440
 
409
441
  Rules: CR 601.2f, CR 118.7a, CR 604.1, CR 601.2a
410
442
 
@@ -452,6 +484,32 @@ Rules: CR 601.2f, CR 118.7a, CR 702.41a
452
484
  }
453
485
  ```
454
486
 
487
+ ## craft
488
+
489
+ Craft with `materials` `cost`: pay `cost`, exile this permanent and exile the materials (`count` (default 1) permanents you control and/or cards in your graveyard matching the card spec `card`; `or_more: true`: that many or more), chosen with `choose_cost`: return this card to the battlefield transformed under its owner's control. Sorcery speed. The exiled materials are the selector "exiled_for_cost".
490
+
491
+ Rules: CR 702.167a, CR 702.167b, CR 702.167c, CR 712.11a, CR 602.2b, CR 406.1
492
+
493
+ | Parameter | Description |
494
+ | --- | --- |
495
+ | `cost` | mana cost string, or a list of costs |
496
+ | `materials` | {"card": card spec, "count": n, "or_more": true} |
497
+
498
+ ```json
499
+ {
500
+ "craft": {
501
+ "cost": "{3}{W}",
502
+ "materials": {
503
+ "card": {
504
+ "types": [
505
+ "artifact"
506
+ ]
507
+ }
508
+ }
509
+ }
510
+ }
511
+ ```
512
+
455
513
  ## crew
456
514
 
457
515
  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.
@@ -472,13 +530,13 @@ Rules: CR 702.122a, CR 702.122b, CR 702.122e, CR 301.7, CR 301.7a, CR 301.7b, CR
472
530
 
473
531
  ## cycling
474
532
 
475
- 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.
533
+ 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. `cost` is a mana cost string (it may hold {X}, announced as it's activated) or a list of costs (`[{"pay_life": 2}]`). "When you cycle this card" is a triggered ability with `zone: "graveyard"` and the trigger `{"cycles": {"self": true}}`; its X is the cycling ability's.
476
534
 
477
- Rules: CR 702.29a, CR 702.29b, CR 702.29e, CR 702.29f, CR 113.6m, CR 602.2a
535
+ Rules: CR 702.29a, CR 702.29b, CR 702.29c, CR 702.29d, CR 702.29e, CR 702.29f, CR 113.6m, CR 602.2a, CR 107.3
478
536
 
479
537
  | Parameter | Description |
480
538
  | --- | --- |
481
- | `cost` | mana cost string, e.g. "{2}" |
539
+ | `cost` | mana cost string, e.g. "{2}" or "{X}{G}{G}", or a list of costs |
482
540
  | `for` | optional card spec for typecycling (see search_library) |
483
541
 
484
542
  ```json
@@ -499,7 +557,7 @@ Rules: CR 702.29a, CR 702.29b, CR 702.29e, CR 702.29f, CR 113.6m, CR 602.2a
499
557
 
500
558
  ## damage_replacement
501
559
 
502
- 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.
560
+ 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.
503
561
 
504
562
  Rules: CR 614.1a, CR 614.5, CR 614.9, CR 616.1, CR 616.1e, CR 616.1f, CR 120.2b
505
563
 
@@ -596,6 +654,24 @@ Rules: CR 702.82a, CR 702.82b, CR 702.82c, CR 614.12, CR 701.21a
596
654
  }
597
655
  ```
598
656
 
657
+ ## disguise
658
+
659
+ Disguise: you may cast this card face down as a nameless colorless 2/2 creature spell with ward {2} by paying {3} rather than its mana cost (cast option `via: "alt:<ref>"`). Any time you have priority you may turn the face-down permanent face up by paying `cost` (special action `{type: "turn_face_up", via: "disguise"}`).
660
+
661
+ Rules: CR 702.168a, CR 702.168b, CR 702.168c, CR 702.168d, CR 708.2, CR 708.4, CR 708.8, CR 116.2b
662
+
663
+ | Parameter | Description |
664
+ | --- | --- |
665
+ | `cost` | mana cost string: the cost to turn it face up |
666
+
667
+ ```json
668
+ {
669
+ "disguise": {
670
+ "cost": "{4}{G}"
671
+ }
672
+ }
673
+ ```
674
+
599
675
  ## double_counters
600
676
 
601
677
  While this permanent is on the battlefield, if its controller would put one or more counters (only `counter`, if given) on a permanent matching `affects` ({"each": filter, "controller": you|opponent|any}, relative to this permanent's controller), the number put is doubled. This includes counters a permanent enters with.
@@ -937,13 +1013,13 @@ Rules: CR 705.3, CR 604.1
937
1013
 
938
1014
  ## flashback
939
1015
 
940
- Flashback: you may cast this instant or sorcery card from your graveyard by paying `cost` rather than its mana cost; then it's exiled whenever it would leave the stack. `cost` is a mana cost string or a list of costs (`[{"mana": "{1}{U}"}, {"tap_permanents": {"count": 3}}]`). Cast option `via: "alt:<ref>"`.
1016
+ Flashback: you may cast this instant or sorcery card from your graveyard by paying `cost` rather than its mana cost; then it's exiled whenever it would leave the stack. `cost` is a mana cost string or a list of costs (`[{"mana": "{1}{U}"}, {"tap_permanents": {"count": 3}}]`), or `"mana_cost"`: the card's own mana cost ("its flashback cost is equal to its mana cost", e.g. granted with `grant_ability`). Cast option `via: "alt:<ref>"`.
941
1017
 
942
- Rules: CR 702.34a, CR 118.9, CR 601.2b, CR 601.2f, CR 601.2h
1018
+ Rules: CR 702.34a, CR 118.9, CR 118.6, CR 601.2b, CR 601.2f, CR 601.2h
943
1019
 
944
1020
  | Parameter | Description |
945
1021
  | --- | --- |
946
- | `cost` | mana cost string, or a list of costs |
1022
+ | `cost` | mana cost string, a list of costs, or "mana_cost" |
947
1023
 
948
1024
  ```json
949
1025
  {
@@ -1011,13 +1087,13 @@ Rules: CR 702.180a, CR 702.180b, CR 118.9, CR 601.2b, CR 601.2f, CR 601.2h
1011
1087
 
1012
1088
  ## hexproof_from
1013
1089
 
1014
- 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).
1090
+ 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).
1015
1091
 
1016
- Rules: CR 702.11d, CR 702.11f, CR 702.11g, CR 115.4
1092
+ Rules: CR 702.11d, CR 702.11f, CR 702.11g, CR 115.4, CR 607.2d
1017
1093
 
1018
1094
  | Parameter | Description |
1019
1095
  | --- | --- |
1020
- | `(value)` | card spec of the quality, or "its_colors" |
1096
+ | `(value)` | card spec of the quality, "its_colors" or "chosen_color" |
1021
1097
 
1022
1098
  ```json
1023
1099
  {
@@ -1047,6 +1123,58 @@ Rules: CR 702.75a, CR 406.3, CR 607.2a
1047
1123
  }
1048
1124
  ```
1049
1125
 
1126
+ ## impending
1127
+
1128
+ Impending `amount`—`cost`: you may cast this card by paying `cost` rather than its mana cost. If you do, it enters with `amount` time counters, and while its impending cost was paid and it has a time counter on it, it isn't a creature. At the beginning of your end step, remove a time counter from it (a triggered ability that comes with the keyword). Cast option `via: "alt:<ref>"`; `{"cast_with": "impending"}` reads it.
1129
+
1130
+ Rules: CR 702.176a, CR 118.9, CR 601.2b, CR 601.2f, CR 601.2h, CR 613.1d, CR 613.6, CR 122.6
1131
+
1132
+ | Parameter | Description |
1133
+ | --- | --- |
1134
+ | `amount` | integer >= 1: the time counters |
1135
+ | `cost` | mana cost string, or a list of costs |
1136
+
1137
+ ```json
1138
+ {
1139
+ "impending": {
1140
+ "amount": 4,
1141
+ "cost": "{1}{G}{G}"
1142
+ }
1143
+ }
1144
+ ```
1145
+
1146
+ ## infinity
1147
+
1148
+ An Infinity card's "∞ — [ability]": one static, triggered or activated ability that works only while this permanent is harnessed. Condition `{"harnessed": true}` reads the designation.
1149
+
1150
+ Rules: CR 702.186a, CR 702.186b, CR 701.64b
1151
+
1152
+ | Parameter | Description |
1153
+ | --- | --- |
1154
+ | `(ability)` | {"static" | "triggered" | "activated": {...}} |
1155
+
1156
+ ```json
1157
+ {
1158
+ "infinity": {
1159
+ "triggered": {
1160
+ "when": {
1161
+ "step_begins": {
1162
+ "step": "upkeep",
1163
+ "whose": "your"
1164
+ }
1165
+ },
1166
+ "effects": [
1167
+ {
1168
+ "draw": {
1169
+ "amount": 1
1170
+ }
1171
+ }
1172
+ ]
1173
+ }
1174
+ }
1175
+ }
1176
+ ```
1177
+
1050
1178
  ## kicker
1051
1179
 
1052
1180
  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.
@@ -1069,6 +1197,28 @@ Rules: CR 702.33a, CR 702.33d, CR 702.33g, CR 601.2b, CR 601.2f, CR 601.2h
1069
1197
  }
1070
1198
  ```
1071
1199
 
1200
+ ## life_gain_replacement
1201
+
1202
+ While this permanent is on the battlefield, each time `player` (you (default) | opponent | any, relative to its controller) would gain life, instead: `multiply` (2 = "twice that much"), `plus` an amount ("that much life plus 1"), or `lose: true` ("that player loses that much life instead"). Each applies once to an event; the affected player's best order is used: losing instead first, then adding, then multiplying. Gaining 0 life is no event (nothing applies).
1203
+
1204
+ Rules: CR 614.1a, CR 614.5, CR 616.1, CR 119.10
1205
+
1206
+ | Parameter | Description |
1207
+ | --- | --- |
1208
+ | `player` | you | opponent | any |
1209
+ | `multiply` | integer >= 2 |
1210
+ | `plus` | amount |
1211
+ | `lose` | true |
1212
+
1213
+ ```json
1214
+ {
1215
+ "life_gain_replacement": {
1216
+ "player": "you",
1217
+ "plus": 1
1218
+ }
1219
+ }
1220
+ ```
1221
+
1072
1222
  ## look_at_top
1073
1223
 
1074
1224
  While this permanent is on the battlefield, its controller sees the top card of their library (the `library_top` of their view).
@@ -1202,6 +1352,24 @@ Rules: CR 702.187a, CR 702.187b, CR 702.187c, CR 118.9, CR 601.2b, CR 601.2f, CR
1202
1352
  }
1203
1353
  ```
1204
1354
 
1355
+ ## miracle
1356
+
1357
+ Miracle `cost`: when you draw this card as the first card you drew this turn, it's revealed and a triggered ability lets you cast it as that ability resolves by paying `cost` rather than its mana cost (an `effect_choice`: cast or done), if it's still in your hand. Never offered at priority. `cards_have` with `zone: "hand"` can give it to cards in your hand.
1358
+
1359
+ Rules: CR 702.94a, CR 702.94b, CR 608.2g, CR 118.9, CR 601.2b, CR 601.2f, CR 601.2h, CR 121.2
1360
+
1361
+ | Parameter | Description |
1362
+ | --- | --- |
1363
+ | `cost` | mana cost string, or a list of costs |
1364
+
1365
+ ```json
1366
+ {
1367
+ "miracle": {
1368
+ "cost": "{1}{R}"
1369
+ }
1370
+ }
1371
+ ```
1372
+
1205
1373
  ## mobilize
1206
1374
 
1207
1375
  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.
@@ -1220,6 +1388,60 @@ Rules: CR 702.181a, CR 508.4
1220
1388
  }
1221
1389
  ```
1222
1390
 
1391
+ ## morph
1392
+
1393
+ Morph: you may cast this card face down as a nameless colorless 2/2 creature spell by paying {3} rather than its mana cost (cast option `via: "alt:<ref>"`). Any time you have priority you may turn the face-down permanent face up by paying `cost` (special action `{type: "turn_face_up", via: "morph"}`); abilities about entering don't trigger then.
1394
+
1395
+ Rules: CR 702.37a, CR 702.37c, CR 702.37d, CR 702.37e, CR 708.2, CR 708.4, CR 708.8, CR 116.2b
1396
+
1397
+ | Parameter | Description |
1398
+ | --- | --- |
1399
+ | `cost` | mana cost string: the cost to turn it face up |
1400
+
1401
+ ```json
1402
+ {
1403
+ "morph": {
1404
+ "cost": "{1}{G}"
1405
+ }
1406
+ }
1407
+ ```
1408
+
1409
+ ## ninjutsu
1410
+
1411
+ Ninjutsu: an activated ability from your hand: pay `cost`, reveal this card and return an unblocked attacking creature you control to its owner's hand (a `choose_cost` decision) to put this card onto the battlefield tapped and attacking what that creature was attacking. It isn't cast. Usable while you have an unblocked attacker (after blockers are declared).
1412
+
1413
+ Rules: CR 702.49a, CR 702.49b, CR 702.49c, CR 509.1h, CR 506.3a, CR 113.6m, CR 602.2a
1414
+
1415
+ | Parameter | Description |
1416
+ | --- | --- |
1417
+ | `cost` | mana cost string, e.g. "{1}{U}{B}" |
1418
+
1419
+ ```json
1420
+ {
1421
+ "ninjutsu": {
1422
+ "cost": "{1}{U}"
1423
+ }
1424
+ }
1425
+ ```
1426
+
1427
+ ## offspring
1428
+
1429
+ Offspring: as you cast this spell you may also pay `cost` (announced with the `choose_kicker` decision; the spell isn't kicked). When the permanent enters, if its offspring cost was paid, create a 1/1 token copy of it (a triggered ability that comes with the keyword). `{"cast_with": "offspring"}` holds if it was paid.
1430
+
1431
+ Rules: CR 702.175a, CR 702.175b, CR 601.2b, CR 601.2f, CR 601.2h, CR 707.9b, CR 603.4
1432
+
1433
+ | Parameter | Description |
1434
+ | --- | --- |
1435
+ | `cost` | mana cost string, or a list of costs |
1436
+
1437
+ ```json
1438
+ {
1439
+ "offspring": {
1440
+ "cost": "{2}"
1441
+ }
1442
+ }
1443
+ ```
1444
+
1223
1445
  ## play_from
1224
1446
 
1225
1447
  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.
@@ -1248,16 +1470,17 @@ Rules: CR 601.3, CR 113.6e, CR 113.6f, CR 305.1, CR 401.5, CR 122.1, CR 614.12,
1248
1470
 
1249
1471
  ## player_rule
1250
1472
 
1251
- 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.
1473
+ 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.
1252
1474
 
1253
- Rules: CR 702.11c, CR 115.4, CR 508.1c, CR 402.2, CR 514.1, CR 615.1, CR 615.1a, CR 704.5a, CR 104.3b, CR 701.21a, CR 614.17b, CR 101.2, CR 601.3, CR 701.6a, CR 119.7, CR 602.5, CR 615.12, CR 702.16b, CR 702.16e, CR 702.16k, CR 604.1, CR 604.2, CR 611.3a
1475
+ Rules: CR 702.11c, CR 115.4, CR 508.1c, CR 402.2, CR 514.1, CR 615.1, CR 615.1a, CR 704.5a, CR 104.3b, CR 701.21a, CR 614.17b, CR 101.2, CR 601.3, CR 701.6a, CR 119.7, CR 602.5, CR 615.12, CR 702.16b, CR 702.16e, CR 702.16k, CR 506.3, CR 604.1, CR 604.2, CR 611.3a
1254
1476
 
1255
1477
  | Parameter | Description |
1256
1478
  | --- | --- |
1257
- | `rule` | 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 |
1479
+ | `rule` | 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 |
1258
1480
  | `affects` | you | opponents | each |
1259
- | `filter` | permanent filter (cant_sacrifice, cant_activate) |
1481
+ | `filter` | permanent filter (cant_sacrifice, cant_activate, cant_be_attacked) |
1260
1482
  | `spells` | card spec of the spells (cant_cast, spells_cant_be_countered) |
1483
+ | `name` | "chosen" (cant_activate: sources with the chosen name) |
1261
1484
  | `if` | condition ("during your turn": {"your_turn": true}) |
1262
1485
 
1263
1486
  ```json
@@ -1324,7 +1547,7 @@ Rules: CR 702.16a, CR 702.16b, CR 702.16c, CR 702.16d, CR 702.16e, CR 702.16f, C
1324
1547
 
1325
1548
  | Parameter | Description |
1326
1549
  | --- | --- |
1327
- | `(value)` | card spec of the quality, "everything", "each_opponent" or "its_colors" |
1550
+ | `(value)` | card spec of the quality, "everything", "each_opponent", "its_colors" or "chosen_color" |
1328
1551
 
1329
1552
  ```json
1330
1553
  {
@@ -1372,6 +1595,35 @@ Rules: CR 702.190a, CR 702.190b, CR 506.3a, CR 118.9, CR 601.2b, CR 601.2f, CR 6
1372
1595
  }
1373
1596
  ```
1374
1597
 
1598
+ ## solved
1599
+
1600
+ A Case's "Solved — [ability]": one static, triggered or activated ability that works only while this permanent is solved (a static applies as long as it's solved, a triggered ability triggers only if it's solved, an activated ability can be activated only if it's solved). Condition `{"solved": true}` reads the designation.
1601
+
1602
+ Rules: CR 702.169a, CR 702.169b, CR 702.169c, CR 702.169d, CR 720.3b, CR 720.3c
1603
+
1604
+ | Parameter | Description |
1605
+ | --- | --- |
1606
+ | `(ability)` | {"static" | "triggered" | "activated": {...}} |
1607
+
1608
+ ```json
1609
+ {
1610
+ "solved": {
1611
+ "activated": {
1612
+ "cost": [
1613
+ "sacrifice"
1614
+ ],
1615
+ "effects": [
1616
+ {
1617
+ "draw": {
1618
+ "amount": 1
1619
+ }
1620
+ }
1621
+ ]
1622
+ }
1623
+ }
1624
+ }
1625
+ ```
1626
+
1375
1627
  ## spell
1376
1628
 
1377
1629
  The spell ability of an instant or sorcery: its targets are chosen while casting and its effects happen in order when it resolves. If every target is illegal on resolution, it doesn't resolve. A mode of a modal spell may have a `cost`: a mana cost paid in addition when that mode is chosen (tiered: "Choose one additional cost").
@@ -1464,9 +1716,9 @@ Rules: CR 702.126a, CR 702.51a, CR 611.3a, CR 604.1
1464
1716
 
1465
1717
  ## static
1466
1718
 
1467
- While its source is on the battlefield (and its `if` condition holds), every permanent it `affects` gets `pump` (fixed or computed amounts, layer 7c), the `keywords` and granted `abilities` (layer 6, triggered, activated or mana abilities), and with `creature_types` has exactly those creature types (layer 4); `loses_abilities: true` removes the abilities it had before (layer 6, in timestamp order: later grants and keyword counters stay, CR 613.7), `colors` sets its colors (layer 5) and `base_power_toughness` its base power and toughness (layer 7b); `types` are card types it has in addition to its other types ("this Vehicle is an artifact creature", layer 4) and `subtypes` subtypes it has in addition to its other types ("is a Wizard in addition to its other types", layer 4). `affects` is {"each": filter, "controller": you|opponent|any, "other": true} (relative to the source's controller), "self", or "attached" ("equipped/enchanted creature").
1719
+ While its source is on the battlefield (and its `if` condition holds), every permanent it `affects` gets `pump` (fixed or computed amounts, layer 7c), the `keywords` and granted `abilities` (layer 6, triggered, activated or mana abilities), and with `creature_types` has exactly those creature types (layer 4); `loses_abilities: true` removes the abilities it had before (layer 6, in timestamp order: later grants and keyword counters stay, CR 613.7), `colors` sets its colors (layer 5) and `base_power_toughness` its base power and toughness (layer 7b); `types` are card types it has in addition to its other types ("this Vehicle is an artifact creature", layer 4) and `subtypes` subtypes it has in addition to its other types ("is a Wizard in addition to its other types", layer 4). `affects` is {"each": filter, "controller": you|opponent|any, "other": true} (relative to the source's controller), "self", or "attached" ("equipped/enchanted creature"). The filter and the `if` condition may read combat and tapped status ("attacking creatures you control have first strike", {"if": {"attacking": "attached"}}), never power or toughness.
1468
1720
 
1469
- Rules: CR 604.1, CR 604.2, CR 611.3a, CR 612.8, CR 613.1c, CR 613.1d, CR 613.1e, CR 613.1f, CR 613.4b, CR 613.4c, CR 613.7a, CR 613.8a, CR 205.1a, CR 205.1b, CR 301.5f, CR 303.4m
1721
+ Rules: CR 604.1, CR 604.2, CR 611.3a, CR 506.4, CR 612.8, CR 613.1c, CR 613.1d, CR 613.1e, CR 613.1f, CR 613.4b, CR 613.4c, CR 613.7a, CR 613.8a, CR 205.1a, CR 205.1b, CR 301.5f, CR 303.4m
1470
1722
 
1471
1723
  | Parameter | Description |
1472
1724
  | --- | --- |
@@ -1588,6 +1840,27 @@ Rules: CR 702.194a, CR 702.194b, CR 702.194c, CR 601.2b, CR 601.2f, CR 601.2h
1588
1840
  }
1589
1841
  ```
1590
1842
 
1843
+ ## to_solve
1844
+
1845
+ A Case's "To solve — [condition]": at the beginning of your end step, if the condition holds and this Case isn't solved, it becomes solved (an intervening-if triggered ability). The parameter is the condition itself.
1846
+
1847
+ Rules: CR 720.3a, CR 720.3b, CR 603.4
1848
+
1849
+ | Parameter | Description |
1850
+ | --- | --- |
1851
+ | `(condition)` | any condition, e.g. {"hand_size": "you", "at_most": 0} |
1852
+
1853
+ ```json
1854
+ {
1855
+ "to_solve": {
1856
+ "amount": {
1857
+ "life_gained_this_turn": "you"
1858
+ },
1859
+ "at_least": 5
1860
+ }
1861
+ }
1862
+ ```
1863
+
1591
1864
  ## token_replacement
1592
1865
 
1593
1866
  If tokens would be created under this permanent's controller's control, that many `token` tokens are created instead (tapped or attacking if the originals would be). `token` is a predefined token name or inline card data.
@@ -1671,13 +1944,14 @@ Rules: CR 702.21a, CR 601.2c, CR 603.2, CR 701.6a, CR 701.67a
1671
1944
 
1672
1945
  ## warp
1673
1946
 
1674
- Warp: you may cast this card from your hand by paying `cost` rather than its mana cost. If you do, the permanent it becomes is exiled at the beginning of the next end step (a delayed triggered ability), and its owner may cast it from exile after this turn has ended for as long as it remains exiled (cast option `via: "warped"`). Conditions `{"cast_with": "warp"}` and `{"cast_with_this_turn": "warp"}` read it.
1947
+ Warp: you may cast this card from your hand by paying `cost` rather than its mana cost. If you do, the permanent it becomes is exiled at the beginning of the next end step (a delayed triggered ability), and its owner may cast it from exile after this turn has ended for as long as it remains exiled (cast option `via: "warped"`). Conditions `{"cast_with": "warp"}` and `{"cast_with_this_turn": "warp"}` read it. `from: ["hand", "graveyard"]`: "you may cast this card from your graveyard using its warp ability" (CR 601.3).
1675
1948
 
1676
- Rules: CR 702.185a, CR 702.185b, CR 702.185c, CR 603.7, CR 118.9, CR 601.2b, CR 601.2f, CR 601.2h
1949
+ Rules: CR 702.185a, CR 702.185b, CR 702.185c, CR 603.7, CR 118.9, CR 601.2b, CR 601.2f, CR 601.2h, CR 601.3
1677
1950
 
1678
1951
  | Parameter | Description |
1679
1952
  | --- | --- |
1680
1953
  | `cost` | mana cost string, or a list of costs |
1954
+ | `from` | zones it works from: "hand" (default), "graveyard", or a list of both |
1681
1955
 
1682
1956
  ```json
1683
1957
  {
@@ -55,6 +55,34 @@ Rules: CR 401.1, CR 113.6m, CR 602.2b, CR 118.3
55
55
  "bottom_self_from_graveyard"
56
56
  ```
57
57
 
58
+ ## choose_creature_type
59
+
60
+ 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"`.
61
+
62
+ Rules: CR 601.2b, CR 205.3m, CR 607.2d
63
+
64
+ ```json
65
+ {
66
+ "choose_creature_type": {}
67
+ }
68
+ ```
69
+
70
+ ## collect_evidence
71
+
72
+ Collect evidence `N`: exile any number of other cards from your graveyard with total mana value N or greater, chosen one at a time (`choose_cost`; `done` once they total N). Not payable without that much mana value in your graveyard. "If evidence was collected": make it an optional `additional_cost` and read `{"cast_with": "additional_cost"}`.
73
+
74
+ Rules: CR 701.59a, CR 701.59b, CR 701.59c, CR 202.3, CR 601.2h, CR 118.3
75
+
76
+ | Parameter | Description |
77
+ | --- | --- |
78
+ | `(value)` | integer >= 1: N |
79
+
80
+ ```json
81
+ {
82
+ "collect_evidence": 6
83
+ }
84
+ ```
85
+
58
86
  ## discard
59
87
 
60
88
  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.
@@ -133,6 +161,26 @@ Rules: CR 406.1, CR 601.2h, CR 602.2b, CR 118.3
133
161
  }
134
162
  ```
135
163
 
164
+ ## exile_permanent
165
+
166
+ Exile `count` permanents you control matching `filter` (`other: true`: not the source). Chosen while casting or activating, exiled as it becomes cast; the exiled cards are `exiled_for_cost`, and their last known power, toughness and mana value are amount `sacrificed`.
167
+
168
+ Rules: CR 406.1, CR 601.2h, CR 602.2b, CR 118.3, CR 608.2h
169
+
170
+ | Parameter | Description |
171
+ | --- | --- |
172
+ | `filter` | filter (default permanent) |
173
+ | `count` | integer (default 1) |
174
+ | `other` | true: not the source itself |
175
+
176
+ ```json
177
+ {
178
+ "exile_permanent": {
179
+ "filter": "creature"
180
+ }
181
+ }
182
+ ```
183
+
136
184
  ## exile_self
137
185
 
138
186
  Exile the permanent the ability belongs to ("Exile this enchantment: ...").
@@ -220,13 +268,13 @@ Rules: CR 118.3, CR 601.2b, CR 601.2f, CR 602.2b, CR 118.12
220
268
 
221
269
  ## pay_life
222
270
 
223
- 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.
271
+ 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.
224
272
 
225
- Rules: CR 119.4, CR 119.4b, CR 118.3b, CR 601.2b, CR 107.3a
273
+ Rules: CR 119.4, CR 119.4b, CR 118.3b, CR 601.2b, CR 107.3a, CR 702.21a
226
274
 
227
275
  | Parameter | Description |
228
276
  | --- | --- |
229
- | `(value)` | integer >= 1, or "X" |
277
+ | `(value)` | integer >= 1, "X", or an amount |
230
278
 
231
279
  ```json
232
280
  {
@@ -236,7 +284,7 @@ Rules: CR 119.4, CR 119.4b, CR 118.3b, CR 601.2b, CR 107.3a
236
284
 
237
285
  ## remove_counters
238
286
 
239
- 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.
287
+ 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
288
 
241
289
  Rules: CR 602.2b, CR 601.2h, CR 118.3, CR 122.1
242
290
 
@@ -245,6 +293,7 @@ Rules: CR 602.2b, CR 601.2h, CR 118.3, CR 122.1
245
293
  | `count` | integer |
246
294
  | `filter` | filter (default creature) |
247
295
  | `counter` | counter name (optional) |
296
+ | `self` | true: from this permanent only |
248
297
 
249
298
  ```json
250
299
  {
@@ -287,9 +336,13 @@ Rules: CR 701.21a, CR 601.2h, CR 602.2b, CR 118.3, CR 608.2h
287
336
 
288
337
  ## tap
289
338
 
290
- {T} — tap the permanent the ability belongs to. Requires it to be untapped.
339
+ {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).
340
+
341
+ Rules: CR 107.5, CR 602.5a, CR 602.2b, CR 607.1a, CR 302.6
291
342
 
292
- Rules: CR 107.5, CR 602.5a
343
+ | Parameter | Description |
344
+ | --- | --- |
345
+ | `(value)` | "granter": tap the granting permanent instead |
293
346
 
294
347
  ```json
295
348
  "tap"
@@ -44,6 +44,10 @@ While casting/activating a spell or ability with {X} in its cost: `{type: "x", v
44
44
 
45
45
  Your commander is in a graveyard, exile, hand or library: `{type: "command", object: id}` puts it into the command zone, `{type: "stay", object: id}` leaves it where it is (CR 903.9).
46
46
 
47
+ ## damage_order
48
+
49
+ Order the effects that apply to damage dealt to you or a permanent you control (CR 616.1): submit one of `{type: "order", order: [effect keys], steps: [labels], amount: final damage}` exactly as listed.
50
+
47
51
  ## declare_attackers
48
52
 
49
53
  Declare one attacker: `{type: "attack", object: id, target: ref}` (the defending player or one of their planeswalkers), or `{type: "done"}` (withheld while a creature that attacks each combat if able could still attack, CR 508.1d, or while a creature that can't attack alone attacks alone, CR 506.5; then `{type: "withdraw", object: id}` undoes an attack).
@@ -82,7 +86,7 @@ Put one of your pending triggered abilities on the stack next: `{type: "trigger"
82
86
 
83
87
  ## pay_cost
84
88
 
85
- While casting/activating or paying a cost: `{type: "pay_mana", mana: "R"}` spends one mana from the pool (`restricted: i`: restricted mana, CR 106.6; `from: i`: the pool mana an artifact made that pool_sources[i] names), `{type: "activate_mana", object: id, ability: ref}` (plus `mana: "{G}{G}"` when the mana is chosen) taps a source, `{type: "cancel"}` rewinds (or declines a payment asked for while resolving). Cancel isn't offered once a mana ability with a cost other than {T} (a Treasure) has been activated. `{type: "convoke", object: id}` taps a creature to pay for {1} or one mana of its color (a spell with convoke); `{type: "improvise", object: id}` taps an artifact to pay for {1} (a spell with improvise); `{type: "waterbend", object: id}` taps an artifact or creature to pay {1} of a waterbend cost. `remaining` shows what is left to pay.
89
+ While casting/activating or paying a cost: `{type: "pay_mana", mana: "R"}` spends one mana from the pool (`restricted: i`: restricted mana, CR 106.6; `from: i`: the pool mana an artifact made that pool_sources[i] names), `{type: "activate_mana", object: id, ability: ref}` (plus `mana: "{G}{G}"` when the mana is chosen) taps a source, `{type: "cancel"}` rewinds (or declines a payment asked for while resolving). Cancel isn't offered once a mana ability with a cost other than {T} (a Treasure) has been activated, unless the cost can no longer be paid: then it is the only option, and rewinds keeping the mana abilities' mana in the pool (CR 734.1). `{type: "convoke", object: id}` taps a creature to pay for {1} or one mana of its color (a spell with convoke); `{type: "improvise", object: id}` taps an artifact to pay for {1} (a spell with improvise); `{type: "waterbend", object: id}` taps an artifact or creature to pay {1} of a waterbend cost. `remaining` shows what is left to pay.
86
90
 
87
91
  ## play_or_draw
88
92
 
@@ -104,3 +108,5 @@ Untap step: `{type: "untap", object: id}` or `{type: "keep_tapped", object: id}`
104
108
  - `pass` — `{type: "pass"}` — pass priority. When all players pass in succession with an empty stack, the step ends (CR 117.4).
105
109
  - `play_land` — `{type: "play_land", object: id}` — special action: your main phase, empty stack, one land per turn plus additional land plays (CR 305.1, 305.2). With `via`: a land from another zone that an effect lets you play. With `face: 1`: a modal double-faced card played with its land back face up (CR 712.9).
106
110
  - `special_action` — `{type: "special_action", object: id, ability: ref}` — a special action of a card in your hand: foretell (during your turn, pay {2} and exile it face down, CR 116.2h) or suspend (when you could begin to cast it, pay its suspend cost and exile it with time counters, CR 116.2f) or plot (in your main phase with an empty stack, pay its plot cost and exile it, CR 116.2k).
111
+ - `turn_face_up` — `{type: "turn_face_up", object: id, via: "mana_cost" | "morph" | "disguise"}` — turn a face-down permanent you control face up by paying its mana cost (a manifested or cloaked creature card) or its morph or disguise cost (a special action, any time you have priority, CR 116.2b).
112
+ - `unlock` — `{type: "unlock", object: id, door: "left" | "right"}` — unlock a locked door of a Room you control by paying that door's mana cost (a special action, during a main phase of your turn with an empty stack, CR 116.2m, 709.5e).