Package mage.filter.common

Examples of mage.filter.common.FilterControlledLandPermanent


    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            FilterPermanent filter = new FilterControlledLandPermanent(new StringBuilder("any number of ").append(sweepSubtype).append("s you control").toString());
            filter.add(new SubtypePredicate(sweepSubtype));
            Target target = new TargetPermanent(0, Integer.MAX_VALUE, filter, true);
            if (controller.chooseTarget(outcome, target, source, game)) {
                game.getState().setValue(CardUtil.getCardZoneString("sweep", source.getSourceId(), game), target.getTargets().size());
                for (UUID uuid : target.getTargets()) {
                    Permanent land = game.getPermanent(uuid);
View Full Code Here


        // You can't play lands.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AggressiveMiningEffect()));
       
        // Sacrifice a land: Draw two cards.  Activate this ability only once each turn.
        Cost cost = new SacrificeTargetCost(new TargetControlledPermanent(new TargetControlledPermanent(new FilterControlledLandPermanent("a land"))));
        this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(2), cost));
    }
View Full Code Here

        Player player = game.getPlayer(source.getControllerId());
        if (player == null){
            return false;
        }
        int amount = 0;
        TargetControlledPermanent sacrificeLand = new TargetControlledPermanent(0, Integer.MAX_VALUE, new FilterControlledLandPermanent("lands you control"), true);
        if(player.chooseTarget(Outcome.Sacrifice, sacrificeLand, source, game)){
            for(Object uuid : sacrificeLand.getTargets()){
                Permanent land = game.getPermanent((UUID)uuid);
                if(land != null){
                    land.sacrifice(source.getSourceId(), game);
View Full Code Here

        this.toughness = new MageInt(1);

        // Sacrifice a land: Target creature you control gains shroud until end of turn.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
                new GainAbilityTargetEffect(ShroudAbility.getInstance(), Duration.EndOfTurn),
                new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent("a land"))));
        ability.addTarget(new TargetControlledCreaturePermanent());
        this.addAbility(ability);
    }
View Full Code Here

        // {tap}: Add {1} to your mana pool.
        this.addAbility(new ColorlessManaAbility());
        // As long as Riftstone Portal is in your graveyard, lands you control have "{tap}: Add {G} or {W} to your mana pool."
        ContinuousEffect effect = new GainAbilityControlledEffect(new GreenManaAbility(),
                Duration.WhileOnBattlefield, new FilterControlledLandPermanent());
        effect.setText("As long as Riftstone Portal is in your graveyard, lands you control have \"{tap}: Add {G} or {W} to your mana pool.\"");
        Ability ability = new SimpleStaticAbility(Zone.GRAVEYARD, effect);
        effect = new GainAbilityControlledEffect(new WhiteManaAbility(),
                Duration.WhileOnBattlefield, new FilterControlledLandPermanent());
        effect.setText("");
        ability.addEffect(effect);
        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

        // Prowess
        this.addAbility(new ProwessAbility());
       
        // Return three lands you control to their owner's hand: Return Pearl Lake Ancient to its owner's hand.
        this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true),
                new ReturnToHandTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledLandPermanent("lands"), true))));
    }
View Full Code Here

        this.expansionSetCode = "ROE";

        this.color.setRed(true);

        // As an additional cost to cast Devastating Summons, sacrifice X lands.
        this.getSpellAbility().addCost(new SacrificeXTargetCost(new FilterControlledLandPermanent("lands"), true));
       
        // Put two X/X red Elemental creature tokens onto the battlefield.
        this.getSpellAbility().addEffect(new DevastatingSummonsEffect());
    }
View Full Code Here

    }

    @Override
    public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
        Player you = game.getPlayer(source.getControllerId());
        List<Permanent> lands = game.getBattlefield().getAllActivePermanents(new FilterControlledLandPermanent(), source.getControllerId(), game);
        String choice = (String) game.getState().getValue(source.getSourceId().toString() + "_Realmwright");
        if (you != null && choice != null) {
            for (Permanent land : lands) {
                if (land != null) {
                    switch (layer) {
View Full Code Here

class BeseechTheQueenPredicate implements Predicate<Card> {


    @Override
    public final boolean apply(Card input, Game game) {
        if(input.getManaCost().convertedManaCost() <= game.getBattlefield().getAllActivePermanents(new FilterControlledLandPermanent(), input.getOwnerId(), game).size()){
            return true;
        }
        return false;
    }
View Full Code Here

TOP

Related Classes of mage.filter.common.FilterControlledLandPermanent

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.