use levels still

This commit is contained in:
ntr 2019-01-08 15:44:11 +11:00
parent 9ea6ac20d0
commit e1161d8ce8
2 changed files with 10 additions and 27 deletions

View File

@ -173,35 +173,18 @@ 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_min = 512u64.saturating_mul(self.lvl.into());
// true => u64::max_value(), let stam_max = 1024u64.saturating_mul(self.lvl.into());
// false => match self.lvl == 1 {
// true => 4_u64,
// false => 2_u64.pow(self.lvl.into()),
// },
// };
// let stam_min = match self.lvl == 1 { let stat_min = 128u64.saturating_mul(self.lvl.into());
// true => 2_u64, let stat_max = 256u64.saturating_mul(self.lvl.into());
// 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()),
// };
match stat { match stat {
Stat::PhysicalDamage => self.phys_dmg.set(rng.gen_range(128, 256)), Stat::PhysicalDamage => self.phys_dmg.set(rng.gen_range(stat_min, stat_max)),
Stat::SpellDamage => self.spell_dmg.set(rng.gen_range(128, 256)), Stat::SpellDamage => self.spell_dmg.set(rng.gen_range(stat_min, stat_max)),
Stat::Speed => self.speed.set(rng.gen_range(128, 256)), Stat::Speed => self.speed.set(rng.gen_range(stat_min, stat_max)),
Stat::Stamina => { Stat::Stamina => {
self.stamina.set(rng.gen_range(512, 1024)); self.stamina.set(rng.gen_range(stam_min, stam_max));
self.hp.set(self.stamina.base) self.hp.set(self.stamina.base)
}, },
_ => panic!("{:?} not a rollable stat", stat), _ => panic!("{:?} not a rollable stat", stat),
@ -539,7 +522,7 @@ pub fn cryp_spawn(params: CrypSpawnParams, tx: &mut Transaction, account: &Accou
let cryp = Cryp::new() let cryp = Cryp::new()
.named(&params.name) .named(&params.name)
.learn(Skill::Attack) .learn(Skill::Attack)
.level(10) .level(1)
.set_account(account.id) .set_account(account.id)
.create(); .create();

View File

@ -602,7 +602,7 @@ impl Skill {
// Strangle // Strangle
Skill::Stun => 5, Skill::Stun => 2,
Skill::Evasion => 3, // additional layer of dmg avoidance Skill::Evasion => 3, // additional layer of dmg avoidance
// ----------------- // -----------------