diff --git a/Mage.Client/src/main/java/mage/client/game/GamePanel.java b/Mage.Client/src/main/java/mage/client/game/GamePanel.java index 3fd791d392..d062ed5d76 100644 --- a/Mage.Client/src/main/java/mage/client/game/GamePanel.java +++ b/Mage.Client/src/main/java/mage/client/game/GamePanel.java @@ -396,8 +396,8 @@ public final class GamePanel extends javax.swing.JPanel { jSplitPane2.setDividerSize(GUISizeHelper.dividerBarSize); stackObjects.setCardDimension(GUISizeHelper.handCardDimension); int newStackWidth = jPanel3.getWidth() * GUISizeHelper.stackWidth / 100; - if (newStackWidth < 360) { - newStackWidth = 360; + if (newStackWidth < 410) { + newStackWidth = 410; } Dimension newDimension = new Dimension(jPanel3.getWidth() - newStackWidth, GUISizeHelper.handCardDimension.height + GUISizeHelper.scrollBarSize); handContainer.setPreferredSize(newDimension); @@ -508,6 +508,7 @@ public final class GamePanel extends javax.swing.JPanel { this.btnSkipToNextMain.setVisible(true); this.btnSkipStack.setVisible(true); this.btnSkipToYourTurn.setVisible(true); + this.btnSkipToEndStepBeforeYourTurn.setVisible(true); this.pnlReplay.setVisible(false); @@ -541,6 +542,7 @@ public final class GamePanel extends javax.swing.JPanel { this.btnSkipToNextMain.setVisible(false); this.btnSkipStack.setVisible(false); this.btnSkipToYourTurn.setVisible(false); + this.btnSkipToEndStepBeforeYourTurn.setVisible(false); this.pnlReplay.setVisible(false); this.gameChatPanel.clear(); @@ -774,7 +776,8 @@ public final class GamePanel extends javax.swing.JPanel { } players.get(player.getPlayerId()).update(player); if (player.getPlayerId().equals(playerId)) { - updateSkipButtons(player.isPassedTurn(), player.isPassedUntilEndOfTurn(), player.isPassedUntilNextMain(), player.isPassedAllTurns(), player.isPassedUntilStackResolved()); + updateSkipButtons(player.isPassedTurn(), player.isPassedUntilEndOfTurn(), player.isPassedUntilNextMain(), player.isPassedAllTurns(), player.isPassedUntilStackResolved(), + player.isPassedUntilEndStepBeforeMyTurn()); } // update open or remove closed graveyard windows graveyards.put(player.getName(), player.getGraveyard()); @@ -850,7 +853,7 @@ public final class GamePanel extends javax.swing.JPanel { static final int BORDER_SIZE = 2; - private void updateSkipButtons(boolean turn, boolean endOfTurn, boolean nextMain, boolean allTurns, boolean stack) { + private void updateSkipButtons(boolean turn, boolean endOfTurn, boolean nextMain, boolean allTurns, boolean stack, boolean endStepBeforeYourStep) { if (turn) { //F4 btnSkipToNextTurn.setBorder(new LineBorder(Color.red, BORDER_SIZE)); } else { @@ -877,6 +880,12 @@ public final class GamePanel extends javax.swing.JPanel { btnSkipToYourTurn.setBorder(new EmptyBorder(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE)); } + if (endStepBeforeYourStep) { // F11 + btnSkipToEndStepBeforeYourTurn.setBorder(new LineBorder(Color.red, BORDER_SIZE)); + } else { + btnSkipToEndStepBeforeYourTurn.setBorder(new EmptyBorder(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE)); + } + } /** @@ -1274,6 +1283,7 @@ public final class GamePanel extends javax.swing.JPanel { btnSkipToNextMain = new javax.swing.JButton(); // F7 btnSkipStack = new javax.swing.JButton(); // F8 btnSkipToYourTurn = new javax.swing.JButton(); // F9 + btnSkipToEndStepBeforeYourTurn = new javax.swing.JButton(); // F11 btnConcede = new javax.swing.JButton(); btnSwitchHands = new javax.swing.JButton(); @@ -1302,7 +1312,7 @@ public final class GamePanel extends javax.swing.JPanel { handCards = new HashMap<>(); pnlShortCuts.setOpaque(false); - pnlShortCuts.setPreferredSize(new Dimension(400, 72)); + pnlShortCuts.setPreferredSize(new Dimension(410, 72)); stackObjects = new mage.client.cards.Cards(); @@ -1473,6 +1483,29 @@ public final class GamePanel extends javax.swing.JPanel { } }); + btnSkipToEndStepBeforeYourTurn.setContentAreaFilled(false); + btnSkipToEndStepBeforeYourTurn.setBorder(new EmptyBorder(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE)); + btnSkipToEndStepBeforeYourTurn.setIcon(new ImageIcon(ImageManagerImpl.getInstance().getSkipEndStepBeforeYourTurnButtonImage())); + btnSkipToEndStepBeforeYourTurn.setToolTipText("Skip to the end step before your turn (F11) - adjust using preferences."); + btnSkipToEndStepBeforeYourTurn.setFocusable(false); + btnSkipToEndStepBeforeYourTurn.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent evt) { + if (evt.getButton() == MouseEvent.BUTTON1) { + btnSkipToEndStepBeforeYourTurnActionPerformed(null); + } + } + }); + + KeyStroke ks11 = KeyStroke.getKeyStroke(KeyEvent.VK_F11, 0); + this.getInputMap(c).put(ks11, "F11_PRESS"); + this.getActionMap().put("F11_PRESS", new AbstractAction() { + @Override + public void actionPerformed(ActionEvent actionEvent) { + btnSkipToEndStepBeforeYourTurnActionPerformed(actionEvent); + } + }); + btnSkipStack.setContentAreaFilled(false); btnSkipStack.setBorder(new EmptyBorder(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE)); btnSkipStack.setIcon(new ImageIcon(ImageManagerImpl.getInstance().getSkipStackButtonImage())); @@ -1695,6 +1728,7 @@ public final class GamePanel extends javax.swing.JPanel { .addComponent(btnSkipToNextMain) .addComponent(btnSkipToYourTurn) .addComponent(btnSkipStack) + .addComponent(btnSkipToEndStepBeforeYourTurn) ) .addGroup(gl_pnlShortCuts.createSequentialGroup() .addComponent(txtSpellsCast) @@ -1727,6 +1761,7 @@ public final class GamePanel extends javax.swing.JPanel { .addComponent(btnSkipToNextMain) .addComponent(btnSkipToYourTurn) .addComponent(btnSkipStack) + .addComponent(btnSkipToEndStepBeforeYourTurn) ) .addGroup(gl_pnlShortCuts.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(txtSpellsCast) @@ -1799,8 +1834,8 @@ public final class GamePanel extends javax.swing.JPanel { .addComponent(handContainer, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ) .addGroup(gl_jPanel3.createParallelGroup(Alignment.LEADING) - .addComponent(pnlShortCuts, 360, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE) - .addComponent(stackObjects, 360, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE) + .addComponent(pnlShortCuts, 410, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE) + .addComponent(stackObjects, 410, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE) ) ) .addGap(0) @@ -1886,6 +1921,9 @@ public final class GamePanel extends javax.swing.JPanel { for (MouseListener ml : this.btnSkipStack.getMouseListeners()) { this.btnSkipStack.removeMouseListener(ml); } + for (MouseListener ml : this.btnSkipToEndStepBeforeYourTurn.getMouseListeners()) { + this.btnSkipToEndStepBeforeYourTurn.removeMouseListener(ml); + } for (MouseListener ml : this.btnSkipToEndTurn.getMouseListeners()) { this.btnSkipToEndTurn.removeMouseListener(ml); } @@ -1956,37 +1994,43 @@ public final class GamePanel extends javax.swing.JPanel { private void btnEndTurnActionPerformed(java.awt.event.ActionEvent evt) { session.sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_NEXT_TURN, gameId, null); AudioManager.playOnSkipButton(); - updateSkipButtons(true, false, false, false, false); + updateSkipButtons(true, false, false, false, false, false); } private void btnUntilEndOfTurnActionPerformed(java.awt.event.ActionEvent evt) { session.sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_TURN_END_STEP, gameId, null); AudioManager.playOnSkipButton(); - updateSkipButtons(false, true, false, false, false); + updateSkipButtons(false, true, false, false, false, false); } private void btnUntilNextMainPhaseActionPerformed(java.awt.event.ActionEvent evt) { session.sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_NEXT_MAIN_PHASE, gameId, null); AudioManager.playOnSkipButton(); - updateSkipButtons(false, false, true, false, false); + updateSkipButtons(false, false, true, false, false, false); } private void btnPassPriorityUntilNextYourTurnActionPerformed(java.awt.event.ActionEvent evt) { session.sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_MY_NEXT_TURN, gameId, null); AudioManager.playOnSkipButton(); - updateSkipButtons(false, false, false, true, false); + updateSkipButtons(false, false, false, true, false, false); } private void btnPassPriorityUntilStackResolvedActionPerformed(java.awt.event.ActionEvent evt) { session.sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_STACK_RESOLVED, gameId, null); AudioManager.playOnSkipButton(); - updateSkipButtons(false, false, false, false, true); + updateSkipButtons(false, false, false, false, true, false); + } + + private void btnSkipToEndStepBeforeYourTurnActionPerformed(java.awt.event.ActionEvent evt) { + session.sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_END_STEP_BEFORE_MY_NEXT_TURN, gameId, null); + AudioManager.playOnSkipButton(); + updateSkipButtons(false, false, false, false, false, true); } private void restorePriorityActionPerformed(java.awt.event.ActionEvent evt) { session.sendPlayerAction(PlayerAction.PASS_PRIORITY_CANCEL_ALL_ACTIONS, gameId, null); AudioManager.playOnSkipButtonCancel(); - updateSkipButtons(false, false, false, false, false); + updateSkipButtons(false, false, false, false, false, false); } private void mouseClickPhaseBar(MouseEvent evt) { @@ -2205,6 +2249,7 @@ public final class GamePanel extends javax.swing.JPanel { private javax.swing.JButton btnSkipToNextMain; // F7 private javax.swing.JButton btnSkipStack; // F8 private javax.swing.JButton btnSkipToYourTurn; // F9 + private javax.swing.JButton btnSkipToEndStepBeforeYourTurn; // F11 private javax.swing.JButton btnConcede; private javax.swing.JButton btnSwitchHands; diff --git a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java index 20fe42c381..0f1c215e28 100644 --- a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java @@ -184,6 +184,10 @@ public class PlayAreaPanel extends javax.swing.JPanel { gamePanel.getSession().sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_MY_NEXT_TURN, gameId, null); break; } + case "F11": { + gamePanel.getSession().sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_END_STEP_BEFORE_MY_NEXT_TURN, gameId, null); + break; + } } } }; @@ -229,7 +233,14 @@ public class PlayAreaPanel extends javax.swing.JPanel { menuItem = new JMenuItem("F9 - Everything until your own next turn"); menuItem.setActionCommand("F9"); menuItem.setToolTipText(tooltipText); - menuItem.setMnemonic(KeyEvent.VK_N); + menuItem.setMnemonic(KeyEvent.VK_V); + skipMenu.add(menuItem); + menuItem.addActionListener(skipListener); + + menuItem = new JMenuItem("F11 - Everything until end step prior to your own next turn"); + menuItem.setActionCommand("F11"); + menuItem.setToolTipText(tooltipText); + menuItem.setMnemonic(KeyEvent.VK_P); skipMenu.add(menuItem); menuItem.addActionListener(skipListener); diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/utils/ImageManager.java b/Mage.Client/src/main/java/org/mage/plugins/card/utils/ImageManager.java index 63f2dcf900..d198e8ae04 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/utils/ImageManager.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/utils/ImageManager.java @@ -41,6 +41,7 @@ public interface ImageManager { Image getSkipEndTurnButtonImage(); Image getSkipMainButtonImage(); Image getSkipStackButtonImage(); + Image getSkipEndStepBeforeYourTurnButtonImage(); Image getSkipYourNextTurnButtonImage(); diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java b/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java index 9209be5d87..d82ceeb37d 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java @@ -328,6 +328,14 @@ public class ImageManagerImpl implements ImageManager { return imageSkipStackButton; } + @Override + public Image getSkipEndStepBeforeYourTurnButtonImage() { + if (imageSkipUntilEndStepBeforeYourTurnButton == null) { + imageSkipUntilEndStepBeforeYourTurnButton = getBufferedImageFromResource("/buttons/skip_to_previous_end.png"); + } + return imageSkipUntilEndStepBeforeYourTurnButton; + } + @Override public Image getSkipYourNextTurnButtonImage() { if (imageSkipYourNextTurnButton == null) { @@ -427,6 +435,7 @@ public class ImageManagerImpl implements ImageManager { private static BufferedImage imageSkipToEndTurnButton; private static BufferedImage imageSkipToMainButton; private static BufferedImage imageSkipStackButton; + private static BufferedImage imageSkipUntilEndStepBeforeYourTurnButton; private static BufferedImage imageSkipYourNextTurnButton; private static Map phasesImages; diff --git a/Mage.Client/src/main/resources/buttons/blank.png b/Mage.Client/src/main/resources/buttons/blank.png new file mode 100644 index 0000000000..3dcfd35323 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/blank.png differ diff --git a/Mage.Client/src/main/resources/buttons/skip_to_previous_end.png b/Mage.Client/src/main/resources/buttons/skip_to_previous_end.png new file mode 100644 index 0000000000..f5f737d8f4 Binary files /dev/null and b/Mage.Client/src/main/resources/buttons/skip_to_previous_end.png differ diff --git a/Mage.Common/src/mage/view/PlayerView.java b/Mage.Common/src/mage/view/PlayerView.java index ee63045b38..6e370a8028 100644 --- a/Mage.Common/src/mage/view/PlayerView.java +++ b/Mage.Common/src/mage/view/PlayerView.java @@ -83,6 +83,7 @@ public class PlayerView implements Serializable { private final boolean passedUntilNextMain; // F6 private final boolean passedUntilStackResolved; // F8 private final boolean passedAllTurns; // F9 + private final boolean passedUntilEndStepBeforeMyTurn; // F11 public PlayerView(Player player, GameState state, Game game, UUID createdForPlayerId, UUID watcherUserId) { this.playerId = player.getId(); @@ -167,6 +168,7 @@ public class PlayerView implements Serializable { this.passedUntilNextMain = player.getPassedUntilNextMain(); this.passedAllTurns = player.getPassedAllTurns(); this.passedUntilStackResolved = player.getPassedUntilStackResolved(); + this.passedUntilEndStepBeforeMyTurn = player.getPassedUntilEndStepBeforeMyTurn(); } private boolean showInBattlefield(Permanent permanent, GameState state) { @@ -303,4 +305,8 @@ public class PlayerView implements Serializable { public boolean isPassedUntilStackResolved() { return passedUntilStackResolved; } + + public boolean isPassedUntilEndStepBeforeMyTurn() { + return passedUntilEndStepBeforeMyTurn; + } } diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index 95fa8274e3..e8ebf4ce6d 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -91,6 +91,7 @@ import mage.game.permanent.Permanent; import mage.game.tournament.Tournament; import mage.players.Player; import mage.players.PlayerImpl; +import mage.players.PlayerList; import mage.target.Target; import mage.target.TargetAmount; import mage.target.TargetCard; @@ -589,6 +590,21 @@ public class HumanPlayer extends PlayerImpl { return false; } } + if (passedUntilEndStepBeforeMyTurn) { + + if (!game.getTurn().getStepType().equals(PhaseStep.END_TURN)) { + if (passWithManaPoolCheck(game)) { + return false; + } + } else { + PlayerList playerList = game.getState().getPlayerList(playerId); + if (!playerList.getPrevious().equals(game.getActivePlayerId())) { + if (passWithManaPoolCheck(game)) { + return false; + } + } + } + } if (game.getStack().isEmpty()) { passedUntilStackResolved = false; boolean dontCheckPassStep = false; @@ -878,7 +894,7 @@ public class HumanPlayer extends PlayerImpl { FilterCreatureForCombat filter = filterCreatureForCombat.copy(); filter.add(new ControllerIdPredicate(attackingPlayerId)); while (!abort) { - if (passedAllTurns + if (passedAllTurns || passedUntilEndStepBeforeMyTurn || (!getUserData().getUserSkipPrioritySteps().isStopOnDeclareAttackersDuringSkipAction() && (passedTurn || passedUntilEndOfTurn || passedUntilNextMain))) { return; } diff --git a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java index 0f00d30abd..be5d9f0eb0 100644 --- a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java +++ b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java @@ -117,7 +117,6 @@ public class TestPlayer implements Player { private int maxCallsWithoutAction = 100; private int foundNoAction = 0; private boolean AIPlayer; - private final List actions = new ArrayList<>(); private final List choices = new ArrayList<>(); private final List targets = new ArrayList<>(); @@ -1928,7 +1927,12 @@ public class TestPlayer implements Player { public boolean getPassedUntilStackResolved() { return computerPlayer.getPassedUntilStackResolved(); } - + + @Override + public boolean getPassedUntilEndStepBeforeMyTurn() { + return computerPlayer.getPassedUntilEndStepBeforeMyTurn(); + } + @Override public void revokePermissionToSeeHandCards() { computerPlayer.revokePermissionToSeeHandCards(); diff --git a/Mage.Tests/src/test/java/org/mage/test/stub/PlayerStub.java b/Mage.Tests/src/test/java/org/mage/test/stub/PlayerStub.java index 86d39bd888..7635562a5c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/stub/PlayerStub.java +++ b/Mage.Tests/src/test/java/org/mage/test/stub/PlayerStub.java @@ -348,10 +348,16 @@ public class PlayerStub implements Player { return false; } + @Override public boolean getPassedAllTurns() { return false; } + + @Override + public boolean getPassedUntilEndStepBeforeMyTurn() { + return false; + } @Override public AbilityType getJustActivatedType() { diff --git a/Mage/src/main/java/mage/constants/PlayerAction.java b/Mage/src/main/java/mage/constants/PlayerAction.java index baee51e5f1..5568ac2f55 100644 --- a/Mage/src/main/java/mage/constants/PlayerAction.java +++ b/Mage/src/main/java/mage/constants/PlayerAction.java @@ -39,6 +39,7 @@ public enum PlayerAction { PASS_PRIORITY_UNTIL_NEXT_MAIN_PHASE, PASS_PRIORITY_UNTIL_NEXT_TURN, PASS_PRIORITY_UNTIL_STACK_RESOLVED, + PASS_PRIORITY_UNTIL_END_STEP_BEFORE_MY_NEXT_TURN, PASS_PRIORITY_CANCEL_ALL_ACTIONS, TRIGGER_AUTO_ORDER_ABILITY_FIRST, TRIGGER_AUTO_ORDER_NAME_FIRST, diff --git a/Mage/src/main/java/mage/players/Player.java b/Mage/src/main/java/mage/players/Player.java index d5f34cb80d..f22e112c06 100644 --- a/Mage/src/main/java/mage/players/Player.java +++ b/Mage/src/main/java/mage/players/Player.java @@ -193,6 +193,8 @@ public interface Player extends MageItem, Copyable { boolean getPassedUntilStackResolved(); + boolean getPassedUntilEndStepBeforeMyTurn(); + boolean getPassedAllTurns(); AbilityType getJustActivatedType(); diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index 1b8dfeb870..d2b86ab37a 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -178,6 +178,7 @@ public abstract class PlayerImpl implements Player, Serializable { protected boolean passedUntilEndOfTurn; // F5 protected boolean passedUntilNextMain; // F6 protected boolean passedUntilStackResolved; // F8 + protected boolean passedUntilEndStepBeforeMyTurn; // F11 protected Date dateLastAddedToStack; // F8 protected boolean skippedAtLeastOnce; // used to track if passed started in specific phase /** @@ -327,6 +328,7 @@ public abstract class PlayerImpl implements Player, Serializable { this.passedUntilNextMain = player.passedUntilNextMain; this.skippedAtLeastOnce = player.skippedAtLeastOnce; this.passedUntilStackResolved = player.passedUntilStackResolved; + this.passedUntilEndStepBeforeMyTurn = player.passedUntilEndStepBeforeMyTurn; this.dateLastAddedToStack = player.dateLastAddedToStack; this.passedAllTurns = player.passedAllTurns; this.justActivatedType = player.justActivatedType; @@ -454,6 +456,7 @@ public abstract class PlayerImpl implements Player, Serializable { this.passedUntilNextMain = false; this.skippedAtLeastOnce = false; this.passedUntilStackResolved = false; + this.passedUntilEndStepBeforeMyTurn = false; this.passedAllTurns = false; this.justActivatedType = null; this.canGainLife = true; @@ -1945,6 +1948,7 @@ public abstract class PlayerImpl implements Player, Serializable { this.passedUntilEndOfTurn = false; this.passedUntilNextMain = false; this.passedUntilStackResolved = false; + this.passedUntilEndStepBeforeMyTurn = false; this.dateLastAddedToStack = null; this.skippedAtLeastOnce = false; this.passedAllTurns = false; @@ -1991,6 +1995,7 @@ public abstract class PlayerImpl implements Player, Serializable { passedTurn = false; passedAllTurns = true; passedUntilStackResolved = false; + passedUntilEndStepBeforeMyTurn = false; this.skip(); break; case PASS_PRIORITY_UNTIL_TURN_END_STEP: // F5 @@ -1999,6 +2004,7 @@ public abstract class PlayerImpl implements Player, Serializable { passedAllTurns = false; passedUntilEndOfTurn = true; passedUntilStackResolved = false; + passedUntilEndStepBeforeMyTurn = false; skippedAtLeastOnce = !PhaseStep.END_TURN.equals(game.getTurn().getStepType()); this.skip(); break; @@ -2007,6 +2013,7 @@ public abstract class PlayerImpl implements Player, Serializable { passedAllTurns = false; passedUntilEndOfTurn = false; passedUntilStackResolved = false; + passedUntilEndStepBeforeMyTurn = false; passedTurn = true; this.skip(); break; @@ -2016,6 +2023,7 @@ public abstract class PlayerImpl implements Player, Serializable { passedUntilEndOfTurn = false; passedUntilNextMain = true; passedUntilStackResolved = false; + passedUntilEndStepBeforeMyTurn = false; skippedAtLeastOnce = !(game.getTurn().getStepType().equals(PhaseStep.POSTCOMBAT_MAIN) || game.getTurn().getStepType().equals(PhaseStep.PRECOMBAT_MAIN)); this.skip(); break; @@ -2025,15 +2033,26 @@ public abstract class PlayerImpl implements Player, Serializable { passedUntilEndOfTurn = false; passedUntilNextMain = false; passedUntilStackResolved = true; + passedUntilEndStepBeforeMyTurn = false; dateLastAddedToStack = game.getStack().getDateLastAdded(); this.skip(); break; + case PASS_PRIORITY_UNTIL_END_STEP_BEFORE_MY_NEXT_TURN: //F11 + passedAllTurns = false; + passedTurn = false; + passedUntilEndOfTurn = false; + passedUntilNextMain = false; + passedUntilStackResolved = false; + passedUntilEndStepBeforeMyTurn = true; + this.skip(); + break; case PASS_PRIORITY_CANCEL_ALL_ACTIONS: passedAllTurns = false; passedTurn = false; passedUntilEndOfTurn = false; passedUntilNextMain = false; passedUntilStackResolved = false; + passedUntilEndStepBeforeMyTurn = false; break; case PERMISSION_REQUESTS_ALLOWED_OFF: userData.setAllowRequestShowHandCards(false); @@ -2965,6 +2984,7 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public void becomesActivePlayer() { this.passedAllTurns = false; + this.passedUntilEndStepBeforeMyTurn = false; this.turns++; } @@ -3462,6 +3482,11 @@ public abstract class PlayerImpl implements Player, Serializable { return passedUntilStackResolved; } + @Override + public boolean getPassedUntilEndStepBeforeMyTurn() { + return passedUntilEndStepBeforeMyTurn; + } + @Override public AbilityType getJustActivatedType() { return justActivatedType;