Skip to main content

manabrew_engine/ability/effects/
blight_effect.rs

1//! Blight — mark a permanent with a blight counter or effect.
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/// `BlightEffect` class extending `SpellAbilityEffect`.
10#[manabrew_engine_macros::spell_effect(BlightEffect)]
11fn resolve(ctx: &mut EffectContext, sa: &crate::spellability::SpellAbility) {
12    if let Some(target) = sa.target_chosen.target_card {
13        if ctx.game.card(target).zone == ZoneType::Battlefield {
14            let ct = super::parse_counter_type("BLIGHT");
15            ctx.game.card_mut(target).add_counter(&ct, 1);
16        }
17    }
18}