- Implemented the "Remove X counters from among creatures you control" logic when testing the availability of counters on cards to do the CostRemoveCounter payment. Fixes Novijen Sages and similar cards (Ooze Flux, Retribution of the Ancients).

This commit is contained in:
Agetian
2015-10-07 11:12:19 +00:00
parent 74405c38e6
commit b84c5dbc23

View File

@@ -139,11 +139,24 @@ public class CostRemoveCounter extends CostPartWithList {
typeList = CardLists.getValidCards(activator.getCardsIn(this.zone), type.split(";"), activator, source); typeList = CardLists.getValidCards(activator.getCardsIn(this.zone), type.split(";"), activator, source);
} }
if (amount != null) { if (amount != null) {
if (this.getTypeDescription().equals("among creatures you control")) {
// remove X counters from among creatures you control
int totalCounters = 0;
for (Card c : typeList) {
totalCounters += c.getCounters(cntrs);
}
if (totalCounters >= amount) {
return true;
}
} else {
// (default logic) remove X counters from a single permanent
for (Card c : typeList) { for (Card c : typeList) {
if (c.getCounters(cntrs) - amount >= 0) { if (c.getCounters(cntrs) - amount >= 0) {
return true; return true;
} }
} }
}
return false; return false;
} }
} }