Package mage.cards

Examples of mage.cards.CardsImpl


                Card card = game.getCard(event.getTargetId());
                Player controller = game.getPlayer(this.getControllerId());
                Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(this.getSourceId());
                if (card != null && controller != null && sourcePermanent != null) {
                    lastTriggeredTurn = game.getTurnNum();
                    controller.revealCards(sourcePermanent.getName(), new CardsImpl(card), game);
                    this.getTargets().clear();
                    this.getEffects().clear();
                    if (card.getCardType().contains(CardType.LAND)) {
                        this.addEffect(new DrawCardSourceControllerEffect(1));
                    } else {
View Full Code Here


        if (player == null || sourcePermanent == null) {
            return false;
        }
        if (player.getLibrary().size() > 0) {
            Card card = player.getLibrary().getFromTop(game);
            Cards cards = new CardsImpl(card);
            player.revealCards(sourcePermanent.getName(), cards, game);

            if (card != null) {
                game.addEffect(new BoostSourceEffect(card.getManaCost().convertedManaCost(), 0, Duration.EndOfTurn), source);
                return true;
View Full Code Here

        MageObject sourceObject = game.getObject(source.getSourceId());
        if (controller != null && sourceObject != null) {
            boolean topCardRevealed = controller.isTopCardRevealed();
            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()) {
                        Card card = cards.get(cardId, game);
                        if (card != null) {
                            cards.remove(card);
                            controller.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
                        }
                    }
                }
                // The rest goes back to library in any order
                if (cards.size() > 0) {
                    game.informPlayers(controller.getName() + " puts " + cards.size() + " card" + (cards.size() ==1 ? "":"s"+ " back to his or her library");
                    target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put on your library (last chosen will be on top)"));
                    while (controller.isInGame() && cards.size() > 1) {
                        controller.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, true);
                        }
                        target.clearChosen();
                    }
                    if (cards.size() == 1) {
                        Card card = cards.get(cards.iterator().next(), game);
                        card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
                    }
                }
            }
            controller.setTopCardRevealed(topCardRevealed);
View Full Code Here

        }
        Permanent faceDownCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
        if (faceDownCreature != null) {
            Permanent copyFaceDown = faceDownCreature.copy();
            copyFaceDown.setFaceDown(false);
            Cards cards = new CardsImpl();
            cards.add(copyFaceDown);
            player.lookAtCards("face down card - " + mageObject.getLogName(), cards, game);
        } else {
            return false;
        }
        return true;
View Full Code Here

        if (permanent != null && controller != null) {
            Player owner = game.getPlayer(permanent.getOwnerId());
            if (owner != null) {
                int plains = game.getBattlefield().countAll(new FilterPermanent("Plains", "Plains you control"), source.getControllerId(), game);
                int xValue = Math.min(plains, owner.getLibrary().size());
                Cards cards = new CardsImpl();
                Deque<UUID> cardIds = new LinkedList<>();
                for (int i = 0; i < xValue; i++) {
                    Card card = owner.getLibrary().removeFromTop(game);
                    cards.add(card);
                    cardIds.push(card.getId());
                }
                // return cards back to library
                permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
                game.informPlayers(new StringBuilder(controller.getName())
                        .append(" puts ").append(permanent.getName())
                        .append(" beneath the top ").append(xValue)
                        .append(" cards of ").append(owner.getName()).append("'s library").toString());
                while(!cardIds.isEmpty()) {
                    UUID cardId = cardIds.poll();
                    Card card = cards.get(cardId, game);
                    if (card != null) {
                        card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
                    }
                }
                return true;
View Full Code Here

                if (filtered.isEmpty()) {
                    game.informPlayer(player, "You have no " + filter.getMessage() + " outside the game.");
                    break;
                }

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

                TargetCard target = new TargetCard(Zone.PICK, filter);
                if (player.choose(Outcome.Benefit, filteredCards, target, game)) {
                    Card card = player.getSideboard().get(target.getFirstTarget(), game);
                    if (card != null) {

                        card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                        Cards revealCard = new CardsImpl();
                        revealCard.add(card);
                        player.revealCards("Living Wish", revealCard, game);
                        break;
                    }
                }
            }
View Full Code Here

            TargetCard targetCard = new TargetCard(Zone.ALL, new FilterNonlandCard());
            targetCard.setRequired(false);
            if (sourcePlayer.choose(Outcome.Discard, player.getHand(), targetCard, game)) {
                Card c = game.getCard(targetCard.getFirstTarget());
                if (c != null) {
                    CardsImpl cards = new CardsImpl();
                    cards.add(c);
                    player.revealCards("Vendilion Clique effect", cards, game);
                    c.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
                    player.drawCards(1, game);
                }
            }
View Full Code Here

                if (filtered.isEmpty()) {
                    game.informPlayer(player, "You have no " + filter.getMessage() + " outside the game.");
                    break;
                }

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

                TargetCard target = new TargetCard(Zone.PICK, filter);
                if (player.choose(Outcome.Benefit, filteredCards, target, game)) {
                    Card card = player.getSideboard().get(target.getFirstTarget(), game);
                    if (card != null) {

                        card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                        Cards revealCard = new CardsImpl();
                        revealCard.add(card);
                        player.revealCards("Cunning Wish", revealCard, game);
                        break;
                    }
                }
            }
View Full Code Here

                if (filtered.isEmpty()) {
                    game.informPlayer(player, "You have no " + filter.getMessage() + " outside the game.");
                    break;
                }

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

                TargetCard target = new TargetCard(Zone.PICK, filter);
                if (player.choose(Outcome.Benefit, filteredCards, target, game)) {
                    Card card = player.getSideboard().get(target.getFirstTarget(), game);
                    if (card != null) {

                        card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                        Cards revealCard = new CardsImpl();
                        revealCard.add(card);
                        player.revealCards("Burning Wish", revealCard, game);
                        break;
                    }
                }
            }
View Full Code Here

                if (filtered.isEmpty()) {
                    game.informPlayer(player, "You have no " + filter.getMessage() + " outside the game.");
                    break;
                }

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

                TargetCard target = new TargetCard(Zone.PICK, filter);
                if (player.choose(Outcome.Benefit, filteredCards, target, game)) {
                    Card card = player.getSideboard().get(target.getFirstTarget(), game);
View Full Code Here

TOP

Related Classes of mage.cards.CardsImpl

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.