Examples of TargetControlledPermanent


Examples of mage.target.common.TargetControlledPermanent

        int amount = count.calculate(game, source, this);
        int realCount = game.getBattlefield().countAll(filter, player.getId(), game);
        amount = Math.min(amount, realCount);

        Target target = new TargetControlledPermanent(amount, amount, filter, true);

        //A spell or ability could have removed the only legal target this player
        //had, if thats the case this ability should fizzle.
        if (amount > 0 && target.canChoose(source.getSourceId(), player.getId(), game)) {
            boolean abilityApplied = false;
            while (!target.isChosen() && target.canChoose(player.getId(), game) && player.isInGame()) {
                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 ) {
                    abilityApplied |= permanent.sacrifice(source.getSourceId(), game);
                }
            }
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

class ChampionExileCost extends CostImpl {

    private String exileZone = null;

    public ChampionExileCost(FilterControlledPermanent filter, String exileZone) {
        this.addTarget(new TargetControlledPermanent(1,1,filter, true));
        this.text = "exile " + filter.getMessage() + " you control";
        this.exileZone = exileZone;
    }
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

        return game.getBattlefield().countAll(filter, source.getControllerId(), game);
    }

    @Override
    public Cost getFixedCostsFromAnnouncedValue(int xValue) {
        return new TapTargetCost(new TargetControlledPermanent(xValue, xValue, filter, true));
    }
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

            }
        }
       
        if (player != null) {
            int amount = Math.min(count, game.getBattlefield().countAll(filter, player.getId(), game));
            Target target = new TargetControlledPermanent(amount, amount, filter, false);

            //A spell or ability could have removed the only legal target this player
            //had, if thats the case this ability should fizzle.
            if (target.canChoose(player.getId(), game)) {
                boolean abilityApplied = false;
                while (!target.isChosen() && target.canChoose(player.getId(), game) && player.isInGame()) {
                    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) {
                        abilityApplied |= permanent.sacrifice(source.getSourceId(), game);
                    }
                }
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

        super(ownerId, 165, "Harrow", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{G}");
        this.expansionSetCode = "ZEN";
        this.color.setGreen(true);       

        // As an additional cost to cast Harrow, sacrifice a land.
        this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));

        // Search your library for up to two basic land cards and put them onto the battlefield. Then shuffle your library.
        TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard());
        this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(target, false, Outcome.PutLandInPlay));
    }
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

        super(ownerId, 205, "Khalni Gem", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}");
        this.expansionSetCode = "ZEN";

        // When Khalni Gem enters the battlefield, return two lands you control to their owner's hand.
        Ability etbAbility = new EntersBattlefieldTriggeredAbility(new KhalniGemReturnToHandTargetEffect());
        Target target = new TargetControlledPermanent(2, 2, filter, false);
        etbAbility.addTarget(target);
        this.addAbility(etbAbility);
        // {tap}: Add two mana of any one color to your mana pool.
        SimpleManaAbility ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(2), new TapSourceCost());
        this.addAbility(ability);
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

        return game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);
    }

    @Override
    public Cost getFixedCostsFromAnnouncedValue(int xValue) {
        TargetControlledPermanent target = new TargetControlledPermanent(xValue, xValue, filter, true);
        return new SacrificeTargetCost(target);
    }
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

        this.expansionSetCode = "EXO";

        this.color.setBlack(true);

        // Sacrifice a creature, Return Recurring Nightmare to its owner's hand: Return target creature card from your graveyard to the battlefield. Activate this ability only any time you could cast a sorcery.
        Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToBattlefieldTargetEffect(), new SacrificeTargetCost(new TargetControlledPermanent(filter2)));
        ability.addTarget(new TargetCardInYourGraveyard(filter));
        ability.addCost(new ReturnToHandSourceCost());
        this.addAbility(ability);
    }
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

        this.expansionSetCode = "TMP";
        this.subtype.add("Atog");
        this.color.setWhite(true);
        this.power = new MageInt(1);
        this.toughness = new MageInt(2);
        this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledPermanent(filter))));
    }
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

        this.subtype.add("Rat");
        this.color.setBlack(true);
        this.power = new MageInt(2);
        this.toughness = new MageInt(1);
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ColoredManaCost(ColoredManaSymbol.B));
        ability.addTarget(new TargetControlledPermanent(filter));
        this.addAbility(ability);
    }
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.