loop until nothing added to stack, AP is turn owner

This commit is contained in:
Maxmtg
2014-02-08 20:52:02 +00:00
parent 862d8ed857
commit a7d359fa10

View File

@@ -964,16 +964,21 @@ public class PhaseHandler implements java.io.Serializable {
SpellAbility chosenSa = null; SpellAbility chosenSa = null;
do { do {
// Rule 704.3 Whenever a player would get priority, the game checks ... for state-based actions,
game.getAction().checkStateEffects(); boolean addedAnythingToStack;
if (game.isGameOver()) do {
return; // state-based effects check could lead to game over addedAnythingToStack = false;
// Rule 704.3 Whenever a player would get priority, the game checks ... for state-based actions,
Player whoAddsToStack = pPlayerPriority; game.getAction().checkStateEffects();
do { if (game.isGameOver())
game.getStack().chooseOrderOfSimultaneousStackEntry(whoAddsToStack); return; // state-based effects check could lead to game over
whoAddsToStack = game.getNextPlayerAfter(whoAddsToStack);
} while( whoAddsToStack != null && whoAddsToStack != pPlayerPriority); Player whoAddsToStack = playerTurn;
do {
addedAnythingToStack |= game.getStack().chooseOrderOfSimultaneousStackEntry(whoAddsToStack);
whoAddsToStack = game.getNextPlayerAfter(whoAddsToStack);
} while( whoAddsToStack != null && whoAddsToStack != pPlayerPriority);
} while(!addedAnythingToStack);
chosenSa = pPlayerPriority.getController().chooseSpellAbilityToPlay(); chosenSa = pPlayerPriority.getController().chooseSpellAbilityToPlay();
if( null == chosenSa ) if( null == chosenSa )