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 de9f95c640b7..815472067543 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 @@ -2928,7 +2928,7 @@ private void setTriggerAutoOrder(PlayerAction playerAction, Game game, Object da protected boolean passWithManaPoolCheck(Game game) { if (userData.confirmEmptyManaPool() - && game.getStack().isEmpty() && getManaPool().count() > 0) { + && game.getStack().isEmpty() && getManaPool().count() > 0 && getManaPool().canLostManaOnEmpty()) { String activePlayerText; if (game.isActivePlayer(playerId)) { activePlayerText = "Your turn"; @@ -2940,7 +2940,7 @@ protected boolean passWithManaPoolCheck(Game game) { priorityPlayerText = " / priority " + game.getPlayer(game.getPriorityPlayerId()).getName(); } // TODO: chooseUse and other dialogs must be under controlling player - if (!chooseUse(Outcome.Detriment, GameLog.getPlayerConfirmColoredText("You still have mana in your mana pool. Pass regardless?") + if (!chooseUse(Outcome.Detriment, GameLog.getPlayerConfirmColoredText("You still have mana in your mana pool and it will be lose. Pass anyway?") + GameLog.getSmallSecondLineText(activePlayerText + " / " + game.getTurnStepType().toString() + priorityPlayerText), null, game)) { sendPlayerAction(PlayerAction.PASS_PRIORITY_CANCEL_ALL_ACTIONS, game, null); return false; diff --git a/Mage/src/main/java/mage/players/ManaPool.java b/Mage/src/main/java/mage/players/ManaPool.java index dd8114a604b4..82bca7edcef1 100644 --- a/Mage/src/main/java/mage/players/ManaPool.java +++ b/Mage/src/main/java/mage/players/ManaPool.java @@ -38,9 +38,10 @@ public class ManaPool implements Serializable { private boolean forcedToPay; // for Word of Command private final List poolBookmark = new ArrayList<>(); // mana pool bookmark for rollback purposes - private final Set doNotEmptyManaTypes = new HashSet<>(); - private boolean manaBecomesBlack = false; - private boolean manaBecomesColorless = false; + // empty mana pool effects + private final Set doNotEmptyManaTypes = new HashSet<>(); // keep some colors + private boolean manaBecomesBlack = false; // replace all pool by black + private boolean manaBecomesColorless = false; // replace all pool by colorless private static final class ConditionalManaInfo { private final ManaType manaType; @@ -147,10 +148,10 @@ && isAutoPaymentRestricted() if (ability.getSourceId().equals(mana.getSourceId()) || !(mana.getSourceObject() instanceof Spell) || ((Spell) mana.getSourceObject()) - .getAbilities(game) - .stream() - .flatMap(a -> a.getAllEffects().stream()) - .anyMatch(ManaEffect.class::isInstance)) { + .getAbilities(game) + .stream() + .flatMap(a -> a.getAllEffects().stream()) + .anyMatch(ManaEffect.class::isInstance)) { continue; // if any of the above cases, not an alt mana payment ability, thus excluded by filter } } @@ -253,6 +254,28 @@ public void init() { manaItems.clear(); } + public boolean canLostManaOnEmpty() { + for (ManaPoolItem item : manaItems) { + for (ManaType manaType : ManaType.values()) { + if (item.get(manaType) == 0) { + continue; + } + if (doNotEmptyManaTypes.contains(manaType)) { + continue; + } + if (manaBecomesBlack) { + continue; + } + if (manaBecomesColorless) { + continue; + } + // found real mana to empty + return true; + } + } + return false; + } + public int emptyPool(Game game) { int total = 0; Iterator it = manaItems.iterator();