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 # FIXME
game ready not auto starting resolve phase game ready not auto starting resolve phase
slay animation still looks a bit weird
triaged / decayed / siphoned / electrocute effect removal with purify / purge 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 self.is_ko() { return vec![Event::TargetKo { construct: self.id }] }
if let Some(p) = self.effects.iter().position(|ce| ce.effect == effect) { 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 { return vec![Event::Removal {
construct: self.id, construct: self.id,
effect: effect, effect: effect,
@ -986,11 +989,13 @@ impl Construct {
if self.is_ko() { return vec![Event::TargetKo { construct: self.id }] } if self.is_ko() { return vec![Event::TargetKo { construct: self.id }] }
while let Some(ce) = self.effects.pop() { while let Some(ce) = self.effects.pop() {
removals.push(Event::Removal { if !ce.effect.hidden() {
construct: self.id, removals.push(Event::Removal {
effect: ce.effect, construct: self.id,
display: EventConstruct::new(self), effect: ce.effect,
}); display: EventConstruct::new(self),
});
}
} }
return removals; return removals;