diff --git a/Mage/src/main/java/mage/abilities/costs/common/PayLifeCost.java b/Mage/src/main/java/mage/abilities/costs/common/PayLifeCost.java index 0e085bb1603..e35de153b5e 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/PayLifeCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/PayLifeCost.java @@ -1,16 +1,13 @@ - - package mage.abilities.costs.common; +import java.util.UUID; import mage.abilities.Ability; +import mage.abilities.costs.Cost; import mage.abilities.costs.CostImpl; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.game.Game; -import java.util.UUID; -import mage.abilities.costs.Cost; - /** * * @author BetaSteward_at_googlemail.com @@ -36,11 +33,12 @@ public class PayLifeCost extends CostImpl { @Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - //118.4. If a cost or effect allows a player to pay an amount of life greater than 0, + //118.4. If a cost or effect allows a player to pay an amount of life greater than 0, //the player may do so only if their life total is greater than or equal to the - //amount of the payment. If a player pays life, the payment is subtracted from his or + //amount of the payment. If a player pays life, the payment is subtracted from his or //her life total; in other words, the player loses that much life. (Players can always pay 0 life.) int lifeToPayAmount = amount.calculate(game, ability, null); + // Paying 0 life is not considered paying any life. if (lifeToPayAmount > 0 && !game.getPlayer(controllerId).canPayLifeCost()) { return false; } diff --git a/Mage/src/main/java/mage/abilities/costs/common/PayVariableLifeCost.java b/Mage/src/main/java/mage/abilities/costs/common/PayVariableLifeCost.java index 47cc2a91fb0..4da6753e7e0 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/PayVariableLifeCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/PayVariableLifeCost.java @@ -1,5 +1,3 @@ - - package mage.abilities.costs.common; import mage.abilities.Ability; @@ -12,7 +10,6 @@ import mage.players.Player; * * @author LevelX2 */ - public class PayVariableLifeCost extends VariableCostImpl { public PayVariableLifeCost() { @@ -21,7 +18,7 @@ public class PayVariableLifeCost extends VariableCostImpl { public PayVariableLifeCost(boolean additionalCostText) { super("life to pay"); - this.text = new StringBuilder(additionalCostText ? "as an additional cost to cast this spell, pay ":"Pay ") + this.text = new StringBuilder(additionalCostText ? "as an additional cost to cast this spell, pay " : "Pay ") .append(xText).append(' ').append("life").toString(); } @@ -44,7 +41,10 @@ public class PayVariableLifeCost extends VariableCostImpl { int maxValue = 0; Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - maxValue = controller.getLife(); + // Paying 0 life is not considered paying any life, so paying 0 is still allowed + if (game.getPlayer(source.getControllerId()).canPayLifeCost()) { + maxValue = controller.getLife(); + } } return maxValue; }