Package mage.cards

Examples of mage.cards.Card.moveToZone()


                    Card card = game.getCard(cardId);
                    if (card == null) {
                        return false;
                    }
                    game.informPlayers(controller.getName() + " moves " + card.getLogName() + " to " + zone.toString().toLowerCase());
                    card.moveToZone(zone, source.getSourceId(), game, tapped);
                }
                exile.clear();
            }
            return true;
        }
View Full Code Here


        event.setAppliedEffects(appliedEffects);
        if (!game.replaceEvent(event)) {
            Card card = player.getLibrary().removeFromTop(game);
            if (card != null) {
                drawnCards.add(card);
                card.moveToZone(Zone.HAND, null, game, false);
                if (player.isTopCardRevealed()) {
                    game.fireInformEvent(player.getName() + " draws a revealed card  (" + card.getLogName() + ")");
                }

                game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DREW_CARD, card.getId(), player.getId()));
View Full Code Here

                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);
                    }
                }

                for (Card card : cards.getCards(game)) {
View Full Code Here

                        cards.remove(card);
                    }
                }

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

            TargetCardInHand target = new TargetCardInHand();
            player.chooseTarget(Outcome.Detriment, target, source, game);
            Card card = player.getHand().get(target.getFirstTarget(), game);
            if (card != null) {
                player.getHand().remove(card);
                card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, putOnTop);
                return true;
            }
        }
        return false;
    }
View Full Code Here

               
                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);
                }
               
                for(UUID uuid : cards){
                    card = cards.get(uuid, game);
                    card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
View Full Code Here

                    card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                }
               
                for(UUID uuid : cards){
                    card = cards.get(uuid, game);
                    card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
                }
               
            }
            player.shuffleLibrary(game);
            return true;
View Full Code Here

            filter.add(new CardTypePredicate(CardType.INSTANT));
            Card[] cards = player.getGraveyard().getCards(filter, game).toArray(new Card[0]);
            if (cards.length > 0) {
                Random rnd = new Random();
                Card card = cards[rnd.nextInt(cards.length)];
                card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
                game.informPlayers(card.getName() + "returned to the hand of" + player.getName());
                return true;
            }
        }
        return false;
View Full Code Here

                Card cardsArray[] = cards.getCards(game).toArray(new Card[0]);
                //If you reveal three cards with different names
                if(cardsArray.length == 3 && !cardsArray[0].getName().equals(cardsArray[1]) && !cardsArray[0].getName().equals(cardsArray[2]) && !cardsArray[1].getName().equals(cardsArray[2])){
                    //Choose one of them at random and put that card into your hand
                    Card randomCard = cards.getRandom(game);
                    randomCard.moveToZone(Zone.HAND, source.getSourceId(), game, true);
                    cards.remove(randomCard);
                }
                //Shuffle the rest into your library
                for(Card card : cards.getCards(game)){
                    card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
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.