Package mage.players

Examples of mage.players.Player.choose()


  public boolean apply(Game game, Ability source) {
    TargetControlledPermanent target = new TargetControlledCreaturePermanent();
    target.setRequired(true);
    Player player = game.getPlayer(source.getControllerId());
    if (target.canChoose(source.getId(), source.getControllerId(), game)) {
      player.choose(this.outcome, target, game);
      Permanent permanent = game.getPermanent(target.getFirstTarget());
      if (permanent != null) {
        return permanent.sacrifice(source.getSourceId(), game);
      }
    }
View Full Code Here


        cards.add(card);
        game.setZone(card.getId(), Zone.PICK);
        TargetCard target = new TargetCard(Zone.PICK, filter);
        target.setRequired(true);
        player.lookAtCards(cards, game);
        player.choose(cards, target, game);
        card = cards.get(target.getFirstTarget(), game);
        if (card != null) {
          card.moveToZone(Zone.HAND, source.getId(), game, false);
          cards.remove(card);
        }
View Full Code Here

  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()).get(0).getId(), game);
            }
            else {
              player.choose(Outcome.Damage, redirectTarget, game);
            }
            return true;
          }
        }
      }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            TargetDiscard target = new TargetDiscard(player.getId());
            player.choose(Outcome.Discard, target, source.getSourceId(), game);
            Card card = player.getHand().get(target.getFirstTarget(), game);
            if (card != null) {
                player.discard(card, source, game);
                source.getEffects().get(1).setValue("discardedCard", card);
                game.getState().setValue(source.getSourceId().toString(), card);
View Full Code Here

            String message = "Play red instant or sorcery card from your graveyard without paying its mana cost?";
            Set<Card> cards = player.getGraveyard().getCards(filter, game);
            TargetCardInGraveyard target = new TargetCardInGraveyard(filter);
            while (!cards.isEmpty() && player.chooseUse(outcome, message, game)) {
                target.clearChosen();
                if (player.choose(outcome, target, source.getSourceId(), game)) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {
                        player.cast(card.getSpellAbility(), game, true);
                        player.getGraveyard().remove(card);
                        cards.remove(card);
View Full Code Here

                cards.add(card);
            }
            TargetCard target1 = new TargetCard(Zone.LIBRARY, filter1);
            target1.setRequired(false);
            // move cards to the bottom of the library
            while (player.isInGame() && cards.size() > 0 && player.choose(Outcome.Detriment, cards, target1, game)) {
                Card card = cards.get(target1.getFirstTarget(), game);
                if (card != null) {
                    cards.remove(card);
                    player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, false, false);
                }
View Full Code Here

        if (target.canChoose(controller.getId(), game)) {
            boolean abilityApplied = false;
            Map<String, Serializable> options = new HashMap<>();
            options.put("UI.right.btn.text", "Done");
            while (target.canChoose(controller.getId(), game)) {
                if (controller.choose(Outcome.Benefit, target, source.getSourceId(), game, options)) {
                    break;
                }
            }

            for (int idx = 0; idx < target.getTargets().size(); idx++) {
View Full Code Here

                            for (Counter counter : permanent.getCounters().values()) {
                                choices.add(counter.getName());
                            }
                            choice.setChoices(choices);
                            choice.setMessage("Choose a counter to proliferate (" + permanent.getName() + ")");
                            controller.choose(Outcome.Benefit, choice, game);
                            for (Counter counter : permanent.getCounters().values()) {
                                if (counter.getName().equals(choice.getChoice())) {
                                    permanent.addCounters(counter.getName(), 1, game);
                                    break;
                                }
View Full Code Here

        }

        FilterCreatureCard filter = new FilterCreatureCard("Goblin creature card from your hand");
        filter.add(new SubtypePredicate("Goblin"));
        TargetCardInHand target = new TargetCardInHand(filter);
        if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
            Card card = game.getCard(target.getFirstTarget());
            if (card != null) {
                card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId());
                return true;
            }
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.