Package mage.cards

Examples of mage.cards.Cards.addAll()


                            }
                        }
                    } else {
                        Target target = new TargetDiscard(numberOfCardsToDiscard, numberOfCardsToDiscard, new FilterCard(), playerId);
                        player.chooseTarget(outcome, target, source, game);
                        cards.addAll(target.getTargets());
                    }
                    cardsToDiscard.put(playerId, cards);
                }
            }
            // discard all choosen cards
View Full Code Here


                                }
                            }
                        }
                    }
                } else {
                    revealedCards.addAll(player.getHand());
                }               

                player.revealCards(sourceCard != null ? sourceCard.getName() :"Discard", revealedCards, game);
               
                boolean result = true;
View Full Code Here

                    }
                }

                // cards in Library
                Cards cardsInLibrary = new CardsImpl(Zone.LIBRARY);
                cardsInLibrary.addAll(targetPlayer.getLibrary().getCards(game));
                cardsCount = (cardName.isEmpty() ? 0 : cardsInLibrary.count(filter, game));
                if (cardsCount > 0) {
                    filter.setMessage("card named " + cardName + " in the library of " + targetPlayer.getName());
                    TargetCardInLibrary target = new TargetCardInLibrary(0, cardsCount, filter);
                    if (controller.choose(Outcome.Exile, cardsInLibrary, target, game)) {
View Full Code Here

        filter.add(new SubtypePredicate("Ally"));

        int numberOfAllies = game.getBattlefield().countAll(filter, you.getId(), game);

        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();
View Full Code Here

                if (card != null) {
                    cards.add(card);
                }
            }
            Cards foundCards = new CardsImpl();
            foundCards.addAll(cards);
            if (reveal) {
                controller.revealCards(sourceObject.getLogName(), foundCards, game);
            }
            if (forceShuffle) {
                controller.shuffleLibrary(game);
View Full Code Here

            if (payLife > 0) {
                controller.loseLife(payLife, game);
                game.informPlayers(new StringBuilder(sourceCard.getName()).append(": ").append(controller.getName()).append(" pays ").append(payLife).append(" life").toString());

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

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

                TargetCard target = new TargetCard(count, Zone.HAND, new FilterCard());
                Cards revealedCards = new CardsImpl();
View Full Code Here

            controller.setTopCardRevealed(false);
            // get cards from top
            Cards cards = new CardsImpl();
            int count = Math.min(controller.getLibrary().size(), 5);
            if (count > 0) {
                cards.addAll(controller.getLibrary().getTopCards(game, count));
                controller.lookAtCards(sourceObject.getLogName(), cards, game);
                // pick cards going to graveyard
                TargetCard target = new TargetCard(0,5, Zone.LIBRARY, new FilterCard("cards to put into your graveyard"));
                if (controller.choose(Outcome.Detriment, cards, target, game)) {
                    for (UUID cardId : (List<UUID>)target.getTargets()) {
View Full Code Here

        Player controller = game.getPlayer(source.getControllerId());
        Player targetPlayer = game.getPlayer(source.getFirstTarget());
        Card sourceCard = game.getCard(source.getSourceId());
        if (controller != null && targetPlayer != null && sourceCard != null) {
            Cards cardsInHand = new CardsImpl();
            cardsInHand.addAll(targetPlayer.getHand());

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

            TargetCard target = new TargetCard(count, Zone.HAND, new FilterCard());
            Cards revealedCards = new CardsImpl();
View Full Code Here

            if (targetPlayer != null) {
                FilterCard filter = new FilterCard("card named " + card.getName());
                filter.add(new NamePredicate(card.getName()));

                Cards cardsInLibrary = new CardsImpl(Zone.LIBRARY);
                cardsInLibrary.addAll(targetPlayer.getLibrary().getCards(game));

                // cards in Graveyard
                int cardsCount = targetPlayer.getGraveyard().count(filter, game);
                if (cardsCount > 0) {
                    filter.setMessage("card named " + card.getName() + " in the graveyard of " + targetPlayer.getName());
View Full Code Here

        Player controller = game.getPlayer(source.getControllerId());
        MageObject sourceObject = game.getObject(source.getSourceId());
        if (controller != null && sourceObject != null) {
            Cards cards = new CardsImpl();
            int count = Math.min(controller.getLibrary().size(), 4);
            cards.addAll(controller.getLibrary().getTopCards(game, count));
            if (!cards.isEmpty()) {
                for (Card card: cards.getCards(game)) {
                    cards.add(card);
                    if (card.getCardType().contains(CardType.LAND)) {
                        controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.