Examples of canChoose()


Examples of mage.target.Target.canChoose()

                case GRAVEYARD:
                    target = new TargetCardInYourGraveyard(Math.min(player.getGraveyard().count(filter, game), amount), filter);
                    break;
                default:
            }
            if (target != null && target.canChoose(player.getId(), game)) {
                if (target.choose(Outcome.Exile, player.getId(), source.getSourceId(), game)) {
                    for (UUID cardId : target.getTargets()) {
                        Card card = game.getCard(cardId);
                        if (card != null) {
                            card.moveToExile(exileId, exileName, source.getSourceId(), game);
View Full Code Here

Examples of mage.target.Target.canChoose()

        Player controller = game.getPlayer(source.getControllerId());
        Target target = new TargetPermanentOrPlayerWithCounter(0, Integer.MAX_VALUE, true);

        //A spell or ability could have removed the only legal target this player
        //had, if thats the case this ability should fizzle.
        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)) {
View Full Code Here

Examples of mage.target.Target.canChoose()

        //had, if thats the case this ability should fizzle.
        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;
                }
            }
View Full Code Here

Examples of mage.target.Target.canChoose()

                    chosen.add(enchantment);
                }
                target3.clearChosen();
            }
           
            if (target4.canChoose(player.getId(), game)) {
                while (player.isInGame() && !target4.isChosen() && target4.canChoose(player.getId(), game)) {
                    player.choose(Outcome.Benefit, target4, source.getSourceId(), game);
                }
                Permanent land = game.getPermanent(target4.getFirstTarget());
                if (land != null) {
View Full Code Here

Examples of mage.target.Target.canChoose()

                }
                target3.clearChosen();
            }
           
            if (target4.canChoose(player.getId(), game)) {
                while (player.isInGame() && !target4.isChosen() && target4.canChoose(player.getId(), game)) {
                    player.choose(Outcome.Benefit, target4, source.getSourceId(), game);
                }
                Permanent land = game.getPermanent(target4.getFirstTarget());
                if (land != null) {
                    chosen.add(land);
View Full Code Here

Examples of mage.target.Target.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.Target.canChoose()

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            Target target = new TargetPermanent(filter);
            if (target.canChoose(source.getControllerId(), game)) {
                player.choose(Outcome.Copy, target, source.getSourceId(), game);
                Permanent tokenToCopy = game.getPermanent(target.getFirstTarget());
                if (tokenToCopy != null) {
                    game.informPlayers("Token selected for populate: " + tokenToCopy.getLogName());
                    Effect effect = new PutTokenOntoBattlefieldCopyTargetEffect();
View Full Code Here

Examples of mage.target.Target.canChoose()

        Player player = game.getPlayer(source.getControllerId());
        Permanent sourcePermanent = game.getPermanent(source.getSourceId());
        if (player != null && sourcePermanent != null) {
            Target target = new TargetPermanent(filter);
            target.setNotTarget(notTarget);
            if (target.canChoose(source.getControllerId(), game)) {
                player.choose(Outcome.Copy, target, source.getSourceId(), game);
                Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget());
                if (copyFromPermanent != null) {
                    bluePrintPermanent = game.copyPermanent(copyFromPermanent, sourcePermanent, source, applier);
                    return true;
View Full Code Here

Examples of mage.target.Target.canChoose()

        Target target = new TargetControlledPermanent(amount, amount, filter, true);

        //A spell or ability could have removed the only legal target this player
        //had, if thats the case this ability should fizzle.
        if (amount > 0 && target.canChoose(source.getSourceId(), player.getId(), game)) {
            boolean abilityApplied = false;
            while (!target.isChosen() && target.canChoose(player.getId(), game) && player.isInGame()) {
                player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
            }
View Full Code Here

Examples of mage.target.Target.canChoose()

        //A spell or ability could have removed the only legal target this player
        //had, if thats the case this ability should fizzle.
        if (amount > 0 && target.canChoose(source.getSourceId(), player.getId(), game)) {
            boolean abilityApplied = false;
            while (!target.isChosen() && target.canChoose(player.getId(), game) && player.isInGame()) {
                player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
            }

            for ( int idx = 0; idx < target.getTargets().size(); idx++) {
                Permanent permanent = game.getPermanent((UUID)target.getTargets().get(idx));
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.