Search in sources :

Example 1 with CantAttackAnyPlayerAllEffect

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;
}
Also used : TargetPlayer(mage.target.TargetPlayer) Player(mage.players.Player) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) ControllerIdPredicate(mage.filter.predicate.permanent.ControllerIdPredicate) ContinuousEffect(mage.abilities.effects.ContinuousEffect) CantAttackAnyPlayerAllEffect(mage.abilities.effects.common.combat.CantAttackAnyPlayerAllEffect)

Aggregations

ContinuousEffect (mage.abilities.effects.ContinuousEffect)1 CantAttackAnyPlayerAllEffect (mage.abilities.effects.common.combat.CantAttackAnyPlayerAllEffect)1 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)1 ControllerIdPredicate (mage.filter.predicate.permanent.ControllerIdPredicate)1 Player (mage.players.Player)1 TargetPlayer (mage.target.TargetPlayer)1