Search in sources :

Example 1 with ExileAllEffect

use of mage.abilities.effects.common.ExileAllEffect in project mage by magefree.

the class MoratoriumStoneEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Card card = game.getCard(source.getFirstTarget());
    if (card == null) {
        return false;
    }
    String cardName = card.getName();
    FilterCard filter1 = new FilterCard();
    filter1.add(new NamePredicate(cardName));
    FilterPermanent filter2 = new FilterPermanent();
    filter2.add(new NamePredicate(cardName));
    return new ExileGraveyardAllPlayersEffect(filter1).apply(game, source) && new ExileAllEffect(filter2).apply(game, source);
}
Also used : FilterCard(mage.filter.FilterCard) ExileGraveyardAllPlayersEffect(mage.abilities.effects.common.ExileGraveyardAllPlayersEffect) NamePredicate(mage.filter.predicate.mageobject.NamePredicate) FilterPermanent(mage.filter.FilterPermanent) ExileAllEffect(mage.abilities.effects.common.ExileAllEffect) FilterCard(mage.filter.FilterCard) Card(mage.cards.Card)

Example 2 with ExileAllEffect

use of mage.abilities.effects.common.ExileAllEffect in project mage by magefree.

the class AjaniStrengthOfThePrideEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player == null || player.getLife() < game.getStartingLife() + 15) {
        return false;
    }
    new ExileSourceEffect().apply(game, source);
    return new ExileAllEffect(filter).apply(game, source);
}
Also used : ExileSourceEffect(mage.abilities.effects.common.ExileSourceEffect) Player(mage.players.Player) ExileAllEffect(mage.abilities.effects.common.ExileAllEffect)

Example 3 with ExileAllEffect

use of mage.abilities.effects.common.ExileAllEffect in project mage by magefree.

the class NightmareUnmakingEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player == null) {
        return false;
    }
    FilterPermanent filter = new FilterCreaturePermanent();
    filter.add(new PowerPredicate(comparisonType, player.getHand().size()));
    return new ExileAllEffect(filter).apply(game, source);
}
Also used : Player(mage.players.Player) FilterPermanent(mage.filter.FilterPermanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) ExileAllEffect(mage.abilities.effects.common.ExileAllEffect) PowerPredicate(mage.filter.predicate.mageobject.PowerPredicate)

Example 4 with ExileAllEffect

use of mage.abilities.effects.common.ExileAllEffect in project mage by magefree.

the class DualNatureExileEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent creature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
    if (creature != null) {
        FilterPermanent filter = new FilterPermanent();
        filter.add(TokenPredicate.TRUE);
        filter.add(new NamePredicate(creature.getName()));
        new ExileAllEffect(filter).apply(game, source);
        return true;
    }
    return false;
}
Also used : NamePredicate(mage.filter.predicate.mageobject.NamePredicate) FilterPermanent(mage.filter.FilterPermanent) ExileAllEffect(mage.abilities.effects.common.ExileAllEffect) FilterPermanent(mage.filter.FilterPermanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) Permanent(mage.game.permanent.Permanent)

Aggregations

ExileAllEffect (mage.abilities.effects.common.ExileAllEffect)4 FilterPermanent (mage.filter.FilterPermanent)3 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)2 NamePredicate (mage.filter.predicate.mageobject.NamePredicate)2 Player (mage.players.Player)2 ExileGraveyardAllPlayersEffect (mage.abilities.effects.common.ExileGraveyardAllPlayersEffect)1 ExileSourceEffect (mage.abilities.effects.common.ExileSourceEffect)1 Card (mage.cards.Card)1 FilterCard (mage.filter.FilterCard)1 PowerPredicate (mage.filter.predicate.mageobject.PowerPredicate)1 Permanent (mage.game.permanent.Permanent)1