changed rng.gen_range(1..=2) to rng.gen_bool(0.5)

This commit is contained in:
horblegorble
2024-06-26 20:02:00 +10:00
parent 14c5ea562e
commit 21a51161bd

View File

@ -4912,9 +4912,8 @@ impl<'a> AgentData<'a> {
}
// otherwise, randomise between firebreath and pumpkin
else {
let randomise: u8 = rng.gen_range(1..=2);
match randomise {
1 => controller.push_basic_input(InputKind::Secondary), // firebreath
match rng.gen_bool(0.5) {
true => controller.push_basic_input(InputKind::Secondary), // firebreath
_ => controller.push_basic_input(InputKind::Ability(0)), // pumpkin
}
}
@ -6221,9 +6220,8 @@ impl<'a> AgentData<'a> {
// randomise in shockwave range
else if attack_data.dist_sqrd < (SHOCKWAVE_RANGE * SHOCKWAVE_RANGE_FACTOR).powi(2)
{
let randomise: u8 = rng.gen_range(1..=2);
match randomise {
1 => controller.push_basic_input(InputKind::Secondary), // barrage
match rng.gen_bool(0.5) {
true => controller.push_basic_input(InputKind::Secondary), // barrage
_ => controller.push_basic_input(InputKind::Ability(0)), // shockwave
}
}