Package mage.target.common

Examples of mage.target.common.TargetControlledPermanent


        this.toughness = new MageInt(4);

        this.addAbility(FlyingAbility.getInstance());

        // When Demonlord of Ashmouth enters the battlefield, exile it unless you sacrifice another creature.
        this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(filter)))));

        this.addAbility(new UndyingAbility());
    }
View Full Code Here


            return false;
        }
        for (UUID playerId : controller.getInRange()) {
            Player player = game.getPlayer(playerId);

            Target target1 = new TargetControlledPermanent(1, 1, filter1, false);
            Target target2 = new TargetControlledPermanent(1, 1, filter2, false);
            Target target3 = new TargetControlledPermanent(1, 1, filter3, false);
            Target target4 = new TargetControlledPermanent(1, 1, filter4, false);
            Target target5 = new TargetControlledPermanent(1, 1, filter5, false);


            target1.setNotTarget(false);
            target2.setNotTarget(false);
            target3.setNotTarget(false);
            target4.setNotTarget(false);
            target5.setNotTarget(false);

            if (target1.canChoose(player.getId(), game)) {
                while (player.isInGame() && !target1.isChosen() && target1.canChoose(player.getId(), game)) {
                    player.chooseTarget(Outcome.Benefit, target1, source, game);
                }
                Permanent artifact = game.getPermanent(target1.getFirstTarget());
                if (artifact != null) {
                    chosen.add(artifact.getId());
                }
                target1.clearChosen();
            }

            if (target2.canChoose(player.getId(), game)) {
                while (player.isInGame() && !target2.isChosen() && target2.canChoose(player.getId(), game)) {
                    player.chooseTarget(Outcome.Benefit, target2, source, game);
                }
                Permanent creature = game.getPermanent(target2.getFirstTarget());
                if (creature != null) {
                    chosen.add(creature.getId());
                }
                target2.clearChosen();
            }

            if (target3.canChoose(player.getId(), game)) {
                while (player.isInGame() && !target3.isChosen() && target3.canChoose(player.getId(), game)) {
                    player.chooseTarget(Outcome.Benefit, target3, source, game);
                }
                Permanent enchantment = game.getPermanent(target3.getFirstTarget());
                if (enchantment != null) {
                    chosen.add(enchantment.getId());
                }
                target3.clearChosen();
            }

            if (target4.canChoose(player.getId(), game)) {
                while (player.isInGame() && !target4.isChosen() && target4.canChoose(player.getId(), game)) {
                    player.chooseTarget(Outcome.Benefit, target4, source, game);
                }
                Permanent land = game.getPermanent(target4.getFirstTarget());
                if (land != null) {
                    chosen.add(land.getId());
                }
                target4.clearChosen();
            }

            if (target5.canChoose(player.getId(), game)) {
                while (player.isInGame() && !target5.isChosen() && target5.canChoose(player.getId(), game)) {
                    player.chooseTarget(Outcome.Benefit, target5, source, game);
                }
                Permanent planeswalker = game.getPermanent(target5.getFirstTarget());
                if (planeswalker != null) {
                    chosen.add(planeswalker.getId());
                }
                target5.clearChosen();
            }

        }

        for (UUID uuid : chosen) {
View Full Code Here

    public ApostlesBlessing(UUID ownerId) {
        super(ownerId, 2, "Apostle's Blessing", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{WP}");
        this.expansionSetCode = "NPH";
        this.color.setWhite(true);
        this.getSpellAbility().addEffect(new ApostlesBlessingEffect(Duration.EndOfTurn));
        this.getSpellAbility().addTarget(new TargetControlledPermanent(filter));
        this.getSpellAbility().addChoice(new ChoiceColorOrArtifact());
    }
View Full Code Here

        // When Marsh Flitter enters the battlefield, put two 1/1 black Goblin Rogue creature tokens onto the battlefield.
        this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new BlackGoblinRogueToken(), 2), false));
        // Sacrifice a Goblin: Marsh Flitter has base power and toughness 3/3 until end of turn.
        Effect effect = new SetPowerToughnessSourceEffect(3, 3, Duration.EndOfTurn);
        effect.setText("{this} has base power and toughness 3/3 until end of turn");
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new SacrificeTargetCost(new TargetControlledPermanent(filter)));
        this.addAbility(ability);

    }
View Full Code Here

    public Deprive(UUID ownerId) {
        super(ownerId, 59, "Deprive", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}{U}");
        this.expansionSetCode = "ROE";
        this.color.setBlue(true);
        // As an additional cost to cast Deprive, return a land you control to its owner's hand.
        this.getSpellAbility().addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(filter)));

        // Counter target spell.
        this.getSpellAbility().addTarget(new TargetSpell());
        this.getSpellAbility().addEffect(new CounterTargetEffect());
    }
View Full Code Here

        this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(5))));
        Ability firstAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new PentaviteToken(), 1), new GenericManaCost(1));
        firstAbility.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance(1)));
        this.addAbility(firstAbility);
        Ability secondAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), new GenericManaCost(1));
        secondAbility.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
        this.addAbility(secondAbility);
    }
View Full Code Here

        super(ownerId, 79, "Artillerize", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{R}");
        this.expansionSetCode = "NPH";

        this.color.setRed(true);

        this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
        this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
        this.getSpellAbility().addEffect(new DamageTargetEffect(5));
    }
View Full Code Here

        this.color.setRed(true);
        this.power = new MageInt(1);
        this.toughness = new MageInt(1);

        // Sacrifice a land: Akki Avalanchers gets +2/+0 until end of turn. Activate this ability only once each turn.
        this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledPermanent(filter))));
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            Target target = new TargetControlledPermanent(new FilterControlledCreaturePermanent());

            if (target.canChoose(player.getId(), game) && player.choose(Outcome.Sacrifice, target, source.getSourceId(), game)) {
                Permanent permanent = game.getPermanent(target.getFirstTarget());
                if (permanent != null) {
                    return permanent.sacrifice(source.getSourceId(), game);
                }
            }
        }
View Full Code Here

        this.expansionSetCode = "MMQ";

        this.color.setRed(true);

        // You may sacrifice two Mountains rather than pay Pulverize's mana cost.
        this.addAbility(new AlternativeCostSourceAbility(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, filter, true))));
       
        // Destroy all artifacts.
        this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterArtifactPermanent()));
    }
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.