Search in sources :

Example 1 with ExileGraveyardAllPlayersEffect

use of mage.abilities.effects.common.ExileGraveyardAllPlayersEffect 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)

Aggregations

ExileAllEffect (mage.abilities.effects.common.ExileAllEffect)1 ExileGraveyardAllPlayersEffect (mage.abilities.effects.common.ExileGraveyardAllPlayersEffect)1 Card (mage.cards.Card)1 FilterCard (mage.filter.FilterCard)1 FilterPermanent (mage.filter.FilterPermanent)1 NamePredicate (mage.filter.predicate.mageobject.NamePredicate)1