Package mage.players

Examples of mage.players.Player.drawCards()


        Card sourceCard = game.getCard(source.getSourceId());
        if (controller != null && sourceCard != null) {
            Card card = controller.getLibrary().getFromTop(game);
            if (card != null) {
                controller.revealCards(sourceCard.getName(), new CardsImpl(card), game);
                controller.drawCards(card.getManaCost().convertedManaCost(), game);
            }
            return true;
        }
        return false;
    }
View Full Code Here


        if (sourcePlayer != null) {
            for (UUID playerId : sourcePlayer.getInRange()) {
                Player player = game.getPlayer(playerId);
                if (player != null) {
                    int amount = player.getGraveyard().count(filter, game);
                    player.drawCards(amount, game);
                }
            }
        }
        return true;
    }
View Full Code Here

                player.getLibrary().addAll(player.getHand().getCards(game), game);
                player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
                player.shuffleLibrary(game);
                player.getHand().clear();
                player.getGraveyard().clear();
                player.drawCards(7, game);
            }
        }
        return true;
    }
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);
            putOnLibrary(player, source, game);
            putOnLibrary(player, source, game);
            return true;
        }
        return false;
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null && player.chooseUse(Outcome.DrawCard, "Do you wish to draw a card? If you do, discard a card.", game)) {
            if (player.drawCards(1, game) > 0) {
                player.discard(1, source, game);
            }
            return true;
        }
        return false;
View Full Code Here

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

                    toughness = ((SacrificeTargetCost) cost).getPermanents().get(0).getToughness().getValue();
                    break;
                }
            }
            if (power > 0) {
                controller.drawCards(power, game);
            }
            if (toughness > 0) {
                controller.gainLife(toughness, game);
            }
            return true;
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent thoughtGorgerLastState = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
        int numberCounters = thoughtGorgerLastState.getCounters().getCount(CounterType.P1P1);
        if (player != null) {
            player.drawCards(numberCounters, game);
            return true;
        }
        return false;
    }
}
View Full Code Here

            int amount = permanent.getCounters().getCount(CounterType.CHARGE);
            if (amount > 0) {
                for (UUID playerId : sourcePlayer.getInRange()) {
                    Player player = game.getPlayer(playerId);
                    if (player != null) {
                        player.drawCards(amount, game);
                    }
                }
            }
        }
        return true;
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            int damage = (Integer) this.getValue("damage");
            if (damage > 0) {
                controller.drawCards(damage, game);
            }
            return 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.