Package mage.filter.common

Examples of mage.filter.common.FilterNonlandCard


            Player player = game.getPlayer(playerId);
            String playerName = new StringBuilder(player.getName()).append("'s").toString();
            if (source.getControllerId().equals(player.getId())) {
                playerName = "your";
            }
            TargetCardInLibrary target = new TargetCardInLibrary(new FilterNonlandCard(new StringBuilder("nonland card from ").append(playerName).append(" library").toString()));
            if (controller.searchLibrary(target, game, playerId)) {
                UUID targetId = target.getFirstTarget();
                Card card = player.getLibrary().remove(targetId, game);
                if (card != null) {
                    controller.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourcePermanent.getName(), source.getSourceId(), game, Zone.LIBRARY);
View Full Code Here


        Player opponent = game.getPlayer(source.getFirstTarget());
        Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
        if (controller != null && opponent != null && sourcePermanent != null) {
            opponent.revealCards(sourcePermanent.getName(), opponent.getHand(), game);

            TargetCard target = new TargetCard(Zone.PICK, new FilterNonlandCard("nonland card to exile"));
            if (controller.choose(Outcome.Exile, opponent.getHand(), target, game)) {
                Card card = opponent.getHand().get(target.getFirstTarget(), game);
                if (card != null) {
                    controller.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourcePermanent.getName(), source.getSourceId(), game, Zone.HAND);
                }
View Full Code Here

        Player controller = game.getPlayer(source.getControllerId());
        if (opponent != null && controller != null) {
            Cards cardsInHand = new CardsImpl(Zone.PICK);
            cardsInHand.addAll(opponent.getHand());
            if (cardsInHand.size() > 0) {
                TargetCard target = new TargetCard(1, Zone.PICK, new FilterNonlandCard());
                if (controller.chooseTarget(outcome, cardsInHand, target, source, game)) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {
                        controller.cast(card.getSpellAbility(), game, true);
                    }
View Full Code Here

                if (cost instanceof RemoveVariableCountersSourceCost) {
                    cmc = ((RemoveVariableCountersSourceCost)cost).getAmount();
                }
            }

            FilterNonlandCard filter = new FilterNonlandCard("nonland card with converted mana cost X = " + cmc);
            filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, cmc));
            TargetCardInLibrary target = new TargetCardInLibrary(filter);

            if (player.searchLibrary(target, game)) {
                Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
                if (card != null) {
View Full Code Here

        if (opponent != null && you != null) {
            Cards cardsInHand = new CardsImpl(Zone.PICK);
            cardsInHand.addAll(opponent.getHand());
            opponent.revealCards("Opponents hand", cardsInHand, game);
            if (cardsInHand.size() > 0
                    && cardsInHand.getCards(new FilterNonlandCard(), game).size() > 0) {
                TargetCard target = new TargetCard(1, Zone.PICK, new FilterNonlandCard());
                if (you.chooseTarget(Outcome.PlayForFree, cardsInHand, target, source, game)) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {
                        you.cast(card.getSpellAbility(), game, true);
                    }
View Full Code Here

}

class TargetTwoNonLandCardsWithSameNameInHand extends TargetCardInHand {

    public TargetTwoNonLandCardsWithSameNameInHand() {
        super(2, 2, new FilterNonlandCard("two nonland cards with the same name"));
    }
View Full Code Here

           
            // reveal hand of target player
            targetPlayer.revealCards(sourceObject.getLogName(), targetPlayer.getHand(), game);
           
            // You choose a nonland card from it
            TargetCardInHand target = new TargetCardInHand(new FilterNonlandCard());
            target.setNotTarget(true);
            Card chosenCard = null;
            if (controller.choose(Outcome.Benefit, targetPlayer.getHand(), target, game)) {
                chosenCard = game.getCard(target.getFirstTarget());
            }
View Full Code Here

TOP

Related Classes of mage.filter.common.FilterNonlandCard

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.