Package mage.target

Examples of mage.target.TargetCard


        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


                filterAuraCard.add(new SubtypePredicate("Aura"));
                filterAuraCard.add(new AuraCardCanAttachToPermanentId(evershrikePermanent.getId()));
                filterAuraCard.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, xAmount));
                int count = you.getHand().count(filterAuraCard, game);
                while (you.isInGame() && count > 0 && you.chooseUse(Outcome.Benefit, "Do you wish to put an Aura card from your hand onto Evershrike", game)) {
                    TargetCard targetAura = new TargetCard(Zone.PICK, filterAuraCard);
                    if (you.choose(Outcome.Benefit, you.getHand(), targetAura, game)) {
                        Card aura = game.getCard(targetAura.getFirstTarget());
                        if (aura != null) {
                            game.getState().setValue("attachTo:" + aura.getId(), evershrikePermanent);
                            aura.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), you.getId());
                            evershrikePermanent.addAttachment(aura.getId(), game);
                            exiled = false;
View Full Code Here

                }
            }

            if (!cards.isEmpty()) {
                player.revealCards("Tracker's Instincts", cards, game);
                TargetCard target = new TargetCard(Zone.PICK, new FilterCreatureCard("creature card to put in hand"));
                if (creaturesFound && player.choose(Outcome.DrawCard, cards, target, game)) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {
                        cards.remove(card);
                        card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                    }
View Full Code Here

            for (Card card: cardsElf.getCards(game)) {
                player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
            }

            TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
            while (player.isInGame() && cards2.size() > 0 && player.choose(Outcome.Detriment, cards2, target, game)) {
                Card card = cards2.get(target.getFirstTarget(), game);
                if (card != null) {
                    cards2.remove(card);
                    card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
                }
                target.clearChosen();
            }
        }
        return true;
    }
View Full Code Here

                card.moveToExile(null, null, source.getSourceId(), game);
            }
            FilterCard filter = new FilterCard("creature and/or land cards to put onto the battlefield");
            filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE),
                                     new CardTypePredicate(CardType.LAND)));
            TargetCard target1 = new TargetCard(0, Integer.MAX_VALUE, Zone.EXILED, filter);
            if (cards.size() > 0
                    && target1.canChoose(source.getSourceId(), source.getControllerId(), game)
                    && player.choose(Outcome.PutCardInPlay, cards, target1, game)) {
                for (UUID targetId: target1.getTargets()) {
                    Card card = cards.get(targetId, game);
                    if (card != null) {
                        player.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId());
                    }
                }
View Full Code Here

                    Card card = player.getLibrary().getCard(cardId, game);
                    revealed.add(card);
                }
                player.revealCards("Cultivate", revealed, game);
                if (target.getTargets().size() == 2) {
                    TargetCard target2 = new TargetCard(Zone.PICK, filter);
                    player.choose(Outcome.Benefit, revealed, target2, game);
                    Card card = revealed.get(target2.getFirstTarget(), game);
                    if (card != null) {
                        player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true);
                        revealed.remove(card);
                    }
                    card = revealed.getCards(game).iterator().next();
View Full Code Here

                    game.setZone(card.getId(), Zone.PICK);
                }
            }
            player.lookAtCards("Plunge into Darkness", cards, game);

            TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put into your hand"));
            if (player.choose(Outcome.DrawCard, cards, target, game)) {
                Card card = cards.get(target.getFirstTarget(), game);
                if (card != null) {
                    cards.remove(card);
                    card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                    game.informPlayers("Plunge into Darkness: " + player.getName() + " puts a card into his or her hand");
                }
View Full Code Here

                        Card card = player.getLibrary().getCard(cardId, game);
                        revealed.add(card);
                    }
                    player.revealCards("Jarad's Orders", revealed, game);
                    if (target.getTargets().size() == 2) {
                        TargetCard target2 = new TargetCard(Zone.PICK, filter);
                        player.choose(Outcome.Benefit, revealed, target2, game);
                        Card card = revealed.get(target2.getFirstTarget(), game);
                        card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                        revealed.remove(card);
                        card = revealed.getCards(game).iterator().next();
                        card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
                    }
View Full Code Here

                                     new CardTypePredicate(CardType.CREATURE),
                                     new CardTypePredicate(CardType.ENCHANTMENT),
                                     new CardTypePredicate(CardType.LAND),
                                     new CardTypePredicate(CardType.PLANESWALKER)
                    ));
            TargetCard target1 = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, filter);
            target1.setRequired(false);

            controller.choose(Outcome.PutCardInPlay, cards, target1, game);
            for (UUID cardId: target1.getTargets()) {
                Card card = cards.get(cardId, game);
                if (card != null) {
                    cards.remove(card);
                    controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
                }
View Full Code Here

                }
            }

            if (!cards.isEmpty()) {
                player.revealCards("Grisly Salvage", cards, game);
                TargetCard target = new TargetCard(Zone.PICK, filterPutInHand);
                if (properCardFound && player.choose(Outcome.DrawCard, cards, target, game)) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {
                        cards.remove(card);
                        card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                    }
View Full Code Here

TOP

Related Classes of mage.target.TargetCard

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.