Package mage.target.common

Examples of mage.target.common.TargetControlledPermanent


        this.expansionSetCode = "MRD";
        this.subtype.add("Atog");
        this.color.setRed(true);
        this.power = new MageInt(3);
        this.toughness = new MageInt(4);
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(3, 3, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledPermanent(filter)));
        ability.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn));
        this.addAbility(ability);
    }
View Full Code Here


    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Player player = game.getPlayer(event.getPlayerId());
        if ( player != null ) {
            ReturnToHandTargetCost attackCost = new ReturnToHandTargetCost(new TargetControlledPermanent(filter));
            if ( attackCost.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
                 player.chooseUse(Outcome.Neutral, "Return an enchantment you control to hand to attack?", game) )
            {
                if (attackCost.pay(source, game, source.getSourceId(), event.getPlayerId(), true) ) {
                    return false;
View Full Code Here

        this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DoIfCostPaid(new CreateTokenEffect(new SpiritWhiteToken("M15")), new ManaCostsImpl("{W}")), filterNontoken, false));
       
        // {1}{W}, Sacrifice a Spirit: Target non-Spirit creature you control gains indestructible until end of turn.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
                new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{1}{W}"));
        ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1,1,filterSpirit, true)));
        ability.addTarget(new TargetControlledCreaturePermanent(filter));
        this.addAbility(ability);
    }
View Full Code Here

        this.toughness = new MageInt(4);

        this.addAbility(FlashAbility.getInstance());
        // When Deceiver Exarch enters the battlefield, choose one - Untap target permanent you control; or tap target permanent an opponent controls.
        Ability ability = new EntersBattlefieldTriggeredAbility(new UntapTargetEffect());
        ability.addTarget(new TargetControlledPermanent());
        Mode mode = new Mode();
        mode.getEffects().add(new TapTargetEffect());
        mode.getTargets().add(new TargetPermanent(filter));
        ability.addMode(mode);
        this.addAbility(ability);
View Full Code Here

        this.color.setBlue(true);
        this.power = new MageInt(1);
        this.toughness = new MageInt(2);
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ColoredManaCost(ColoredManaSymbol.U));
        ability.addCost(new TapSourceCost());
        ability.addTarget(new TargetControlledPermanent());
        this.addAbility(ability);
    }
View Full Code Here

        // {tap}: Add {1} to your mana pool.
        this.addAbility(new ColorlessManaAbility());
        // {3}, {tap}, Sacrifice a land: Destroy target nonbasic land.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new GenericManaCost(3));
        ability.addCost(new TapSourceCost());
        ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent("a land"))));
        Target target = new TargetNonBasicLandPermanent();
        ability.addTarget(target);       
        this.addAbility(ability);
    }
View Full Code Here

        this.expansionSetCode = "DST";

        this.color.setBlue(true);

        // As an additional cost to cast Reshape, sacrifice an artifact.
        this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter, false)));
        // Search your library for an artifact card with converted mana cost X or less and put it onto the battlefield. Then shuffle your library.
        this.getSpellAbility().addEffect(new ReshapeSearchEffect());
    }
View Full Code Here

        this.expansionSetCode = "DST";

        // {2}, {T} , Sacrifice a land: Draw a card and put a charge counter on Arcane Spyglass.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new GenericManaCost(2));
        ability.addCost(new TapSourceCost());
        ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
        ability.addEffect(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()));
        this.addAbility(ability);

        // Remove three charge counters from Arcane Spyglass: Draw a card.
        this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new RemoveCountersSourceCost(CounterType.CHARGE.createInstance(3))));
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            int drawnCards = player.drawCards(source.getManaCostsToPay().getX(), game);
            Target target = new TargetControlledPermanent(0, drawnCards, new FilterPermanent(), true);
            target.choose(Outcome.Sacrifice, player.getId(), source.getSourceId(), game);
            int sacrificedPermanents = 0;
            for (UUID permanentId : target.getTargets()) {
                Permanent permanent = game.getPermanent(permanentId);
                if (permanent != null) {
                    if (permanent.sacrifice(source.getSourceId(), game)) {
                        sacrificedPermanents++;
                    }
View Full Code Here

        if (player == null) {
            return false;
        }

        // sacrifice a creature
        Target target = new TargetControlledPermanent(1, 1, filterCreature, false);
        boolean sacrificed = false;
        if (target.canChoose(player.getId(), game)) {
            while (player.isInGame() && !target.isChosen() && target.canChoose(player.getId(), game)) {
                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));
                if (permanent != null) {
                    sacrificed |= permanent.sacrifice(source.getSourceId(), game);
                }
            }
        }
View Full Code Here

TOP

Related Classes of mage.target.common.TargetControlledPermanent

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.