mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Merge branch 'fixAllCounters' into 'master'
Fix SubCounter<All abilities not working See merge request core-developers/forge!3652
This commit is contained in:
@@ -140,7 +140,13 @@ public class CostRemoveCounter extends CostPart {
|
|||||||
final Card source = ability.getHostCard();
|
final Card source = ability.getHostCard();
|
||||||
final String type = this.getType();
|
final String type = this.getType();
|
||||||
|
|
||||||
final Integer amount = this.convertAmount();
|
final Integer amount;
|
||||||
|
if (getAmount().equals("All")) {
|
||||||
|
amount = source.getCounters(cntrs);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
amount = this.convertAmount();
|
||||||
|
}
|
||||||
if (this.payCostFromSource()) {
|
if (this.payCostFromSource()) {
|
||||||
return (amount == null) || ((source.getCounters(cntrs) - amount) >= 0);
|
return (amount == null) || ((source.getCounters(cntrs) - amount) >= 0);
|
||||||
}
|
}
|
||||||
@@ -170,7 +176,14 @@ public class CostRemoveCounter extends CostPart {
|
|||||||
Card source = ability.getHostCard();
|
Card source = ability.getHostCard();
|
||||||
|
|
||||||
int removed = 0;
|
int removed = 0;
|
||||||
int toRemove = AbilityUtils.calculateAmount(source, getAmount(), ability);
|
final int toRemove;
|
||||||
|
if (getAmount().equals("All")) {
|
||||||
|
toRemove = source.getCounters(counter);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
toRemove = AbilityUtils.calculateAmount(source, getAmount(), ability);
|
||||||
|
}
|
||||||
|
|
||||||
// for this cost, the list should be only one
|
// for this cost, the list should be only one
|
||||||
for (Card c : decision.cards) {
|
for (Card c : decision.cards) {
|
||||||
removed += toRemove;
|
removed += toRemove;
|
||||||
|
|||||||
Reference in New Issue
Block a user