multiple drubs

main
HeNine 1 year ago
parent 110eefd597
commit 35616e74cc

@ -13,10 +13,9 @@ fn main() {
loop {
let mut bob = get_bob();
let mut drub = get_drub();
let mut drub2 = get_drub();
let mut drubs = (0..2).map(|_| get_drub()).collect::<Vec<_>>();
if let Some(turns) = make_them_fight(vec![&mut bob], vec![&mut drub, &mut drub2]) {
if let Some(turns) = make_them_fight(vec![&mut bob], drubs.iter_mut().collect()) {
battles += 1.0;
total_turns += turns as f64;
@ -28,7 +27,7 @@ fn main() {
println!("Drub died in {} turns.", turns)
}
if (a * b) / (f64::powi(a + b, 2) * (a + b + 1.0)) <= 0.00001 {
if (a * b) / (f64::powi(a + b, 2) * (a + b + 1.0)) <= 0.0001 {
break;
}
} else {

@ -28,7 +28,7 @@ pub fn get_drub() -> Character {
String::from("Drub"),
Class::NPC,
Class::NPC,
StatBlock::from((2, 3, 2, 0, 1, 0, -3, -2)),
StatBlock::from((1, 3, 1, 0, 1, 0, -3, -2)),
StatBlock::default(),
Armor::Light,
WeaponType::SimpleWeapon.create_weapon(String::from("Knife")),

Loading…
Cancel
Save