use of mage.filter.common.FilterOpponentsCreaturePermanent in project mage by magefree.
the class RumblingRuinEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int counter = 1;
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) {
if (permanent == null || !permanent.isCreature(game)) {
continue;
}
counter += permanent.getCounters(game).getCount(CounterType.P1P1);
}
FilterCreaturePermanent filter = new FilterOpponentsCreaturePermanent();
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, counter));
game.addEffect(new CantBlockAllEffect(filter, Duration.EndOfTurn), source);
return true;
}
Aggregations