stats nerfed a bit

This commit is contained in:
ntr 2018-12-11 13:50:46 +11:00
parent a24a64c811
commit 17690e434e
2 changed files with 19 additions and 12 deletions

View File

@ -154,21 +154,28 @@ impl Cryp {
pub fn create(mut self) -> Cryp { pub fn create(mut self) -> Cryp {
let mut rng = thread_rng(); let mut rng = thread_rng();
let max = match self.lvl == 64 { let stam_max = 2_u64.pow(self.lvl.into());
true => u64::max_value(),
let stam_min = match self.lvl == 1 {
true => 2_u64,
false => 2_u64.pow(self.lvl.saturating_sub(1).into()), false => 2_u64.pow(self.lvl.saturating_sub(1).into()),
}; };
let min = match self.lvl == 1 { let other_max = match self.lvl == 1 {
true => 2_u64,
false => 2_u64.pow(self.lvl.saturating_sub(1).into()),
};
let other_min = match self.lvl == 1 {
true => 2_u64, true => 2_u64,
false => 2_u64.pow(self.lvl.saturating_sub(2).into()), false => 2_u64.pow(self.lvl.saturating_sub(2).into()),
}; };
self.xp = max; self.xp = stam_max;
self.phys_dmg.set(rng.gen_range(min, max)); self.phys_dmg.set(rng.gen_range(other_min, other_max));
self.spell_dmg.set(rng.gen_range(min, max)); self.spell_dmg.set(rng.gen_range(other_min, other_max));
self.stamina.set(rng.gen_range(min, max)); self.stamina.set(rng.gen_range(stam_min, stam_max));
self.hp.set(self.stamina.base); self.hp.set(self.stamina.base);
self self

View File

@ -690,14 +690,14 @@ fn generate_mob(lvl: u8) -> Cryp {
let mut rng = thread_rng(); let mut rng = thread_rng();
// rng panics on min == max // rng panics on min == max
let mob_lvl: u8 = match lvl { // let mob_lvl: u8 = match lvl {
1 => 1, // 1 => 1,
_ => rng.gen_range(lvl.saturating_sub(2), lvl) // _ => rng.gen_range(lvl.saturating_sub(2), lvl)
}; // };
return Cryp::new() return Cryp::new()
.named(&"bamboo basher".to_string()) .named(&"bamboo basher".to_string())
.level(mob_lvl) .level(lvl)
.create(); .create();
} }