fixed test failure

This commit is contained in:
Evan Kranzler 2022-04-25 22:38:28 -04:00
parent bfc0b2094a
commit 4304b4a66a
2 changed files with 6 additions and 2 deletions

View file

@ -57,7 +57,7 @@ public final class GavelOfTheRighteous extends CardImpl {
Outcome.BoostCreature,
new OrCost(
"Pay {3} or remove a counter from {this}",
new GenericManaCost(3), new RemoveCountersSourceCost(null)
new GenericManaCost(3), new RemoveCountersSourceCost()
)
));
}

View file

@ -26,11 +26,15 @@ public class RemoveCountersSourceCost extends CostImpl {
private final int amount;
private final String name;
public RemoveCountersSourceCost() {
this((Counter) null);
}
public RemoveCountersSourceCost(Counter counter) {
this.amount = counter != null ? counter.getCount() : 1;
this.name = counter != null ? counter.getName() : "";
this.text = new StringBuilder("remove ")
.append((amount == 1 ? CounterType.findArticle(counter.getName()) : CardUtil.numberToText(amount)))
.append((amount == 1 ? CounterType.findArticle(name) : CardUtil.numberToText(amount)))
.append(name.isEmpty() ? "" : (' ' + name))
.append(" counter")
.append((amount != 1 ? "s" : ""))