pub enum TurnEvent<P: BattleProvider + ?Sized> {
MoveUsed {
who: BattlerRef,
move_: P::Move,
},
ActionPrevented {
who: BattlerRef,
reason: EffectResult,
},
Missed {
who: BattlerRef,
target: BattlerRef,
},
Damage {
who: BattlerRef,
target: BattlerRef,
amount: u16,
critical: bool,
effectiveness: f32,
},
Faint {
who: BattlerRef,
},
Switched {
side: u8,
to_slot: usize,
},
Residual {
result: EffectResult,
},
Effect {
result: EffectResult,
},
}Expand description
A single observable event produced during turn execution.
Generic over the provider so move identifiers stay game-defined. The game translates these into its own UI / animation steps.
Variants§
MoveUsed
A battler began its action with the given chosen move.
ActionPrevented
A battler’s action was prevented by the pre-move gate (sleep, freeze, flinch, full paralysis, recharge, …). Carries the gate’s reason.
Missed
A move missed (failed accuracy_check,
including the Gen-1 1/256 miss).
Damage
Damage was dealt to target.
Faint
A battler fainted (HP reached 0).
Fields
who: BattlerRefThe fainted battler.
Switched
A battler switched to another party slot.
Residual
An end-of-turn residual effect resolved (poison/burn tick, leech, …).
Fields
result: EffectResultThe residual result.
Effect
A generic effect result the game wishes to surface (catch/run handling, item use, forced actions, …).
Fields
result: EffectResultThe effect result.