enjine 0.1.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 (269) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +28 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +201 -0
  5. data/SUPPORTED.md +387 -0
  6. data/docs/ARCHITECTURE.md +141 -0
  7. data/docs/DESIGN.md +139 -0
  8. data/docs/MECHANICS_COVERAGE.md +670 -0
  9. data/docs/guides/adding-a-mechanic.md +60 -0
  10. data/docs/guides/api.md +614 -0
  11. data/docs/guides/card-data-format.md +1472 -0
  12. data/docs/guides/deck-builder.md +157 -0
  13. data/docs/plans/standard.md +371 -0
  14. data/docs/reference/abilities.md +1680 -0
  15. data/docs/reference/costs.md +339 -0
  16. data/docs/reference/counters.md +121 -0
  17. data/docs/reference/decisions.md +102 -0
  18. data/docs/reference/effects.md +2340 -0
  19. data/docs/reference/filters.md +172 -0
  20. data/docs/reference/keywords.md +647 -0
  21. data/docs/reference/subtypes.md +169 -0
  22. data/docs/reference/supertypes.md +31 -0
  23. data/docs/reference/triggers.md +797 -0
  24. data/docs/reference/types.md +216 -0
  25. data/exe/enjine +7 -0
  26. data/lib/enjine/actions/activate_mana_ability.rb +24 -0
  27. data/lib/enjine/actions/cast.rb +57 -0
  28. data/lib/enjine/actions/pass.rb +18 -0
  29. data/lib/enjine/actions/play_land.rb +52 -0
  30. data/lib/enjine/actions/special_action.rb +37 -0
  31. data/lib/enjine/actions.rb +20 -0
  32. data/lib/enjine/agents/busy.rb +27 -0
  33. data/lib/enjine/agents/random.rb +28 -0
  34. data/lib/enjine/card_definition.rb +433 -0
  35. data/lib/enjine/card_faces.rb +116 -0
  36. data/lib/enjine/catalog.rb +56 -0
  37. data/lib/enjine/characteristics.rb +39 -0
  38. data/lib/enjine/cli/text.rb +295 -0
  39. data/lib/enjine/cli.rb +312 -0
  40. data/lib/enjine/decisions/bottom.rb +29 -0
  41. data/lib/enjine/decisions/casting.rb +188 -0
  42. data/lib/enjine/decisions/combat.rb +75 -0
  43. data/lib/enjine/decisions/discard.rb +29 -0
  44. data/lib/enjine/decisions/effect_choice.rb +21 -0
  45. data/lib/enjine/decisions/enter_choice.rb +26 -0
  46. data/lib/enjine/decisions/legend_rule.rb +21 -0
  47. data/lib/enjine/decisions/mulligan.rb +26 -0
  48. data/lib/enjine/decisions/order_triggers.rb +21 -0
  49. data/lib/enjine/decisions/play_or_draw.rb +19 -0
  50. data/lib/enjine/decisions/priority.rb +22 -0
  51. data/lib/enjine/decisions/untap_choice.rb +35 -0
  52. data/lib/enjine/decisions.rb +22 -0
  53. data/lib/enjine/deck.rb +151 -0
  54. data/lib/enjine/deck_builder.rb +454 -0
  55. data/lib/enjine/docs.rb +90 -0
  56. data/lib/enjine/engine/ability_layers.rb +118 -0
  57. data/lib/enjine/engine/attachments.rb +86 -0
  58. data/lib/enjine/engine/casting/alt_casting.rb +254 -0
  59. data/lib/enjine/engine/casting/cast_choices.rb +292 -0
  60. data/lib/enjine/engine/casting/casting.rb +326 -0
  61. data/lib/enjine/engine/casting/cost_options.rb +99 -0
  62. data/lib/enjine/engine/casting/costs.rb +117 -0
  63. data/lib/enjine/engine/casting/payment.rb +353 -0
  64. data/lib/enjine/engine/casting/permissions.rb +412 -0
  65. data/lib/enjine/engine/casting/target_counts.rb +113 -0
  66. data/lib/enjine/engine/casting/waterbend.rb +90 -0
  67. data/lib/enjine/engine/characteristics.rb +379 -0
  68. data/lib/enjine/engine/class_levels.rb +25 -0
  69. data/lib/enjine/engine/combat.rb +315 -0
  70. data/lib/enjine/engine/copies.rb +208 -0
  71. data/lib/enjine/engine/damage.rb +196 -0
  72. data/lib/enjine/engine/designations.rb +46 -0
  73. data/lib/enjine/engine/emblems.rb +37 -0
  74. data/lib/enjine/engine/entering.rb +156 -0
  75. data/lib/enjine/engine/face_down.rb +30 -0
  76. data/lib/enjine/engine/faces.rb +222 -0
  77. data/lib/enjine/engine/follow_ups.rb +27 -0
  78. data/lib/enjine/engine/mana_sources.rb +230 -0
  79. data/lib/enjine/engine/phasing.rb +74 -0
  80. data/lib/enjine/engine/pregame.rb +95 -0
  81. data/lib/enjine/engine/priority.rb +47 -0
  82. data/lib/enjine/engine/resolution.rb +168 -0
  83. data/lib/enjine/engine/rules.rb +287 -0
  84. data/lib/enjine/engine/sagas.rb +41 -0
  85. data/lib/enjine/engine/speed.rb +104 -0
  86. data/lib/enjine/engine/spell_grants.rb +46 -0
  87. data/lib/enjine/engine/state_based_actions.rb +157 -0
  88. data/lib/enjine/engine/triggers.rb +364 -0
  89. data/lib/enjine/engine/turn_history.rb +240 -0
  90. data/lib/enjine/engine/turn_structure.rb +224 -0
  91. data/lib/enjine/engine/zones.rb +278 -0
  92. data/lib/enjine/engine.rb +55 -0
  93. data/lib/enjine/errors.rb +62 -0
  94. data/lib/enjine/events.rb +161 -0
  95. data/lib/enjine/frames.rb +84 -0
  96. data/lib/enjine/fuzz.rb +112 -0
  97. data/lib/enjine/game.rb +204 -0
  98. data/lib/enjine/history.rb +26 -0
  99. data/lib/enjine/mana.rb +142 -0
  100. data/lib/enjine/mechanics/abilities/additional_triggers.rb +86 -0
  101. data/lib/enjine/mechanics/abilities/chosen_values.rb +213 -0
  102. data/lib/enjine/mechanics/abilities/cost_changes.rb +154 -0
  103. data/lib/enjine/mechanics/abilities/damage_replacements.rb +569 -0
  104. data/lib/enjine/mechanics/abilities/double_counters.rb +71 -0
  105. data/lib/enjine/mechanics/abilities/entering_choices.rb +91 -0
  106. data/lib/enjine/mechanics/abilities/entering_copy.rb +69 -0
  107. data/lib/enjine/mechanics/abilities/enters_tapped.rb +159 -0
  108. data/lib/enjine/mechanics/abilities/enters_with_counters.rb +116 -0
  109. data/lib/enjine/mechanics/abilities/mana_ability.rb +209 -0
  110. data/lib/enjine/mechanics/abilities/play_permissions.rb +527 -0
  111. data/lib/enjine/mechanics/abilities/player_rules.rb +169 -0
  112. data/lib/enjine/mechanics/abilities/replacement_effects.rb +368 -0
  113. data/lib/enjine/mechanics/abilities/restrictions.rb +144 -0
  114. data/lib/enjine/mechanics/abilities/spell_keywords.rb +55 -0
  115. data/lib/enjine/mechanics/abilities/stack_abilities.rb +542 -0
  116. data/lib/enjine/mechanics/abilities/static.rb +365 -0
  117. data/lib/enjine/mechanics/abilities/tapping_power.rb +71 -0
  118. data/lib/enjine/mechanics/abilities/turn_rules.rb +49 -0
  119. data/lib/enjine/mechanics/card_spec.rb +177 -0
  120. data/lib/enjine/mechanics/copy_except.rb +73 -0
  121. data/lib/enjine/mechanics/costs/base.rb +115 -0
  122. data/lib/enjine/mechanics/costs/behold.rb +76 -0
  123. data/lib/enjine/mechanics/costs/discard.rb +65 -0
  124. data/lib/enjine/mechanics/costs/exert.rb +29 -0
  125. data/lib/enjine/mechanics/costs/exile_cards.rb +39 -0
  126. data/lib/enjine/mechanics/costs/from_graveyard.rb +45 -0
  127. data/lib/enjine/mechanics/costs/get_counters.rb +39 -0
  128. data/lib/enjine/mechanics/costs/mana.rb +37 -0
  129. data/lib/enjine/mechanics/costs/one_of.rb +49 -0
  130. data/lib/enjine/mechanics/costs/pay_life.rb +50 -0
  131. data/lib/enjine/mechanics/costs/remove_counters.rb +51 -0
  132. data/lib/enjine/mechanics/costs/sacrifice.rb +59 -0
  133. data/lib/enjine/mechanics/costs/tap.rb +56 -0
  134. data/lib/enjine/mechanics/costs/waterbend.rb +29 -0
  135. data/lib/enjine/mechanics/counters/kinds.rb +190 -0
  136. data/lib/enjine/mechanics/effects/add_subtypes.rb +30 -0
  137. data/lib/enjine/mechanics/effects/airbend.rb +41 -0
  138. data/lib/enjine/mechanics/effects/amass.rb +124 -0
  139. data/lib/enjine/mechanics/effects/assimilate.rb +72 -0
  140. data/lib/enjine/mechanics/effects/base.rb +148 -0
  141. data/lib/enjine/mechanics/effects/become.rb +182 -0
  142. data/lib/enjine/mechanics/effects/behold.rb +48 -0
  143. data/lib/enjine/mechanics/effects/blight.rb +94 -0
  144. data/lib/enjine/mechanics/effects/choose_cards.rb +168 -0
  145. data/lib/enjine/mechanics/effects/copy.rb +370 -0
  146. data/lib/enjine/mechanics/effects/counter_spell.rb +21 -0
  147. data/lib/enjine/mechanics/effects/counters.rb +161 -0
  148. data/lib/enjine/mechanics/effects/damage.rb +72 -0
  149. data/lib/enjine/mechanics/effects/delayed_triggers.rb +112 -0
  150. data/lib/enjine/mechanics/effects/destroy.rb +22 -0
  151. data/lib/enjine/mechanics/effects/discard.rb +86 -0
  152. data/lib/enjine/mechanics/effects/draw.rb +16 -0
  153. data/lib/enjine/mechanics/effects/earthbend.rb +70 -0
  154. data/lib/enjine/mechanics/effects/emblem.rb +52 -0
  155. data/lib/enjine/mechanics/effects/endure.rb +63 -0
  156. data/lib/enjine/mechanics/effects/exile.rb +49 -0
  157. data/lib/enjine/mechanics/effects/extra_turn.rb +122 -0
  158. data/lib/enjine/mechanics/effects/faces.rb +115 -0
  159. data/lib/enjine/mechanics/effects/fight.rb +76 -0
  160. data/lib/enjine/mechanics/effects/flip_coins.rb +97 -0
  161. data/lib/enjine/mechanics/effects/gain_control.rb +94 -0
  162. data/lib/enjine/mechanics/effects/game_end.rb +42 -0
  163. data/lib/enjine/mechanics/effects/library.rb +327 -0
  164. data/lib/enjine/mechanics/effects/life.rb +83 -0
  165. data/lib/enjine/mechanics/effects/look_at_hand.rb +17 -0
  166. data/lib/enjine/mechanics/effects/loot.rb +118 -0
  167. data/lib/enjine/mechanics/effects/mana.rb +96 -0
  168. data/lib/enjine/mechanics/effects/may.rb +82 -0
  169. data/lib/enjine/mechanics/effects/meld.rb +77 -0
  170. data/lib/enjine/mechanics/effects/mill.rb +22 -0
  171. data/lib/enjine/mechanics/effects/pay.rb +231 -0
  172. data/lib/enjine/mechanics/effects/phasing.rb +51 -0
  173. data/lib/enjine/mechanics/effects/proliferate.rb +72 -0
  174. data/lib/enjine/mechanics/effects/pump.rb +60 -0
  175. data/lib/enjine/mechanics/effects/put_in_library.rb +98 -0
  176. data/lib/enjine/mechanics/effects/return_choice.rb +29 -0
  177. data/lib/enjine/mechanics/effects/return_to_battlefield.rb +80 -0
  178. data/lib/enjine/mechanics/effects/return_to_hand.rb +20 -0
  179. data/lib/enjine/mechanics/effects/roll_dice.rb +45 -0
  180. data/lib/enjine/mechanics/effects/sacrifice.rb +118 -0
  181. data/lib/enjine/mechanics/effects/scry_and_surveil.rb +74 -0
  182. data/lib/enjine/mechanics/effects/search.rb +156 -0
  183. data/lib/enjine/mechanics/effects/tap_untap.rb +23 -0
  184. data/lib/enjine/mechanics/effects/tokens.rb +76 -0
  185. data/lib/enjine/mechanics/filters/any_target.rb +15 -0
  186. data/lib/enjine/mechanics/filters/base.rb +386 -0
  187. data/lib/enjine/mechanics/filters/graveyard.rb +23 -0
  188. data/lib/enjine/mechanics/filters/one_of.rb +55 -0
  189. data/lib/enjine/mechanics/filters/permanents.rb +52 -0
  190. data/lib/enjine/mechanics/filters/players.rb +20 -0
  191. data/lib/enjine/mechanics/filters/stack.rb +97 -0
  192. data/lib/enjine/mechanics/follow_up.rb +46 -0
  193. data/lib/enjine/mechanics/keywords/alternative_costs.rb +361 -0
  194. data/lib/enjine/mechanics/keywords/beam_me_up.rb +78 -0
  195. data/lib/enjine/mechanics/keywords/changeling.rb +58 -0
  196. data/lib/enjine/mechanics/keywords/convoke.rb +77 -0
  197. data/lib/enjine/mechanics/keywords/crew.rb +155 -0
  198. data/lib/enjine/mechanics/keywords/cycling.rb +58 -0
  199. data/lib/enjine/mechanics/keywords/decayed.rb +25 -0
  200. data/lib/enjine/mechanics/keywords/devour.rb +61 -0
  201. data/lib/enjine/mechanics/keywords/evergreen.rb +54 -0
  202. data/lib/enjine/mechanics/keywords/extort.rb +26 -0
  203. data/lib/enjine/mechanics/keywords/flags.rb +46 -0
  204. data/lib/enjine/mechanics/keywords/foretell.rb +45 -0
  205. data/lib/enjine/mechanics/keywords/gift.rb +50 -0
  206. data/lib/enjine/mechanics/keywords/hideaway.rb +28 -0
  207. data/lib/enjine/mechanics/keywords/increment.rb +31 -0
  208. data/lib/enjine/mechanics/keywords/job_select.rb +29 -0
  209. data/lib/enjine/mechanics/keywords/kicker.rb +92 -0
  210. data/lib/enjine/mechanics/keywords/mobilize_and_firebending.rb +84 -0
  211. data/lib/enjine/mechanics/keywords/paradigm.rb +91 -0
  212. data/lib/enjine/mechanics/keywords/power_up.rb +48 -0
  213. data/lib/enjine/mechanics/keywords/protection.rb +111 -0
  214. data/lib/enjine/mechanics/keywords/prowess.rb +30 -0
  215. data/lib/enjine/mechanics/keywords/riot.rb +35 -0
  216. data/lib/enjine/mechanics/keywords/saddle.rb +115 -0
  217. data/lib/enjine/mechanics/keywords/speed.rb +89 -0
  218. data/lib/enjine/mechanics/keywords/station.rb +163 -0
  219. data/lib/enjine/mechanics/keywords/storied.rb +41 -0
  220. data/lib/enjine/mechanics/keywords/storm_and_cascade.rb +86 -0
  221. data/lib/enjine/mechanics/keywords/sunburst.rb +29 -0
  222. data/lib/enjine/mechanics/keywords/suspend.rb +191 -0
  223. data/lib/enjine/mechanics/keywords/teamwork.rb +45 -0
  224. data/lib/enjine/mechanics/keywords/ward.rb +67 -0
  225. data/lib/enjine/mechanics/linked.rb +67 -0
  226. data/lib/enjine/mechanics/mana_spent.rb +99 -0
  227. data/lib/enjine/mechanics/selector.rb +207 -0
  228. data/lib/enjine/mechanics/subtypes/auras_and_equipment.rb +176 -0
  229. data/lib/enjine/mechanics/subtypes/basic_land_types.rb +36 -0
  230. data/lib/enjine/mechanics/subtypes/class_levels.rb +102 -0
  231. data/lib/enjine/mechanics/subtypes/saga.rb +89 -0
  232. data/lib/enjine/mechanics/supertypes/basic.rb +17 -0
  233. data/lib/enjine/mechanics/supertypes/legendary.rb +18 -0
  234. data/lib/enjine/mechanics/triggers/ability_triggers.rb +51 -0
  235. data/lib/enjine/mechanics/triggers/any_of.rb +43 -0
  236. data/lib/enjine/mechanics/triggers/base.rb +228 -0
  237. data/lib/enjine/mechanics/triggers/casting.rb +219 -0
  238. data/lib/enjine/mechanics/triggers/combat.rb +123 -0
  239. data/lib/enjine/mechanics/triggers/damage.rb +130 -0
  240. data/lib/enjine/mechanics/triggers/dilemma.rb +37 -0
  241. data/lib/enjine/mechanics/triggers/draw_and_discard.rb +85 -0
  242. data/lib/enjine/mechanics/triggers/keyword_actions.rb +55 -0
  243. data/lib/enjine/mechanics/triggers/life.rb +35 -0
  244. data/lib/enjine/mechanics/triggers/steps.rb +39 -0
  245. data/lib/enjine/mechanics/triggers/tap_and_counters.rb +111 -0
  246. data/lib/enjine/mechanics/triggers/zone_changes.rb +249 -0
  247. data/lib/enjine/mechanics/types/kindred.rb +30 -0
  248. data/lib/enjine/mechanics/types/land.rb +24 -0
  249. data/lib/enjine/mechanics/types/permanent_types.rb +67 -0
  250. data/lib/enjine/mechanics/types/spell_types.rb +38 -0
  251. data/lib/enjine/mechanics/values.rb +675 -0
  252. data/lib/enjine/mechanics.rb +74 -0
  253. data/lib/enjine/player.rb +30 -0
  254. data/lib/enjine/primitive.rb +61 -0
  255. data/lib/enjine/replacements.rb +191 -0
  256. data/lib/enjine/rng.rb +57 -0
  257. data/lib/enjine/rules_monitor.rb +404 -0
  258. data/lib/enjine/setup.rb +45 -0
  259. data/lib/enjine/snapshot/player_checks.rb +86 -0
  260. data/lib/enjine/snapshot/turn_checks.rb +91 -0
  261. data/lib/enjine/snapshot.rb +307 -0
  262. data/lib/enjine/state.rb +173 -0
  263. data/lib/enjine/steps.rb +117 -0
  264. data/lib/enjine/tokens.rb +25 -0
  265. data/lib/enjine/verify.rb +233 -0
  266. data/lib/enjine/version.rb +7 -0
  267. data/lib/enjine/view.rb +162 -0
  268. data/lib/enjine.rb +46 -0
  269. metadata +315 -0
@@ -0,0 +1,1680 @@
1
+ # Abilities
2
+
3
+ <!-- Generated by `rake docs` from the primitive registry. Do not edit. -->
4
+
5
+ ## activated
6
+
7
+ 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).
8
+
9
+ Rules: CR 602.1, CR 602.2, CR 602.5b, CR 602.5d, CR 702.177a, CR 702.193a, CR 702.193b, CR 702.142a
10
+
11
+ | Parameter | Description |
12
+ | --- | --- |
13
+ | `cost` | list of costs (tap, {"mana": "{1}"}, {"mana": "{X}"}) |
14
+ | `targets` | list of target filters |
15
+ | `effects` | list of effects |
16
+ | `timing` | "instant" (default), "sorcery" or "your_turn" |
17
+ | `limit` | "once_each_turn" | "once" (CR 602.5b) |
18
+ | `only_if` | condition ("activate only if ...") |
19
+ | `exhaust` | true: "Exhaust — [cost]: [effect]", activate only once (CR 702.177a) |
20
+ | `power_up` | true: "Power-up — [cost]: [effect]" (CR 702.193a) |
21
+ | `boast` | true: "Boast — [cost]: [effect]" (CR 702.142a) |
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) |
24
+
25
+ ```json
26
+ {
27
+ "activated": {
28
+ "cost": [
29
+ "tap"
30
+ ],
31
+ "targets": [
32
+ "any_target"
33
+ ],
34
+ "effects": [
35
+ {
36
+ "deal_damage": {
37
+ "amount": 1,
38
+ "to": {
39
+ "target": 0
40
+ }
41
+ }
42
+ }
43
+ ]
44
+ }
45
+ }
46
+ ```
47
+
48
+ ## additional_cost
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).
51
+
52
+ Rules: CR 601.2b, CR 601.2f, CR 601.2h, CR 118.8, CR 118.8b
53
+
54
+ | Parameter | Description |
55
+ | --- | --- |
56
+ | `cost` | list of costs |
57
+ | `optional` | true: you may pay it |
58
+
59
+ ```json
60
+ {
61
+ "additional_cost": {
62
+ "cost": [
63
+ {
64
+ "sacrifice_permanent": {
65
+ "filter": "creature"
66
+ }
67
+ }
68
+ ]
69
+ }
70
+ }
71
+ ```
72
+
73
+ ## additional_land_plays
74
+
75
+ 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.
76
+
77
+ Rules: CR 305.2, CR 305.2a, CR 305.2b, CR 604.1
78
+
79
+ ```json
80
+ "additional_land_plays"
81
+ ```
82
+
83
+ ## additional_triggers
84
+
85
+ While this permanent is on the battlefield, a triggered ability of a permanent its controller controls that triggers because of `cause` triggers an additional time. `cause`: you_gain_life (its controller gaining life).
86
+
87
+ Rules: CR 603.2d, CR 119.9
88
+
89
+ | Parameter | Description |
90
+ | --- | --- |
91
+ | `cause` | you_gain_life |
92
+
93
+ ```json
94
+ {
95
+ "additional_triggers": {
96
+ "cause": "you_gain_life"
97
+ }
98
+ }
99
+ ```
100
+
101
+ ## beam_me_up
102
+
103
+ 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>"`.
104
+
105
+ Rules: CR 702.196a, CR 702.196b, CR 118.9, CR 601.2b, CR 601.2f, CR 601.2h
106
+
107
+ | Parameter | Description |
108
+ | --- | --- |
109
+ | `cost` | mana cost string, e.g. "{3}{W}" |
110
+
111
+ ```json
112
+ {
113
+ "beam_me_up": {
114
+ "cost": "{3}{W}"
115
+ }
116
+ }
117
+ ```
118
+
119
+ ## can_block_only
120
+
121
+ This creature can block only attacking creatures matching `filter` (checked as blockers are declared, with their current characteristics; controller-relative filter keys are seen from this creature's controller).
122
+
123
+ Rules: CR 509.1b, CR 509.1a
124
+
125
+ | Parameter | Description |
126
+ | --- | --- |
127
+ | `filter` | a creature filter, e.g. {"creature": {"keywords": ["flying"]}} |
128
+
129
+ ```json
130
+ {
131
+ "can_block_only": {
132
+ "filter": {
133
+ "creature": {
134
+ "keywords": [
135
+ "flying"
136
+ ]
137
+ }
138
+ }
139
+ }
140
+ }
141
+ ```
142
+
143
+ ## cant_be_blocked_by
144
+
145
+ This creature can't be blocked by creatures matching `filter` (checked as blockers are declared, with their current characteristics).
146
+
147
+ Rules: CR 509.1b, CR 509.1a
148
+
149
+ | Parameter | Description |
150
+ | --- | --- |
151
+ | `filter` | a creature filter, e.g. {"creature": {"power": {"at_most": 2}}} |
152
+
153
+ ```json
154
+ {
155
+ "cant_be_blocked_by": {
156
+ "filter": {
157
+ "creature": {
158
+ "power": {
159
+ "at_most": 2
160
+ }
161
+ }
162
+ }
163
+ }
164
+ }
165
+ ```
166
+
167
+ ## cant_be_targeted_by
168
+
169
+ 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"]}).
170
+
171
+ Rules: CR 115.4, CR 113.7, CR 702.11d
172
+
173
+ | Parameter | Description |
174
+ | --- | --- |
175
+ | `abilities_from` | card spec of the ability's source |
176
+
177
+ ```json
178
+ {
179
+ "cant_be_targeted_by": {
180
+ "abilities_from": {
181
+ "types": [
182
+ "artifact"
183
+ ]
184
+ }
185
+ }
186
+ }
187
+ ```
188
+
189
+ ## cant_phase_in
190
+
191
+ While this permanent is on the battlefield, permanents can't phase in.
192
+
193
+ Rules: CR 702.26a, CR 502.1, CR 604.1
194
+
195
+ ```json
196
+ "cant_phase_in"
197
+ ```
198
+
199
+ ## cast_restriction
200
+
201
+ 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.
202
+
203
+ Rules: CR 601.3, CR 101.2
204
+
205
+ | Parameter | Description |
206
+ | --- | --- |
207
+ | `only_if` | condition |
208
+
209
+ ```json
210
+ {
211
+ "cast_restriction": {
212
+ "only_if": {
213
+ "amount": {
214
+ "graveyard_size": "you"
215
+ },
216
+ "at_least": 7
217
+ }
218
+ }
219
+ }
220
+ ```
221
+
222
+ ## chapter
223
+
224
+ 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`.
225
+
226
+ Rules: CR 715.2, CR 715.2b, CR 715.2c, CR 715.2d, CR 122.6
227
+
228
+ | Parameter | Description |
229
+ | --- | --- |
230
+ | `chapter` | integer >= 1 (the chapter symbol's number) |
231
+ | `targets` | list of target filters |
232
+ | `effects` | list of effects |
233
+ | `modes` | optional modes, as for a spell |
234
+
235
+ ```json
236
+ {
237
+ "chapter": {
238
+ "chapter": 2,
239
+ "effects": [
240
+ {
241
+ "gain_life": {
242
+ "amount": 3
243
+ }
244
+ }
245
+ ]
246
+ }
247
+ }
248
+ ```
249
+
250
+ ## choose_basic_land_type
251
+
252
+ 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").
253
+
254
+ Rules: CR 614.12, CR 305.6, CR 607.2d
255
+
256
+ ```json
257
+ {
258
+ "choose_basic_land_type": {}
259
+ }
260
+ ```
261
+
262
+ ## choose_card_name
263
+
264
+ 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.
265
+
266
+ Rules: CR 614.12, CR 614.12a, CR 201.4, CR 201.4a, CR 607.2
267
+
268
+ | Parameter | Description |
269
+ | --- | --- |
270
+ | `not` | list of card types |
271
+
272
+ ```json
273
+ {
274
+ "choose_card_name": {
275
+ "not": [
276
+ "land"
277
+ ]
278
+ }
279
+ }
280
+ ```
281
+
282
+ ## choose_card_type
283
+
284
+ As this permanent enters, its controller chooses a card type; filters with "types": "chosen" (or "not": "chosen") use it.
285
+
286
+ Rules: CR 614.12, CR 205.2a, CR 607.2d
287
+
288
+ ```json
289
+ {
290
+ "choose_card_type": {}
291
+ }
292
+ ```
293
+
294
+ ## choose_color
295
+
296
+ As this permanent enters, its controller chooses a color; filters with "colors": "chosen" (and other abilities of it) use it.
297
+
298
+ Rules: CR 614.12, CR 105.4, CR 607.2d
299
+
300
+ ```json
301
+ {
302
+ "choose_color": {}
303
+ }
304
+ ```
305
+
306
+ ## choose_creature_type
307
+
308
+ As this permanent enters, its controller chooses a creature type; filters with "subtypes": "chosen" use it.
309
+
310
+ Rules: CR 614.12, CR 205.3m, CR 607.2d
311
+
312
+ ```json
313
+ {
314
+ "choose_creature_type": {}
315
+ }
316
+ ```
317
+
318
+ ## choose_number
319
+
320
+ As this permanent enters, its controller chooses a number from `min` to `max`; abilities of it that say "the chosen number" use it.
321
+
322
+ Rules: CR 614.12, CR 614.12a, CR 607.2
323
+
324
+ | Parameter | Description |
325
+ | --- | --- |
326
+ | `min` | integer (default 0) |
327
+ | `max` | integer |
328
+
329
+ ```json
330
+ {
331
+ "choose_number": {
332
+ "min": 0,
333
+ "max": 10
334
+ }
335
+ }
336
+ ```
337
+
338
+ ## choose_option
339
+
340
+ As this permanent enters, its controller chooses one of the `options` (words with no rules meaning); a condition {"chosen": word} is true when that word was chosen.
341
+
342
+ Rules: CR 614.12, CR 607.2f, CR 614.12b
343
+
344
+ | Parameter | Description |
345
+ | --- | --- |
346
+ | `options` | list of two or more lowercase words |
347
+
348
+ ```json
349
+ {
350
+ "choose_option": {
351
+ "options": [
352
+ "khans",
353
+ "dragons"
354
+ ]
355
+ }
356
+ }
357
+ ```
358
+
359
+ ## class_level
360
+
361
+ A class level bar: `cost` (a mana cost string or a list of costs): this permanent's level becomes `level`; activate only if its level is `level` - 1, as a sorcery. While its level is `level` or greater it has `keywords` and `abilities`. A permanent without a level is level 1.
362
+
363
+ Rules: CR 717.2a, CR 717.2b, CR 717.2d, CR 717.3, CR 602.5d
364
+
365
+ | Parameter | Description |
366
+ | --- | --- |
367
+ | `level` | integer >= 2 |
368
+ | `cost` | mana cost string or list of costs |
369
+ | `keywords` | list of keywords |
370
+ | `abilities` | list of abilities |
371
+
372
+ ```json
373
+ {
374
+ "class_level": {
375
+ "level": 2,
376
+ "cost": "{1}{R}",
377
+ "abilities": [
378
+ {
379
+ "triggered": {
380
+ "when": {
381
+ "discards": {}
382
+ },
383
+ "effects": [
384
+ {
385
+ "deal_damage": {
386
+ "amount": 2,
387
+ "to": "each_opponent"
388
+ }
389
+ }
390
+ ]
391
+ }
392
+ }
393
+ ]
394
+ }
395
+ }
396
+ ```
397
+
398
+ ## cost_modifier
399
+
400
+ 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) cost `reduce` less or `increase` more generic mana. `from` / `not_from`: only spells cast from (not from) that zone (hand | graveyard | exile | library | outside).
401
+
402
+ Rules: CR 601.2f, CR 118.7a, CR 604.1, CR 601.2a
403
+
404
+ | Parameter | Description |
405
+ | --- | --- |
406
+ | `spells` | {"any_of": [types], "not": [types]} (optional) |
407
+ | `caster` | you | opponent | any |
408
+ | `reduce` | amount |
409
+ | `increase` | amount |
410
+ | `from` | zone |
411
+ | `not_from` | zone |
412
+
413
+ ```json
414
+ {
415
+ "cost_modifier": {
416
+ "spells": {
417
+ "not": [
418
+ "creature"
419
+ ]
420
+ },
421
+ "reduce": 1
422
+ }
423
+ }
424
+ ```
425
+
426
+ ## cost_reduction
427
+
428
+ 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}.
429
+
430
+ Rules: CR 601.2f, CR 118.7a, CR 702.41a
431
+
432
+ | Parameter | Description |
433
+ | --- | --- |
434
+ | `amount` | amount (integer or computed) |
435
+ | `if` | condition (optional) |
436
+
437
+ ```json
438
+ {
439
+ "cost_reduction": {
440
+ "amount": 1,
441
+ "if": {
442
+ "attacked": true
443
+ }
444
+ }
445
+ }
446
+ ```
447
+
448
+ ## crew
449
+
450
+ 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.
451
+
452
+ Rules: CR 702.122a, CR 702.122b, CR 702.122e, CR 301.7, CR 301.7a, CR 301.7b, CR 208.3, CR 302.6
453
+
454
+ | Parameter | Description |
455
+ | --- | --- |
456
+ | `power` | integer >= 1 (the N of crew N) |
457
+
458
+ ```json
459
+ {
460
+ "crew": {
461
+ "power": 3
462
+ }
463
+ }
464
+ ```
465
+
466
+ ## cycling
467
+
468
+ 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.
469
+
470
+ Rules: CR 702.29a, CR 702.29b, CR 702.29e, CR 702.29f, CR 113.6m, CR 602.2a
471
+
472
+ | Parameter | Description |
473
+ | --- | --- |
474
+ | `cost` | mana cost string, e.g. "{2}" |
475
+ | `for` | optional card spec for typecycling (see search_library) |
476
+
477
+ ```json
478
+ {
479
+ "cycling": {
480
+ "cost": "{2}",
481
+ "for": {
482
+ "supertypes": [
483
+ "basic"
484
+ ],
485
+ "types": [
486
+ "land"
487
+ ]
488
+ }
489
+ }
490
+ }
491
+ ```
492
+
493
+ ## damage_replacement
494
+
495
+ 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.
496
+
497
+ Rules: CR 614.1a, CR 614.5, CR 614.9, CR 616.1, CR 616.1e, CR 616.1f, CR 120.2b
498
+
499
+ | Parameter | Description |
500
+ | --- | --- |
501
+ | `by` | damage scope |
502
+ | `to` | damage scope |
503
+ | `combat` | combat | noncombat |
504
+ | `multiply` | integer >= 2 |
505
+ | `plus` | amount |
506
+ | `redirect` | "self" | "attached" |
507
+
508
+ ```json
509
+ {
510
+ "damage_replacement": {
511
+ "by": {
512
+ "controller": "you"
513
+ },
514
+ "to": {
515
+ "controller": "opponent"
516
+ },
517
+ "multiply": 2
518
+ }
519
+ }
520
+ ```
521
+
522
+ ## damage_unpreventable
523
+
524
+ 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.
525
+
526
+ Rules: CR 615.12
527
+
528
+ | Parameter | Description |
529
+ | --- | --- |
530
+ | `by` | damage scope |
531
+ | `to` | damage scope |
532
+ | `combat` | combat | noncombat |
533
+
534
+ ```json
535
+ {
536
+ "damage_unpreventable": {
537
+ "combat": "combat"
538
+ }
539
+ }
540
+ ```
541
+
542
+ ## destroy_replacement
543
+
544
+ 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.
545
+
546
+ Rules: CR 614.1a, CR 614.8, CR 701.8a, CR 701.21a, CR 704.5f, CR 704.5g, CR 704.5h
547
+
548
+ | Parameter | Description |
549
+ | --- | --- |
550
+ | `affects` | {"each": filter, "controller": ..., "other": bool} |
551
+ | `remove_counters` | counter name |
552
+ | `remove_damage` | boolean |
553
+
554
+ ```json
555
+ {
556
+ "destroy_replacement": {
557
+ "affects": {
558
+ "each": {
559
+ "creature": {
560
+ "counters": "+1/+1"
561
+ }
562
+ },
563
+ "controller": "you",
564
+ "other": true
565
+ },
566
+ "remove_counters": "+1/+1",
567
+ "remove_damage": true
568
+ }
569
+ }
570
+ ```
571
+
572
+ ## devour
573
+
574
+ 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.
575
+
576
+ Rules: CR 702.82a, CR 702.82b, CR 702.82c, CR 614.12, CR 701.21a
577
+
578
+ | Parameter | Description |
579
+ | --- | --- |
580
+ | `amount` | integer >= 1 |
581
+ | `each` | permanent filter (default "creature") |
582
+
583
+ ```json
584
+ {
585
+ "devour": {
586
+ "amount": 3,
587
+ "each": "land"
588
+ }
589
+ }
590
+ ```
591
+
592
+ ## double_counters
593
+
594
+ 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.
595
+
596
+ Rules: CR 614.1a, CR 122.6, CR 122.6a, CR 616.1
597
+
598
+ | Parameter | Description |
599
+ | --- | --- |
600
+ | `affects` | {"each": filter, "controller": ...} |
601
+ | `counter` | optional counter name |
602
+
603
+ ```json
604
+ {
605
+ "double_counters": {
606
+ "affects": {
607
+ "each": "creature",
608
+ "controller": "you"
609
+ }
610
+ }
611
+ }
612
+ ```
613
+
614
+ ## double_tokens
615
+
616
+ While this permanent is on the battlefield, if tokens would be created under its controller's control, twice that many of those tokens are created instead. Several apply one after another (two make four times as many).
617
+
618
+ Rules: CR 614.1a, CR 614.5, CR 111.1, CR 616.1
619
+
620
+ ```json
621
+ "double_tokens"
622
+ ```
623
+
624
+ ## draw_replacement
625
+
626
+ While this permanent is on the battlefield, each time its controller would draw a card, they draw `amount` cards instead (even with an empty library). The draws it makes aren't replaced by it again, but another such effect applies to each of them.
627
+
628
+ Rules: CR 614.11, CR 614.11a, CR 614.5, CR 121.2, CR 616.1
629
+
630
+ | Parameter | Description |
631
+ | --- | --- |
632
+ | `amount` | integer >= 2 |
633
+
634
+ ```json
635
+ {
636
+ "draw_replacement": {
637
+ "amount": 2
638
+ }
639
+ }
640
+ ```
641
+
642
+ ## enchant
643
+
644
+ The Aura's enchant ability: a target filter for what its spell targets and what the Aura may be attached to, e.g. "creature" or {"permanent": {"any_of": ["artifact", "creature"]}}. Only Auras have it.
645
+
646
+ Rules: CR 702.5a, CR 115.1b, CR 303.4a
647
+
648
+ | Parameter | Description |
649
+ | --- | --- |
650
+ | `(value)` | a target filter for a permanent |
651
+
652
+ ```json
653
+ {
654
+ "enchant": "creature"
655
+ }
656
+ ```
657
+
658
+ ## enter_as_copy
659
+
660
+ As this permanent enters, its controller may choose a permanent on the battlefield matching `of`; it enters as a copy of that permanent (its copiable values, with the `except` modifications) and its enter abilities trigger. `with_counters: true`: it also enters with the counters the copied permanent has. Choosing none: it enters as itself.
661
+
662
+ Rules: CR 707.5, CR 707.9b, CR 614.1c, CR 614.12
663
+
664
+ | Parameter | Description |
665
+ | --- | --- |
666
+ | `of` | filter (the permanents it may copy) |
667
+ | `except` | {"legendary": false, "keywords": [...], "types": [...], "subtypes": [...], "supertypes": [...], "name": ..., "power": n, "toughness": n, "colors": [...]} |
668
+ | `with_counters` | boolean |
669
+
670
+ ```json
671
+ {
672
+ "enter_as_copy": {
673
+ "of": {
674
+ "permanent": {
675
+ "any_of": [
676
+ "artifact",
677
+ "creature"
678
+ ]
679
+ }
680
+ },
681
+ "except": {
682
+ "legendary": false
683
+ },
684
+ "with_counters": true
685
+ }
686
+ }
687
+ ```
688
+
689
+ ## enters_attacking
690
+
691
+ While this permanent's controller controls an attacking creature, permanents matching `affects` enter the battlefield tapped and attacking (the defending player). They never "attacked", so attack triggers don't see them.
692
+
693
+ Rules: CR 614.1c, CR 508.4, CR 506.4
694
+
695
+ | Parameter | Description |
696
+ | --- | --- |
697
+ | `affects` | {"each": filter, "controller": you|opponent|any} |
698
+
699
+ ```json
700
+ {
701
+ "enters_attacking": {
702
+ "affects": {
703
+ "each": "creature",
704
+ "controller": "you"
705
+ }
706
+ }
707
+ }
708
+ ```
709
+
710
+ ## enters_prepared
711
+
712
+ This permanent enters the battlefield prepared (it needs a prepare spell, see `layout: "prepare"`).
713
+
714
+ Rules: CR 723.3a, CR 614.1c
715
+
716
+ ```json
717
+ "enters_prepared"
718
+ ```
719
+
720
+ ## enters_tapped
721
+
722
+ This permanent enters the battlefield tapped (a self-replacement effect).
723
+
724
+ Rules: CR 614.1c, CR 614.12
725
+
726
+ ```json
727
+ "enters_tapped"
728
+ ```
729
+
730
+ ## enters_tapped_unless
731
+
732
+ This permanent enters tapped unless `condition` is true as it would enter (checked for its controller; the permanent itself isn't on the battlefield yet).
733
+
734
+ Rules: CR 614.1c, CR 614.12
735
+
736
+ | Parameter | Description |
737
+ | --- | --- |
738
+ | `condition` | a condition, e.g. {"controls": {"each": "land", "controller": "you"}, "at_least": 2} |
739
+
740
+ ```json
741
+ {
742
+ "enters_tapped_unless": {
743
+ "condition": {
744
+ "controls": {
745
+ "each": "land",
746
+ "controller": "you"
747
+ },
748
+ "at_least": 2
749
+ }
750
+ }
751
+ }
752
+ ```
753
+
754
+ ## enters_tapped_unless_behold
755
+
756
+ As this permanent enters, its controller may behold an object matching the card spec `card` (reveal such a card from their hand or choose such a permanent they control); if they don't, it enters tapped.
757
+
758
+ Rules: CR 614.12, CR 701.4a
759
+
760
+ | Parameter | Description |
761
+ | --- | --- |
762
+ | `card` | card spec (required), e.g. {"subtypes": ["jace"]} |
763
+
764
+ ```json
765
+ {
766
+ "enters_tapped_unless_behold": {
767
+ "card": {
768
+ "subtypes": [
769
+ "jace"
770
+ ]
771
+ }
772
+ }
773
+ }
774
+ ```
775
+
776
+ ## enters_tapped_unless_pay_life
777
+
778
+ As this permanent enters, its controller may pay `life` life; if they don't, it enters tapped. You can't pay more life than you have.
779
+
780
+ Rules: CR 614.12, CR 119.4
781
+
782
+ | Parameter | Description |
783
+ | --- | --- |
784
+ | `life` | integer |
785
+
786
+ ```json
787
+ {
788
+ "enters_tapped_unless_pay_life": {
789
+ "life": 2
790
+ }
791
+ }
792
+ ```
793
+
794
+ ## enters_untapped
795
+
796
+ Permanents matching `affects` enter the battlefield untapped, even if another effect or their own ability would have them enter tapped.
797
+
798
+ Rules: CR 614.1c, CR 614.12, CR 616.1
799
+
800
+ | Parameter | Description |
801
+ | --- | --- |
802
+ | `affects` | {"each": filter, "controller": you|opponent|any} |
803
+
804
+ ```json
805
+ {
806
+ "enters_untapped": {
807
+ "affects": {
808
+ "each": "land",
809
+ "controller": "you"
810
+ }
811
+ }
812
+ }
813
+ ```
814
+
815
+ ## enters_with_counters
816
+
817
+ Without `affects`: this permanent enters with the `counters` on it; a count may be an amount computed as it enters (e.g. the mana spent to cast it, CR 601.2h). With `affects` ({"each": filter, "controller": you|opponent|any, "other": true}, relative to this permanent's controller): while this permanent is on the battlefield, each matching permanent enters with the `counters` in addition to any others.
818
+
819
+ Rules: CR 614.1c, CR 614.12, CR 122.6, CR 122.6a
820
+
821
+ | Parameter | Description |
822
+ | --- | --- |
823
+ | `counters` | {counter name: n} (n >= 1; without `affects`, n may be an amount) |
824
+ | `affects` | optional {"each": filter, "controller": ..., "other": bool} |
825
+
826
+ ```json
827
+ {
828
+ "enters_with_counters": {
829
+ "counters": {
830
+ "+1/+1": 1
831
+ },
832
+ "affects": {
833
+ "each": "creature",
834
+ "controller": "you",
835
+ "other": true
836
+ }
837
+ }
838
+ }
839
+ ```
840
+
841
+ ## equip
842
+
843
+ Equip: pay `cost` to attach this Equipment to target creature you control (not itself). Sorcery speed. Only Equipment have it.
844
+
845
+ Rules: CR 702.6a, CR 301.5b, CR 301.5c, CR 701.3a
846
+
847
+ | Parameter | Description |
848
+ | --- | --- |
849
+ | `cost` | list of costs, e.g. [{"mana": "{2}"}] |
850
+
851
+ ```json
852
+ {
853
+ "equip": {
854
+ "cost": [
855
+ {
856
+ "mana": "{2}"
857
+ }
858
+ ]
859
+ }
860
+ }
861
+ ```
862
+
863
+ ## evoke
864
+
865
+ Evoke: you may cast this card by paying `cost` rather than its mana cost. When the permanent enters, if its evoke cost was paid, its controller sacrifices it (a triggered ability that comes with the keyword). Cast option `via: "alt:<ref>"`.
866
+
867
+ Rules: CR 702.74a, CR 118.9, CR 601.2b, CR 601.2f, CR 601.2h, CR 603.4
868
+
869
+ | Parameter | Description |
870
+ | --- | --- |
871
+ | `cost` | mana cost string, or a list of costs |
872
+
873
+ ```json
874
+ {
875
+ "evoke": {
876
+ "cost": "{R/W}{R/W}"
877
+ }
878
+ }
879
+ ```
880
+
881
+ ## exile_if_dies
882
+
883
+ While this permanent is on the battlefield, a permanent matching `affects` that would be put into a graveyard from the battlefield is exiled instead; the card is "exiled with" this permanent (exiled_with). `then`: effects right after ("instead exile it and you gain 2 life"; a reflexive_trigger for "When you do, ..."), reading {"triggering": "object"} (the exiled card) and "player" (who controlled it).
884
+
885
+ Rules: CR 614.1a, CR 700.4, CR 603.12, CR 607.2a
886
+
887
+ | Parameter | Description |
888
+ | --- | --- |
889
+ | `affects` | {"each": filter, "controller": you|opponent|any, "other": bool} |
890
+ | `then` | list of effects |
891
+
892
+ ```json
893
+ {
894
+ "exile_if_dies": {
895
+ "affects": {
896
+ "each": "creature",
897
+ "controller": "opponent"
898
+ }
899
+ }
900
+ }
901
+ ```
902
+
903
+ ## firebending
904
+
905
+ Firebending `amount`: whenever this creature attacks, add that much {R}; you don't lose this mana as steps end until end of combat.
906
+
907
+ Rules: CR 702.189a, CR 500.5
908
+
909
+ | Parameter | Description |
910
+ | --- | --- |
911
+ | `amount` | amount |
912
+
913
+ ```json
914
+ {
915
+ "firebending": {
916
+ "amount": 2
917
+ }
918
+ }
919
+ ```
920
+
921
+ ## first_flips_win
922
+
923
+ The first time each turn its controller flips one or more coins, those coins come up heads and they win those flips.
924
+
925
+ Rules: CR 705.3, CR 604.1
926
+
927
+ ```json
928
+ "first_flips_win"
929
+ ```
930
+
931
+ ## flashback
932
+
933
+ 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>"`.
934
+
935
+ Rules: CR 702.34a, CR 118.9, CR 601.2b, CR 601.2f, CR 601.2h
936
+
937
+ | Parameter | Description |
938
+ | --- | --- |
939
+ | `cost` | mana cost string, or a list of costs |
940
+
941
+ ```json
942
+ {
943
+ "flashback": {
944
+ "cost": "{2}{R}"
945
+ }
946
+ }
947
+ ```
948
+
949
+ ## foretell
950
+
951
+ Foretell: during your turn, you may pay {2} and exile this card from your hand face down (special action `{type: "special_action"}`). After that turn you may cast it from exile by paying `cost` rather than its mana cost (cast option `via: "alt:<ref>"`). `{"cast_with": "foretell"}` reads it.
952
+
953
+ Rules: CR 702.143a, CR 702.143b, CR 702.143c, CR 116.2h, CR 406.3, CR 118.9, CR 601.2b, CR 601.2f, CR 601.2h
954
+
955
+ | Parameter | Description |
956
+ | --- | --- |
957
+ | `cost` | mana cost string, or a list of costs |
958
+
959
+ ```json
960
+ {
961
+ "foretell": {
962
+ "cost": "{2}{R}"
963
+ }
964
+ }
965
+ ```
966
+
967
+ ## gift
968
+
969
+ 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.
970
+
971
+ Rules: CR 702.174a, CR 702.174b, CR 702.174j, CR 702.174k, CR 702.174m, CR 601.2b
972
+
973
+ ```json
974
+ "gift"
975
+ ```
976
+
977
+ ## grants_beam_me_up
978
+
979
+ 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>"`.
980
+
981
+ Rules: CR 702.196a, CR 702.196b, CR 604.1, CR 611.3a
982
+
983
+ ```json
984
+ "grants_beam_me_up"
985
+ ```
986
+
987
+ ## harmonize
988
+
989
+ 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>"`.
990
+
991
+ Rules: CR 702.180a, CR 702.180b, CR 118.9, CR 601.2b, CR 601.2f, CR 601.2h
992
+
993
+ | Parameter | Description |
994
+ | --- | --- |
995
+ | `cost` | mana cost string, or a list of costs |
996
+
997
+ ```json
998
+ {
999
+ "harmonize": {
1000
+ "cost": "{4}{G}"
1001
+ }
1002
+ }
1003
+ ```
1004
+
1005
+ ## hexproof_from
1006
+
1007
+ 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).
1008
+
1009
+ Rules: CR 702.11d, CR 702.11f, CR 702.11g, CR 115.4
1010
+
1011
+ | Parameter | Description |
1012
+ | --- | --- |
1013
+ | `(value)` | card spec of the quality, or "its_colors" |
1014
+
1015
+ ```json
1016
+ {
1017
+ "hexproof_from": {
1018
+ "colors": [
1019
+ "B"
1020
+ ]
1021
+ }
1022
+ }
1023
+ ```
1024
+
1025
+ ## hideaway
1026
+
1027
+ 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.
1028
+
1029
+ Rules: CR 702.75a, CR 406.3, CR 607.2a
1030
+
1031
+ | Parameter | Description |
1032
+ | --- | --- |
1033
+ | `amount` | amount |
1034
+
1035
+ ```json
1036
+ {
1037
+ "hideaway": {
1038
+ "amount": 4
1039
+ }
1040
+ }
1041
+ ```
1042
+
1043
+ ## kicker
1044
+
1045
+ 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.
1046
+
1047
+ Rules: CR 702.33a, CR 702.33d, CR 702.33g, CR 601.2b, CR 601.2f, CR 601.2h
1048
+
1049
+ | Parameter | Description |
1050
+ | --- | --- |
1051
+ | `cost` | list of costs, e.g. [{"mana": "{1}{U}"}] |
1052
+
1053
+ ```json
1054
+ {
1055
+ "kicker": {
1056
+ "cost": [
1057
+ {
1058
+ "mana": "{1}{U}"
1059
+ }
1060
+ ]
1061
+ }
1062
+ }
1063
+ ```
1064
+
1065
+ ## look_at_top
1066
+
1067
+ While this permanent is on the battlefield, its controller sees the top card of their library (the `library_top` of their view).
1068
+
1069
+ Rules: CR 401.5, CR 604.1
1070
+
1071
+ ```json
1072
+ "look_at_top"
1073
+ ```
1074
+
1075
+ ## loyalty
1076
+
1077
+ A loyalty ability. Its cost adds (positive) or removes (negative) loyalty counters and is paid on activation. Sorcery speed, and only one loyalty ability per planeswalker per turn.
1078
+
1079
+ Rules: CR 606.3, CR 606.4, CR 606.5, CR 602.2b
1080
+
1081
+ | Parameter | Description |
1082
+ | --- | --- |
1083
+ | `cost` | integer, e.g. 1 for +1 or -2 |
1084
+ | `targets` | list of target filters |
1085
+ | `effects` | list of effects |
1086
+
1087
+ ```json
1088
+ {
1089
+ "loyalty": {
1090
+ "cost": -3,
1091
+ "targets": [
1092
+ "creature"
1093
+ ],
1094
+ "effects": [
1095
+ {
1096
+ "deal_damage": {
1097
+ "amount": 3,
1098
+ "to": {
1099
+ "target": 0
1100
+ }
1101
+ }
1102
+ }
1103
+ ]
1104
+ }
1105
+ }
1106
+ ```
1107
+
1108
+ ## mana
1109
+
1110
+ An activated mana ability: pay the cost, add the mana to your mana pool immediately. It does not use the stack and can be activated whenever you have priority. `produce`: the fixed mana (`amount` times). Or `color`: `amount` mana (default 1) of one color you choose as you activate it (`"any_one"`) or in any combination of colors (`"any"`); `colors` limits the choice. `"chosen"`: of the color chosen as this entered (choose_color). `spend_only` restricts how the mana can be spent. `only_if`: "Activate only if ...".
1111
+
1112
+ Rules: CR 605.1a, CR 605.3a, CR 605.3b, CR 106.1a, CR 106.4, CR 106.6, CR 607.2d, CR 602.5b
1113
+
1114
+ | Parameter | Description |
1115
+ | --- | --- |
1116
+ | `cost` | list of costs (e.g. ["tap"]) |
1117
+ | `produce` | mana symbols added, e.g. "{G}" or "{C}{C}" |
1118
+ | `amount` | amount (default 1; with produce: how many times) |
1119
+ | `color` | any_one | any | chosen |
1120
+ | `colors` | list of colors to choose from (default all five) |
1121
+ | `spend_only` | {"spells": card spec, "abilities": card spec, "from" | "not_from": zone} |
1122
+ | `only_if` | condition: it can be activated only while it holds (CR 602.5b) |
1123
+
1124
+ ```json
1125
+ {
1126
+ "mana": {
1127
+ "cost": [
1128
+ "tap"
1129
+ ],
1130
+ "produce": "{C}"
1131
+ }
1132
+ }
1133
+ ```
1134
+
1135
+ ## max_speed
1136
+
1137
+ While your speed is 4 (max speed), this object has `keywords` and `abilities` (any kind: activated, triggered, static, mana; an ability with a graveyard cost works from your graveyard).
1138
+
1139
+ Rules: CR 702.178a, CR 702.178b, CR 702.179e, CR 113.6c
1140
+
1141
+ | Parameter | Description |
1142
+ | --- | --- |
1143
+ | `keywords` | list of keywords |
1144
+ | `abilities` | list of abilities |
1145
+
1146
+ ```json
1147
+ {
1148
+ "max_speed": {
1149
+ "abilities": [
1150
+ {
1151
+ "activated": {
1152
+ "cost": [
1153
+ "tap"
1154
+ ],
1155
+ "effects": [
1156
+ {
1157
+ "draw": {
1158
+ "amount": 1
1159
+ }
1160
+ }
1161
+ ]
1162
+ }
1163
+ }
1164
+ ]
1165
+ }
1166
+ }
1167
+ ```
1168
+
1169
+ ## may_not_untap
1170
+
1171
+ Its controller may choose not to untap it during their untap step (decision `untap_choice`, asked only while it's tapped).
1172
+
1173
+ Rules: CR 502.3, CR 604.1
1174
+
1175
+ ```json
1176
+ "may_not_untap"
1177
+ ```
1178
+
1179
+ ## mayhem
1180
+
1181
+ 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>"`.
1182
+
1183
+ Rules: CR 702.187a, CR 702.187b, CR 702.187c, CR 118.9, CR 601.2b, CR 601.2f, CR 601.2h, CR 305.1
1184
+
1185
+ | Parameter | Description |
1186
+ | --- | --- |
1187
+ | `cost` | mana cost string, or a list of costs (optional) |
1188
+
1189
+ ```json
1190
+ {
1191
+ "mayhem": {
1192
+ "cost": "{1}{R}"
1193
+ }
1194
+ }
1195
+ ```
1196
+
1197
+ ## mobilize
1198
+
1199
+ 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.
1200
+
1201
+ Rules: CR 702.181a, CR 508.4
1202
+
1203
+ | Parameter | Description |
1204
+ | --- | --- |
1205
+ | `amount` | amount |
1206
+
1207
+ ```json
1208
+ {
1209
+ "mobilize": {
1210
+ "amount": 2
1211
+ }
1212
+ }
1213
+ ```
1214
+
1215
+ ## play_from
1216
+
1217
+ 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.
1218
+
1219
+ Rules: CR 601.3, CR 113.6e, CR 113.6f, CR 305.1, CR 401.5, CR 122.1, CR 614.12, CR 400.11a, CR 400.11b, CR 108.3
1220
+
1221
+ | Parameter | Description |
1222
+ | --- | --- |
1223
+ | `zone` | graveyard | exile | library_top | outside |
1224
+ | `zones` | list of zones (instead of `zone`) |
1225
+ | `cards` | "self" or a card spec |
1226
+ | `play` | cast | play |
1227
+ | `once_each_turn` | boolean |
1228
+ | `enters_with` | {counter name: n} |
1229
+
1230
+ ```json
1231
+ {
1232
+ "play_from": {
1233
+ "zone": "graveyard",
1234
+ "enters_with": {
1235
+ "finality": 1
1236
+ }
1237
+ }
1238
+ }
1239
+ ```
1240
+
1241
+ ## player_rule
1242
+
1243
+ 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.
1244
+
1245
+ 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
1246
+
1247
+ | Parameter | Description |
1248
+ | --- | --- |
1249
+ | `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 |
1250
+ | `affects` | you | opponents | each |
1251
+ | `filter` | permanent filter (cant_sacrifice, cant_activate) |
1252
+ | `spells` | card spec of the spells (cant_cast, spells_cant_be_countered) |
1253
+ | `if` | condition ("during your turn": {"your_turn": true}) |
1254
+
1255
+ ```json
1256
+ {
1257
+ "player_rule": {
1258
+ "rule": "cant_cast",
1259
+ "affects": "opponents",
1260
+ "if": {
1261
+ "your_turn": true
1262
+ }
1263
+ }
1264
+ }
1265
+ ```
1266
+
1267
+ ## prevent_damage
1268
+
1269
+ 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).
1270
+
1271
+ Rules: CR 615.1, CR 615.1a, CR 615.5, CR 615.6
1272
+
1273
+ | Parameter | Description |
1274
+ | --- | --- |
1275
+ | `by` | damage scope |
1276
+ | `to` | damage scope |
1277
+ | `combat` | combat | noncombat |
1278
+ | `then` | list of effects |
1279
+
1280
+ ```json
1281
+ {
1282
+ "prevent_damage": {
1283
+ "to": {
1284
+ "each": "creature",
1285
+ "controller": "you",
1286
+ "other": true
1287
+ },
1288
+ "combat": "noncombat"
1289
+ }
1290
+ }
1291
+ ```
1292
+
1293
+ ## protection_from
1294
+
1295
+ 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).
1296
+
1297
+ Rules: CR 702.16a, CR 702.16b, CR 702.16c, CR 702.16d, CR 702.16e, CR 702.16f, CR 702.16g, CR 702.16h, CR 702.16i, CR 702.16j, CR 702.16k, CR 704.5m, CR 704.5n
1298
+
1299
+ | Parameter | Description |
1300
+ | --- | --- |
1301
+ | `(value)` | card spec of the quality, "everything", "each_opponent" or "its_colors" |
1302
+
1303
+ ```json
1304
+ {
1305
+ "protection_from": {
1306
+ "colors": [
1307
+ "W"
1308
+ ]
1309
+ }
1310
+ }
1311
+ ```
1312
+
1313
+ ## saddle
1314
+
1315
+ Saddle 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 saddled until end of turn. Activate only as a sorcery.
1316
+
1317
+ Rules: CR 702.171a, CR 702.171b, CR 702.171c
1318
+
1319
+ | Parameter | Description |
1320
+ | --- | --- |
1321
+ | `power` | integer >= 1 (the N of saddle N) |
1322
+
1323
+ ```json
1324
+ {
1325
+ "saddle": {
1326
+ "power": 2
1327
+ }
1328
+ }
1329
+ ```
1330
+
1331
+ ## sneak
1332
+
1333
+ Sneak: any time you could cast an instant during your declare blockers step, you may cast this spell by paying `cost` and returning an unblocked attacking creature you control to its owner's hand rather than its mana cost. A permanent spell cast this way enters tapped and attacking what that creature was attacking. Cast option `via: "alt:<ref>"`.
1334
+
1335
+ Rules: CR 702.190a, CR 702.190b, CR 506.3a, CR 118.9, CR 601.2b, CR 601.2f, CR 601.2h
1336
+
1337
+ | Parameter | Description |
1338
+ | --- | --- |
1339
+ | `cost` | mana cost string, or a list of costs |
1340
+
1341
+ ```json
1342
+ {
1343
+ "sneak": {
1344
+ "cost": "{1}{B}"
1345
+ }
1346
+ }
1347
+ ```
1348
+
1349
+ ## spell
1350
+
1351
+ 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").
1352
+
1353
+ Rules: CR 113.3a, CR 601.2c, CR 608.2b, CR 608.2c, CR 702.183a, CR 601.2f
1354
+
1355
+ | Parameter | Description |
1356
+ | --- | --- |
1357
+ | `targets` | list of target filters |
1358
+ | `effects` | list of effects |
1359
+ | `modes` | list of {targets, effects, cost} (with `choose`) |
1360
+
1361
+ ```json
1362
+ {
1363
+ "spell": {
1364
+ "targets": [
1365
+ "any_target"
1366
+ ],
1367
+ "effects": [
1368
+ {
1369
+ "deal_damage": {
1370
+ "amount": 3,
1371
+ "to": {
1372
+ "target": 0
1373
+ }
1374
+ }
1375
+ }
1376
+ ]
1377
+ }
1378
+ }
1379
+ ```
1380
+
1381
+ ## spell_keywords
1382
+
1383
+ Spells you control on the stack matching `spells` (a spell filter; default every spell), cast `from` / `not_from` a zone if given, have the `keywords` (e.g. cascade, which then triggers as such a spell is cast).
1384
+
1385
+ Rules: CR 604.1, CR 611.3a, CR 702.85a
1386
+
1387
+ | Parameter | Description |
1388
+ | --- | --- |
1389
+ | `spells` | spell filter |
1390
+ | `from` | zone |
1391
+ | `not_from` | zone |
1392
+ | `keywords` | list of keywords |
1393
+
1394
+ ```json
1395
+ {
1396
+ "spell_keywords": {
1397
+ "spells": {
1398
+ "spell": {
1399
+ "any_of": [
1400
+ "instant",
1401
+ "sorcery"
1402
+ ]
1403
+ }
1404
+ },
1405
+ "from": "hand",
1406
+ "keywords": [
1407
+ "cascade"
1408
+ ]
1409
+ }
1410
+ }
1411
+ ```
1412
+
1413
+ ## spells_have
1414
+
1415
+ Spells you cast matching the card spec `spells` (default: every spell) have `keywords` (convoke and/or improvise) while this permanent is on the battlefield.
1416
+
1417
+ Rules: CR 702.126a, CR 702.51a, CR 611.3a, CR 604.1
1418
+
1419
+ | Parameter | Description |
1420
+ | --- | --- |
1421
+ | `spells` | card spec, e.g. {"not_types": ["creature"]} |
1422
+ | `keywords` | list of convoke, improvise |
1423
+
1424
+ ```json
1425
+ {
1426
+ "spells_have": {
1427
+ "spells": {
1428
+ "not_types": [
1429
+ "creature"
1430
+ ]
1431
+ },
1432
+ "keywords": [
1433
+ "improvise"
1434
+ ]
1435
+ }
1436
+ }
1437
+ ```
1438
+
1439
+ ## static
1440
+
1441
+ 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").
1442
+
1443
+ 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
1444
+
1445
+ | Parameter | Description |
1446
+ | --- | --- |
1447
+ | `affects` | {"each": filter, "controller": ..., "other": bool}, "self" or "attached" |
1448
+ | `if` | condition ("as long as ...", "during your turn") |
1449
+ | `pump` | {"power": amount, "toughness": amount} ("gets +1/+1 for each ...") |
1450
+ | `keywords` | list of keywords |
1451
+ | `creature_types` | list of creature types (replaces the others) |
1452
+ | `types` | list of card types it also has (in addition to its other types) |
1453
+ | `subtypes` | list of subtypes it also has (in addition to its other types), or "chosen": the type chosen as its source entered |
1454
+ | `abilities` | list of triggered, activated or mana abilities the affected permanents have |
1455
+ | `loses_abilities` | true: it loses all abilities ("loses all abilities") |
1456
+ | `colors` | list of W, U, B, R, G: its colors are exactly these ([] for colorless) |
1457
+ | `base_power_toughness` | {"power": n, "toughness": n} |
1458
+ | `set_types` | list of card types: its card types are exactly these |
1459
+ | `name` | its name ("named Humble Merchant") |
1460
+
1461
+ ```json
1462
+ {
1463
+ "static": {
1464
+ "affects": {
1465
+ "each": "creature",
1466
+ "controller": "you"
1467
+ },
1468
+ "pump": {
1469
+ "power": 1,
1470
+ "toughness": 1
1471
+ }
1472
+ }
1473
+ }
1474
+ ```
1475
+
1476
+ ## station_symbol
1477
+
1478
+ While this permanent has at least `at` charge counters it has `keywords` and `abilities`; with `power`/`toughness` it is also a creature with that base power and toughness (layers 4 and 7b).
1479
+
1480
+ Rules: CR 722.2a, CR 722.2b, CR 722.2c, CR 613.1d, CR 613.4b
1481
+
1482
+ | Parameter | Description |
1483
+ | --- | --- |
1484
+ | `at` | integer >= 1 (the N of {N+}) |
1485
+ | `power` | integer |
1486
+ | `toughness` | integer |
1487
+ | `keywords` | list of keywords |
1488
+ | `abilities` | list of abilities |
1489
+
1490
+ ```json
1491
+ {
1492
+ "station_symbol": {
1493
+ "at": 6,
1494
+ "power": 3,
1495
+ "toughness": 4,
1496
+ "keywords": [
1497
+ "flying"
1498
+ ]
1499
+ }
1500
+ }
1501
+ ```
1502
+
1503
+ ## suspend
1504
+
1505
+ Suspend `amount`—`cost`: whenever you could begin to cast this card from your hand, you may pay `cost` and exile it with `amount` time counters (special action `{type: "special_action"}`); then it works as the keyword `suspend`.
1506
+
1507
+ Rules: CR 702.62a, CR 702.62c, CR 116.2f
1508
+
1509
+ | Parameter | Description |
1510
+ | --- | --- |
1511
+ | `amount` | integer >= 1 (time counters) |
1512
+ | `cost` | mana cost string |
1513
+
1514
+ ```json
1515
+ {
1516
+ "suspend": {
1517
+ "amount": 3,
1518
+ "cost": "{2}{W}"
1519
+ }
1520
+ }
1521
+ ```
1522
+
1523
+ ## tapping_power
1524
+
1525
+ When this creature is tapped to pay the cost of the abilities in `for` (crew, saddle, station), it counts its `use` (power, default; toughness; toughness_if_greater: its toughness when that's greater than its power) plus `plus`. Several of them add up their `plus`. A `static` can grant it.
1526
+
1527
+ Rules: CR 702.122a, CR 702.171a, CR 702.184a, CR 702.184c
1528
+
1529
+ | Parameter | Description |
1530
+ | --- | --- |
1531
+ | `for` | list of crew, saddle, station |
1532
+ | `use` | power | toughness | toughness_if_greater |
1533
+ | `plus` | integer (default 0) |
1534
+
1535
+ ```json
1536
+ {
1537
+ "tapping_power": {
1538
+ "for": [
1539
+ "crew",
1540
+ "saddle"
1541
+ ],
1542
+ "plus": 2
1543
+ }
1544
+ }
1545
+ ```
1546
+
1547
+ ## teamwork
1548
+
1549
+ Teamwork N: as you cast this spell you may also tap any number of untapped creatures you control with total power N or more (the `choose_kicker` decision, then one `choose_cost` per creature). `{"cast_with": "teamwork"}` holds if you did; `kicked_targets` are its targets then.
1550
+
1551
+ Rules: CR 702.194a, CR 702.194b, CR 702.194c, CR 601.2b, CR 601.2f, CR 601.2h
1552
+
1553
+ | Parameter | Description |
1554
+ | --- | --- |
1555
+ | `power` | integer >= 1 (the N of teamwork N) |
1556
+
1557
+ ```json
1558
+ {
1559
+ "teamwork": {
1560
+ "power": 4
1561
+ }
1562
+ }
1563
+ ```
1564
+
1565
+ ## token_replacement
1566
+
1567
+ 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.
1568
+
1569
+ Rules: CR 614.1a, CR 614.16, CR 111.1, CR 616.1
1570
+
1571
+ | Parameter | Description |
1572
+ | --- | --- |
1573
+ | `token` | "Treasure" | "Clue" | "Food" | {card data} |
1574
+
1575
+ ```json
1576
+ {
1577
+ "token_replacement": {
1578
+ "token": {
1579
+ "name": "Illusion",
1580
+ "types": [
1581
+ "artifact",
1582
+ "creature"
1583
+ ],
1584
+ "subtypes": [
1585
+ "illusion"
1586
+ ],
1587
+ "power": 3,
1588
+ "toughness": 3
1589
+ }
1590
+ }
1591
+ }
1592
+ ```
1593
+
1594
+ ## triggered
1595
+
1596
+ A triggered ability: when its trigger condition happens, it is put on the stack the next time a player would receive priority (in APNAP order), with targets chosen then.
1597
+
1598
+ Rules: CR 603.2, CR 603.3, CR 603.3b, CR 603.3d
1599
+
1600
+ | Parameter | Description |
1601
+ | --- | --- |
1602
+ | `when` | a trigger condition, e.g. {"enters": {}} |
1603
+ | `targets` | list of target filters |
1604
+ | `effects` | list of effects |
1605
+ | `if` | condition: an intervening "if", checked when it triggers and on resolution (CR 603.4) |
1606
+ | `while` | condition checked only when it triggers ("whenever you attack while ...", CR 603.2) |
1607
+ | `limit` | "once_each_turn": it triggers at most once each turn (per object) |
1608
+ | `zone` | "graveyard": the ability functions only while its card is in a graveyard (CR 113.6k) |
1609
+
1610
+ ```json
1611
+ {
1612
+ "triggered": {
1613
+ "when": {
1614
+ "enters": {}
1615
+ },
1616
+ "effects": [
1617
+ {
1618
+ "draw": {
1619
+ "amount": 1
1620
+ }
1621
+ }
1622
+ ]
1623
+ }
1624
+ }
1625
+ ```
1626
+
1627
+ ## ward
1628
+
1629
+ Ward: whenever this permanent becomes the target of a spell or ability an opponent controls, counter that spell or ability unless its controller pays `cost`: a mana cost, or a list of costs ("Ward—Pay 2 life", "Ward—Discard a card or pay {2}" with `one_of`). With `waterbend`, they waterbend that cost: "Ward—Waterbend {4}".
1630
+
1631
+ Rules: CR 702.21a, CR 601.2c, CR 603.2, CR 701.6a, CR 701.67a
1632
+
1633
+ | Parameter | Description |
1634
+ | --- | --- |
1635
+ | `cost` | mana cost string, e.g. "{2}", or a list of costs, e.g. [{"pay_life": 2}] |
1636
+ | `waterbend` | mana cost string, instead of cost |
1637
+
1638
+ ```json
1639
+ {
1640
+ "ward": {
1641
+ "cost": "{2}"
1642
+ }
1643
+ }
1644
+ ```
1645
+
1646
+ ## warp
1647
+
1648
+ 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.
1649
+
1650
+ 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
1651
+
1652
+ | Parameter | Description |
1653
+ | --- | --- |
1654
+ | `cost` | mana cost string, or a list of costs |
1655
+
1656
+ ```json
1657
+ {
1658
+ "warp": {
1659
+ "cost": "{1}{R}"
1660
+ }
1661
+ }
1662
+ ```
1663
+
1664
+ ## web_slinging
1665
+
1666
+ Web-slinging: you may cast this spell by paying `cost` and returning a tapped creature you control to its owner's hand rather than its mana cost. The creature is a `choose_cost` decision, returned as the spell becomes cast. Cast option `via: "alt:<ref>"`.
1667
+
1668
+ Rules: CR 702.188a, CR 118.9, CR 601.2b, CR 601.2f, CR 601.2h
1669
+
1670
+ | Parameter | Description |
1671
+ | --- | --- |
1672
+ | `cost` | mana cost string, or a list of costs |
1673
+
1674
+ ```json
1675
+ {
1676
+ "web_slinging": {
1677
+ "cost": "{2}{G}"
1678
+ }
1679
+ }
1680
+ ```