Package mage.players

Examples of mage.players.Player.discard()


    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getFirstTarget());
        if (player != null) {
            Set<Card> cards = player.getHand().getCards(game);
            for (Card card : cards) {
                player.discard(card, source, game);
            }
            return true;
        }
        return false;
    }
View Full Code Here


                if (targetPlayer.getHand().size() > 0) {
                    targetPlayer.revealCards("Infernal Kirin", targetPlayer.getHand(), game);
                    for (UUID uuid: targetPlayer.getHand().copy()) {
                        Card card = game.getCard(uuid);
                        if (card != null && card.getManaCost().convertedManaCost() == cmc) {
                            targetPlayer.discard(card, source, game);
                        }
                    }
                }
                return true;
            }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getFirstTarget());
        if (player != null) {
            Set<Card> cards = player.getHand().getCards(game);
            for (Card card : cards) {
                player.discard(card, source, game);
            }
            return true;
        }
        return false;
    }
View Full Code Here

        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            Set<Card> cardsInHand = player.getHand().getCards(game);
            int amount = cardsInHand.size();
            for (Card card : cardsInHand) {
                player.discard(card, source, game);
            }
            player.drawCards(amount, game);
            return true;
        }
        return false;
View Full Code Here

        if (controller != null) {
            Card card = controller.getLibrary().getFromTop(game);
            controller.drawCards(1, game);
            controller.revealCards("Fa'adiyah Seer", new CardsImpl(card), game);
            if (!filter.match(card, game)) {
                controller.discard(card, source, game);
            }
            return true;
        }
        return false;
    }
View Full Code Here

        Permanent target = game.getPermanent(source.getFirstTarget());
        if (target != null) {
            Player controller = game.getPlayer(target.getControllerId());
            if (controller != null) {
                controller.moveCardToHandWithInfo(target, source.getSourceId(), game, Zone.BATTLEFIELD);
                controller.discard(1, source, game);
                return true;
            }
        }
        return false;
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
        if (permanent != null) {
            Player player = game.getPlayer(permanent.getControllerId());
            if (player != null) {
                player.discard(1, source, game);
                return true;
            }
        }
        return false;
    }
View Full Code Here

        you.drawCards(7, game);
        Cards hand = you.getHand();
        for (int i = 0; i < 3; i++) {
            Card card = hand.getRandom(game);
            if (card != null) {
                you.discard(card, source, game);
            }
        }
        return false;
    }
View Full Code Here

        Permanent dragon = game.getPermanent(source.getSourceId());
        you.drawCards(1, game);
        TargetDiscard target = new TargetDiscard(you.getId());
        you.choose(Outcome.Discard, target, source.getSourceId(), game);
        Card card = you.getHand().get(target.getFirstTarget(), game);
        if (card != null && you.discard(card, source, game)) {
            int cmc = card.getManaCost().convertedManaCost();
            if (dragon != null) {
                game.addEffect(new BoostSourceEffect(cmc, 0, Duration.EndOfTurn), source);
                return true;
            }
View Full Code Here

            //Discard
            for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) {
                Player player = game.getPlayer(playerId);
                if (player != null)
                {
                    player.discard(player.getHand().size(), source, game);
                }
            }
            //Return to hand
            for (Iterator<Card> it = cards.getCards(game).iterator(); it.hasNext();) {
                Card card = it.next();
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.