Examples of canTarget()


Examples of mage.target.Target.canTarget()

                return false;
            }
            boolean twoTimesTarget = false;
            if (targets.size() == 1 && targets.get(0).getTargets().size() == 1) {
                Target target = targets.get(0);
                if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) {
                    oldTarget = game.getObject(targets.getFirstTarget());
                    target.clearChosen();
                    target.add(source.getSourceId(), game);
                }               
            }
View Full Code Here

Examples of mage.target.Target.canTarget()

                            // you can't change this target to Spellskite because Spellskite is already another targetId of that target.
                            twoTimesTarget = true;
                            continue;
                        }
                        if (name != null && player.chooseUse(Outcome.Neutral, new StringBuilder("Change target from ").append(name).append(" to ").append(sourceObject.getName()).append("?").toString(), game)) {
                            if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) {
                                oldTarget = game.getObject(targets.getFirstTarget());
                                target.remove(targetId);
                                target.addTarget(source.getSourceId(), source, game);
                                break;
                            }
View Full Code Here

Examples of mage.target.Target.canTarget()

            Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
            if (aura != null && creature != null) {
                Permanent oldCreature = game.getPermanent(aura.getAttachedTo());
                if (oldCreature != null && !oldCreature.equals(creature)) {
                    Target auraTarget = aura.getSpellAbility().getTargets().get(0);
                    if (!auraTarget.canTarget(creature.getId(), game))  {
                        game.informPlayers(aura.getLogName() + " was not attched to " +creature.getLogName() + " because it's no legal target for the aura" );
                    } else if (oldCreature.removeAttachment(aura.getId(), game)) {
                        game.informPlayers(aura.getLogName() + " was unattached from " + oldCreature.getLogName() + " and attached to " + creature.getLogName());
                        creature.addAttachment(aura.getId(), game);
                    }
View Full Code Here

Examples of mage.target.TargetSource.canTarget()

                    MageObject targetObject = game.getObject(targetId);
                    if (targetObject != null) {
                        for (String choose2: choices) {
                            if (targetObject.getName().equals(choose2)) {
                                List<UUID> alreadyTargetted = target.getTargets();
                                if (t.canTarget(targetObject.getId(), game)) {
                                    if (alreadyTargetted != null && !alreadyTargetted.contains(targetObject.getId())) {
                                        target.add(targetObject.getId(), game);
                                        choices.remove(choose2);
                                        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.