Package mage.target.common

Examples of mage.target.common.TargetControlledPermanent


        this.expansionSetCode = "7ED";

        this.color.setBlue(true);

        // Tap an untapped creature you control: Tap target artifact, creature, or land.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapTargetCost(new TargetControlledPermanent(untappedcreatureyoucontrol)));
        ability.addTarget(new TargetPermanent(artifactcreatureorland));
        this.addAbility(ability);

    }
View Full Code Here


       
        game.informPlayers("Each player returns a permanent he or she controls to its owner's hand instead");
        for (UUID playerId : game.getPlayerList()) {
            Player player = game.getPlayer(playerId);
            if (player != null) {
                TargetControlledPermanent target = new TargetControlledPermanent();
                List<Permanent> liste = game.getBattlefield().getActivePermanents(new FilterControlledPermanent(), playerId, game);
                if(!liste.isEmpty()){
                    while (!player.choose(Outcome.ReturnToHand, target, source.getSourceId(), game)){
                        if (!player.isInGame()) {
                            return false;
                        }
                    }
                    Permanent permanent = game.getPermanent(target.getFirstTarget());
                    if (permanent != null) {
                        permanent.moveToZone(Zone.HAND, source.getSourceId(), game, false);
                    }
                }
            }
View Full Code Here

       
        // {1}{G}, Sacrifice another creature: You gain life equal to the sacrificed creature's toughness.
        Effect effect = new GainLifeEffect(new SacrificeCostCreaturesToughness());
        effect.setText("You gain life equal to the sacrificed creature's toughness");
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{1}{G}"));
        ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
        this.addAbility(ability);
    }
View Full Code Here

        this.expansionSetCode = "MMQ";

        this.color.setRed(true);

        // You may sacrifice a Mountain rather than pay Crash's mana cost.
        this.addAbility(new AlternativeCostSourceAbility(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, alternativeCostFilter, true))));

        // Destroy target artifact.
        this.getSpellAbility().addEffect(new DestroyTargetEffect());
        this.getSpellAbility().addTarget(new TargetPermanent(effectFilter));
    }
View Full Code Here

        this.color.setWhite(true);
        this.power = new MageInt(3);
        this.toughness = new MageInt(3);

        // Tap five untapped Soldiers you control: Exile target creature.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new TapTargetCost(new TargetControlledPermanent(5,5,filter,false)));
        ability.addTarget(new TargetCreaturePermanent());
        this.addAbility(ability);
    }
View Full Code Here

            if (!controller.moveCardToHandWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD)){
                return false;
            }           
            Player player = game.getPlayer(permanent.getControllerId());
            if (player.chooseUse(Outcome.ReturnToHand, "Sacrifice a land to copy this spell?", game)){
                TargetControlledPermanent target = new TargetControlledPermanent(new FilterControlledLandPermanent());
                if (player.chooseTarget(Outcome.Sacrifice, target, source, game)){
                    Permanent land = game.getPermanent(target.getFirstTarget());
                    if(land != null){
                        if(land.sacrifice(source.getSourceId(), game)){
                            Spell spell = game.getStack().getSpell(source.getSourceId());
                            if (spell != null) {
                                Spell copy = spell.copySpell();
View Full Code Here

        // {1}{B}, Sacrifice another creature: Put a +1/+1 counter on Blood Host
        Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance());
        effect.setText("Put a +1/+1 counter on {this}");
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{B}"));
        ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
        // and you gain 2 life.
        effect = new GainLifeEffect(2);
        effect.setText("and you gain 2 life");
        ability.addEffect(effect);
        this.addAbility(ability);
View Full Code Here

        // Uktabi Wildcats's power and toughness are each equal to the number of Forests you control.
        this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame)));
       
        // {G}, Sacrifice a Forest: Regenerate Uktabi Wildcats.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new  RegenerateSourceEffect(), new ManaCostsImpl("{G}"));
        ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, sacrificeFilter, true)));
        this.addAbility(ability);
    }
View Full Code Here

        Player controller = game.getPlayer(source.getControllerId());

        FilterControlledPermanent filter = new FilterControlledPermanent("creature");
        filter.add(new CardTypePredicate(CardType.CREATURE));
        filter.add(new ControllerPredicate(TargetController.YOU));
        TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false);

        if (target.canChoose(player.getId(), game)) {
            player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);

            Permanent permanent = game.getPermanent(target.getFirstTarget());
            if (permanent != null) {
                controller.gainLife(permanent.getToughness().getValue(), game);
                return permanent.sacrifice(source.getSourceId(), game);
            }
            return true;
View Full Code Here

        this.color.setBlack(true);

        // {B}{B}, Pay 2 life, Sacrifice a Swamp: Return target creature card from your graveyard to the battlefield.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToBattlefieldTargetEffect(), new ManaCostsImpl("{B}{B}"));
        ability.addCost(new PayLifeCost(2));
        ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
        ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")));
        this.addAbility(ability);
    }
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.