Expand description
The effect provider, per-effect state arena, per-move scratch, and the
split-borrow BattleCtx (design §3).
The borrow-checker crux: never hand a handler &mut BattleState plus
borrowed battler refs. Instead, hand it a BattleCtx of split accessors and
resolve via the relay fold (the dispatch loop in
dispatch owns iteration and re-borrows per step).
Structs§
- Battle
Ctx - Split-borrow context handed to every handler (design §3.2). A handler’s only mutable path into the battle is through this struct’s accessors.
- Effect
State - One live effect’s mutable per-instance state, held in an arena keyed by id
(design §3.1).
kindis the game’s typed counter enum, so the compiler checks every counter (no positional slot bag). - Move
Context - Per-move scratch shared across a move’s event chain (design §3.2): the crit flag, the rolled damage, the miss flag, and the last damage dealt (the canonical home for Counter/Bide reads — design §9 open question).
Enums§
- Effect
Host - Where an effect is hosted (design §3.1, the broadened addressing). A
cross-gen battle hosts effects not only on a battler (volatiles, ability,
item) but on a side (screens, hazards, Wish) or the field (weather,
terrain, Trick Room).
EffectHostis the 3-way scope the engine routes by.
Traits§
- Effect
Provider - The game’s effect registry, extending
BattleProvider(design §1.5).