Package mage.cards

Examples of mage.cards.Card.moveToZone()


            // Put the rest on the bottom of your library in a random order
            while (cards.size() > 0) {
                card = cards.getRandom(game);
                if (card != null) {
                    cards.remove(card);
                    card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
                }
            }
            return true;
        }
        return false;
View Full Code Here


        if (player != null) {
            int cardsCount = Math.min(4, 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, true);
                }
            }
            return true;
        }
        return false;
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getFirstTarget());
        if (player != null && player.getLibrary().size() > 0) {
            Card card = player.getLibrary().removeFromBottom(game);
            if (card != null) {
                card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, true);
                if (card.getCardType().contains(CardType.CREATURE)) {
                    ZombieToken token = new ZombieToken("ISD");
                    token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
                }
            }
View Full Code Here

            Card sourceCard = game.getCard(source.getSourceId());
            if (exile != null && sourceCard != null) {
                LinkedList<UUID> cards = new LinkedList<>(exile);
                for (UUID cardId : cards) {
                    Card card = game.getCard(cardId);
                    card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
                    game.informPlayers(new StringBuilder(sourceCard.getName()).append(": ").append(card.getName()).append(" returns to battlefield from exile").toString());
                }
                exile.clear();
                return true;
            }           
View Full Code Here

            for (UUID targetId : targets) {
                Card card = game.getCard(targetId);
                if (card != null) {
                    if (player.getGraveyard().contains(card.getId())) {
                        player.getGraveyard().remove(card);
                        card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
                        shuffle = true;
                    }
                }
            }
            if (shuffle) {
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Card card = game.getCard(getTargetPointer().getFirst(game, source));
        if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) {
            return card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
        }
        return false;
    }
}
View Full Code Here

        }
        if (you != null) {
            if (card != null
                    && you.chooseUse(Outcome.Benefit, "Do you wish to shuffle up to one target card from your graveyard into your library?", game)
                    && game.getState().getZone(card.getId()).match(Zone.GRAVEYARD)) {
                card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
                you.shuffleLibrary(game);
            }
        }
        return countered;
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getFirstTarget());
        if (player != null && player.getLibrary().size() > 0) {
            Card card = player.getLibrary().removeFromTop(game);
            if (card != null) {
                card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
                int amount = card.getManaCost().convertedManaCost();
                if (amount > 0)
                    game.addEffect(new BoostSourceEffect(amount, amount, Duration.EndOfTurn), source);
                return true;
            }
View Full Code Here

                    cards.add(card);
                    if (MorbidCondition.getInstance().apply(game, source)
                            && player.chooseUse(Outcome.PutLandInPlay, "Do you wish to put the card onto the battlefield instead?", game)) {
                        card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId());
                    } else {
                        card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                    }
                }
                player.revealCards("Caravan Vigil", cards, game);
                player.shuffleLibrary(game);
                return true;
View Full Code Here

                    }
                    cards.add(card);
                }
                player.revealCards("Mirror-Mad Phantasm", cards, game);
                for (Card card: cards.getCards(game)) {
                    card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
                }
                return true;
            }
        }
        return false;
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.