From 5ad13968d6e15074f0ab6689c017f33f16a608ba Mon Sep 17 00:00:00 2001 From: ntr Date: Tue, 10 Dec 2019 12:25:23 +1000 Subject: [PATCH] stats --- core/fixme.md | 2 ++ core/src/construct.rs | 6 ++++-- core/src/game.rs | 9 ++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/core/fixme.md b/core/fixme.md index ff73860f..2aba1e61 100644 --- a/core/fixme.md +++ b/core/fixme.md @@ -3,6 +3,8 @@ last round of animations skipped cause no skill phase to add new vec ko constructs are still casting +check silence skill multiplier + check for ko in cast_modifier tick skips for triage etc diff --git a/core/src/construct.rs b/core/src/construct.rs index b3155f54..462ebaf3 100644 --- a/core/src/construct.rs +++ b/core/src/construct.rs @@ -129,6 +129,7 @@ pub enum Stat { Speed, Cooldowns, + EffectsCount, Skills(Colour), } @@ -496,8 +497,9 @@ impl Construct { Stat::Speed => self.speed(), - Stat::Cooldowns => unimplemented!(), - Stat::Skills(Colour) => unimplemented!(), + Stat::Cooldowns => self.skills.iter().filter(|cs| cs.cd.is_some()).count(), + Stat::Skills(colour) => self.skills.iter().filter(|cs| cs.skill.colours().contains(&colour)).count(), + Stat::EffectsCount => self.effects.len(), } } diff --git a/core/src/game.rs b/core/src/game.rs index 7040b95b..f8e003f2 100644 --- a/core/src/game.rs +++ b/core/src/game.rs @@ -570,15 +570,14 @@ impl Game { Value::Fixed { value } => *value, - Value::Cooldowns { construct, mult } => unimplemented!(), + Value::Cooldowns { construct, mult } => + self.construct_by_id(*construct).unwrap().stat(Stat::Cooldowns).pct(*mult), Value::Effects { construct, mult } => - self.construct_by_id(*construct).unwrap().effects.len().pct(*mult), + self.construct_by_id(*construct).unwrap().stat(Stat::EffectsCount).pct(*mult), Value::ColourSkills { construct, colour, mult } => - self.construct_by_id(*construct).unwrap().skills.iter() - .filter(|cs| cs.) - .count(), + self.construct_by_id(*construct).unwrap().stat(Stat::Skills(*colour)).pct(*mult), Value::DamageTaken { construct, colour, mult } => events.iter().fold(0, |dmg, e| match e {