Package mage.target.common

Examples of mage.target.common.TargetPermanentOrPlayerWithCounter


    }

    @Override
    public boolean apply(Game game, Ability source) {
        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)) {
                    break;
                }
            }

            for (int idx = 0; idx < target.getTargets().size(); idx++) {
                UUID chosen = (UUID) target.getTargets().get(idx);
                Permanent permanent = game.getPermanent(chosen);
                if (permanent != null) {
                    if (permanent.getCounters().size() > 0) {
                        if (permanent.getCounters().size() == 1) {
                            for (Counter counter : permanent.getCounters().values()) {
View Full Code Here

TOP

Related Classes of mage.target.common.TargetPermanentOrPlayerWithCounter

Copyright © 2018 www.massapicom. 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.