From 7569e8697a8d7a8ee9ceb1d4d82611242a912a31 Mon Sep 17 00:00:00 2001 From: Sloth Date: Tue, 21 Oct 2014 07:25:00 +0000 Subject: [PATCH] - remove option to fire events from checkStaticAbilities, because it isn't (and shouldn't really be used). --- .../src/main/java/forge/game/GameAction.java | 16 ++++++---------- .../java/forge/game/ability/AbilityUtils.java | 2 +- .../java/forge/player/PlayerControllerHuman.java | 2 -- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/forge-game/src/main/java/forge/game/GameAction.java b/forge-game/src/main/java/forge/game/GameAction.java index 35cb541ba8d..8931e3f46d9 100644 --- a/forge-game/src/main/java/forge/game/GameAction.java +++ b/forge-game/src/main/java/forge/game/GameAction.java @@ -93,7 +93,7 @@ public class GameAction { } if (zoneFrom == null && !c.isToken()) { zoneTo.add(c, position); - checkStaticAbilities(false); + checkStaticAbilities(); game.getTriggerHandler().registerActiveTrigger(c, true); game.fireEvent(new GameEventCardChangeZone(c, zoneFrom, zoneTo)); return c; @@ -217,7 +217,7 @@ public class GameAction { } // Need to apply any static effects to produce correct triggers - checkStaticAbilities(false); + checkStaticAbilities(); game.getTriggerHandler().registerActiveTrigger(c, true); // play the change zone sound @@ -524,10 +524,10 @@ public class GameAction { } } - public final void checkStaticAbilities(final boolean fireEvents) { - checkStaticAbilities(fireEvents, new HashSet()); + public final void checkStaticAbilities() { + checkStaticAbilities(new HashSet()); } - public final void checkStaticAbilities(final boolean fireEvents, final Set affectedCards) { + public final void checkStaticAbilities(final Set affectedCards) { if (game.isGameOver()) { return; } @@ -627,10 +627,6 @@ public class GameAction { } } - if (fireEvents && !affectedCards.isEmpty()) { - game.fireEvent(new GameEventCardStatsChanged(affectedCards)); - } - final HashMap runParams = new HashMap(); game.getTriggerHandler().runTrigger(TriggerType.Always, runParams, false); } @@ -666,7 +662,7 @@ public class GameAction { // do this multiple times, sometimes creatures/permanents will survive when they shouldn't for (int q = 0; q < 9; q++) { - checkStaticAbilities(false, affectedCards); + checkStaticAbilities(affectedCards); boolean checkAgain = false; for (Player p : game.getPlayers()) { diff --git a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java index 4c1cdd4e0b0..5b4c3a03421 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java @@ -1214,7 +1214,7 @@ public class AbilityUtils { } // Needed - Equip an untapped creature with Sword of the Paruns then cast Deadshot on it. Should deal 2 more damage. - game.getAction().checkStaticAbilities(false); // this will refresh continuous abilities for players and permanents. + game.getAction().checkStaticAbilities(); // this will refresh continuous abilities for players and permanents. AbilityUtils.resolveApiAbility(abSub, game); } diff --git a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java index b1eb7296f2f..bd1812ae2d5 100644 --- a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java +++ b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java @@ -1523,8 +1523,6 @@ public class PlayerControllerHuman extends PlayerController { game.getTriggerHandler().clearSuppression(TriggerType.ChangesZone); - game.getAction().checkStaticAbilities(false); - game.getAction().checkStateEffects(true); //ensure state based effects and triggers are updated } });