- remove option to fire events from checkStaticAbilities, because it isn't (and shouldn't really be used).

This commit is contained in:
Sloth
2014-10-21 07:25:00 +00:00
parent c3d9ff5fe2
commit 7569e8697a
3 changed files with 7 additions and 13 deletions

View File

@@ -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<Card>());
public final void checkStaticAbilities() {
checkStaticAbilities(new HashSet<Card>());
}
public final void checkStaticAbilities(final boolean fireEvents, final Set<Card> affectedCards) {
public final void checkStaticAbilities(final Set<Card> affectedCards) {
if (game.isGameOver()) {
return;
}
@@ -627,10 +627,6 @@ public class GameAction {
}
}
if (fireEvents && !affectedCards.isEmpty()) {
game.fireEvent(new GameEventCardStatsChanged(affectedCards));
}
final HashMap<String, Object> runParams = new HashMap<String, Object>();
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()) {

View File

@@ -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);
}

View File

@@ -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
}
});