use of mage.abilities.effects.common.combat.CantBlockAllEffect 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;
}
use of mage.abilities.effects.common.combat.CantBlockAllEffect in project mage by magefree.
the class EmberGaleEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(source.getFirstTarget());
if (targetPlayer != null) {
FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.add(new ControllerIdPredicate(targetPlayer.getId()));
RestrictionEffect effect = new CantBlockAllEffect(filter, Duration.EndOfTurn);
game.addEffect(effect, source);
FilterPermanent filter2 = new FilterPermanent();
filter2.add(new ControllerIdPredicate(targetPlayer.getId()));
filter2.add(Predicates.or(new ColorPredicate(ObjectColor.WHITE), new ColorPredicate(ObjectColor.BLUE)));
filter2.add(CardType.CREATURE.getPredicate());
for (Permanent creature : game.getBattlefield().getAllActivePermanents(filter2, targetPlayer.getId(), game)) {
creature.damage(1, source.getSourceId(), source, game, false, true);
}
return true;
}
return false;
}
use of mage.abilities.effects.common.combat.CantBlockAllEffect in project mage by magefree.
the class MarkForDeathEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent target = game.getPermanent(source.getFirstTarget());
if (target == null) {
return false;
}
FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.add(new ControllerIdPredicate(target.getControllerId()));
filter.add(Predicates.not(new CardIdPredicate(target.getId())));
ContinuousEffect effect = new BlocksIfAbleTargetEffect(Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(target.getId()));
game.addEffect(effect, source);
target.untap(game);
ContinuousEffect effect2 = new CantBlockAllEffect(filter, Duration.EndOfTurn);
game.addEffect(effect2, source);
return true;
}
Aggregations