1
0
Fork 0

Fixed effect marker not being removed on ship list

This commit is contained in:
Michaël Lemaire 2017-01-23 17:33:13 +01:00
parent a0d4ec6720
commit f141a705c2
2 changed files with 5 additions and 2 deletions

1
TODO
View file

@ -6,6 +6,7 @@
* Mobile: display tooltips larger and on the side of screen where the finger is not * Mobile: display tooltips larger and on the side of screen where the finger is not
* Mobile: targetting in two times, using a draggable target indicator * Mobile: targetting in two times, using a draggable target indicator
* AI: apply safety distances to move actions * AI: apply safety distances to move actions
* AI: bully AI crashes when winning a battle (trying to move toward null ship!)
* Add a defeat screen (game over for now) * Add a defeat screen (game over for now)
* Add a victory screen, with loot display * Add a victory screen, with loot display
* Add retreat from battle * Add retreat from battle

View file

@ -252,18 +252,20 @@ module SpaceTac.Game {
this.recoverActionPoints(); this.recoverActionPoints();
// Decrement sticky effects duration // Decrement sticky effects duration
let removed_effects: EffectRemovedEvent[] = [];
this.temporary_effects = this.temporary_effects.filter((effect: TemporaryEffect): boolean => { this.temporary_effects = this.temporary_effects.filter((effect: TemporaryEffect): boolean => {
if (effect.duration <= 1) { if (effect.duration <= 1) {
this.addBattleEvent(new EffectRemovedEvent(this, effect)); removed_effects.push(new EffectRemovedEvent(this, effect));
return false; return false;
} else { } else {
return true; return true;
} }
}); });
this.temporary_effects.forEach((effect: TemporaryEffect) => { this.temporary_effects.forEach(effect => {
effect.duration -= 1; effect.duration -= 1;
this.addBattleEvent(new EffectDurationChangedEvent(this, effect, effect.duration + 1)); this.addBattleEvent(new EffectDurationChangedEvent(this, effect, effect.duration + 1));
}); });
removed_effects.forEach(effect => this.addBattleEvent(effect));
} }
// Add a temporary effect // Add a temporary effect