Package mage.target

Examples of mage.target.TargetCard


            Cards filteredCards = new CardsImpl();
            for (Card card : filtered) {
                filteredCards.add(card.getId());
            }

            TargetCard target = new TargetCard(Zone.PICK, filterCard);
            if (player.choose(Outcome.Benefit, filteredCards, target, game)) {
                Card card = player.getSideboard().get(target.getFirstTarget(), game);
                if (card != null) {
                    player.cast(card.getSpellAbility(), game, true);
                }
            }
        }
View Full Code Here


        Cards cardsInHand = new CardsImpl(Zone.PICK);
        cardsInHand.addAll(targetPlayer.getHand());

        int count = Math.min(cardsInHand.size(), numberOfAllies);

        TargetCard target = new TargetCard(count, Zone.PICK, new FilterCard());
        Cards revealedCards = new CardsImpl();

        if (targetPlayer.choose(Outcome.DrawCard, cardsInHand, target, game)) {
            List<UUID> targets = target.getTargets();
            for (UUID targetId : targets) {
                Card card = game.getCard(targetId);
                if (card != null) {
                    revealedCards.add(card);
                }
            }
        }

        TargetCard targetInHand = new TargetCard(Zone.PICK, new FilterCard("card to discard"));

        if (!revealedCards.isEmpty()) {
            targetPlayer.revealCards("Bala Ged Thief", revealedCards, game);
            you.choose(Outcome.Neutral, revealedCards, targetInHand, game);
            Card card = revealedCards.get(targetInHand.getFirstTarget(), game);
            if (card != null) {
                targetPlayer.discard(card, source, game);
                game.informPlayers(new StringBuilder("Bala Ged Thief: ").append(targetPlayer.getName()).append(" discarded ").append(card.getName()).toString());
            }
        }
View Full Code Here

                }
            }
        }
        player.revealCards("Merfolk Wayfinder", cardsToReveal, 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);
            }
        }

        if (!cards.isEmpty()) {
            TargetCard target = new TargetCard(Zone.PICK,
                    new FilterCreatureCard(
                    "creature card to put on the battlefield"));
            if (player.choose(Outcome.PutCreatureInPlay, cards, target, game)) {
                Card card = cards.get(target.getFirstTarget(), game);
                if (card != null) {
                    cards.remove(card);
                    card.putOntoBattlefield(game, Zone.PICK,
                            source.getSourceId(), source.getControllerId());
                }
            }
            if (cards.size() > 0) {
                TargetCard target2 = new TargetCard(Zone.PICK,
                        new FilterCard(
                        "card to put on the bottom of your library"));
                while (player.isInGame() && cards.size() > 1) {
                    player.choose(Outcome.Benefit, cards, target2,
                            game);
                    Card card = cards.get(target2.getFirstTarget(), game);
                    if (card != null) {
                        cards.remove(card);
                        player.getLibrary().putOnBottom(card, game);
                    }
                    target2.clearChosen();
                }
                Card card = cards.get(cards.iterator().next(), game);
                cards.remove(card);
                player.getLibrary().putOnBottom(card, game);
            }
View Full Code Here

     * @param game
     */
    protected void putCardsBack(Ability source, Player player, Cards cards, Game game) {
        switch(targetZoneLookedCards) {
            case LIBRARY:
                TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard(this.getPutBackText()));
                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);
                        player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, putOnTop, false);
                    }
                    target.clearChosen();
                }
                if (cards.size() == 1) {
                    Card card = cards.get(cards.iterator().next(), game);
                    player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, putOnTop, false);
                }
View Full Code Here

                        Zone fromZone = game.getState().getZone(cardId);
                        this.moveCardToLibraryWithInfo(card, source.getSourceId(), game, fromZone, false, false);
                    }
                }
            } else {
                TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library (last one chosen will be bottommost)"));
                target.setRequired(true);
                while (isInGame() && cards.size() > 1) {
                    this.choose(Outcome.Neutral, cards, target, game);
                    Card chosenCard = cards.get(target.getFirstTarget(), game);
                    if (chosenCard != null) {
                        cards.remove(chosenCard);
                        Zone fromZone = game.getState().getZone(chosenCard.getId());
                        this.moveCardToLibraryWithInfo(chosenCard, source.getSourceId(), game, fromZone, false, false);
                    }
                    target.clearChosen();
                }
                if (cards.size() == 1) {
                    Card chosenCard = cards.get(cards.iterator().next(), game);
                    Zone fromZone = game.getState().getZone(chosenCard.getId());
                    this.moveCardToLibraryWithInfo(chosenCard, source.getSourceId(), game, fromZone, false, false);
View Full Code Here

                        Zone fromZone = game.getState().getZone(cardId);
                        this.moveCardToLibraryWithInfo(card, source.getSourceId(), game, fromZone, true, false);
                    }
                }
            } else {
                TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the top of your library (last one chosen will be topmost)"));
                target.setRequired(true);
                while (isInGame() && cards.size() > 1) {
                    this.choose(Outcome.Neutral, cards, target, game);
                    Card chosenCard = cards.get(target.getFirstTarget(), game);
                    if (chosenCard != null) {
                        cards.remove(chosenCard);
                        Zone fromZone = game.getState().getZone(chosenCard.getId());
                        this.moveCardToLibraryWithInfo(chosenCard, source.getSourceId(), game, fromZone, true, false);
                    }
                    target.clearChosen();
                }
                if (cards.size() == 1) {
                    Card chosenCard = cards.get(cards.iterator().next(), game);
                    Zone fromZone = game.getState().getZone(chosenCard.getId());
                    this.moveCardToLibraryWithInfo(chosenCard, source.getSourceId(), game, fromZone, true, false);
View Full Code Here

                cards.add(card);
            }
        }

        if (cards.getCards(new FilterInstantOrSorceryCard(), game).size() > 0) {
            TargetCard target = new TargetCard(Zone.EXILED, new FilterInstantOrSorceryCard());
            if (you.chooseTarget(Outcome.PlayForFree, cards, target, source, game)) {
                Card card = cards.get(target.getFirstTarget(), game);
                if (card != null) {
                    Card copy1 = card.copy();
                    Card copy2 = card.copy();
                    Card copy3 = card.copy();
                    if (copy1 != null && you.chooseUse(outcome, "Do you wish to cast copy 1 of " + card.getName(), game)) {
View Full Code Here

                        cards.add(card);
                    }
                }
                player.revealCards("Reveal", cards, game);
               
                TargetCard targetCard = new TargetCard(Zone.PICK, new FilterCard());
               
                while(!opponent.choose(Outcome.Neutral, cards, targetCard, game));
                Card card = cards.get(targetCard.getFirstTarget(), game);
                if (card != null) {
                    cards.remove(card);
                    card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                }
               
View Full Code Here

            }

            if (cards.size() > 0) {
                player.lookAtCards("Glimpse the Future", 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

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.