1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-03-24 01:02:43 -09:00

[NCC] fix Gavel of the Righteous alternate equip

This commit is contained in:
theelk801 2023-04-13 16:23:58 -04:00
parent 947351932b
commit 1021443b2a

View file

@ -7,7 +7,6 @@ import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.Outcome;
import mage.counters.Counter;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -47,7 +46,16 @@ public class RemoveCountersSourceCost extends CostImpl {
@Override
public boolean canPay(Ability ability, Ability source, UUID controllerId, Game game) {
Permanent permanent = game.getPermanent(source.getSourceId());
return permanent != null && permanent.getCounters(game).getCount(name) >= amount;
return permanent != null && name.isEmpty()
? permanent
.getCounters(game)
.values()
.stream()
.map(Counter::getCount)
.anyMatch(i -> i > 0)
: permanent
.getCounters(game)
.getCount(name) >= amount;
}
@Override