Package mage.players

Examples of mage.players.Player.choose()


    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent perm = game.getPermanent(source.getSourceId());
        if (player != null && perm != null) {
            ChoiceColor colorChoice = new ChoiceColor();
            if (player.choose(Outcome.Benefit, colorChoice, game)) {
                game.informPlayers(perm.getName() + ": " + player.getName() + " has chosen " + colorChoice.getChoice());
                game.addEffect(new GainProtectionFromChosenColorEffect(colorChoice.getColor()), source);
            }
            return true;
        }
View Full Code Here


        }
        if (choosingPlayer == null) {
            choosingPlayer = getPlayer(pickChoosingPlayer());
        }

        if (choosingPlayer != null && choosingPlayer.choose(Outcome.Benefit, targetPlayer, null, this)) {
            startingPlayerId = targetPlayer.getTargets().get(0);
            Player startingPlayer = state.getPlayer(startingPlayerId);
            StringBuilder message = new StringBuilder(choosingPlayer.getName()).append(" chooses that ");
            if (choosingPlayer.getId().equals(startingPlayerId)) {
                message.append("he or she");
View Full Code Here

        // choose land type
        if (chooseLandType) {
            Player controller = game.getPlayer(source.getControllerId());
            if (controller != null) {
                Choice choice = new ChoiceBasicLandType();
                controller.choose(outcome, choice, game);
                landTypes.add(choice.getChoice());
            } else {
                this.discard();
            }
        }
View Full Code Here

            } else {
                Player controller = game.getPlayer(source.getControllerId());
                if (controller != null) {
                    for(int i = 0; i < count; i++){
                        ChoiceColor choiceColor = new ChoiceColor();
                        while (!controller.choose(Outcome.Benefit, choiceColor, game)) {
                            if (!controller.isInGame()) {
                                return computedMana;
                            }
                        }
                        if (choiceColor.getColor().isBlack()) {
View Full Code Here

            if (card != null) {
                card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId());
                Permanent equipment = game.getPermanent(card.getId());

                Target targetCreature = new TargetControlledCreaturePermanent();
                if (equipment != null && player.choose(Outcome.BoostCreature, targetCreature, source.getSourceId(), game)) {
                    Permanent permanent = game.getPermanent(targetCreature.getFirstTarget());
                    permanent.addAttachment(equipment.getId(), game);
                }
            }
        }
View Full Code Here

                boolean result = true;
                int filteredCardsCount = revealedCards.count(filter, source.getSourceId(), source.getControllerId(), game);
                int numberToDiscard = Math.min(this.numberCardsToDiscard.calculate(game, source, this), filteredCardsCount);
                if (numberToDiscard > 0) {
                    TargetCard target = new TargetCard(numberToDiscard, Zone.HAND, filter);
                    if (controller.choose(Outcome.Benefit, revealedCards, target, game)) {
                        for (Object targetId : target.getTargets()) {
                            Card card = revealedCards.get((UUID) targetId, game);
                            if (card != null) {
                                if (!player.discard(card, source, game)) {
                                    result = false;
View Full Code Here

        if (player == null || !player.chooseUse(Outcome.PutCreatureInPlay, choiceText, game)) {
            return false;
        }

        TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard());
        if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
            Card card = game.getCard(target.getFirstTarget());
            if (card != null) {
                player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
                return true;
            }
View Full Code Here

        if (player != null && foundCardsToPick > 0) {
            if (!optional || player.chooseUse(Outcome.DrawCard, getMayText(), game)) {
                FilterCard pickFilter = filter.copy();
                pickFilter.setMessage(getPickText());
                TargetCard target = new TargetCard((upTo ? 0:numberToPick.calculate(game, source, this)),numberToPick.calculate(game, source, this), Zone.PICK, pickFilter);
                if (player.choose(Outcome.DrawCard, cards, target, game)) {
                    Cards reveal = new CardsImpl();
                    for (UUID cardId : (List<UUID>)target.getTargets()) {
                        Card card = cards.get(cardId, game);
                        if (card != null) {
                            cards.remove(card);
View Full Code Here

        if (cards.size() == 0 || hideawaySource == null) {
            return false;
        }

        TargetCard target1 = new TargetCard(Zone.PICK, filter1);
        if (player.choose(Outcome.Detriment, cards, target1, game)) {
            Card card = cards.get(target1.getFirstTarget(), game);
            if (card != null) {
                cards.remove(card);
                card.setFaceDown(true);
                card.moveToExile(CardUtil.getCardExileZoneId(game, source),
View Full Code Here

        }

        if (cards.size() > 0) {
            TargetCard target2 = new TargetCard(Zone.PICK, filter2);
            while (player.isInGame() && cards.size() > 1) {
                player.choose(Outcome.Benefit, cards, target2, game);
                Card card = cards.get(target2.getFirstTarget(), game);
                if (card != null) {
                    cards.remove(card);
                    card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
                }
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.