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()) {
|
if (game.getTriggerHandler().runWaitingTriggers()) {
|
||||||
checkAgain = true;
|
checkAgain = true;
|
||||||
// Place triggers on stack
|
|
||||||
game.getStack().chooseOrderOfSimultaneousStackEntryAll();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean yamazaki = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals("Brothers Yamazaki")).size() == 2;
|
boolean yamazaki = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals("Brothers Yamazaki")).size() == 2;
|
||||||
for (Player p : game.getPlayers()) {
|
for (Player p : game.getPlayers()) {
|
||||||
if (this.handleLegendRule(p, yamazaki)) {
|
if (this.handleLegendRule(p, yamazaki)) {
|
||||||
|
|||||||
@@ -166,8 +166,6 @@ public class PhaseHandler implements java.io.Serializable {
|
|||||||
* a {@link forge.game.player.Player} object.
|
* a {@link forge.game.player.Player} object.
|
||||||
*/
|
*/
|
||||||
public final void setPriority(final Player p) {
|
public final void setPriority(final Player p) {
|
||||||
game.getStack().chooseOrderOfSimultaneousStackEntryAll();
|
|
||||||
|
|
||||||
this.pFirstPriority = p;
|
this.pFirstPriority = p;
|
||||||
this.pPlayerPriority = p;
|
this.pPlayerPriority = p;
|
||||||
}
|
}
|
||||||
@@ -984,6 +982,7 @@ public class PhaseHandler implements java.io.Serializable {
|
|||||||
// SBA could lead to game over
|
// SBA could lead to game over
|
||||||
if (game.isGameOver()) { return; }
|
if (game.isGameOver()) { return; }
|
||||||
|
|
||||||
|
game.getStack().chooseOrderOfSimultaneousStackEntry(pPlayerPriority);
|
||||||
pPlayerPriority.getController().takePriority();
|
pPlayerPriority.getController().takePriority();
|
||||||
|
|
||||||
if (DEBUG_PHASES) {
|
if (DEBUG_PHASES) {
|
||||||
@@ -1004,7 +1003,8 @@ public class PhaseHandler implements java.io.Serializable {
|
|||||||
|
|
||||||
if (game.isGameOver() || nextPlayer == null) { return; } // conceded?
|
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 (getFirstPriority() == nextPlayer) {
|
||||||
if (game.getStack().isEmpty()) {
|
if (game.getStack().isEmpty()) {
|
||||||
this.setPriority(this.getPlayerTurn()); // this needs to be set early as we exit the phase
|
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()) {
|
else if (!game.getStack().hasSimultaneousStackEntries()) {
|
||||||
game.getStack().resolveStack();
|
game.getStack().resolveStack();
|
||||||
game.getStack().chooseOrderOfSimultaneousStackEntryAll();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -223,7 +223,6 @@ public class Untap extends Phase {
|
|||||||
c.addHiddenExtrinsicKeyword("HIDDEN This card doesn't untap during your next untap step.");
|
c.addHiddenExtrinsicKeyword("HIDDEN This card doesn't untap during your next untap step.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
game.getStack().chooseOrderOfSimultaneousStackEntryAll();
|
|
||||||
} // end doUntap
|
} // end doUntap
|
||||||
|
|
||||||
private static void optionalUntap(final Card c) {
|
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
|
// Add all waiting triggers onto the stack
|
||||||
game.getTriggerHandler().runWaitingTriggers();
|
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) {
|
public final void setResolving(final boolean b) {
|
||||||
this.bResolving = 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);
|
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);
|
this.simultaneousStackEntryList.add(sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final void chooseOrderOfSimultaneousStackEntry(final Player activePlayer) {
|
||||||
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) {
|
|
||||||
if (this.simultaneousStackEntryList.isEmpty()) {
|
if (this.simultaneousStackEntryList.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -424,7 +424,7 @@ public final class GuiDisplayUtil {
|
|||||||
final Player player = GuiChoose.oneOrNone("Which player should roll?", players);
|
final Player player = GuiChoose.oneOrNone("Which player should roll?", players);
|
||||||
if (player == null) { return; }
|
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; }
|
if (res == null) { return; }
|
||||||
|
|
||||||
System.out.println("Rigging planar dice roll: " + res.toString());
|
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("ActivePlanes: " + getGame().getActivePlanes());
|
||||||
//System.out.println("CommandPlanes: " + getGame().getCardsIn(ZoneType.Command));
|
//System.out.println("CommandPlanes: " + getGame().getCardsIn(ZoneType.Command));
|
||||||
|
|
||||||
PlanarDice.roll(player, res);
|
|
||||||
|
|
||||||
getGame().getAction().invoke(new Runnable() {
|
getGame().getAction().invoke(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
player.getGame().getStack().chooseOrderOfSimultaneousStackEntryAll();
|
PlanarDice.roll(player, res);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -467,7 +467,6 @@ public final class GuiDisplayUtil {
|
|||||||
public void run() {
|
public void run() {
|
||||||
getGame().getAction().changeZone(null, p.getZone(ZoneType.PlanarDeck), forgeCard, 0);
|
getGame().getAction().changeZone(null, p.getZone(ZoneType.PlanarDeck), forgeCard, 0);
|
||||||
PlanarDice.roll(p, PlanarDice.Planeswalk);
|
PlanarDice.roll(p, PlanarDice.Planeswalk);
|
||||||
p.getGame().getStack().chooseOrderOfSimultaneousStackEntryAll();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user