Package mage.players

Examples of mage.players.Player.choose()


            typeChoice.getChoices().add(CardType.CREATURE.toString());
            typeChoice.getChoices().add(CardType.ENCHANTMENT.toString());
            typeChoice.getChoices().add(CardType.LAND.toString());
            typeChoice.getChoices().add(CardType.PLANESWALKER.toString());

            while (controller.isInGame() && !controller.choose(Outcome.ReturnToHand, typeChoice, game)) {
            }

            String typeName = typeChoice.getChoice();
            CardType chosenType = null;
            for (CardType cardType : CardType.values()) {
View Full Code Here


                Player player = game.getPlayer(playerId);

                Target target = new TargetControlledPermanent(1, 1, filter, false);
                if (target.canChoose(player.getId(), game)) {
                    while (player.isInGame() && !target.isChosen() && target.canChoose(player.getId(), game)) {
                        player.choose(Outcome.Benefit, target, source.getSourceId(), game);
                    }
                    Permanent permanent = game.getPermanent(target.getFirstTarget());
                    if (permanent != null) {
                        chosen.add(permanent);
                    }
View Full Code Here

            if (count > 0) {
                cards.addAll(controller.getLibrary().getTopCards(game, count));
                controller.lookAtCards(sourceObject.getLogName(), cards, game);
                // pick cards going to graveyard
                TargetCard target = new TargetCard(0,5, Zone.LIBRARY, new FilterCard("cards to put into your graveyard"));
                if (controller.choose(Outcome.Detriment, cards, target, game)) {
                    for (UUID cardId : (List<UUID>)target.getTargets()) {
                        Card card = cards.get(cardId, game);
                        if (card != null) {
                            cards.remove(card);
                            controller.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
View Full Code Here

                // The rest goes back to library in any order
                if (cards.size() > 0) {
                    game.informPlayers(controller.getName() + " puts " + cards.size() + " card" + (cards.size() ==1 ? "":"s"+ " back to his or her library");
                    target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put on your library (last chosen will be on top)"));
                    while (controller.isInGame() && cards.size() > 1) {
                        controller.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, true);
                        }
View Full Code Here

        if (choice.getChoices().size() > 0) {
            Player player = game.getPlayer(source.getControllerId());
            if (choice.getChoices().size() == 1) {
                choice.setChoice(choice.getChoices().iterator().next());
            } else {
                player.choose(outcome, choice, game);
            }
            if (choice.getChoice() != null) {
                switch (choice.getChoice()) {
                    case "Black":
                        player.getManaPool().addMana(Mana.BlackMana, game, source);
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player.getHand().size() > 0) {
            TargetCard target = new TargetCard(Zone.HAND, filter);
            if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
                    && player.choose(Outcome.Benefit, player.getHand(), target, game)) {
                Card card = player.getHand().get(target.getFirstTarget(), game);
                if (card != null) {
                    card.moveToExile(source.getSourceId(), "Elite Arcanist", source.getSourceId(), game);
                    Permanent permanent = game.getPermanent(source.getSourceId());
                    if (permanent != null) {
View Full Code Here

                for (Card card : filtered) {
                    filteredCards.add(card.getId());
                }

                TargetCard target = new TargetCard(Zone.PICK, filter);
                if (player.choose(Outcome.Benefit, filteredCards, target, game)) {
                    Card card = player.getSideboard().get(target.getFirstTarget(), game);
                    if (card != null) {

                        card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                        Cards revealCard = new CardsImpl();
View Full Code Here

        Player player = game.getPlayer(targetPointer.getFirst(game, source));
        Player sourcePlayer = game.getPlayer(source.getControllerId());
        if (player != null && sourcePlayer != null) {
            TargetCard targetCard = new TargetCard(Zone.ALL, new FilterNonlandCard());
            targetCard.setRequired(false);
            if (sourcePlayer.choose(Outcome.Discard, player.getHand(), targetCard, game)) {
                Card c = game.getCard(targetCard.getFirstTarget());
                if (c != null) {
                    CardsImpl cards = new CardsImpl();
                    cards.add(c);
                    player.revealCards("Vendilion Clique effect", cards, game);
View Full Code Here

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

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

        Player player = game.getPlayer(source.getControllerId());
        Permanent permanent = (Permanent)game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
        if (player != null && permanent != null) {
            TargetOpponent target = new TargetOpponent();
            target.setNotTarget(true);
            if (player.choose(this.outcome, target, source.getSourceId(), game)) {
                Player chosenPlayer = game.getPlayer(target.getFirstTarget());
                if (chosenPlayer != null) {
                    game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + chosenPlayer.getName());
                    int diff = chosenPlayer.getHand().size() - player.getHand().size();
                    if (diff > 0) {
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.