Examples of canChoose()


Examples of mage.target.common.TargetCardInLibrary.canChoose()

                FilterCard filter = new FilterCreatureCard("number of creature cards with total converted mana cost 6 or less (6 CMC left)");
                filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, manaCostLeftToFetch + 1));
                TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter);
                target.setCardLimit(librarySearchLimit);

                while (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
                    target.choose(Outcome.PutCreatureInPlay, source.getControllerId(), source.getControllerId(), game);
                    Card card = player.getLibrary().remove(target.getFirstTarget(), game);
                    if (card == null) {
                        break;
                    }
View Full Code Here

Examples of mage.target.common.TargetCardInOpponentsGraveyard.canChoose()

        FilterCard filter = new FilterCard("creature card in an opponent's graveyard");
        filter.add(new CardTypePredicate(CardType.CREATURE));
        TargetCardInOpponentsGraveyard target = new TargetCardInOpponentsGraveyard(1, 1, filter);

        if (you != null) {
            if (target.canChoose(source.getControllerId(), game)
                    && you.choose(Outcome.GainControl, target, source.getSourceId(), game)) {
                if (!target.getTargets().isEmpty()) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {
                        if (card.getManaCost().convertedManaCost() <= allycount) {
View Full Code Here

Examples of mage.target.common.TargetCardInYourGraveyard.canChoose()

        if (player == null || !(ability instanceof SpellAbility)) {
            return;
        }
        Target target = new TargetCardInYourGraveyard(1, Integer.MAX_VALUE, new FilterCard());
        target.setTargetName("cards to delve from your graveyard");
        if (!target.canChoose(sourceId, controllerId, game)) {
            return;
        }
        if (!CardUtil.isCheckPlayableMode(ability) && player.chooseUse(Outcome.Detriment, "Delve cards from your graveyard?", game)) {
            player.chooseTarget(Outcome.Detriment, target, ability, game);
            if (target.getTargets().size() > 0) {
View Full Code Here

Examples of mage.target.common.TargetControlledCreaturePermanent.canChoose()

  @Override
  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

Examples of mage.target.common.TargetControlledCreaturePermanent.canChoose()

        if (player == null || !(ability instanceof SpellAbility)) {
            return;
        }
        Target target = new TargetControlledCreaturePermanent(1, Integer.MAX_VALUE, filter,true);
        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) {
View Full Code Here

Examples of mage.target.common.TargetControlledCreaturePermanent.canChoose()

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

Examples of mage.target.common.TargetControlledCreaturePermanent.canChoose()

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent();
        if (controller != null) {
            if (target.canChoose(source.getControllerId(), game)
                && controller.chooseUse(outcome, "Cipher this spell to a creature?", game)) {
                controller.chooseTarget(outcome, target, source, game);
                Card sourceCard = game.getCard(source.getSourceId());
                Permanent targetCreature = game.getPermanent(target.getFirstTarget());
                if (targetCreature != null && sourceCard != null) {
View Full Code Here

Examples of mage.target.common.TargetControlledCreaturePermanent.canChoose()

        Permanent creature = game.getPermanent(event.getTargetId());
        Player controller = game.getPlayer(source.getControllerId());
        if (creature != null && controller != null) {
            Target target = new TargetControlledCreaturePermanent(1, Integer.MAX_VALUE, filter, true);
            target.setRequired(false);
            if (!target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
                return false;
            }
            if (controller.chooseUse(Outcome.Detriment, "Devour creatures?", game)) {
                controller.chooseTarget(Outcome.Detriment, target, source, game);
                if (target.getTargets().size() > 0) {
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent.canChoose()

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player != null) {
      TargetControlledPermanent target = new TargetControlledPermanent(filter);
      if (target.canChoose(null, source.getControllerId(), game)) {
        target.setRequired(true);
        if (player.choose(Outcome.Neutral, target, game)) {
          Permanent permanent = game.getPermanent(target.getFirstTarget());
          if (permanent != null) {
            permanent.addCounters("phylactery", 1);
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent.canChoose()

  @Override
  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
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.