Package mage.players

Examples of mage.players.Player.choose()


    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            FilterCard protectionFilter = new FilterCard();
            ChoiceColorOrArtifact choice = new ChoiceColorOrArtifact();
            if (controller.choose(outcome, choice, game)) {
                if (choice.isArtifactSelected()) {
                    protectionFilter.add(new CardTypePredicate(CardType.ARTIFACT));
                } else {
                    protectionFilter.add(new ColorPredicate(choice.getColor()));
                }
View Full Code Here


    @Override
    public boolean apply(Game game, Ability source) {
        ChoiceColor choice = new ChoiceColor();
        choice.setMessage("Choose color to get protection from");
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null && controller.choose(outcome, choice, game)) {
            FilterCard protectionFilter = new FilterCard();
            protectionFilter.add(new ColorPredicate(choice.getColor()));
            protectionFilter.setMessage(choice.getChoice().toLowerCase());
            ContinuousEffect effect = new GainAbilitySourceEffect(new ProtectionAbility(protectionFilter), Duration.EndOfTurn);
            game.addEffect(effect, source);
View Full Code Here

        player.drawCards(3, game);
        if (player.getHand().size() > 0) {
            FilterCard filter = new FilterCard("card from your hand to put on the bottom of your library");
            TargetCard target = new TargetCard(Zone.HAND, filter);

            if (player.choose(Outcome.Detriment, player.getHand(), target, game)) {
                Card card = player.getHand().get(target.getFirstTarget(), game);
                if (card != null) {
                    player.removeFromHand(card, game);
                    card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
                }
View Full Code Here

        if (player != null && controller != null) {
            Choice cardChoice = new ChoiceImpl();
            cardChoice.setChoices(CardRepository.instance.getNonLandNames());
            cardChoice.clearChoice();

            while (!controller.choose(Outcome.Exile, cardChoice, game)) {
                if (!controller.isInGame()) {
                    return false;
                }
            }
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

        }
        player.lookAtCards("Petals of Insight", cards, game);
        if (player.chooseUse(outcome, "Put the cards on the bottom of your library in any order?", 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

                    }
                    int numberOfCardsToPutBack = cardsPutBack.size();
                    if (numberOfCardsToPutBack > 1) {
                        TargetCard target2 = new TargetCard(Zone.PICK, new FilterCard("card to put on the top of your library (last chosen will be on top)"));
                        while (controller.isInGame() && cardsPutBack.size() > 1) {
                            controller.choose(Outcome.Benefit, cardsPutBack, target2, game);
                            Card card = cardsPutBack.get(target2.getFirstTarget(), game);
                            if (card != null) {
                                cardsPutBack.remove(card);
                                card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
                            }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getFirstTarget());
        if (player != null) {
            TargetCard target = new TargetCard(Zone.PICK, filter);
            if (player.choose(Outcome.Detriment, player.getHand(), target, game)) {
                while (player.getHand().size() > 1) {
                    for (UUID uuid : player.getHand()) {
                        if (!uuid.equals(target.getFirstTarget())) {
                            Card card = player.getHand().get(uuid, game);
                            if (card != null) {
View Full Code Here

            Choice cardChoice = new ChoiceImpl();
            cardChoice.setChoices(CardRepository.instance.getNonLandNames());
            cardChoice.clearChoice();
            cardChoice.setMessage("Name a nonland card");

            while (!controller.choose(Outcome.Exile, cardChoice, game)) {
                if (!controller.isInGame()) {
                    return false;
                }
            }
            String cardName;
View Full Code Here

        Player player = game.getPlayer(source.getControllerId());
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (player != null && permanent != null) {
            ChoiceColor colorChoice = new ChoiceColor();
            colorChoice.setMessage("Choose color");
            while (!player.choose(Outcome.BoostCreature, colorChoice, game)) {
                if (!player.isInGame()) {
                    return false;
                }
            }
            if (colorChoice.getChoice() != null) {
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.