Package mage.target

Examples of mage.target.Target


            FilterCard filter = new FilterCard(new StringBuilder("artifact or creature card with converted mana cost ").append(xValue).append(" from an opponent's graveyard").toString());
            filter.add(Predicates.or(
                new CardTypePredicate(CardType.ARTIFACT),
                new CardTypePredicate(CardType.CREATURE)));
            filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, xValue));
            Target target = new TargetCardInOpponentsGraveyard(filter);
            ability.addTarget(target);
        }
    }
View Full Code Here


        this.power = new MageInt(3);
        this.toughness = new MageInt(3);

        Effect putCountersEffect = new AddCountersTargetEffect(CounterType.M1M1.createInstance(3), Outcome.UnboostCreature);
        Ability ability = new EntersBattlefieldTriggeredAbility(putCountersEffect, false);
        Target target = new TargetCreaturePermanent();
        ability.addTarget(target);
        this.addAbility(ability);
    }
View Full Code Here

        // Target creature you control fights target creature you don't control.
        effect = new FightTargetsEffect();
        effect.setText("<br/><br/>Target creature you control fights target creature you don't control");
        this.getSpellAbility().addEffect(effect);
        this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
        Target target = new TargetCreaturePermanent(filter);
        this.getSpellAbility().addTarget(target);
    }
View Full Code Here

        this.color.setBlue(true);

        // Strive - Polymorphous Rush costs {1}{U} more to cast for each target beyond the first.
        this.addAbility(new StriveAbility("{1}{U}"));
        // Choose a creature on the battlefield. Any number of target creatures you control each become a copy of that creature until end of turn.
        Target target = new TargetCreaturePermanent(new FilterCreaturePermanent(""));
        target.setNotTarget(true);
        target.setTargetName("a creature on the battlefield (creature to copy)");
        this.getSpellAbility().addTarget(target);
        this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE));
        this.getSpellAbility().addEffect(new PolymorphousRushCopyEffect());

    }
View Full Code Here

        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            for (UUID playerId : controller.getInRange()) {
                Player player = game.getPlayer(playerId);

                Target target = new TargetControlledPermanent(1, 1, filter, false);
                if (target.canChoose(player.getId(), game)) {
                    while (player.isInGame() && !target.isChosen() && target.canChoose(player.getId(), game)) {
                        player.choose(Outcome.Benefit, target, source.getSourceId(), game);
                    }
                    Permanent permanent = game.getPermanent(target.getFirstTarget());
                    if (permanent != null) {
                        chosen.add(permanent);
                    }
                }
            }
View Full Code Here

        this.color.setGreen(true);

        // Target creature you control fights target creature you don't control.
        this.getSpellAbility().addEffect(new FightTargetsEffect());
        this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
        Target target = new TargetCreaturePermanent(filter);
        this.getSpellAbility().addTarget(target);
    }
View Full Code Here

    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType().equals(GameEvent.EventType.ZONE_CHANGE)) {
            ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
            if (zEvent.isDiesEvent() && zEvent.getTarget() != null && zEvent.getTargetId().equals(getTargets().getFirstTarget())) {
                this.getTargets().clear(); // else spell fizzels because target creature died
                Target target = new TargetPlayer();
                target.add(zEvent.getTarget().getControllerId(), game);
                this.addTarget(target);
                return true;
            }
        }
        return false;
View Full Code Here

        // Strive - Consign to Dust costs 2G more to cast for each target beyond the first.
        this.addAbility(new StriveAbility("{2}{G}"));
        // Destroy any number of target artifacts and/or enchantments.
        Effect effect = new DestroyTargetEffect();
        effect.setText("Destroy any number of target artifacts and/or enchantments");
        Target target = new TargetPermanent(0, Integer.MAX_VALUE, filter, false);
        this.getSpellAbility().addTarget(target);
        this.getSpellAbility().addEffect(effect);
    }
View Full Code Here

        this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
       
        effect = new FightTargetsEffect();
        effect.setText("It fights target creature you don't control");
        this.getSpellAbility().addEffect(effect);       
        Target target = new TargetCreaturePermanent(filter);
        this.getSpellAbility().addTarget(target);

    }
View Full Code Here

    }

    @Override
    public boolean apply(Game game, Ability source) {
        if (source.getTargets().size() > 0) {
            Target multiTarget = source.getTargets().get(0);
            for (UUID target: multiTarget.getTargets()) {
                Permanent permanent = game.getPermanent(target);
                if (permanent != null) {
                    permanent.addCounters(CounterType.P1P1.createInstance(multiTarget.getTargetAmount(target)), game);
                }
            }
        }
        return true;
    }
View Full Code Here

TOP

Related Classes of mage.target.Target

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.