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 396ae4a322..6021b18fbe 100644 --- a/Mage.Client/src/main/java/mage/client/game/GamePanel.java +++ b/Mage.Client/src/main/java/mage/client/game/GamePanel.java @@ -883,10 +883,12 @@ public final class GamePanel extends javax.swing.JPanel { public void select(String message, GameView gameView, int messageId, Map options) { updateGame(gameView, options); + boolean controllingPlayer = false; for (PlayerView playerView : gameView.getPlayers()) { if (playerView.getPlayerId().equals(playerId)) { // magenoxx: because of uncaught bug with saving state, rolling back and stack // undo is allowed only for empty stack + controllingPlayer = !gameView.getPriorityPlayerName().equals(playerView.getName()); if (playerView.getStatesSavedSize() > 0 && gameView.getStack().size() == 0) { feedbackPanel.allowUndo(playerView.getStatesSavedSize()); } @@ -896,13 +898,17 @@ public final class GamePanel extends javax.swing.JPanel { } Map panelOptions = new HashMap<>(); panelOptions.put("your_turn", true); - String playerName; + String activePlayerText; if (gameView.getActivePlayerId().equals(playerId)) { - playerName = "Your turn"; + activePlayerText = "Your turn"; } else { - playerName = gameView.getActivePlayerName(); + activePlayerText = gameView.getActivePlayerName() +"'s turn"; } - String messageToDisplay = message + "
" + playerName +" / " + gameView.getStep().toString() + "
"; + String priorityPlayerText = ""; + if (controllingPlayer) { + priorityPlayerText = " / priority " + gameView.getPriorityPlayerName(); + } + String messageToDisplay = message + "
" + activePlayerText +" / " + gameView.getStep().toString() + priorityPlayerText + "
"; this.feedbackPanel.getFeedback(FeedbackMode.SELECT, messageToDisplay, gameView.getSpecial(), panelOptions, messageId); } 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 456bfb651f..5a3750c595 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 @@ -568,10 +568,18 @@ public class HumanPlayer extends PlayerImpl { revealFaceDownCard((Card) object, game); result = true; } - LinkedHashMap useableAbilities = getUseableActivatedAbilities(object, zone, game); - if (useableAbilities != null && useableAbilities.size() > 0) { - activateAbility(useableAbilities, object, game); - result = true; + Player actingPlayer = null; + if (game.getPriorityPlayerId().equals(playerId)) { + actingPlayer = this; + } else if (getPlayersUnderYourControl().contains(game.getPriorityPlayerId())) { + actingPlayer = game.getPlayer(game.getPriorityPlayerId()); + } + if (actingPlayer != null) { + LinkedHashMap useableAbilities = actingPlayer.getUseableActivatedAbilities(object, zone, game); + if (useableAbilities != null && useableAbilities.size() > 0) { + activateAbility(useableAbilities, object, game); + result = true; + } } } } diff --git a/Mage/src/mage/abilities/PlayLandAbility.java b/Mage/src/mage/abilities/PlayLandAbility.java index f25fc785ad..416bb45003 100644 --- a/Mage/src/mage/abilities/PlayLandAbility.java +++ b/Mage/src/mage/abilities/PlayLandAbility.java @@ -55,7 +55,7 @@ public class PlayLandAbility extends ActivatedAbilityImpl { if (!controlsAbility(playerId, game)) { return false; } - //20091005 - 114.2a + //20091005 - 114.2a return game.canPlaySorcery(playerId) && game.getPlayer(playerId).canPlayLand(); } diff --git a/Mage/src/mage/abilities/common/delayed/AtTheEndOfTurnStepPostDelayedTriggeredAbility.java b/Mage/src/mage/abilities/common/delayed/AtTheEndOfTurnStepPostDelayedTriggeredAbility.java index d98ca8965a..b7ad76204c 100644 --- a/Mage/src/mage/abilities/common/delayed/AtTheEndOfTurnStepPostDelayedTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/delayed/AtTheEndOfTurnStepPostDelayedTriggeredAbility.java @@ -38,7 +38,7 @@ import mage.game.events.GameEvent; public class AtTheEndOfTurnStepPostDelayedTriggeredAbility extends DelayedTriggeredAbility { public AtTheEndOfTurnStepPostDelayedTriggeredAbility(Effect effect) { - super(effect); + this(effect, false); } public AtTheEndOfTurnStepPostDelayedTriggeredAbility(Effect effect, boolean usesStack) { @@ -68,6 +68,6 @@ public class AtTheEndOfTurnStepPostDelayedTriggeredAbility extends DelayedTrigge @Override public String getRule() { - return "At end of turn " + modes.getText(); + return "At end of turn " + super.getRule(); } } diff --git a/Mage/src/mage/abilities/effects/common/LoseControlOnOtherPlayersControllerEffect.java b/Mage/src/mage/abilities/effects/common/LoseControlOnOtherPlayersControllerEffect.java index ce7ad10372..5ddf7d65e2 100644 --- a/Mage/src/mage/abilities/effects/common/LoseControlOnOtherPlayersControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/LoseControlOnOtherPlayersControllerEffect.java @@ -40,8 +40,9 @@ import mage.players.Player; */ public class LoseControlOnOtherPlayersControllerEffect extends OneShotEffect { - public LoseControlOnOtherPlayersControllerEffect() { + public LoseControlOnOtherPlayersControllerEffect(String controllingPlayerName, String controlledPlayerName) { super(Outcome.Detriment); + staticText = controlledPlayerName + " lost control over " + controlledPlayerName; } public LoseControlOnOtherPlayersControllerEffect(final LoseControlOnOtherPlayersControllerEffect effect) { diff --git a/Mage/src/mage/abilities/keyword/GraftAbility.java b/Mage/src/mage/abilities/keyword/GraftAbility.java index ca9d57b6f1..45eed19b92 100644 --- a/Mage/src/mage/abilities/keyword/GraftAbility.java +++ b/Mage/src/mage/abilities/keyword/GraftAbility.java @@ -76,7 +76,7 @@ public class GraftAbility extends TriggeredAbilityImpl { addSubAbility(new GraftStaticAbility(amount)); } - public GraftAbility(GraftAbility ability) { + public GraftAbility(final GraftAbility ability) { super(ability); this.amount = ability.amount; this.cardtype = ability.cardtype; diff --git a/Mage/src/mage/players/Player.java b/Mage/src/mage/players/Player.java index a3a13e4451..f2ce8e6aef 100644 --- a/Mage/src/mage/players/Player.java +++ b/Mage/src/mage/players/Player.java @@ -30,6 +30,7 @@ package mage.players; import java.io.Serializable; import java.util.ArrayList; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -379,7 +380,8 @@ public interface Player extends MageItem, Copyable { List getPlayableOptions(Ability ability, Game game); Set getPlayableInHand(Game game); - + LinkedHashMap getUseableActivatedAbilities(MageObject object, Zone zone, Game game); + void addCounters(Counter counter, Game game); List getAttachments(); boolean addAttachment(UUID permanentId, Game game); diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 6a35a5da6d..8b88325759 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -550,7 +550,7 @@ public abstract class PlayerImpl implements Player, Serializable { player.setGameUnderYourControl(false); player.setTurnControlledBy(this.getId()); } - DelayedTriggeredAbility ability = new AtTheEndOfTurnStepPostDelayedTriggeredAbility(new LoseControlOnOtherPlayersControllerEffect()); + DelayedTriggeredAbility ability = new AtTheEndOfTurnStepPostDelayedTriggeredAbility(new LoseControlOnOtherPlayersControllerEffect(this.getLogName(), player.getLogName())); ability.setSourceId(getId()); ability.setControllerId(getId()); game.addDelayedTriggeredAbility(ability); @@ -1174,7 +1174,8 @@ public abstract class PlayerImpl implements Player, Serializable { return useable; } - protected LinkedHashMap getUseableActivatedAbilities(MageObject object, Zone zone, Game game) { + @Override + public LinkedHashMap getUseableActivatedAbilities(MageObject object, Zone zone, Game game) { LinkedHashMap useable = new LinkedHashMap<>(); if (!(object instanceof Permanent) || ((Permanent) object).canUseActivatedAbilities(game)) { for (Ability ability : object.getAbilities()) {