diff --git a/core/fixme.md b/core/fixme.md index 4e496e5e..53ce1e4f 100644 --- a/core/fixme.md +++ b/core/fixme.md @@ -3,6 +3,6 @@ last round of animations skipped cause no skill phase to add new vec check silence skill multiplier game ready not auto starting resolve phase -purify conditional healing +purify conditional healing absorb post resolve diff --git a/core/src/construct.rs b/core/src/construct.rs index cf2d7b56..42e56fce 100644 --- a/core/src/construct.rs +++ b/core/src/construct.rs @@ -518,7 +518,7 @@ impl Construct { 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(), + Stat::EffectsCount => self.effects.iter().filter(|ce| !ce.effect.hidden()).count(), _ => panic!("{:?} cannot be calculated without an amount", stat), } @@ -893,6 +893,7 @@ impl Construct { } pub fn effect_add(&mut self, effect: ConstructEffect) -> Vec { + let mut results = vec![]; if self.is_ko() { return vec![Event::TargetKo { construct: self.id }] } if let Some(p) = self.effects.iter().position(|ce| ce.effect == effect.effect) { @@ -902,19 +903,20 @@ impl Construct { self.effects[p] = effect; } else { // new effect - // info!("{:?} {:?} adding effect", self.name, effect.effect); self.effects.push(effect); } - // todo modified durations cause of buffs - let result = Event::Effect { - construct: self.id, - effect: effect.effect, - duration: effect.duration, - display: EventConstruct::new(self) + // probably not a good idea + if !effect.effect.hidden() { + results.push(Event::Effect { + construct: self.id, + effect: effect.effect, + duration: effect.duration, + display: EventConstruct::new(self) + }); }; - return vec![result]; + return results; } pub fn effect_remove(&mut self, effect: Effect) -> Vec { diff --git a/core/src/effect.rs b/core/src/effect.rs index d9d4e7b8..edc74998 100644 --- a/core/src/effect.rs +++ b/core/src/effect.rs @@ -117,6 +117,18 @@ impl Effect { } } + // hidden effects are used generally for immunities + // they are not displayed on client + // and not included in counts + pub fn hidden(&self) -> bool { + match self { + Effect::Siphoned => true, + Effect::Decayed => true, + Effect::Triaged => true, + _ => false, + } + } + pub fn disables_skill(&self, skill: Skill) -> bool { if skill.is_tick() { return false; diff --git a/core/src/game.rs b/core/src/game.rs index 708e98d6..7a7e7c01 100644 --- a/core/src/game.rs +++ b/core/src/game.rs @@ -995,7 +995,7 @@ impl EventConstruct { red: construct.stat(Stat::RedLife), green: construct.stat(Stat::GreenLife), blue: construct.stat(Stat::BlueLife), - effects: construct.effects.clone(), + effects: construct.effects.iter().cloned().filter(|ce| !ce.effect.hidden()).collect(), } } }