···4242 ..Self::default()
4343 }
4444 }
4545+4646+ /// Returns a new modifier scaled by a fraction.
4747+ ///
4848+ /// When the scale is zero, the bonus will be zero while the multiplier will be one.
4949+ pub fn scaled(&self, fraction: f32) -> Self {
5050+ Self {
5151+ bonus: (self.bonus as f32 * fraction) as i32,
5252+ multiplier: (1.0 - fraction) * 1.0 + fraction * self.multiplier,
5353+ }
5454+ }
4555}
46564757impl Default for Modifier {
+3-1
immediate_stats/src/stat.rs
···8080 self.multiplier *= modifier.multiplier;
8181 }
82828383- /// Scales and applies the [`Modifier`] values to the bonus and multiplier.
8383+ /// [Scales](Modifier::scaled) and applies the [`Modifier`] values to the bonus and multiplier.
8484+ ///
8585+ /// When the scale is zero, the bonus will be zero while the multiplier will be one.
8486 ///
8587 /// This adds the bonuses, and multiplies the multipliers.
8688 pub fn apply_scaled(&mut self, modifier: Modifier, fraction: f32) {