hide hidden effects in removal

This commit is contained in:
ntr 2019-12-20 12:59:10 +10:00
parent 122c385f1c
commit 443b3bb3ac
2 changed files with 11 additions and 8 deletions

View File

@ -1,5 +1,3 @@
# FIXME
game ready not auto starting resolve phase
slay animation still looks a bit weird
triaged / decayed / siphoned / electrocute effect removal with purify / purge

View File

@ -950,7 +950,10 @@ impl Construct {
if self.is_ko() { return vec![Event::TargetKo { construct: self.id }] }
if let Some(p) = self.effects.iter().position(|ce| ce.effect == effect) {
self.effects.remove(p);
let ce = self.effects.remove(p);
if ce.effect.hidden() { return vec![] }
return vec![Event::Removal {
construct: self.id,
effect: effect,
@ -986,11 +989,13 @@ impl Construct {
if self.is_ko() { return vec![Event::TargetKo { construct: self.id }] }
while let Some(ce) = self.effects.pop() {
removals.push(Event::Removal {
construct: self.id,
effect: ce.effect,
display: EventConstruct::new(self),
});
if !ce.effect.hidden() {
removals.push(Event::Removal {
construct: self.id,
effect: ce.effect,
display: EventConstruct::new(self),
});
}
}
return removals;