Function law_power_multiplier_for

Source
pub fn law_power_multiplier_for(
    units: i64,
    capacity: i64,
    cap_permyriad: i64,
) -> f64
Expand description

1 + delivered × cap / capacity, in permyriad, clamped at the cap.

A free function because the Bridge Law stones move capacity and cap away from the configured pair and still have to price amplification the same way.

Multiply before dividing, on integers. delivered / capacity in f64 turns 3/10 into 0.2999… and a 1.15 multiplier into 1.1499999999999999; that multiplier goes into damage, which is floored, so the difference is a whole point of damage at the boundary. On integers the two forms are identical.