fix roll numbers

This commit is contained in:
ntr 2019-01-08 15:21:39 +11:00
parent f704b80dfb
commit 9ea6ac20d0
2 changed files with 31 additions and 23 deletions

View File

@ -3,6 +3,9 @@
* Express something
* Prove something
# Key Mechanics
* 10d chaos maths, not rock paper scissors
# WORK WORK
broken skills
@ -11,6 +14,11 @@ strangle
## NOW
* clean up categories
* scale down damage
* why is the text fucked?
* iconography
* full svg buttons to not have to fuck around with text
* FAQ
## SOON
* aoe skills

View File

@ -173,35 +173,35 @@ impl Cryp {
pub fn roll_stat(&mut self, stat: Stat) -> &mut Cryp {
let mut rng = thread_rng();
let stam_max = match self.lvl == 64 {
true => u64::max_value(),
false => match self.lvl == 1 {
true => 4_u64,
false => 2_u64.pow(self.lvl.into()),
},
};
// let stam_max = match self.lvl == 64 {
// true => u64::max_value(),
// false => match self.lvl == 1 {
// true => 4_u64,
// false => 2_u64.pow(self.lvl.into()),
// },
// };
let stam_min = match self.lvl == 1 {
true => 2_u64,
false => 2_u64.pow(self.lvl.saturating_sub(1).into()),
};
// let stam_min = match self.lvl == 1 {
// true => 2_u64,
// false => 2_u64.pow(self.lvl.saturating_sub(1).into()),
// };
let other_max = match self.lvl == 1 {
true => 4_u64,
false => 2_u64.pow(self.lvl.saturating_sub(1).into()),
};
// let other_max = match self.lvl == 1 {
// true => 4_u64,
// false => 2_u64.pow(self.lvl.saturating_sub(1).into()),
// };
let other_min = match self.lvl == 1 {
true => 2_u64,
false => 2_u64.pow(self.lvl.saturating_sub(2).into()),
};
// let other_min = match self.lvl == 1 {
// true => 2_u64,
// false => 2_u64.pow(self.lvl.saturating_sub(2).into()),
// };
match stat {
Stat::PhysicalDamage => self.phys_dmg.set(rng.gen_range(other_min, other_max)),
Stat::SpellDamage => self.spell_dmg.set(rng.gen_range(other_min, other_max)),
Stat::Speed => self.speed.set(rng.gen_range(other_min, other_max)),
Stat::PhysicalDamage => self.phys_dmg.set(rng.gen_range(128, 256)),
Stat::SpellDamage => self.spell_dmg.set(rng.gen_range(128, 256)),
Stat::Speed => self.speed.set(rng.gen_range(128, 256)),
Stat::Stamina => {
self.stamina.set(rng.gen_range(stam_min, stam_max));
self.stamina.set(rng.gen_range(512, 1024));
self.hp.set(self.stamina.base)
},
_ => panic!("{:?} not a rollable stat", stat),