use of mage.filter.common.FilterNonlandPermanent in project mage by magefree.
the class BloodletterEffect method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Map<Character, Integer> initialCount = new HashMap<>();
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterNonlandPermanent(), getControllerId(), getSourceId(), game)) {
Character initial = permanent.getName().charAt(0);
initialCount.putIfAbsent(initial, 0);
initialCount.put(initial, initialCount.get(initial) + 1);
}
for (Map.Entry<Character, Integer> entry : initialCount.entrySet()) {
if (entry.getValue() >= 3) {
return true;
}
}
return false;
}
use of mage.filter.common.FilterNonlandPermanent in project mage by magefree.
the class HasLowestCMCAmongstNonlandPermanentsPredicate method apply.
@Override
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
FilterPermanent filter = new FilterNonlandPermanent();
filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, input.getObject().getManaValue()));
return !game.getBattlefield().contains(filter, input.getSourceId(), input.getPlayerId(), game, 1);
}
Aggregations