manabrew_engine/ability/effects/regeneration_effect.rs
1//! Regeneration — set up a regeneration shield (older mechanic).
2
3use forge_foundation::ZoneType;
4
5use super::EffectContext;
6
7/// Struct form of this effect so it can participate in the
8/// `SpellAbilityEffect` trait hierarchy — mirrors Java's
9/// `RegenerationEffect` class extending `SpellAbilityEffect`.
10#[manabrew_engine_macros::spell_effect(RegenerationEffect)]
11fn resolve(ctx: &mut EffectContext, sa: &crate::spellability::SpellAbility) {
12 if let Some(target) = sa.target_chosen.target_card.or(sa.source) {
13 if ctx.game.card(target).zone == ZoneType::Battlefield {
14 ctx.game.card_mut(target).regeneration_shields += 1;
15 }
16 }
17}