mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
orderSimultaneousStackEntries only when player gains priority
This commit is contained in:
@@ -874,9 +874,8 @@ public class GameAction {
|
||||
|
||||
if (game.getTriggerHandler().runWaitingTriggers()) {
|
||||
checkAgain = true;
|
||||
// Place triggers on stack
|
||||
game.getStack().chooseOrderOfSimultaneousStackEntryAll();
|
||||
}
|
||||
|
||||
boolean yamazaki = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals("Brothers Yamazaki")).size() == 2;
|
||||
for (Player p : game.getPlayers()) {
|
||||
if (this.handleLegendRule(p, yamazaki)) {
|
||||
|
||||
@@ -166,8 +166,6 @@ public class PhaseHandler implements java.io.Serializable {
|
||||
* a {@link forge.game.player.Player} object.
|
||||
*/
|
||||
public final void setPriority(final Player p) {
|
||||
game.getStack().chooseOrderOfSimultaneousStackEntryAll();
|
||||
|
||||
this.pFirstPriority = p;
|
||||
this.pPlayerPriority = p;
|
||||
}
|
||||
@@ -984,6 +982,7 @@ public class PhaseHandler implements java.io.Serializable {
|
||||
// SBA could lead to game over
|
||||
if (game.isGameOver()) { return; }
|
||||
|
||||
game.getStack().chooseOrderOfSimultaneousStackEntry(pPlayerPriority);
|
||||
pPlayerPriority.getController().takePriority();
|
||||
|
||||
if (DEBUG_PHASES) {
|
||||
@@ -1004,7 +1003,8 @@ public class PhaseHandler implements java.io.Serializable {
|
||||
|
||||
if (game.isGameOver() || nextPlayer == null) { return; } // conceded?
|
||||
|
||||
// System.out.println(String.format("%s %s: %s passes priority to %s", playerTurn, phase, actingPlayer, nextPlayer));
|
||||
if( DEBUG_PHASES )
|
||||
System.out.println(String.format("%s %s: %s passes priority to %s", playerTurn, phase, pPlayerPriority, nextPlayer));
|
||||
if (getFirstPriority() == nextPlayer) {
|
||||
if (game.getStack().isEmpty()) {
|
||||
this.setPriority(this.getPlayerTurn()); // this needs to be set early as we exit the phase
|
||||
@@ -1017,7 +1017,6 @@ public class PhaseHandler implements java.io.Serializable {
|
||||
}
|
||||
else if (!game.getStack().hasSimultaneousStackEntries()) {
|
||||
game.getStack().resolveStack();
|
||||
game.getStack().chooseOrderOfSimultaneousStackEntryAll();
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -223,7 +223,6 @@ public class Untap extends Phase {
|
||||
c.addHiddenExtrinsicKeyword("HIDDEN This card doesn't untap during your next untap step.");
|
||||
}
|
||||
}
|
||||
game.getStack().chooseOrderOfSimultaneousStackEntryAll();
|
||||
} // end doUntap
|
||||
|
||||
private static void optionalUntap(final Card c) {
|
||||
|
||||
@@ -205,11 +205,6 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
||||
}
|
||||
// Add all waiting triggers onto the stack
|
||||
game.getTriggerHandler().runWaitingTriggers();
|
||||
|
||||
if (!simultaneousStackEntryList.isEmpty()) {
|
||||
this.chooseOrderOfSimultaneousStackEntryAll();
|
||||
//game.getAction().checkStaticAbilities();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,9 +229,6 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
||||
*/
|
||||
public final void setResolving(final boolean b) {
|
||||
this.bResolving = b;
|
||||
if (!this.bResolving) {
|
||||
this.chooseOrderOfSimultaneousStackEntryAll();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -466,10 +458,6 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
||||
|
||||
game.getTriggerHandler().runTrigger(TriggerType.BecomesTarget, runParams, false);
|
||||
}
|
||||
|
||||
if (!this.simultaneousStackEntryList.isEmpty()) {
|
||||
chooseOrderOfSimultaneousStackEntryAll();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -780,22 +768,7 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
||||
this.simultaneousStackEntryList.add(sa);
|
||||
}
|
||||
|
||||
|
||||
public final void chooseOrderOfSimultaneousStackEntryAll() {
|
||||
final Player playerTurn = game.getPhaseHandler().getPlayerTurn();
|
||||
|
||||
this.chooseOrderOfSimultaneousStackEntry(playerTurn);
|
||||
|
||||
if (playerTurn != null) {
|
||||
for(final Player other : playerTurn.getGame().getPlayers()) {
|
||||
if ( other == playerTurn ) continue;
|
||||
this.chooseOrderOfSimultaneousStackEntry(other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private final void chooseOrderOfSimultaneousStackEntry(final Player activePlayer) {
|
||||
public final void chooseOrderOfSimultaneousStackEntry(final Player activePlayer) {
|
||||
if (this.simultaneousStackEntryList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ public final class GuiDisplayUtil {
|
||||
final Player player = GuiChoose.oneOrNone("Which player should roll?", players);
|
||||
if (player == null) { return; }
|
||||
|
||||
PlanarDice res = GuiChoose.oneOrNone("Choose result", PlanarDice.values());
|
||||
final PlanarDice res = GuiChoose.oneOrNone("Choose result", PlanarDice.values());
|
||||
if (res == null) { return; }
|
||||
|
||||
System.out.println("Rigging planar dice roll: " + res.toString());
|
||||
@@ -433,12 +433,12 @@ public final class GuiDisplayUtil {
|
||||
//System.out.println("ActivePlanes: " + getGame().getActivePlanes());
|
||||
//System.out.println("CommandPlanes: " + getGame().getCardsIn(ZoneType.Command));
|
||||
|
||||
PlanarDice.roll(player, res);
|
||||
|
||||
|
||||
getGame().getAction().invoke(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.getGame().getStack().chooseOrderOfSimultaneousStackEntryAll();
|
||||
PlanarDice.roll(player, res);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -467,7 +467,6 @@ public final class GuiDisplayUtil {
|
||||
public void run() {
|
||||
getGame().getAction().changeZone(null, p.getZone(ZoneType.PlanarDeck), forgeCard, 0);
|
||||
PlanarDice.roll(p, PlanarDice.Planeswalk);
|
||||
p.getGame().getStack().chooseOrderOfSimultaneousStackEntryAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user