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 * Express something
* Prove something * Prove something
# Key Mechanics
* 10d chaos maths, not rock paper scissors
# WORK WORK # WORK WORK
broken skills broken skills
@ -11,6 +14,11 @@ strangle
## NOW ## NOW
* clean up categories * 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 ## SOON
* aoe skills * aoe skills

View File

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