*TriggerHandler now runs static triggers before others. Fixes Adaptive Automaton not pumping Champion of the Parish and others.

This commit is contained in:
Hellfish
2011-11-16 16:03:06 +00:00
parent 3a52765310
commit 7471d249b7

View File

@@ -290,14 +290,29 @@ public class TriggerHandler {
// This is done to allow the list of triggers to be modified while
// triggers are running.
final ArrayList<Trigger> delayedTriggersWorkingCopy = new ArrayList<Trigger>(this.delayedTriggers);
CardList allCards;
CardList allCards = AllZoneUtil.getCardsInGame();
//Static triggers
for(final Card c : allCards) {
for(final Trigger t : c.getTriggers()) {
if(t.getMapParams().containsKey("Static")) {
this.runSingleTrigger(t, mode, runParams);
}
}
}
this.suppressMode("Always");
AllZone.getGameAction().checkStateEffects(true);
this.clearSuppression("Always");
// AP
allCards = playerAP.getAllCards();
allCards.addAll(AllZoneUtil.getCardsIn(Constant.Zone.Stack).getController(playerAP));
for (final Card c : allCards) {
for (final Trigger t : c.getTriggers()) {
this.runSingleTrigger(t, mode, runParams);
if(!t.getMapParams().containsKey("Static")) {
this.runSingleTrigger(t, mode, runParams);
}
}
}
for (int i = 0; i < delayedTriggersWorkingCopy.size(); i++) {
@@ -316,7 +331,9 @@ public class TriggerHandler {
allCards.addAll(AllZoneUtil.getCardsIn(Constant.Zone.Stack).getController(playerAP.getOpponent()));
for (final Card c : allCards) {
for (final Trigger t : c.getTriggers()) {
this.runSingleTrigger(t, mode, runParams);
if(!t.getMapParams().containsKey("Static")) {
this.runSingleTrigger(t, mode, runParams);
}
}
}
for (int i = 0; i < delayedTriggersWorkingCopy.size(); i++) {