Package mage.players

Examples of mage.players.Player.discard()


        for (UUID playerId : sourcePlayer.getInRange()) {
            Player player = game.getPlayer(playerId);
            if (player != null) {
                int discarded = 0;
                for (Card c : player.getHand().getCards(game)) {
                    if (player.discard(c, source, game)) {
                        discarded++;
                    }
                }
                if (discarded > maxDiscarded) {
                    maxDiscarded = discarded;
View Full Code Here


    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(targetPointer.getFirst(game, source));
        if (player != null) {
            int value = player.getCounters().getCount(CounterType.POISON);
            if (value > 0) {
                player.discard(value, source, game);
                return true;
            }
        }
        return false;
    }
View Full Code Here

        if (player != null) {
            player.drawCards(2, game);
            Cards hand = player.getHand();
            Card card = hand.getRandom(game);
            if (card != null) {
                player.discard(card, source, game);
            }
            return true;
        }
        return false;
    }
View Full Code Here

                Card card = player.getHand().get(targetId, game);
                if (card == null) {
                    return false;
                }
                isZombieCard = card.getSubtype().contains("Zombie");
                paid |= player.discard(card, null, game);

            }
        }
        return paid;
    }
View Full Code Here

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

                    return true;
                }
            }
        }
        if (you != null) {
            you.discard(2, source, game);
            return true;
        }
        return false;
    }
}
View Full Code Here

            TargetCardInHand target = new TargetCardInHand(new FilterLandCard());
            Cost cost = new DiscardTargetCost(target);
            if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game) &&
                    player.chooseUse(outcome, "Discard land? (Otherwise Mox Diamond goes to graveyard)", game) &&
                    player.chooseTarget(Outcome.Discard, target, source, game)){
                player.discard(game.getCard(target.getFirstTarget()), source, game);
                return false;
            }
            else{
                Card card = game.getCard(event.getTargetId());
                if (card != null) {
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
        if (targetPlayer != null) {
            targetPlayer.drawCards(1, game);
            targetPlayer.discard(1, 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

                Player player = game.getPlayer(playerId);
                if (player != null) {
                    for (UUID cardId : cardsToDiscard.get(playerId)) {
                        Card card = game.getCard(cardId);
                        if (card != null) {
                            player.discard(card, source, 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.