Package mage.filter.common

Examples of mage.filter.common.FilterLandPermanent


        return new BecomesBasicLandTypeAllEffect(this);
    }

    @Override
    public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
        for (Permanent land : game.getState().getBattlefield().getAllActivePermanents(new FilterLandPermanent(), source.getControllerId(), game)) {
            if (land != null) {
                switch (layer) {
                    case AbilityAddingRemovingEffects_6:
                        Mana mana = new Mana();
                        for (Ability ability : land.getAbilities()){
View Full Code Here


        Player controller = game.getPlayer(source.getControllerId());
        Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
        Set<UUID> lands = new HashSet<>();
        if (controller != null && sourcePermanent != null) {
            for (String landName : new String[] {"Forest","Island","Mountain","Plains","Swamp"}) {
                FilterLandPermanent filter = new FilterLandPermanent(new StringBuilder(landName).append(" to destroy").toString());
                filter.add(new SubtypePredicate(landName));
                Target target = new TargetLandPermanent(1,1, filter, true);
                if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
                    controller.chooseTarget(outcome, target, source, game);
                    lands.add(target.getFirstTarget());
                }
View Full Code Here

        // {W}, {tap}: Search your library for a land card, reveal it, and put it into your hand. Then shuffle your library. Activate this ability only if an opponent controls more lands than you.
        Ability ability = new ActivateIfConditionActivatedAbility(
                Zone.BATTLEFIELD,
                new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterLandCard()), true, true),
                new ManaCostsImpl("{W}"),
                new OpponentControllsMoreCondition(new FilterLandPermanent("lands")));
        ability.addCost(new TapSourceCost());
        this.addAbility(ability);
    }
View Full Code Here

        this.subtype.add("Elf");
        this.subtype.add("Druid");
        this.color.setGreen(true);
        this.power = new MageInt(2);
        this.toughness = new MageInt(1);
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new AnyColorManaAbility(), Duration.WhileOnBattlefield, new FilterLandPermanent(), false)));
    }
View Full Code Here

   
    @Override
    public boolean apply(Game game, Ability source) {
        Player targetPlayer = game.getPlayer(source.getFirstTarget());
        if (targetPlayer != null) {
            FilterLandPermanent filter = new FilterLandPermanent();
            filter.add(new ControllerIdPredicate(targetPlayer.getId()));

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

        this.expansionSetCode = "PTK";

        this.color.setWhite(true);

        // Destroy all lands.
        this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterLandPermanent("lands")));
    }
View Full Code Here

        this.expansionSetCode = "5ED";

        this.color.setWhite(true);

        // Destroy all lands.
        this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterLandPermanent("lands")));
    }
View Full Code Here

            }
            // then sacrifices a third of the lands he or she controls.
            for (UUID playerId : controller.getInRange()) {
                Player player = game.getPlayer(playerId);
                if (player != null) {
                    FilterLandPermanent filter = new FilterLandPermanent();
                    filter.add(new ControllerIdPredicate(playerId));
                    int landsToSacrifice = (int) Math.ceil(game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) / 3.0);
                    if (landsToSacrifice > 0) {
                        Target target = new TargetLandPermanent(landsToSacrifice, landsToSacrifice, filter, true);
                        target.choose(Outcome.Sacrifice, playerId, source.getSourceId(), game);
                        for (UUID permanentId : target.getTargets()) {
View Full Code Here

        this.expansionSetCode = "BOK";

        this.color.setGreen(true);

        // Whenever a land enters the battlefield, you may gain 1 life.
        this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), new FilterLandPermanent("a land"), true));
    }
View Full Code Here

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

        // Lands don't untap during their controllers' untap steps.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipUntapAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, new FilterLandPermanent("Lands"))));

        // At the beginning of each player's upkeep, that player untaps a land he or she controls.
        this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new HokoriDustDrinkerUntapEffect(), TargetController.ANY, false));

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.