Search in sources :

Example 16 with FilterLandCard

use of mage.filter.common.FilterLandCard in project mage by magefree.

the class TheMendingOfDominariaSecondEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        controller.moveCards(controller.getGraveyard().getCards(new FilterLandCard(), source.getSourceId(), source.getControllerId(), game), Zone.BATTLEFIELD, source, game, false, false, false, null);
        for (Card card : controller.getGraveyard().getCards(game)) {
            controller.moveCardToLibraryWithInfo(card, source, game, Zone.GRAVEYARD, true, true);
        }
        controller.shuffleLibrary(source, game);
    }
    return false;
}
Also used : Player(mage.players.Player) FilterLandCard(mage.filter.common.FilterLandCard) FilterLandCard(mage.filter.common.FilterLandCard) Card(mage.cards.Card)

Example 17 with FilterLandCard

use of mage.filter.common.FilterLandCard in project mage by magefree.

the class TrenchGorgerEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        TargetCardInLibrary target = new TargetCardInLibrary(0, Integer.MAX_VALUE, new FilterLandCard("any number of land cards"));
        target.choose(outcome, controller.getId(), controller.getId(), game);
        int count = 0;
        for (UUID cardId : target.getTargets()) {
            Card card = game.getCard(cardId);
            if (card != null) {
                controller.moveCardToExileWithInfo(card, null, "", source, game, Zone.LIBRARY, true);
                count++;
            }
        }
        controller.shuffleLibrary(source, game);
        game.addEffect(new SetPowerToughnessSourceEffect(count, count, Duration.EndOfGame, SubLayer.SetPT_7b), source);
        return true;
    }
    return false;
}
Also used : SetPowerToughnessSourceEffect(mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect) Player(mage.players.Player) FilterLandCard(mage.filter.common.FilterLandCard) UUID(java.util.UUID) TargetCardInLibrary(mage.target.common.TargetCardInLibrary) FilterLandCard(mage.filter.common.FilterLandCard) Card(mage.cards.Card)

Aggregations

FilterLandCard (mage.filter.common.FilterLandCard)17 Player (mage.players.Player)17 Card (mage.cards.Card)7 CardsImpl (mage.cards.CardsImpl)7 UUID (java.util.UUID)6 Permanent (mage.game.permanent.Permanent)6 TargetCardInLibrary (mage.target.common.TargetCardInLibrary)6 Cards (mage.cards.Cards)5 TargetCard (mage.target.TargetCard)4 LinkedHashSet (java.util.LinkedHashSet)3 MageObject (mage.MageObject)3 TargetCardInHand (mage.target.common.TargetCardInHand)3 HashSet (java.util.HashSet)1 Cost (mage.abilities.costs.Cost)1 DiscardTargetCost (mage.abilities.costs.common.DiscardTargetCost)1 SetPowerToughnessSourceEffect (mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect)1 FilterCard (mage.filter.FilterCard)1 FilterPermanent (mage.filter.FilterPermanent)1 FilterControlledLandPermanent (mage.filter.common.FilterControlledLandPermanent)1 FilterLandPermanent (mage.filter.common.FilterLandPermanent)1