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 b715441ee3..685d7195c1 100644 --- a/Mage.Client/src/main/java/mage/client/game/GamePanel.java +++ b/Mage.Client/src/main/java/mage/client/game/GamePanel.java @@ -739,6 +739,17 @@ public class GamePanel extends javax.swing.JPanel { } }); + KeyStroke ks8 = KeyStroke.getKeyStroke(KeyEvent.VK_F9, 0); + this.getInputMap(c).put(ks8, "F9_PRESS"); + this.getActionMap().put("F9_PRESS", new AbstractAction() { + @Override + public void actionPerformed(ActionEvent actionEvent) { + if (feedbackPanel != null && FeedbackMode.SELECT.equals(feedbackPanel.getMode())) { + session.sendPlayerInteger(gameId, -9999); + } + } + }); + KeyStroke ksAltShift = KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.ALT_MASK); this.getInputMap(c).put(ksAltShift, "ENLARGE"); this.getActionMap().put("ENLARGE", new AbstractAction() { 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 9787e20d49..d863a522bc 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 @@ -371,6 +371,10 @@ public class HumanPlayer extends PlayerImpl { public boolean priority(Game game) { passed = false; if (!abort) { + if (passedAllTurns) { + pass(); + return false; + } if (passedTurn && game.getStack().isEmpty()) { pass(); return false; @@ -382,6 +386,9 @@ public class HumanPlayer extends PlayerImpl { pass(); return false; } else if (response.getInteger() != null) { + if (response.getInteger() == -9999) { + passedAllTurns = true; + } pass(); passedTurn = true; return false; diff --git a/Mage.Server/plugins/mage-player-human.jar b/Mage.Server/plugins/mage-player-human.jar index f55588656b..bcd7b9afe2 100644 Binary files a/Mage.Server/plugins/mage-player-human.jar and b/Mage.Server/plugins/mage-player-human.jar differ diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index 935627f8f5..c2a58377a1 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -28,12 +28,7 @@ package mage.game; -import mage.Constants.CardType; -import mage.Constants.MultiplayerAttackOption; -import mage.Constants.Outcome; -import mage.Constants.PhaseStep; -import mage.Constants.RangeOfInfluence; -import mage.Constants.Zone; +import mage.Constants.*; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.ActivatedAbility; @@ -55,9 +50,9 @@ import mage.cards.decks.Deck; import mage.choices.Choice; import mage.counters.CounterType; import mage.filter.Filter; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.*; import mage.filter.predicate.mageobject.NamePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.combat.Combat; import mage.game.command.CommandObject; import mage.game.command.Emblem; @@ -85,7 +80,6 @@ import org.apache.log4j.Logger; import java.io.IOException; import java.io.Serializable; import java.util.*; -import mage.filter.predicate.mageobject.SubtypePredicate; public abstract class GameImpl> implements Game, Serializable { @@ -462,6 +456,7 @@ public abstract class GameImpl> implements Game, Serializa fireInformEvent("Turn " + Integer.toString(state.getTurnNum())); if (checkStopOnTurnOption()) return; state.setActivePlayerId(player.getId()); + player.becomesActivePlayer(); state.getTurn().play(this, player.getId()); if (isPaused() || isGameOver()) break; diff --git a/Mage/src/mage/players/Player.java b/Mage/src/mage/players/Player.java index 60a79475de..cbc9eeaebd 100644 --- a/Mage/src/mage/players/Player.java +++ b/Mage/src/mage/players/Player.java @@ -256,4 +256,9 @@ public interface Player extends MageItem, Copyable { public List getAttachments(); public boolean addAttachment(UUID permanentId, Game game); public boolean removeAttachment(UUID permanentId, Game game); + + /** + * Signals that the player becomes active player in this turn. + */ + public void becomesActivePlayer(); } diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index c379e4ebf9..de1a17c61d 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -97,6 +97,11 @@ public abstract class PlayerImpl> implements Player, Ser protected ManaPool manaPool; protected boolean passed; protected boolean passedTurn; + /** + * This indicates that player passed all turns until his own turn starts. + * Note! This differs from passedTurn as it doesn't care about spells and abilities in the stack and will pass them as well. + */ + protected boolean passedAllTurns; protected boolean left; protected RangeOfInfluence range; protected Set inRange = new HashSet(); @@ -152,6 +157,7 @@ public abstract class PlayerImpl> implements Player, Ser this.manaPool = player.manaPool.copy(); this.passed = player.passed; this.passedTurn = player.passedTurn; + this.passedAllTurns = player.passedAllTurns; this.left = player.left; this.range = player.range; this.canGainLife = player.canGainLife; @@ -188,6 +194,7 @@ public abstract class PlayerImpl> implements Player, Ser this.left = false; this.passed = false; this.passedTurn = false; + this.passedAllTurns = false; this.canGainLife = true; this.canLoseLife = true; game.getState().getWatchers().add(new BloodthirstWatcher(playerId)); @@ -1445,4 +1452,9 @@ public abstract class PlayerImpl> implements Player, Ser public boolean autoLoseGame() { return false; } + + @Override + public void becomesActivePlayer() { + this.passedAllTurns = false; + } }