Expand description
CR 613 layer system — continuous effect application.
Mirrors Java Forge’s GameAction.checkStaticAbilities() and
StaticAbilityContinuous.applyContinuousAbility().
§How to use
Call apply_continuous_effects after any event that could change which
static abilities are active (card entering/leaving the battlefield, spell
resolution, etc.):
ⓘ
apply_continuous_effects(&mut game);The function resets all derived fields (static_power_modifier,
static_toughness_modifier, static_set_power, static_set_toughness,
granted_keywords, cant_attack_static, cant_block_static) and
recomputes them from scratch.
§Layer ordering (CR 613)
- Copy effects (not yet implemented)
- Control-changing
- Text-changing (not yet implemented)
- Type-changing →
Layer::Type - Color-changing →
Layer::Color - Ability-adding/removing →
Layer::Ability7a. CDA P/T →Layer::Characteristic7b. Set P/T →Layer::SetPT7c. Modify P/T →Layer::ModifyPT7d. Counters (handled intrinsically byCard::power()) - Forge rules-modifying layer →
Layer::Rules
Functions§
- apply_
continuous_ effects - Recompute all continuously-applied static-ability effects for the current game state.
- apply_
etb_ tapped - Apply ETB-tapped effects to
entering_cardas it enters the battlefield. - apply_
etb_ tapped_ with_ agents - classify_
static_ layers - CR 613 layers a
Continuousstatic contributes to. - get_
etb_ unless_ life_ cost - Check if a card has a shock-land-style “enters tapped unless you pay life” effect.
- get_
etb_ unless_ reveal_ cost - Check if a card has a “enters tapped unless you reveal a
from hand” effect. - prompt_
etb_ tapped_ replacement_ with_ agents