Package mage.players

Examples of mage.players.Player.choose()


    public boolean choose(Game game, Ability source) {
        if (this.size() > 0) {
            Player player = game.getPlayer(source.getControllerId());
            while (!isChosen()) {
                Choice choice = this.getUnchosen().get(0);
                if (!player.choose(outcome, choice, game)) {
                    return false;
                }
            }
        }
        return true;
View Full Code Here


                        redirectTarget = new TargetPermanent(filter);
                        if (numPlaneswalkers == 1) {
                            redirectTarget.add(game.getBattlefield().getAllActivePermanents(filter, target.getId(), game).get(0).getId(), game);
                        }
                        else {
                            player.choose(Outcome.Damage, redirectTarget, null, game);
                        }
                        game.informPlayers(new StringBuilder(player.getName()).append(" redirects ")
                                .append(event.getAmount())
                                .append(" damage to ")
                                .append(game.getPermanent(redirectTarget.getFirstTarget()).getLogName()).toString());
View Full Code Here

    @Override
    public boolean choose(Outcome outcome, UUID playerId, UUID sourceId, Game game) {
        Player player = game.getPlayer(playerId);
        while (!isChosen() && !doneChosing()) {
            chosen = targets.size() >= minNumberOfTargets;
            if (!player.choose(outcome, this, sourceId, game)) {
                return chosen;
            }
            chosen = targets.size() >= minNumberOfTargets;
        }
        return chosen = true;
View Full Code Here

            if (cards.size() > 0) {
                player.lookAtCards("Glimpse the Future", cards, game);

                TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put in your hand"));
                if (player.choose(Outcome.Benefit, cards, target, game)) {
                    Card card = cards.get(target.getFirstTarget(), game);
                    if (card != null) {
                        card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                        cards.remove(card);
                    }
View Full Code Here

    if (player != null) {
      player.revealCards(player.getHand(), game);
      Player you = game.getPlayer(source.getControllerId());
      if (you != null) {
        TargetCard target = new TargetCard(Zone.PICK, filter);
        if (you.choose(player.getHand(), target, game)) {
          Card card = player.getHand().get(target.getFirstTarget(), game);
          if (card != null) {
            return player.discard(card, source, game);
          }
        }
View Full Code Here

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
      if (controller.choose(Outcome.Detriment, target, game)) {
        Card card = game.getCard(cardId);
        if (card != null) {
          card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId());
          Permanent permanent = game.getPermanent(target.getFirstTarget());
          if (permanent != null) {
View Full Code Here

                for (Integer i = 0; i <= existingCount; i++) {
                    choice.getChoices().add(i.toString());
                }

                int amount = 0;
                if (player.choose(Outcome.Detriment, choice, game)) {
                    amount = Integer.parseInt(choice.getChoice());
                }

                permanent.removeCounters(CounterType.CHARGE.getName(), amount, game);
            }
View Full Code Here

                        opponent = game.getPlayer(target.getFirstTarget());
                    } else {
                        opponent = game.getPlayer(game.getOpponents(player.getId()).iterator().next());
                    }
                    TargetCard targetDiscard = new TargetCard(2, Zone.PICK, new FilterCard("cards to put in graveyard"));
                    if (opponent != null && opponent.choose(Outcome.Discard, cards, targetDiscard, game)) {
                        cardsToKeep.removeAll(targetDiscard.getTargets());
                        cards.removeAll(cardsToKeep);
                    }
                }
View Full Code Here

        Card card = null;
        Zone zone = null;
        if (player.chooseUse(Outcome.Neutral, "Search your graveyard for Arachnus Web?", game)) {
            TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filter);
            if (player.choose(Outcome.PutCardInPlay, player.getGraveyard(), target, game)) {
                card = game.getCard(target.getFirstTarget());
                if (card != null) {
                    zone = Zone.GRAVEYARD;
                }
            }
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.Detriment, typeChoice, game)) {
                    if (!player.isInGame()) {
                        return false;
                    }
                }
                game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + typeChoice.getChoice());
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.