use of mage.abilities.effects.common.PreventAllDamageByAllPermanentsEffect in project mage by magefree.
the class InquisitorsSnareEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent targetCreature = game.getPermanent(source.getFirstTarget());
if (targetCreature != null) {
FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.add(new PermanentIdPredicate(targetCreature.getId()));
game.addEffect(new PreventAllDamageByAllPermanentsEffect(filter, Duration.EndOfTurn, false), source);
if (targetCreature.getColor(game).isBlack() || targetCreature.getColor(game).isRed()) {
return targetCreature.destroy(source, game, false);
}
}
return false;
}
Aggregations