From 91a748cb1cd6e9a4061ab69af2bac6e3f209ca36 Mon Sep 17 00:00:00 2001 From: Maxmtg Date: Sun, 14 Apr 2013 09:11:55 +0000 Subject: [PATCH] CostRemoveCounter assigns cntRemoved for correct AI payment --- .../java/forge/card/cost/CostRemoveCounter.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/forge/card/cost/CostRemoveCounter.java b/src/main/java/forge/card/cost/CostRemoveCounter.java index ab6d82ed63b..838c53d042a 100644 --- a/src/main/java/forge/card/cost/CostRemoveCounter.java +++ b/src/main/java/forge/card/cost/CostRemoveCounter.java @@ -146,9 +146,8 @@ public class CostRemoveCounter extends CostPartWithList { executePayment(ability, source); return true; } - - - + + List validCards = CardLists.getValidCards(ability.getActivatingPlayer().getCardsIn(getZone()), getType().split(";"), ability.getActivatingPlayer(), source); if (this.getZone().equals(ZoneType.Battlefield)) { final InputSelectCardToRemoveCounter inp = new InputSelectCardToRemoveCounter(cntRemoved, getCounter(), validCards); @@ -326,11 +325,12 @@ public class CostRemoveCounter extends CostPartWithList { Integer c = this.convertAmount(); if (c == null) { if (amount.equals("All")) { - c = source.getCounters(this.counter); + cntRemoved = source.getCounters(this.counter); } else { - c = AbilityUtils.calculateAmount(source, amount, ability); + cntRemoved = AbilityUtils.calculateAmount(source, amount, ability); } - } + } else + cntRemoved = c.intValue(); if (this.payCostFromSource()) { executePayment(ability, source); @@ -339,7 +339,7 @@ public class CostRemoveCounter extends CostPartWithList { executePayment(ability, card); } } - source.setSVar("CostCountersRemoved", Integer.toString(c)); + source.setSVar("CostCountersRemoved", Integer.toString(cntRemoved)); } @Override