- Added the option "AllCounters" to AF RemoveCounterAll.

This commit is contained in:
Sloth
2011-09-14 15:37:47 +00:00
parent f588a07c57
commit 26c284135f
2 changed files with 11 additions and 2 deletions

View File

@@ -1663,9 +1663,14 @@ public class AbilityFactory_Counters {
Counters cType = Counters.valueOf(params.get("CounterType"));
int amount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("CounterNum"), sa);
String amountString = Integer.toString(amount);
if(params.containsKey("AllCounters")) {
amountString = "all";
}
sb.append("Remove ").append(amount).append(" ").append(cType.getName()).append(" counter");
if (amount != 1) { sb.append("s"); }
if (!amountString.equals("1")) { sb.append("s"); }
sb.append(" from each valid permanent.");
Ability_Sub abSub = sa.getSubAbility();
@@ -1723,6 +1728,10 @@ public class AbilityFactory_Counters {
}
for (Card tgtCard : cards) {
if(params.containsKey("AllCounters")) {
counterAmount = tgtCard.getCounters(Counters.valueOf(type));
}
tgtCard.subtractCounter(Counters.valueOf(type), counterAmount);
}
}