pub enum ReplacementEvent {
Show 40 variants
Draw {
player: PlayerId,
extra_draws: i32,
is_first_in_draw_step: bool,
},
DamageToCard {
target: CardId,
amount: i32,
source: Option<CardId>,
is_combat: bool,
},
DamageToPlayer {
target: PlayerId,
amount: i32,
source: Option<CardId>,
is_combat: bool,
},
Destroy {
target: CardId,
},
Moved {
card: CardId,
origin: ZoneType,
destination: ZoneType,
is_discard: bool,
counter_map: Option<Vec<CounterMapValue>>,
counter_cause: Option<Box<SpellAbility>>,
counter_is_effect: bool,
after_replacement_static_abilities: Vec<(CardId, Vec<String>)>,
},
GainLife {
player: PlayerId,
amount: i32,
},
CreateToken {
player: PlayerId,
count: i32,
is_effect: bool,
},
AddCounter {
target: GameEntity,
source: Option<PlayerId>,
counter_type: CounterType,
count: i32,
counter_map: Vec<CounterMapValue>,
after_replacement_static_abilities: Vec<(CardId, Vec<String>)>,
cause: Option<Box<SpellAbility>>,
is_effect: bool,
},
GameLoss {
player: PlayerId,
reason: GameLossReason,
},
GameWin {
player: PlayerId,
},
Counter {
card: CardId,
},
ProduceMana {
source: CardId,
activator: PlayerId,
mana: String,
},
Tap {
card: CardId,
},
Untap {
card: CardId,
player: Option<PlayerId>,
},
LifeReduced {
player: PlayerId,
amount: i32,
is_damage: bool,
},
RemoveCounter {
target: CardId,
counter_type: CounterType,
count: i32,
},
DealtDamage {
target: CardId,
amount: i32,
source: Option<CardId>,
},
DrawCards {
player: PlayerId,
count: i32,
},
Mill {
player: PlayerId,
count: i32,
},
PayLife {
player: PlayerId,
amount: i32,
},
Scry {
player: PlayerId,
count: i32,
},
Attached {
card: CardId,
target: CardId,
},
BeginPhase {
player: PlayerId,
phase: PhaseType,
},
BeginTurn {
player: PlayerId,
},
Explore {
card: CardId,
},
DeclareBlocker {
player: PlayerId,
},
AssignDealDamage {
card: CardId,
},
Transform {
card: CardId,
},
TurnFaceUp {
card: CardId,
},
CopySpell {
player: PlayerId,
count: i32,
},
Proliferate {
player: PlayerId,
count: i32,
},
Cascade {
player: PlayerId,
},
Learn {
player: PlayerId,
},
LoseMana {
player: PlayerId,
},
RollDice {
player: PlayerId,
sides: i32,
number: i32,
ignore: i32,
ignore_chosen: HashMap<PlayerId, i32>,
dice_pt_exchanges: HashSet<CardId>,
},
RollPlanarDice {
player: PlayerId,
},
PlanarDiceResult {
player: PlayerId,
},
Planeswalk {
player: PlayerId,
},
SetInMotion {
player: PlayerId,
},
AssembleContraption {
player: PlayerId,
},
}Expand description
A game event that may be subject to one or more replacement effects.
Each variant carries the mutable parameters of the event so that a replacement effect can modify them (e.g. reduce damage to 0, redirect a zone move, etc.).
Mirrors the runParams map passed to ReplacementHandler.run() in Java,
but typed for safety.
Variants§
Draw
A card is being drawn by a player.
extra_draws is incremented by replacements (e.g. Alhammarret’s Archive DrawTwo).
is_first_in_draw_step is true for the first draw in the draw step (not extra draws).
DamageToCard
Damage is being dealt to a permanent.
Fields
DamageToPlayer
Damage is being dealt to a player.
Fields
Destroy
A permanent is being destroyed (lethal damage or destroy effect).
Moved
A card is moving between zones.
Fields
is_discard: boolTrue when this move originates from a discard action.
Mirrors Java’s AbilityKey.Discard in replacement params.
counter_map: Option<Vec<CounterMapValue>>counter_cause: Option<Box<SpellAbility>>GainLife
A player is gaining life.
CreateToken
Token(s) are being created.
is_effect is true when created by a spell/ability effect, false for game rules.
AddCounter
Counter(s) are being added to a permanent.
is_effect is true when placed by a spell/ability, false for ETB keywords/game rules.
Fields
target: GameEntitycounter_type: CounterTypecounter_map: Vec<CounterMapValue>cause: Option<Box<SpellAbility>>GameLoss
A player is losing the game.
GameWin
A player is winning the game.
Counter
A spell is being countered.
ProduceMana
Mana is being produced (for doublers like Mirari’s Wake, Nyxbloom Ancient).
mana is the produced mana string (e.g. “G” or “U U”) that may be modified.
Tap
A permanent is being tapped.
Untap
A permanent is being untapped.
LifeReduced
Life is being reduced (distinct from damage).
RemoveCounter
Counter(s) are being removed from a permanent.
DealtDamage
Damage has been dealt (post-damage).
DrawCards
Multiple cards are being drawn.
Mill
Cards are being milled.
PayLife
Life is being paid as a cost.
Scry
A player is scrying.
Attached
An aura/equipment is being attached.
BeginPhase
A phase is beginning.
BeginTurn
A turn is beginning.
Explore
A creature is exploring.
DeclareBlocker
Blockers are being declared.
AssignDealDamage
Damage is being assigned before dealing.
Transform
A DFC is transforming.
TurnFaceUp
A face-down card is turning face up.
CopySpell
A spell is being copied.
Proliferate
A player is proliferating.
Cascade
Cascade is triggering.
Learn
A player is learning.
LoseMana
Mana is being lost.
RollDice
Dice are being rolled.
Fields
RollPlanarDice
The planar die is being rolled.
PlanarDiceResult
A planar dice result is being applied.
Planeswalk
A player is planeswalking.
SetInMotion
A scheme is being set in motion.
AssembleContraption
A contraption is being assembled.
Trait Implementations§
Source§impl Clone for ReplacementEvent
impl Clone for ReplacementEvent
Source§fn clone(&self) -> ReplacementEvent
fn clone(&self) -> ReplacementEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more