pub enum DamageValue {
Const(u16),
UserLevel,
RngScaledLevel {
num: u32,
den: u32,
},
}Expand description
The source of a Op::SetDamage value (blueprint 15 §2/§3 — the
special/fixed damage moves that bypass the type chart: Seismic Toss /
Night Shade = the user’s level, Dragon Rage = 40, Sonic Boom = 20, Psywave =
rng·(num/den)·level). Every variant is pure (no entropy except the
explicit RngScaledLevel which draws ONE
ctx.rng byte at the op’s ordinal). Game-agnostic: the only game reach is the
per-battler level, supplied by
RuleBindings::battler_level.
Variants§
Const(u16)
A fixed constant (Dragon Rage = 40, Sonic Boom = 20).
UserLevel
The source selector’s level (Seismic Toss / Night Shade).
RngScaledLevel
(rng_byte * num / den * level) then floored at 1 — the Psywave shape
(rng · 1.5 · level / 256, authored as num=…, den=…). Draws exactly ONE
ctx.rng byte (the SOLE entropy in this op), at the op’s ordinal, so the
stream stays a pure function of the op-list.
Trait Implementations§
Source§impl Clone for DamageValue
impl Clone for DamageValue
Source§fn clone(&self) -> DamageValue
fn clone(&self) -> DamageValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more