Package mage.players

Examples of mage.players.Player.choose()


            Permanent auraPermanent = game.getPermanent(source.getSourceId());
            if (auraPermanent != null && auraPermanent.getSubtype().contains("Aura") && auraPermanent.getOwnerId().equals(source.getControllerId())) {
                Permanent enchantedPermanent = game.getPermanent(auraPermanent.getAttachedTo());
                filter.add(new AuraCardCanAttachToPermanentId(enchantedPermanent.getId()));
                TargetCardInHand target = new TargetCardInHand(0, 1, filter);
                if (player.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) {
                    Card auraInHand = game.getCard(target.getFirstTarget());
                    if (auraInHand != null) {
                        player.putOntoBattlefieldWithInfo(auraInHand, game, Zone.HAND, source.getSourceId());
                        enchantedPermanent.addAttachment(auraInHand.getId(), game);
                        player.moveCardToHandWithInfo(auraPermanent, source.getSourceId(), game, Zone.BATTLEFIELD);
View Full Code Here


            //A spell or ability could have removed the only legal target this player
            //had, if thats the case this ability should fizzle.
            if (target.canChoose(player.getId(), game)) {
                boolean abilityApplied = false;
                while (!target.isChosen() && target.canChoose(player.getId(), game) && player.isInGame()) {
                    player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
                }

                for (int idx = 0; idx < target.getTargets().size(); idx++) {
                    Permanent permanent = game.getPermanent((UUID) target.getTargets().get(idx));
View Full Code Here

                    cardChoice.setChoices(CardRepository.instance.getNonLandNames());
                    cardChoice.setMessage("Name a non land card");
                    break;                   
            }           
            cardChoice.clearChoice();
            while (!controller.choose(Outcome.Detriment, cardChoice, game)) {
                if (!controller.isInGame()) {
                    return false;
                }
            }
            String cardName = cardChoice.getChoice();
View Full Code Here

            UUID opponentId;
            if (game.getOpponents(controller.getId()).size() == 1) {
                opponentId = game.getOpponents(controller.getId()).iterator().next();
            } else {
                Target target = new TargetOpponent();
                controller.choose(outcome, target, source.getSourceId(), game);
                opponentId = target.getFirstTarget();
            }
            if (opponentId != null) {
                Player opponent = game.getPlayer(opponentId);
                if (opponent != null) {
View Full Code Here

                                            choices.add(counter.getName());
                                        }
                                    }
                                    choice.setChoices(choices);
                                    choice.setMessage("Choose a counter to remove from " + permanent.getLogName());
                                    controller.choose(Outcome.UnboostCreature, choice, game);
                                    counterName = choice.getChoice();
                                } else {
                                    for (Counter counter : permanent.getCounters().values()) {
                                        if (counter.getCount() > 0) {
                                            counterName = counter.getName();
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            Target target = new TargetCardInHand(new FilterLandCard("land card"));
            if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
                    && controller.choose(outcome, target, source.getSourceId(), game)) {
                Card card = game.getCard(target.getFirstTarget());
                if (card != null) {
                    controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId(), tapped);
                }
            }
View Full Code Here

        Permanent permanent = game.getPermanent(source.getSourceId());
        if (controller != null && permanent != null) {
            Choice typeChoice = new ChoiceImpl(true);
            typeChoice.setMessage("Choose creature type");
            typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
            while (!controller.choose(outcome, typeChoice, game)) {
                if (!controller.isInGame()) {
                    return false;
                }
            }
            game.informPlayers(permanent.getName() + ": " + controller.getName() + " has chosen " + typeChoice.getChoice());
View Full Code Here

        Permanent permanent = game.getPermanent(source.getSourceId());
        if (player != null && permanent != null) {
            Choice typeChoice = new ChoiceImpl(true);
            typeChoice.setMessage("Choose creature type");
            typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
            while (!player.choose(Outcome.BoostCreature, typeChoice, game)) {
                if (!player.isInGame()) {
                    return false;
                }
            }
            game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + typeChoice.getChoice());
View Full Code Here

                            break Ability;
                        }
                    }
                }
            }
            if (player != null && player.choose(auraOutcome, target, card.getId(), game)) {
                targetId = target.getFirstTarget();
            }
        }

        Permanent targetPermanent = game.getPermanent(targetId);
View Full Code Here

                }
                player.revealCards("Reveal", cards, game);
               
                TargetCard targetCard = new TargetCard(Zone.PICK, new FilterCard());
               
                while(!opponent.choose(Outcome.Neutral, cards, targetCard, game));
                Card card = cards.get(targetCard.getFirstTarget(), game);
                if (card != null) {
                    cards.remove(card);
                    card.moveToZone(Zone.HAND, 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.