Examples of Targets


Examples of mage.target.Targets

    protected Choices choices;
    protected Effects effects;

    public Mode() {
        this.id = UUID.randomUUID();
        this.targets = new Targets();
        this.choices = new Choices();
        this.effects = new Effects();
    }
View Full Code Here

Examples of mage.target.Targets

    @Override
    public boolean canChoose(UUID sourceControllerId, Game game) {
        for (StackObject stackObject : game.getStack()) {
            if ((stackObject instanceof Spell) || (stackObject instanceof StackAbility)) {
                Targets objectTargets = stackObject.getStackAbility().getTargets();
                if(!objectTargets.isEmpty()) {
                    for (Target target : objectTargets) {
                        for (UUID targetId : target.getTargets()) {
                            Permanent targetedPermanent = game.getPermanentOrLKIBattlefield(targetId);
                            if (targetedPermanent != null && targetedPermanent.getControllerId().equals(sourceControllerId)) {
                                return true;
View Full Code Here

Examples of mage.target.Targets

    @Override
    public Set<UUID> possibleTargets(UUID sourceControllerId, Game game) {
        Set<UUID> possibleTargets = new HashSet<>();
        for (StackObject stackObject : game.getStack()) {
            if ((stackObject instanceof Spell) || (stackObject instanceof StackAbility)) {
                Targets objectTargets = stackObject.getStackAbility().getTargets();
                if(!objectTargets.isEmpty()) {
                    for (Target target : objectTargets) {
                        for (UUID targetId : target.getTargets()) {
                            Permanent targetedPermanent = game.getPermanentOrLKIBattlefield(targetId);
                            if (targetedPermanent != null && targetedPermanent.getControllerId().equals(sourceControllerId)) {
                                possibleTargets.add(stackObject.getId());
View Full Code Here

Examples of mage.target.Targets

    @Override
    public boolean apply(Game game, Ability source) {
        StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget());
        MageObject sourceObject = game.getObject(source.getSourceId());
        if (stackObject != null && sourceObject != null) {
            Targets targets;
            Ability sourceAbility;
            MageObject oldTarget = null;
            if (stackObject instanceof Spell) {
                Spell spell = (Spell)stackObject;
                sourceAbility = spell.getSpellAbility();
                targets = spell.getSpellAbility().getTargets();
            } else if (stackObject instanceof StackAbility) {
                StackAbility stackAbility = (StackAbility)stackObject;
                sourceAbility = stackAbility;
                targets = stackAbility.getTargets();
            } else {
                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);
                }               
            }
            else {
                Player player = game.getPlayer(source.getControllerId());
                for (Target target: targets) {
                    for (UUID targetId: target.getTargets()) {
                        MageObject object = game.getObject(targetId);
                        String name;
                        if (object == null) {
                            Player targetPlayer = game.getPlayer(targetId);
                            name = targetPlayer.getName();
                        } else {
                            name = object.getName();
                        }
                        if (!targetId.equals(source.getSourceId()) && target.getTargets().contains(source.getSourceId())) {
                            // 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.Targets

        return new YoseiTheMorningStarTapEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
                Targets targets = source.getTargets();
                Target target1 = targets.get(1);
                for (UUID target: target1.getTargets()) {
            Permanent permanent = game.getPermanent(target);
            if (permanent != null) {
                permanent.tap(game);
            } else {
View Full Code Here

Examples of mage.target.Targets

   
    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            Targets targets = source.getTargets();
            int i = 0;
                for (Target target: targets) {
                    Card card = game.getCard(target.getFirstTarget());
                    player.discard(card, source, game);
                    i++;
View Full Code Here

Examples of net.sf.minuteProject.configuration.bean.Targets

    configuration.setConventions(getKernelConventions());
    return configuration;
  }
 
  private Targets getTargets() {
    Targets targets = new Targets();
//    Target target = getChoosenTarget();
//    targets.addTarget(target);
    for (Target target2 : getAllRelatedTechnologies()) {
      targets.addTarget(target2);
    }
    return targets;
  }
View Full Code Here

Examples of org.bouncycastle.asn1.x509.Targets

                {
                    boolean found = false;

                    for (int i=0; i<targetss.length; i++)
                    {
                        Targets t = targetss[i];
                        Target[] targets = t.getTargets();
                        for (int j=0; j<targets.length; j++)
                        {
                            if (targetNames.contains(GeneralName.getInstance(targets[j]
                                                       .getTargetName())))
                            {
                                found = true;
                                break;
                            }
                        }
                    }
                    if (!found)
                    {
                        return false;
                    }
                }
                if (!targetGroups.isEmpty())
                {
                    boolean found = false;

                    for (int i=0; i<targetss.length; i++)
                    {
                        Targets t = targetss[i];
                        Target[] targets = t.getTargets();
                        for (int j=0; j<targets.length; j++)
                        {
                            if (targetGroups.contains(GeneralName.getInstance(targets[j]
                                                        .getTargetGroup())))
                            {
View Full Code Here

Examples of org.bouncycastle.asn1.x509.Targets

                {
                    boolean found = false;

                    for (int i=0; i<targetss.length; i++)
                    {
                        Targets t = targetss[i];
                        Target[] targets = t.getTargets();
                        for (int j=0; j<targets.length; j++)
                        {
                            if (targetNames.contains(targets[j]
                                                       .getTargetName()))
                            {
                                found = true;
                                break;
                            }
                        }
                    }
                    if (!found)
                    {
                        return false;
                    }
                }
                if (!targetGroups.isEmpty())
                {
                    boolean found = false;

                    for (int i=0; i<targetss.length; i++)
                    {
                        Targets t = targetss[i];
                        Target[] targets = t.getTargets();
                        for (int j=0; j<targets.length; j++)
                        {
                            if (targetGroups.contains(targets[j]
                                                        .getTargetGroup()))
                            {
View Full Code Here

Examples of org.bouncycastle.asn1.x509.Targets

                {
                    boolean found = false;

                    for (int i=0; i<targetss.length; i++)
                    {
                        Targets t = targetss[i];
                        Target[] targets = t.getTargets();
                        for (int j=0; j<targets.length; j++)
                        {
                            if (targetNames.contains(GeneralName.getInstance(targets[j]
                                                       .getTargetName())))
                            {
                                found = true;
                                break;
                            }
                        }
                    }
                    if (!found)
                    {
                        return false;
                    }
                }
                if (!targetGroups.isEmpty())
                {
                    boolean found = false;

                    for (int i=0; i<targetss.length; i++)
                    {
                        Targets t = targetss[i];
                        Target[] targets = t.getTargets();
                        for (int j=0; j<targets.length; j++)
                        {
                            if (targetGroups.contains(GeneralName.getInstance(targets[j]
                                                        .getTargetGroup())))
                            {
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.