Package mage.filter.common

Examples of mage.filter.common.FilterLandPermanent


        this.color.setBlue(true);

        // Tap up to three target lands.
        this.getSpellAbility().addEffect(new TapTargetEffect());
        this.getSpellAbility().addTarget(new TargetLandPermanent(0, 3, new FilterLandPermanent(), false));
    }
View Full Code Here


            if (card.getCardType().contains(CardType.ENCHANTMENT)
                    && game.getBattlefield().countAll(new FilterEnchantmentPermanent(), opponent.getId(), game)
                        > game.getBattlefield().countAll(new FilterEnchantmentPermanent(), source.getControllerId(), game)) {
                return true;
            }
            final int yourLands = game.getBattlefield().countAll(new FilterLandPermanent(), source.getControllerId(), game);
            if (card.getCardType().contains(CardType.LAND)
                    && game.getBattlefield().countAll(new FilterLandPermanent(), opponent.getId(), game) > yourLands) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

                    Permanent permanent = game.getPermanent(defenderId);
                    if (permanent != null) {
                        defenderId = permanent.getControllerId();
                    }
                }
                return game.getBattlefield().countAll(new FilterLandPermanent(), defenderId, game);

            }
        }
        return 0;
    }
View Full Code Here

   
    @Override
    public void init(Ability source, Game game) {
        super.init(source, game);
        this.affectedObjectsSet = true;
        for (Permanent perm: game.getBattlefield().getActivePermanents(new FilterLandPermanent(), source.getControllerId(), source.getSourceId(), game)) {
            objects.add(perm.getId());
        }
    }
View Full Code Here

        this.color.setWhite(true);

        // At the beginning of your upkeep, if an opponent controls more lands than you, you may search your library for up to three basic land cards, reveal them, and put them into your hand. If you do, shuffle your library.
        this.addAbility(new ConditionalTriggeredAbility(
                new BeginningOfUpkeepTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 3, new FilterBasicLandCard()), true),TargetController.YOU, true),
                new OpponentControllsMoreCondition(new FilterLandPermanent("lands")),
                "At the beginning of your upkeep, if an opponent controls more lands than you, you may search your library for up to three basic land cards, reveal them, and put them into your hand. If you do, shuffle your library"));
       
    }
View Full Code Here

        this.addAbility(FirstStrikeAbility.getInstance());
       
        // When Knight of the White Orchid enters the battlefield, if an opponent controls more lands than you, you may search your library for a Plains card, put it onto the battlefield, then shuffle your library.
        this.addAbility(new ConditionalTriggeredAbility(
                new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, new FilterBySubtypeCard("Plains")), true), true),
                new OpponentControllsMoreCondition(new FilterLandPermanent("lands")),
                "When {this} enters the battlefield, if an opponent controls more lands than you, you may search your library for a Plains card, put it onto the battlefield, then shuffle your library"));
       
    }
View Full Code Here

        this.color.setRed(true);

        // Target player sacrifices an artifact and a land. Structural Collapse deals 2 damage to that player.
        this.getSpellAbility().addEffect(new SacrificeEffect(new FilterArtifactPermanent(), 1, "Target player"));
        this.getSpellAbility().addEffect(new SacrificeEffect(new FilterLandPermanent(), 1, "Target player"));
        this.getSpellAbility().addEffect(new DamageTargetEffect(2));
        this.getSpellAbility().addTarget(new TargetPlayer());
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
        Player targetPlayer = game.getPlayer(permanent.getControllerId());
        if (targetPlayer != null && permanent != null && (permanent.getSupertype().get(0).toString().equals("Legendary"))) {
                FilterPermanent filter = new FilterLandPermanent("land to sacrifice");
                filter.add(new ControllerIdPredicate(targetPlayer.getId()));
                TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false);

                if (target.canChoose(targetPlayer.getId(), game)) {
                    targetPlayer.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
View Full Code Here

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

        // Whenever a land is put into a graveyard from the battlefield, Akki Raider gets +1/+0 until end of turn.
        this.addAbility(new ZoneChangeAllTriggeredAbility(Zone.BATTLEFIELD, Zone.BATTLEFIELD, Zone.GRAVEYARD,
                new BoostSourceEffect(1,0,Duration.EndOfTurn), new FilterLandPermanent(),
                "Whenever a land is put into a graveyard from the battlefield, ", false));
    }
View Full Code Here

    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType().equals(EventType.DAMAGED_PLAYER)
                && event.getSourceId().equals(this.getSourceId())
                && event.getAmount() > 5
                && game.getOpponents(this.getControllerId()).contains(event.getTargetId())) {
            FilterLandPermanent filter = new FilterLandPermanent("land of the damaged player");
            filter.add(new ControllerIdPredicate(event.getTargetId()));
            Target target = new TargetLandPermanent(filter);
            this.getTargets().clear();
            this.addTarget(target);
            return true;
        }
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.