Package mage.filter.common

Examples of mage.filter.common.FilterLandPermanent


    public boolean apply(Game game, Ability source) {
        if (source.getFirstTarget() == null) {
            return false;
        }

        FilterLandPermanent filter = new FilterLandPermanent();
        filter.add(new ControllerIdPredicate(source.getFirstTarget()));

        List<Permanent> lands = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
        for (Permanent land : lands) {
            land.tap(game);
        }
View Full Code Here


        getLeftHalfCard().getSpellAbility().addTarget(new TargetPermanent(filter2));

        // Bust
        // Destroy all lands.
        getRightHalfCard().getColor().setRed(true);
        getRightHalfCard().getSpellAbility().addEffect(new DestroyAllEffect(new FilterLandPermanent()));

    }
View Full Code Here

        // Whenever Numot, the Devastator deals combat damage to a player, you may pay {2}{R}. If you do, destroy up to two target lands.
        OneShotEffect effect = new DestroyTargetEffect();
        effect.setText("destroy up to two target lands");
        Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(
                new DoIfCostPaid(effect, new ManaCostsImpl("{2}{R}")), false);
        ability.addTarget(new TargetLandPermanent(0,2, new FilterLandPermanent("lands"), false));
        this.addAbility(ability);       
    }
View Full Code Here

    @Override
    public void init(Ability source, Game game) {
        super.init(source, game);

        FilterLandPermanent filter = new FilterLandPermanent("Swamps");
        filter.add(new SubtypePredicate("Swamp"));
        filter.add(new ControllerPredicate(TargetController.YOU));
        this.amount = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);

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

        String message = "Should the target creature get -X/-X instead of +X/+X?";
View Full Code Here

    public ChromaticLantern(UUID ownerId) {
        super(ownerId, 226, "Chromatic Lantern", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}");
        this.expansionSetCode = "RTR";

        // Lands you control have "{T}: Add one mana of any color to your mana pool."
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new AnyColorManaAbility(), Duration.WhileOnBattlefield, new FilterLandPermanent("Lands"), false)));


        // {T}: Add one mana of any color to your mana pool.
        this.addAbility(new AnyColorManaAbility());
View Full Code Here

        this.color.setRed(true);

        // At the beginning of your upkeep, if there are seven or more lands on the battlefield, sacrifice Impending Disaster and destroy all lands.
        TriggeredAbility ability  = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceEffect(), TargetController.YOU, false);
        ability.addEffect(new DestroyAllEffect(new FilterLandPermanent()));
        ImpendingDisasterCondition contition = new ImpendingDisasterCondition();
        this.addAbility(new ConditionalTriggeredAbility(ability, contition, "At the beginning of your upkeep, if there are seven or more lands on the battlefield, sacrifice {this} and destroy all lands"));
       
    }
View Full Code Here

   
    class ImpendingDisasterCondition implements Condition {

        @Override
        public boolean apply(Game game, Ability source) {
            return game.getBattlefield().count(new FilterLandPermanent(), source.getSourceId(), source.getControllerId(), game) >= 7;
        }
View Full Code Here

        this.expansionSetCode = "ICE";

        // Cumulative upkeep-Pay 2 life.
        this.addAbility(new CumulativeUpkeepAbility(new PayLifeCost(2)));
        // When Glacial Chasm enters the battlefield, sacrifice a land.
        this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterLandPermanent(), 1, "")));
        // Creatures you control can't attack.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackEffect()));
        // Prevent all damage that would be dealt to you.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventAllDamageToControllerEffect(Duration.WhileOnBattlefield)));
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Card p = game.getCard(source.getSourceId());
        boolean kicked = KickedCondition.getInstance().apply(game, source);
        for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterLandPermanent(), source.getControllerId(), source.getSourceId(), game)) {
            if ((!kicked && permanent.getControllerId() == source.getControllerId())
               || kicked) {
                permanent.destroy(source.getSourceId(), game, false);
            }
        }
View Full Code Here

                    if (player != null) {
                        int lands = game.getState().getBattlefield().countAll(filter, playerId, game);
                        if (amount >= lands) {
                            permanentsToSacrifice.addAll(game.getState().getBattlefield().getAllActivePermanents(filter, playerId, game));
                        } else {
                            FilterLandPermanent playerFilter = filter.copy();
                            playerFilter.add(new ControllerIdPredicate(playerId));
                            Target target = new TargetLandPermanent(amount, amount, playerFilter, true);
                            player.choose(outcome, target, source.getSourceId(), game);
                            for (UUID landId : target.getTargets()) {
                                Permanent permanent = game.getPermanent(landId);
                                if (permanent != null) {
View Full Code Here

TOP

Related Classes of mage.filter.common.FilterLandPermanent

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.