Package mage.filter

Examples of mage.filter.FilterPermanent


        this.expansionSetCode = "WTH";

        this.color.setWhite(true);

        // At the beginning of your upkeep, destroy all artifacts and enchantments. They can't be regenerated.
        Effect effect = new DestroyAllEffect(new FilterPermanent(filter), true);
        Ability ability = new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", effect, false);
        this.addAbility(ability);
    }
View Full Code Here


}

class LichsTombTriggeredAbility extends TriggeredAbilityImpl {
   
    LichsTombTriggeredAbility() {
        super(Zone.BATTLEFIELD, new SacrificeControllerEffect(new FilterPermanent(), 0, ""), false);
    }
View Full Code Here

        if (protectionFilter == null) {
            Permanent permanent = game.getPermanent(source.getSourceId());
            if (permanent != null) {
                String subtype = (String) game.getState().getValue(permanent.getId() + "_type");
                if (subtype != null) {
                    protectionFilter = new FilterPermanent(subtype+"s");
                    protectionFilter.add(new SubtypePredicate(subtype));
                }
            }
        }
        if (protectionFilter != null) {
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        UUID bruna = source.getSourceId();
        Player player = game.getPlayer(source.getControllerId());
       
        FilterPermanent filterAura = new FilterPermanent("Aura");
        FilterCard filterAuraCard = new FilterCard("Aura card");

        filterAura.add(new CardTypePredicate(CardType.ENCHANTMENT));
        filterAura.add(new SubtypePredicate("Aura"));
        filterAura.add(new AuraPermanentCanAttachToPermanentId(bruna));
        filterAuraCard.add(new CardTypePredicate(CardType.ENCHANTMENT));
        filterAuraCard.add(new SubtypePredicate("Aura"));
        filterAuraCard.add(new AuraCardCanAttachToPermanentId(bruna));
       
        if (player == null) {
View Full Code Here

                    for (int i = 1; i < 4; i++) {
                        playerPiles.put(i, new LinkedHashSet<UUID>());
                    }
                    playerPermanents.put(currentPlayer.getId(), playerPiles);
                    for (int i = 1; i < 3; i++) {
                        FilterPermanent filter = new FilterPermanent(
                                new StringBuilder("the permanents for the ").append(i == 1 ? "first " : "second ").append("pile").toString());
                        filter.add(new ControllerIdPredicate(currentPlayer.getId()));
                        Target target;
                        if (i == 1) {
                            target = new TargetPermanent(0, Integer.MAX_VALUE, filter, true);
                        } else {
                            target = new TargetSecondPilePermanent(playerPiles.get(1), filter);
View Full Code Here

        this.color.setBlue(true);
        this.color.setWhite(true);

        // All permanents are enchantments in addition to their other types.
        Effect effect = new EnchangedEveningEffect(CardType.ENCHANTMENT, Duration.WhileOnBattlefield, new FilterPermanent());
        effect.setText("All permanents are enchantments in addition to their other types");
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));

    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            int drawnCards = player.drawCards(source.getManaCostsToPay().getX(), game);
            Target target = new TargetControlledPermanent(0, drawnCards, new FilterPermanent(), true);
            target.choose(Outcome.Sacrifice, player.getId(), source.getSourceId(), game);
            int sacrificedPermanents = 0;
            for (UUID permanentId : target.getTargets()) {
                Permanent permanent = game.getPermanent(permanentId);
                if (permanent != null) {
View Full Code Here

    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)
                && ((DamagedPlayerEvent) event).isCombatDamage()) {
            Player player = game.getPlayer(event.getTargetId());
            if (player != null) {
                FilterPermanent filter = new FilterPermanent("an artifact controlled by " + player.getName());
                filter.add(Predicates.or(
                    new CardTypePredicate(CardType.ARTIFACT)));
                filter.add(new ControllerIdPredicate(event.getTargetId()));

                this.getTargets().clear();
                this.addTarget(new TargetPermanent(filter));
                return true;
            }
View Full Code Here

        this.color.setRed(true);
        this.power = new MageInt(10);
        this.toughness = new MageInt(10);

        // When Bearer of the Heavens dies, destroy all permanents at the beginning of the next end step.
        DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new DestroyAllEffect(new FilterPermanent("permanents")));
        Effect effect = new CreateDelayedTriggeredAbilityEffect(delayedAbility);
        effect.setText("destroy all permanents at the beginning of the next end step");
        this.addAbility(new DiesTriggeredAbility(effect, false));
    }
View Full Code Here

    public KormusBell(UUID ownerId) {
        super(ownerId, 256, "Kormus Bell", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}");
        this.expansionSetCode = "LEA";

        // All Swamps are 1/1 black creatures that are still lands.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(new KormusBellToken(), "lands", new FilterPermanent("Swamp", "Swamps"), Duration.WhileOnBattlefield)));
    }
View Full Code Here

TOP

Related Classes of mage.filter.FilterPermanent

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.