pub fn human_detected_bug(
        &mut self,
        human: &GameHuman,
        task: &GameTask,
        project_complexity: u32,
    ) -> bool {
        if task.bugs == 0 {
            return false;
        }

        for _ in task.bugs_found..task.bugs {
            let det = 2_000 + task.difficulty * 70 + project_complexity * 60;
            let num = 10 + human.experience / 2;
            // triple the chances if reviewed by someone else
            let num = if task.developed_by != Some(human.id) {
                num * 3
            } else {
                num
            };

            if self.rng.gen_ratio(num.min(det) as u32, det) {
                return true;
            }
        }
        false
    }
/// Roll for whether the human discovered a bug
/// while reviewing a task.
Roll for whether the human discovered a bug
while reviewing a task.
Roll for whether the human discovered a bug while reviewing a task .
pub fn human_detected_bug(
        &mut self,
        human: &GameHuman,
        task: &GameTask,
        project_complexity: u32,
    ) -> bool {
        if task.bugs == 0 {
            return false;
        }
        for _ in task.bugs_found..task.bugs {
            let det = 2_000 + task.difficulty * 70 + project_complexity * 60;
            let num = 10 + human.experience / 2;
            // triple the chances if reviewed by someone else
            let num = if task.developed_by != Some(human.id) {
                num * 3
            } else {
                num
            };
            if self.rng.gen_ratio(num.min(det) as u32, det) {
                return true;
            }
        }
        false
    }
pub fn human_detected_bug ( & mut self , human : & GameHuman , task : & GameTask , project_complexity : u32 , ) -> bool { if task . bugs == 0 { return false ; } for _ in task . bugs_found .. task . bugs { let det = 2_000 + task . difficulty * 70 + project_complexity * 60 ; let num = 10 + human . experience / 2 ; // triple the chances if reviewed by someone else let num = if task . developed_by != Some ( human . id ) { num * 3 } else { num } ; if self . rng . gen_ratio ( num . min ( det ) as u32 , det ) { return true ; } } false }
Roll for whether the human discovered a bug
while reviewing a task.
Roll for whether the human discovered a bug while reviewing a task .
&mut self
human
&GameHuman
task
&GameTask
project_complexity
u32
&mut self
human
&GameHuman
task
&GameTask
project_complexity
u32