pub fn human_introduced_bug(
        &mut self,
        human: &GameHuman,
        task: &GameTask,
        project_complexity: u32,
    ) -> bool {
        let det = 3_500 + human.experience * 16;
        let mut num = task.difficulty * project_complexity / 2;

        // if bugs were found before,
        // that means we're fixing previous bugs,
        // so less chance of introducing new ones
        if task.bugs_found > 0 {
            num /= 8
        };

        self.rng.gen_ratio(num.min(det) as u32, det)
    }
/// Roll for whether the human introduced a bug
/// while working on the given task.
Roll for whether the human introduced a bug
while working on the given task.
Roll for whether the human introduced a bug while working on the given task .
pub fn human_introduced_bug(
        &mut self,
        human: &GameHuman,
        task: &GameTask,
        project_complexity: u32,
    ) -> bool {
        let det = 3_500 + human.experience * 16;
        let mut num = task.difficulty * project_complexity / 2;
        // if bugs were found before,
        // that means we're fixing previous bugs,
        // so less chance of introducing new ones
        if task.bugs_found > 0 {
            num /= 8
        };
        self.rng.gen_ratio(num.min(det) as u32, det)
    }
pub fn human_introduced_bug ( & mut self , human : & GameHuman , task : & GameTask , project_complexity : u32 , ) -> bool { let det = 3_500 + human . experience * 16 ; let mut num = task . difficulty * project_complexity / 2 ; // if bugs were found before, // that means we're fixing previous bugs, // so less chance of introducing new ones if task . bugs_found > 0 { num /= 8 } ; self . rng . gen_ratio ( num . min ( det ) as u32 , det ) }
Roll for whether the human introduced a bug
while working on the given task.
Roll for whether the human introduced a bug while working on the given task .
&mut self
human
&GameHuman
task
&GameTask
project_complexity
u32
&mut self
human
&GameHuman
task
&GameTask
project_complexity
u32