mirror of
https://github.com/correl/mage.git
synced 2025-03-29 11:43:34 -09:00
[NCC] fix Gavel of the Righteous alternate equip
This commit is contained in:
parent
947351932b
commit
1021443b2a
1 changed files with 10 additions and 2 deletions
|
@ -7,7 +7,6 @@ import mage.choices.Choice;
|
||||||
import mage.choices.ChoiceImpl;
|
import mage.choices.ChoiceImpl;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.counters.Counter;
|
import mage.counters.Counter;
|
||||||
import mage.counters.CounterType;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
@ -47,7 +46,16 @@ public class RemoveCountersSourceCost extends CostImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean canPay(Ability ability, Ability source, UUID controllerId, Game game) {
|
public boolean canPay(Ability ability, Ability source, UUID controllerId, Game game) {
|
||||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
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
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue