Package mage.target

Examples of mage.target.TargetCard


                    cards.add(card);
                }
            }
            if (cards.size() > 0) {
                player.lookAtCards("Bitter Revelation", cards, game);
                TargetCard target = new TargetCard(Math.min(2, cards.size()), Zone.PICK, new FilterCard("two cards to put in your hand"));
                if (player.choose(Outcome.DrawCard, cards, target, game)) {
                    for (UUID targetId : target.getTargets()) {
                        Card card = cards.get(targetId, game);
                        if (card != null) {
                            player.putInHand(card, game);
                            cards.remove(card);
                        }  
View Full Code Here


        if (targetOpponent != null) {
            if (targetOpponent.getHand().size() > 0) {
                targetOpponent.revealCards("Mindclaw Shaman", targetOpponent.getHand(), game);
                Player you = game.getPlayer(source.getControllerId());
                if (you != null) {
                    TargetCard target = new TargetCard(Zone.PICK, filter);
                    target.setNotTarget(true);
                    if (you.choose(Outcome.Benefit, targetOpponent.getHand(), target, game)) {
                        Card chosenCard = targetOpponent.getHand().get(target.getFirstTarget(), game);
                        if (chosenCard != null) {
                            if (targetOpponent != null) {
                                if (you.chooseUse(Outcome.Benefit, "Cast the chosen card?", game)) {
                                    you.cast(chosenCard.getSpellAbility(), game, true);
                                } else {
View Full Code Here

            controller.revealCards(sourceObject.getLogName(), cards, game);
            Card card = null;
            if (cards.size() == 1) {
                card = cards.getRandom(game);
            } else {
                TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put into your hand"));
                target.setRequired(true);
                if (controller.choose(Outcome.DrawCard, cards, target, game)) {
                    card = cards.get(target.getFirstTarget(), game);
                }
            }
            if (card != null) {
                cards.remove(card);
                controller.moveCardToHandWithInfo(card, 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

            }

            if (cards.size() > 0) {
                player.lookAtCards("Strategic Planning", cards, game);

                TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put in your hand"));
                if (player.choose(Outcome.Benefit, cards, target, game)) {
                    Card card = cards.get(target.getFirstTarget(), game);
                    if (card != null) {
                        card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                        cards.remove(card);
                    }
                }
View Full Code Here

            }
        }
        player.lookAtCards("Mitotic Manipulation", cards, game);

        if (!cardsFound.isEmpty() && player.chooseUse(Outcome.PutCardInPlay, "Do you wish to put a card on the battlefield?", game)) {
            TargetCard target = new TargetCard(Zone.PICK, filter);

            if (player.choose(Outcome.PutCardInPlay, cardsFound, target, game)) {
                Card card = cards.get(target.getFirstTarget(), game);
                if (card != null) {
                    cards.remove(card);
                    card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId());
                }
            }
        }

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

        player.lookAtCards("Gift of the Gargantuan", cards, game);

        if ((creatureCardFound || landCardFound) && player.chooseUse(Outcome.DrawCard, "Do you wish to reveal a creature card and/or a land card and put them into your hand?", game)) {
            Cards revealedCards = new CardsImpl();

            TargetCard target = new TargetCard(Zone.PICK, new FilterCreatureCard("creature card to reveal and put into your hand"));
            if (creatureCardFound && 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);
                    revealedCards.add(card);
                }
            }

            target = new TargetCard(Zone.PICK, new FilterLandCard("land card to reveal and put into your hand"));
            if (landCardFound && 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);
                    revealedCards.add(card);
                }
            }

            if (!revealedCards.isEmpty()) {
                player.revealCards("Gift of the Gargantuan", revealedCards, game);
            }
        }

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

                    cards.add(card);
                    game.getState().setZone(card.getId(), Zone.PICK);
                }
            }
            if(cards.size() > 0){
                TargetCard target = new TargetCard(Zone.PICK, new FilterCard("Card to put back on top of library"));
                if(controller.chooseTarget(Outcome.Benefit, cards, target, source, game)){
                    Card card = cards.get(target.getFirstTarget(), game);
                    if(card != null){
                        card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
                        cards.remove(card);
                    }
                   
View Full Code Here

                player.loseLife(1, game);
            } else {
                player.shuffleLibrary(game);
            }
           
            TargetCard target = new TargetCard(Zone.PICK, new FilterCard(doAgain ? textBottom : textTop));
            while (player.isInGame() && cards.size() > 1) {
                player.choose(Outcome.Neutral, cards, target, game);
                Card card = cards.get(target.getFirstTarget(), game);
                if (card != null) {
                    cards.remove(card);
                    card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, !doAgain);
                }
                target.clearChosen();
            }
            if (cards.size() == 1) {
                Card card = cards.get(cards.iterator().next(), game);
                card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, !doAgain);
            }
View Full Code Here

                Card card = cards.getRandom(game);
                cards.remove(card);
                card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                return true;
            } else {
                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);
                    }
                }
            }
        }


        TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
        while (cards.size() > 1) {
            player.choose(Outcome.Neutral, cards, target, game);
            Card card = cards.get(target.getFirstTarget(), game);
            if (card != null) {
                cards.remove(card);
                card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
            }
            target.clearChosen();
        }
        if (cards.size() == 1) {
            Card card = cards.get(cards.iterator().next(), game);
            card.moveToZone(Zone.LIBRARY, 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.