mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- runWaitingTriggers will now call checkStaticAbilities before triggers are checked (experimental).
This commit is contained in:
@@ -169,27 +169,29 @@ public class TriggerHandler {
|
||||
if (game.getStack().isFrozen() || holdTrigger) {
|
||||
waitingTriggers.add(new TriggerWaiting(mode, runParams));
|
||||
} else {
|
||||
runWaitingTrigger(new TriggerWaiting(mode, runParams), true);
|
||||
runWaitingTrigger(new TriggerWaiting(mode, runParams));
|
||||
}
|
||||
// Tell auto stop to stop
|
||||
}
|
||||
|
||||
public final boolean runWaitingTriggers(boolean runStaticEffects) {
|
||||
public final boolean runWaitingTriggers() {
|
||||
ArrayList<TriggerWaiting> waiting = new ArrayList<TriggerWaiting>(waitingTriggers);
|
||||
waitingTriggers.clear();
|
||||
if (waiting.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Singletons.getModel().getGame().getAction().checkStaticAbilities();
|
||||
|
||||
boolean haveWaiting = false;
|
||||
for (TriggerWaiting wt : waiting) {
|
||||
haveWaiting |= runWaitingTrigger(wt, runStaticEffects);
|
||||
haveWaiting |= runWaitingTrigger(wt);
|
||||
}
|
||||
|
||||
return haveWaiting;
|
||||
}
|
||||
|
||||
public final boolean runWaitingTrigger(TriggerWaiting wt, boolean runStaticEffects) {
|
||||
public final boolean runWaitingTrigger(TriggerWaiting wt) {
|
||||
final TriggerType mode = wt.getMode();
|
||||
final Map<String, Object> runParams = wt.getParams();
|
||||
final GameState game = Singletons.getModel().getGame();
|
||||
|
||||
@@ -848,7 +848,7 @@ public class GameAction {
|
||||
}
|
||||
|
||||
/** */
|
||||
private final void checkStaticAbilities() {
|
||||
public final void checkStaticAbilities() {
|
||||
// remove old effects
|
||||
game.getStaticEffects().clearStaticEffects();
|
||||
|
||||
@@ -1051,7 +1051,7 @@ public class GameAction {
|
||||
}
|
||||
}
|
||||
|
||||
if (game.getTriggerHandler().runWaitingTriggers(true)) {
|
||||
if (game.getTriggerHandler().runWaitingTriggers()) {
|
||||
checkAgain = true;
|
||||
// Place triggers on stack
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public class MagicStack extends MyObservable {
|
||||
this.add(sa);
|
||||
}
|
||||
// Add all waiting triggers onto the stack
|
||||
checkState |= Singletons.getModel().getGame().getTriggerHandler().runWaitingTriggers(false);
|
||||
checkState |= Singletons.getModel().getGame().getTriggerHandler().runWaitingTriggers();
|
||||
if (checkState) {
|
||||
this.chooseOrderOfSimultaneousStackEntryAll();
|
||||
game.getAction().checkStateEffects();
|
||||
|
||||
Reference in New Issue
Block a user