Skip to main content

run_ops

Function run_ops 

Source
pub fn run_ops<P: RulesProvider>(
    ctx: &mut BattleCtx<'_, P>,
    relay: RelayVar,
    target: BattlerRef,
    source: BattlerRef,
    bindings: &P::Bindings,
    hook: &CompiledHook,
) -> HandlerResult
Expand description

The closed primitive interpreter (doc 11 §1.1). Folds the hook’s op-list over relay, returning the engine HandlerResult. Short-circuits on the first Fail/FailSilent exactly like the native fold (dispatch.rs:285); a numeric op produces Set; a side-effecting op produces Unchanged (the relay is threaded through).

Determinism: this fn touches ctx.rng ONLY via the caller’s chance gate (it is not re-drawn here); every op below is a pure ctx/RelayVar/binding operation. No entropy, no clock, no draw-order-affecting iteration.