mirror of
https://github.com/correl/mage.git
synced 2024-12-25 19:25:41 +00:00
fixed delayed triggered abilities
This commit is contained in:
parent
65ce0c3948
commit
90c7079bfa
2 changed files with 14 additions and 0 deletions
|
@ -48,6 +48,19 @@ import mage.game.events.GameEvent;
|
|||
public DelayedTriggeredAbilities copy() {
|
||||
return new DelayedTriggeredAbilities(this);
|
||||
}
|
||||
|
||||
public void checkTriggers(GameEvent event, Game game) {
|
||||
if (this.size() > 0) {
|
||||
Iterator<DelayedTriggeredAbility> it = this.iterator();
|
||||
while (it.hasNext()) {
|
||||
DelayedTriggeredAbility ability = it.next();
|
||||
if (ability.checkTrigger(event, game)) {
|
||||
ability.trigger(game, ability.controllerId);
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -424,6 +424,7 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
|
||||
public void handleEvent(GameEvent event, Game game) {
|
||||
watchers.watch(event, game);
|
||||
delayed.checkTriggers(event, game);
|
||||
triggers.checkTriggers(event, game);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue