Package mage.players

Examples of mage.players.Player.discard()


                    if (permanent.sacrifice(source.getSourceId(), game)) {
                        sacrificedPermanents++;
                    }
                }
            }
            player.discard(drawnCards - sacrificedPermanents, source, game);
            return true;
        }
        return false;
    }
}
View Full Code Here


                if (otherPlayer != null && otherPlayer.getHand().size() > 0) {
                    TargetCardInHand target = new TargetCardInHand();
                    if (otherPlayer.choose(Outcome.Discard, target, source.getSourceId(), game)) {
                        Card card = game.getCard(target.getFirstTarget());
                        if (card != null) {
                            if (otherPlayer.discard(card, source, game)) {
                                amount += 1;
                                result = true;
                                target.clearChosen();
                            }
                        }
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

            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);
                if (card.getCardType().contains(CardType.CREATURE)) {
                    Permanent permanent = game.getPermanent(source.getSourceId());
                    if (permanent != null) {
                        permanent.untap(game);
                        permanent.transform(game);
View Full Code Here

                                }
                            }
                        }
                        if (!cardsToDiscard.isEmpty()) {
                            for (Card card :cardsToDiscard.getCards(game)) {
                                spellController.discard(card, source, game);
                            }
                        }
                    }

                }
View Full Code Here

        Player player = game.getPlayer(source.getControllerId());
        Permanent thoughtGorger = game.getPermanent(source.getSourceId());
        if (player != null && player.getHand().size() > 0 && thoughtGorger != null ) {
            int cardsInHand = player.getHand().size();
            thoughtGorger.addCounters(CounterType.P1P1.createInstance(cardsInHand), game);
            player.discard(cardsInHand, source, game);
            return true;
        }
        return false;
    }
}
View Full Code Here

            }
        }

        if (player != null && player.getHand().size() > 0) {
            int cardsInHand = player.getHand().size();
            player.discard(cardsInHand, source, game);
        }

        for (int i = 0; i < 6; i++) {
            if (player != null && player.getLibrary().size() > 0) {
                Card topCard = player.getLibrary().getFromTop(game);
View Full Code Here

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

            Player targetController = game.getPlayer(targetCreature.getControllerId());
            targetCreature.destroy(source.getSourceId(), game, false);
            Permanent destroyedCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
            if (destroyedCreature.getColor().isGreen()
                    || destroyedCreature.getColor().isWhite()) {
                targetController.discard(1, source, game);
                return true;
            }
        }
        return false;
    }
View Full Code Here

            for (UUID playerId : controller.getInRange()) {
                Player player = game.getPlayer(playerId);
                if (player != null) {
                    int cardsToDiscard = (int) Math.ceil(player.getHand().size() / 3.0);
                    if (cardsToDiscard > 0) {
                        player.discard(cardsToDiscard, source, game);
                    }
                }
            }
            // then sacrifices a third of the creatures he or she controls,
            for (UUID playerId : controller.getInRange()) {
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.