Package mage.players

Examples of mage.players.Player.drawCards()


                if (player != null) {
                    Card card = player.getLibrary().removeFromTop(game);
                    if (card != null) {
                        int cmc = card.getManaCost().convertedManaCost();
                        result = card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, true);
                        player.drawCards(cmc, game);
                    }
                }
                return result;
            }
View Full Code Here


        Player damagedPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
        if (sourceController != null && damagedPlayer != null) {
            int amount = (Integer) getValue("damage");
            if (amount > 0) {
                sourceController.drawCards(amount, game);
                damagedPlayer.drawCards(amount, game);
                return true;
            }
        }
        return false;
    }
View Full Code Here

                        card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
                    }
                }
                game.informPlayers(player.getName() + " shuffles the cards from his or her hand into his or her library");
                player.shuffleLibrary(game);
                player.drawCards(count, game);
                if (MetalcraftCondition.getInstance().apply(game, source) && !playerId.equals(source.getControllerId())) {
                    MoltenPsycheWatcher watcher = (MoltenPsycheWatcher) game.getState().getWatchers().get("CardsDrawn");
                    player.damage(watcher.getDraws(playerId), source.getSourceId(), game, false, true);
                }
            }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            Cards initialHand = player.getHand().copy();
            player.drawCards(3, game);
            Cards drawnCards = new CardsImpl(Zone.PICK);
            for (UUID cardId : player.getHand()) {
                if (!initialHand.contains(cardId)) {
                    drawnCards.add(cardId);
                }
View Full Code Here

            for (UUID playerId : sourcePlayer.getInRange()) {
                Player player = game.getPlayer(playerId);
                if (player != null) {
                    int cardsToDrawCount = player.getAmount(0, 7, "How many cards to draw (up to 7)?", game);
                    player.drawCards(cardsToDrawCount, game);
                }
            }
        }
        return true;
    }
View Full Code Here

        if (player != null) {
            int amount = player.getHand().getCards(game).size();
            for (Card c : player.getHand().getCards(game)) {
                player.discard(c, source, game);
            }
            player.drawCards(amount, game);
            return true;
        }
        return false;
    }
View Full Code Here

            if (cards.size() == 1) {
                Card card = cards.get(cards.iterator().next(), game);
                card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
            }
            you.getHand().clear();
            you.drawCards(count, game);
        }
        return true;
    }

    @Override
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            player.drawCards(3, game);
            TargetDiscard target = new TargetDiscard(player.getId());
            if (target.canChoose(source.getSourceId(), player.getId(), game)) {
                player.choose(Outcome.Discard, target, source.getSourceId(), game);
                Card card = player.getHand().get(target.getFirstTarget(), game);
                if (card != null) {
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            controller.drawCards(2, game);
            CardsDrawnThisTurnWatcher watcher = (CardsDrawnThisTurnWatcher) game.getState().getWatchers().get("CardsDrawnThisTurnWatcher", source.getControllerId());
            if (watcher != null) {
                Cards cards = new CardsImpl();
                for (UUID cardId : controller.getHand()) {
                    if (watcher.getCardsDrawnThisTurn().contains(cardId)) {
View Full Code Here

    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            player.drawCards(1, game, event.getAppliedEffects());
        }
        return true;
    }

    @Override
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.