use of mage.abilities.effects.common.combat.CantAttackAnyPlayerAllEffect in project mage by magefree.
the class OrissSamiteGuardianCantCastEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
game.addEffect(new OrissSamiteGuardianCantCastEffect(), source);
FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures that player controls");
filter.add(new ControllerIdPredicate(getTargetPointer().getFirst(game, source)));
ContinuousEffect effect = new CantAttackAnyPlayerAllEffect(Duration.EndOfTurn, filter);
game.addEffect(effect, source);
return true;
}
return false;
}
Aggregations