Package mage.filter.common

Examples of mage.filter.common.FilterLandPermanent


    }

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(game.getActivePlayerId());
        FilterLandPermanent filter = new FilterLandPermanent("land you control");
        filter.add(new ControllerIdPredicate(game.getActivePlayerId()));
        Target target = new TargetLandPermanent(filter);
        if (player != null && player.chooseTarget(Outcome.Untap, target, source, game)) {
            for (UUID landId : target.getTargets()) {
                Permanent land = game.getPermanent(landId);
                if (land != null) {
View Full Code Here


    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));
        if (player != null) {
            for (Permanent land: game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), player.getId(), game)) {
                land.untap(game);
            }
            return true;
        }
        return false;
View Full Code Here

        mode1.getTargets().add(new TargetPermanent(new FilterEnchantment()));
        this.getSpellAbility().addMode(mode1);

        Mode mode2 = new Mode();
        mode2.getEffects().add(new DestroyTargetEffect());
        mode2.getTargets().add(new TargetPermanent(new FilterLandPermanent()));
        this.getSpellAbility().addMode(mode2);
    }
View Full Code Here

                    if (game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) {
                        game.informPlayers(new StringBuilder(sourceObject.getName()).append(": additional cost wasn't paid - countering ").append(spell.getName()).toString());
                    }
                   
                    // that player taps all lands with mana abilities he or she controls...
                    List<Permanent> lands = game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), player.getId(), game);
                    for (Permanent land : lands) {
                        Abilities<Ability> landAbilities = land.getAbilities();
                        for (Ability ability : landAbilities) {
                            if (ability instanceof ManaAbility) {
                                land.tap(game);
View Full Code Here

        this.expansionSetCode = "WWK";

        this.color.setWhite(true);

        // All lands are indestructible.
        FilterLandPermanent filter = new FilterLandPermanent("All lands");
        Effect effect = new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, filter, false);
        effect.setText("All lands are indestructible");
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
    }
View Full Code Here

        super(ownerId, 165, "Urborg, Tomb of Yawgmoth", Rarity.RARE, new CardType[]{CardType.LAND}, "");
        this.expansionSetCode = "PLC";
        this.supertype.add("Legendary");

        // Each land is a Swamp in addition to its other land types.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(new BlackManaAbility(), Duration.WhileOnBattlefield, new FilterLandPermanent(),"")));
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AddCardSubtypeAllEffect()));
       
    }
View Full Code Here

        Set<UUID> damagedPlayers = (HashSet<UUID>) this.getValue("damagedPlayers");
        if (damagedPlayers == null) {
            return false;
        }

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

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            int numberOfLands = 0;
            int ownLands = game.getBattlefield().countAll(new FilterLandPermanent(), controller.getId(), game);
            for (UUID playerId: controller.getInRange()) {
                if (!playerId.equals(controller.getId())) {
                    if (game.getBattlefield().countAll(new FilterLandPermanent(), playerId, game) > ownLands + 1) {
                        numberOfLands++;
                    }
                }
            }
            game.informPlayers(new StringBuilder("Surveyor's Scope: X = ").append(numberOfLands).toString());
View Full Code Here

        this.color.setBlue(true);
        this.power = new MageInt(4);
        this.toughness = new MageInt(4);
        this.addAbility(FlyingAbility.getInstance());
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CopyTargetSpellEffect(), new GenericManaCost(2));
        ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(2, 2, new FilterLandPermanent("lands"), false)));
        ability.addTarget(new TargetSpell(filter));
        this.addAbility(ability);
    }
View Full Code Here

        this.toughness = new MageInt(6);

        // Trample
        this.addAbility(TrampleAbility.getInstance());
        // At the beginning of your upkeep, sacrifice Cosmic Larva unless you sacrifice two lands.
        this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterLandPermanent("two lands"), true))), TargetController.YOU, 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.