Package mage.players

Examples of mage.players.Player.choose()


    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (player != null && permanent != null) {
            ChoiceColor colorChoice = new ChoiceColor();
            if (player.choose(Outcome.Detriment, colorChoice, game)) {
                game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + colorChoice.getChoice());
                game.getState().setValue(permanent.getId() + "_color", colorChoice.getColor());
                permanent.addInfo("chosen color", CardUtil.addToolTipMarkTags("Chosen color: " + colorChoice.getColor().getDescription()));
            }
            return true;
View Full Code Here


        TargetCard targetInHand = new TargetCard(Zone.PICK, new FilterCard("card to discard"));

        if (!revealedCards.isEmpty()) {
            targetPlayer.revealCards("Bala Ged Thief", revealedCards, game);
            you.choose(Outcome.Neutral, revealedCards, targetInHand, game);
            Card card = revealedCards.get(targetInHand.getFirstTarget(), game);
            if (card != null) {
                targetPlayer.discard(card, source, game);
                game.informPlayers(new StringBuilder("Bala Ged Thief: ").append(targetPlayer.getName()).append(" discarded ").append(card.getName()).toString());
            }
View Full Code Here

                        if (chooseManaType.getChoices().size() > 0) {
                            if (chooseManaType.getChoices().size() > 1) {
                                chooseManaType.getChoices().add("Colorless");
                                chooseManaType.setMessage("Choose mana color to reduce from " + perm.getName());
                                while (!chooseManaType.isChosen()) {
                                    player.choose(Outcome.Benefit, chooseManaType, game);
                                }
                            } else {
                                chooseManaType.setChoice(chooseManaType.getChoices().iterator().next());
                            }
                            if (chooseManaType.getChoice().equals("Black")) {
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            Target target = new TargetPermanent(filter);
            if (target.canChoose(source.getControllerId(), game)) {
                player.choose(Outcome.Copy, target, source.getSourceId(), game);
                Permanent tokenToCopy = game.getPermanent(target.getFirstTarget());
                if (tokenToCopy != null) {
                    game.informPlayers("Token selected for populate: " + tokenToCopy.getLogName());
                    Effect effect = new PutTokenOntoBattlefieldCopyTargetEffect();
                    effect.setTargetPointer(new FixedTarget(target.getFirstTarget()));
View Full Code Here

        Player you = game.getPlayer(source.getControllerId());
        Permanent sourceCreature = game.getPermanent(source.getSourceId());
        if (you != null && sourceCreature != null) {
            Choice choiceImpl = new ChoiceImpl();
            choiceImpl.setChoices(choice);
            while (you.isInGame() && !you.choose(Outcome.Neutral, choiceImpl, game)) {}
            CardType type = null;
            String choosenType = choiceImpl.getChoice();

            if (choosenType.equals(CardType.ARTIFACT.toString())) {
                type = CardType.ARTIFACT;
View Full Code Here

                target.setNotTarget(true);

                // you always go first
                if (target.canChoose(you.getId(), game)) {
                    while (you.isInGame() && !target.isChosen() && target.canChoose(you.getId(), game)) {
                        you.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
                    }
                    Permanent permanent = game.getPermanent(target.getFirstTarget());
                    if (permanent != null) {
                        chosen.add(permanent);
                    }
View Full Code Here

                for (UUID playerId : game.getPlayerList()) {
                    if (playerId != you.getId()) {
                        Player player = game.getPlayer(playerId);
                        if (target.canChoose(playerId, game)) {
                            while (!target.isChosen() && target.canChoose(playerId, game)) {
                                player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
                            }
                            Permanent permanent = game.getPermanent(target.getFirstTarget());
                            if (permanent != null) {
                                chosen.add(permanent);
                            }
View Full Code Here

        Permanent sourcePermanent = game.getPermanent(source.getSourceId());
        if (player != null && sourcePermanent != null) {
            Target target = new TargetPermanent(filter);
            target.setNotTarget(notTarget);
            if (target.canChoose(source.getControllerId(), game)) {
                player.choose(Outcome.Copy, target, source.getSourceId(), game);
                Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget());
                if (copyFromPermanent != null) {
                    bluePrintPermanent = game.copyPermanent(copyFromPermanent, sourcePermanent, source, applier);
                    return true;
                }
View Full Code Here

        }
        player.revealCards("Merfolk Wayfinder", cardsToReveal, game);

        TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
        while (player.isInGame() && cards.size() > 1) {
            player.choose(Outcome.Neutral, cards, target, game);
            Card card = cards.get(target.getFirstTarget(), game);
            if (card != null) {
                cards.remove(card);
                card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
            }
View Full Code Here

        if (!cards.isEmpty()) {
            TargetCard target = new TargetCard(Zone.PICK,
                    new FilterCreatureCard(
                    "creature card to put on the battlefield"));
            if (player.choose(Outcome.PutCreatureInPlay, cards, target, game)) {
                Card card = cards.get(target.getFirstTarget(), game);
                if (card != null) {
                    cards.remove(card);
                    card.putOntoBattlefield(game, Zone.PICK,
                            source.getSourceId(), source.getControllerId());
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.