forked from External/mage
even more refactoring of ConditionalInterveningIfTriggeredAbility
All checks were successful
/ build_release (push) Successful in 10m45s
All checks were successful
/ build_release (push) Successful in 10m45s
This commit is contained in:
parent
6bbd4f457c
commit
8d93cb8bcd
56 changed files with 443 additions and 642 deletions
|
|
@ -12,14 +12,17 @@ public enum SourceHasCountersCondition implements Condition {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = source.getSourcePermanentOrLKI(game);
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
return permanent
|
||||
return permanent != null
|
||||
&& permanent
|
||||
.getCounters(game)
|
||||
.values()
|
||||
.stream()
|
||||
.mapToInt(Counter::getCount)
|
||||
.anyMatch(x -> x > 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{this} has counters on it";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue