Package mage.cards

Examples of mage.cards.Card.moveToZone()


    @Override
    public boolean apply(Game game, Ability source) {
        Card card = game.getCard(source.getFirstTarget());
        if (card != null) {
            card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
            if (card.getSubtype().contains("Goblin")) {
                game.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn), source);
            }
            return true;
        }
View Full Code Here


                    int cardsCount = Math.min(xvalue, player.getLibrary().size());

                    for (int i = 0; i < cardsCount; i++) {
                        Card removedCard = player.getLibrary().getFromTop(game);
                        if (removedCard != null) {
                            removedCard.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
                        } else {
                            break;
                        }
                    }
View Full Code Here

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

                        }
                        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);
            return true;
View Full Code Here

                        .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

        Card card = cardInfo != null ? cardInfo.getCard() : null;
        if (card != null) {
            Set<Card> cards = new HashSet<>();
            cards.add(card);
            game.loadCards(cards, playerId);
            card.moveToZone(Zone.HAND, null, game, false);
            return true;
        } else {
            return false;
        }
    }
View Full Code Here

                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

                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);
                }
            }
            return true;
        }
View Full Code Here

            // putting cards to grave shouldn't end the game, so getting minimun available
            int cardsCount = Math.min(5, player.getLibrary().size());
            for (int i = 0; i < cardsCount; i++) {
                Card card = player.getLibrary().removeFromTop(game);
                if (card != null) {
                    card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
                    if (filter.match(card, game)) {
                        cards.add(card);
                    }
                }
                else {
View Full Code Here

                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

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.