mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
CostRemoveCounter assigns cntRemoved for correct AI payment
This commit is contained in:
@@ -148,7 +148,6 @@ public class CostRemoveCounter extends CostPartWithList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<Card> validCards = CardLists.getValidCards(ability.getActivatingPlayer().getCardsIn(getZone()), getType().split(";"), ability.getActivatingPlayer(), source);
|
List<Card> validCards = CardLists.getValidCards(ability.getActivatingPlayer().getCardsIn(getZone()), getType().split(";"), ability.getActivatingPlayer(), source);
|
||||||
if (this.getZone().equals(ZoneType.Battlefield)) {
|
if (this.getZone().equals(ZoneType.Battlefield)) {
|
||||||
final InputSelectCardToRemoveCounter inp = new InputSelectCardToRemoveCounter(cntRemoved, getCounter(), validCards);
|
final InputSelectCardToRemoveCounter inp = new InputSelectCardToRemoveCounter(cntRemoved, getCounter(), validCards);
|
||||||
@@ -326,11 +325,12 @@ public class CostRemoveCounter extends CostPartWithList {
|
|||||||
Integer c = this.convertAmount();
|
Integer c = this.convertAmount();
|
||||||
if (c == null) {
|
if (c == null) {
|
||||||
if (amount.equals("All")) {
|
if (amount.equals("All")) {
|
||||||
c = source.getCounters(this.counter);
|
cntRemoved = source.getCounters(this.counter);
|
||||||
} else {
|
} else {
|
||||||
c = AbilityUtils.calculateAmount(source, amount, ability);
|
cntRemoved = AbilityUtils.calculateAmount(source, amount, ability);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else
|
||||||
|
cntRemoved = c.intValue();
|
||||||
|
|
||||||
if (this.payCostFromSource()) {
|
if (this.payCostFromSource()) {
|
||||||
executePayment(ability, source);
|
executePayment(ability, source);
|
||||||
@@ -339,7 +339,7 @@ public class CostRemoveCounter extends CostPartWithList {
|
|||||||
executePayment(ability, card);
|
executePayment(ability, card);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
source.setSVar("CostCountersRemoved", Integer.toString(c));
|
source.setSVar("CostCountersRemoved", Integer.toString(cntRemoved));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user