Examples of chooseTarget()


Examples of mage.players.Player.chooseTarget()

      if (creature.canAttack(game)) {
        TargetDefender target = new TargetDefender(game.getCombat().getDefenders(), creature.getControllerId());
        target.setRequired(true);
        Player controller = game.getPlayer(creature.getControllerId());
        while (!target.isChosen())
          controller.chooseTarget(Outcome.Damage, target, source, game);
        game.getCombat().declareAttacker(creature.getId(), target.getFirstTarget(), game);
        return true;
      }
    }
    return false;
View Full Code Here

Examples of mage.players.Player.chooseTarget()

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

Examples of mage.players.Player.chooseTarget()

        return chosen;
      }
      chosen = targets.size() >= minNumberOfTargets;
    }
    while (!doneChosing()) {
      if (!player.chooseTarget(outcome, this, source, game)) {
        break;
      }
    }
    return chosen = true;
  }
View Full Code Here

Examples of mage.players.Player.chooseTarget()

    if (startingPlayerId == null) {
      TargetPlayer targetPlayer = new TargetPlayer();
      targetPlayer.setRequired(true);
      targetPlayer.setTargetName("starting player");
      Player choosingPlayer = getPlayer(pickChoosingPlayer());
      if (choosingPlayer.chooseTarget(Outcome.Benefit, targetPlayer, null, this)) {
        startingPlayerId = ((List<UUID>)targetPlayer.getTargets()).get(0);
        fireInformEvent(state.getPlayer(startingPlayerId).getName() + " will start");
      }
      else {
        return;
View Full Code Here

Examples of mage.players.Player.chooseTarget()

      if (creature.canAttack(game)) {
        TargetDefender target = new TargetDefender(game.getCombat().getDefenders(), creature.getControllerId());
        target.setRequired(true);
        Player controller = game.getPlayer(creature.getControllerId());
        while (!target.isChosen())
          controller.chooseTarget(Outcome.Damage, target, source, game);
        game.getCombat().declareAttacker(creature.getId(), target.getFirstTarget(), game);
        return true;
      }
    }
    return false;
View Full Code Here

Examples of mage.players.Player.chooseTarget()

      Target newTarget = target.copy();
      newTarget.clearChosen();
      for (UUID targetId: target.getTargets()) {
        MageObject object = game.getObject(targetId);
        if (player.chooseUse(ability.getEffects().get(0).getOutcome(), "Change target from " + object.getName() + "?", game)) {
          if (!player.chooseTarget(ability.getEffects().get(0).getOutcome(), newTarget, ability, game))
            newTarget.addTarget(targetId, ability, game);
        }
        else {
          newTarget.addTarget(targetId, ability, game);
        }
View Full Code Here

Examples of mage.players.Player.chooseTarget()

                                cards.add(card);
                            }
                        }
                    } else {
                        Target target = new TargetDiscard(numberOfCardsToDiscard, numberOfCardsToDiscard, new FilterCard(), playerId);
                        player.chooseTarget(outcome, target, source, game);
                        cards.addAll(target.getTargets());
                    }
                    cardsToDiscard.put(playerId, cards);
                }
            }
View Full Code Here

Examples of mage.players.Player.chooseTarget()

        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            FilterPermanent filter = new FilterControlledLandPermanent(new StringBuilder("any number of ").append(sweepSubtype).append("s you control").toString());
            filter.add(new SubtypePredicate(sweepSubtype));
            Target target = new TargetPermanent(0, Integer.MAX_VALUE, filter, true);
            if (controller.chooseTarget(outcome, target, source, game)) {
                game.getState().setValue(CardUtil.getCardZoneString("sweep", source.getSourceId(), game), target.getTargets().size());
                for (UUID uuid : target.getTargets()) {
                    Permanent land = game.getPermanent(uuid);
                    land.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                }
View Full Code Here

Examples of mage.players.Player.chooseTarget()

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if(player != null){
            TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(Math.min(amount, player.getGraveyard().size()), new FilterCard());
            if (player.chooseTarget(outcome, target, source, game)) {
                for (UUID targetId: target.getTargets()) {
                    Card card = player.getGraveyard().get(targetId, game);
                    if (card != null) {
                        card.moveToZone(Zone.EXILED, source.getSourceId(), game, false);
                    }
View Full Code Here

Examples of mage.players.Player.chooseTarget()

        target.setTargetName("creatures to convoke");
        if (!target.canChoose(sourceId, controllerId, game)) {
            return;
        }
        if (player.chooseUse(Outcome.Detriment, "Convoke creatures?", game)) {
            player.chooseTarget(Outcome.Tap, target, ability, game);
            if (target.getTargets().size() > 0) {
                for (UUID creatureId: target.getTargets()) {
                    Permanent perm = game.getPermanent(creatureId);
                    if (perm == null || ability.getManaCostsToPay().convertedManaCost() == 0) {
                        continue;
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.