pub fn score_damage(&mut self, total_score: u32, score_linger_rate: u32) -> u32 {
        let dist = rand_distr::Normal::new(score_linger_rate as f32, (total_score / 2_000) as f32)
            .unwrap_throw();
        let damage = dist.sample(&mut self.rng);
        // gloo_console::debug!("lingering score damage:", damage);

        (damage as u32).clamp(0, total_score / 5)
    }
/// Determine how much of the score to deduct.
Determine how much of the score to deduct.
Determine how much of the score to deduct .
pub fn score_damage(&mut self, total_score: u32, score_linger_rate: u32) -> u32 {
        let dist = rand_distr::Normal::new(score_linger_rate as f32, (total_score / 2_000) as f32)
            .unwrap_throw();
        let damage = dist.sample(&mut self.rng);
        // gloo_console::debug!("lingering score damage:", damage);
        (damage as u32).clamp(0, total_score / 5)
    }
pub fn score_damage ( & mut self , total_score : u32 , score_linger_rate : u32 ) -> u32 { let dist = rand_distr :: Normal :: new ( score_linger_rate as f32 , ( total_score / 2_000 ) as f32 ) . unwrap_throw ( ) ; let damage = dist . sample ( & mut self . rng ) ; // gloo_console::debug!("lingering score damage:", damage); ( damage as u32 ) . clamp ( 0 , total_score / 5 ) }
Determine how much of the score to deduct.
Determine how much of the score to deduct .
&mut self
total_score
u32
score_linger_rate
u32
&mut self
total_score
u32
score_linger_rate
u32