Fixed variable remove counter costs to work also correctly if X=0 (e.g. Retribution of the Ancients and Willbreaker).

This commit is contained in:
LevelX2 2015-10-03 18:22:14 +02:00
parent f6ec543b1b
commit 85f0cc6bb3
4 changed files with 84 additions and 10 deletions

View file

@ -157,8 +157,7 @@ public abstract class VariableCostImpl implements Cost, VariableCost {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
xValue = controller.announceXCost(getMinValue(source, game), getMaxValue(source, game),
new StringBuilder("Announce the number of ").append(actionText).toString(),
game, source, this);
"Announce the number of " + actionText, game, source, this);
}
return xValue;
}

View file

@ -84,6 +84,9 @@ public class RemoveCounterCost extends CostImpl {
int countersRemoved = 0;
Player controller = game.getPlayer(controllerId);
if (controller != null) {
if (countersToRemove == 0) { // Can happen when used for X costs where X = 0;
return paid = true;
}
target.clearChosen();
if (target.choose(Outcome.UnboostCreature, controllerId, sourceId, game)) {
for (UUID targetId : target.getTargets()) {