From 7ae0860355bcc8a4e1a23fc48fed994ccb16027d Mon Sep 17 00:00:00 2001 From: swordshine Date: Sat, 31 May 2014 10:57:26 +0000 Subject: [PATCH] - Move controllerChangeZoneCorrection to checkStaticAbilities --- .../src/main/java/forge/game/GameAction.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/forge-game/src/main/java/forge/game/GameAction.java b/forge-game/src/main/java/forge/game/GameAction.java index f6b6b9f9dd5..1d3270a2cbb 100644 --- a/forge-game/src/main/java/forge/game/GameAction.java +++ b/forge-game/src/main/java/forge/game/GameAction.java @@ -672,9 +672,9 @@ public class GameAction { } /** */ - public final void checkStaticAbilities() { // TODO return checkagain in SBA + public final boolean checkStaticAbilities() { if (game.isGameOver()) { - return; + return false; } // remove old effects @@ -755,13 +755,25 @@ public class GameAction { } } + boolean checkAgain = false; + for (Player p : game.getPlayers()) { + for (Card c : p.getCardsIn(ZoneType.Battlefield)) { + if (!c.getController().equals(p)) { + controllerChangeZoneCorrection(c); + checkAgain = true; + } + } + } + if (!affectedCards.isEmpty()) { game.fireEvent(new GameEventCardStatsChanged(affectedCards)); + checkAgain = true; } final HashMap runParams = new HashMap(); game.getTriggerHandler().runTrigger(TriggerType.Always, runParams, false); + return checkAgain; } /** @@ -797,17 +809,9 @@ public class GameAction { // do this twice, sometimes creatures/permanents will survive when they // shouldn't for (int q = 0; q < 9; q++) { - boolean checkAgain = false; - - this.checkStaticAbilities(); + boolean checkAgain = this.checkStaticAbilities(); for (Player p : game.getPlayers()) { - for (Card c : p.getCardsIn(ZoneType.Battlefield)) { - if (!c.getController().equals(p)) { // should not be here - controllerChangeZoneCorrection(c); - checkAgain = true; - } - } for (ZoneType zt : ZoneType.values()) { if (zt == ZoneType.Battlefield) { continue;