From 2e698b3b55228ba27fe334272edf37d62b4700d8 Mon Sep 17 00:00:00 2001 From: ntr Date: Wed, 10 Apr 2019 21:04:19 +1000 Subject: [PATCH] defenssives --- server/WORKLOG.md | 19 +++++++++---------- server/src/skill.rs | 16 +++++++++++++--- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/server/WORKLOG.md b/server/WORKLOG.md index 093775c7..61b88c30 100644 --- a/server/WORKLOG.md +++ b/server/WORKLOG.md @@ -19,27 +19,26 @@ *CLIENT* * general * icons change with % + * find new icons for colours / life * game * resolve animations + effects *SERVER* -var / skill info rpc - thresholds / bonuses - sell cost - etc - -change initial vbox to be more intuitive - -siphon might have a prob -put ticks on stack at start of phase - cryp vbox update defensives in skill.rs consolidate buffs debuffs and disables no more red/blue +var / skill info rpc + thresholds / bonuses + sell cost + etc + +siphon might have a prob +put ticks on stack at start of phase + make strike *really* hit first / resolve at same time? ## SOON diff --git a/server/src/skill.rs b/server/src/skill.rs index 160446ce..7237cf7d 100644 --- a/server/src/skill.rs +++ b/server/src/skill.rs @@ -5,9 +5,6 @@ use cryp::{Cryp, CrypEffect, EffectMeta, Stat}; use vbox::{Var}; pub fn resolve(skill: Skill, source: &mut Cryp, target: &mut Cryp, mut resolutions: Vec) -> Resolutions { - let mut rng = thread_rng(); - let _base: u64 = rng.gen(); - if let Some(disable) = source.disabled(skill) { resolutions.push(Resolution::new(source, target).event(Event::Disable { disable, skill })); return resolutions; @@ -753,13 +750,26 @@ impl Skill { } pub fn defensive(&self) -> bool { + let mut rng = thread_rng(); + match self { Skill::Heal | Skill::Triage | Skill::Empower | Skill::Purify | Skill::Parry | + Skill::Clutch | + Skill::Shield | + Skill::Recharge | + Skill::Reflect | + Skill::Haste | + Skill::Invert | + Skill::Amplify | + Skill::Hostility | + Skill::Corrupt | Skill::Block => true, + + Skill::Banish => rng.gen_bool(0.5), _ => false, } }