Package mage.filter.common

Examples of mage.filter.common.FilterEnchantmentPermanent


    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event instanceof DamagedPlayerEvent) {
            Permanent soltari = game.getPermanent(event.getSourceId());
            if (soltari != null && soltari.getId() == this.getSourceId()) {
                FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("enchantment that player controls.");
                filter.add(new ControllerIdPredicate(event.getPlayerId()));
                filter.setMessage("enchantment controlled by " + game.getPlayer(event.getTargetId()).getName());
                this.getTargets().clear();
                this.addTarget(new TargetPermanent(filter));
                return true;
            }
        }
View Full Code Here


* @author LevelX2
*/
public class TargetEnchantmentPermanent extends TargetPermanent {
   
    public TargetEnchantmentPermanent() {
        this(1, 1, new FilterEnchantmentPermanent(), false);
    }
View Full Code Here

    public TargetEnchantmentPermanent(FilterEnchantmentPermanent filter) {
        this(1, 1, filter, false);
    }

    public TargetEnchantmentPermanent(int numTargets) {
        this(numTargets, numTargets, new FilterEnchantmentPermanent(), false);
    }
View Full Code Here

        this.color.setBlue(true);

        // Strive - Kiora's Dismissal costs U more to cast for each target beyond the first.
        this.addAbility(new StriveAbility("{U}"));
        // Return any number of target enchantments to their owners' hands.
        this.getSpellAbility().addTarget(new TargetPermanent(0, Integer.MAX_VALUE, new FilterEnchantmentPermanent(), false));
        Effect effect = new ReturnToHandTargetEffect();
        effect.setText("Return any number of target enchantments to their owners' hands");
        this.getSpellAbility().addEffect(effect);
    }
View Full Code Here

            for (Effect effect : ability.getEffects()) {
                if (effect instanceof DestroyTargetEffect) {
                    Player attackedPlayer = game.getPlayer(effect.getTargetPointer().getFirst(game, ability));
                    if (attackedPlayer != null) {
                        ability.getTargets().clear();
                        FilterPermanent filterEnchantment = new FilterEnchantmentPermanent("enchantment attacked player controls");
                        filterEnchantment.add(new ControllerIdPredicate(attackedPlayer.getId()));
                        Target target = new TargetPermanent(filterEnchantment);
                        ability.addTarget(target);
                        effect.setTargetPointer(new FirstTargetPointer());
                        break;
                    }
View Full Code Here

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

        // Whenever an enchantment is put into a graveyard from the battlefield, draw a card.
        this.addAbility(new ZoneChangeAllTriggeredAbility(Zone.BATTLEFIELD, Zone.BATTLEFIELD, Zone.GRAVEYARD,
                new DrawCardSourceControllerEffect(1), new FilterEnchantmentPermanent(),
                "Whenever an enchantment is put into a graveyard from the battlefield, ", false));
    }
View Full Code Here

        // {G}, {tap}, Sacrifice Druid Lyrist: Destroy target enchantment.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{G}"));
        ability.addCost(new TapSourceCost());
        ability.addCost(new SacrificeSourceCost());
        Target target = new TargetPermanent(new FilterEnchantmentPermanent());
        ability.addTarget(target);
        this.addAbility(ability);
    }
View Full Code Here

        Mode mode = new Mode();
        mode.getEffects().add(new ExileAllEffect(new FilterCreaturePermanent("creatures")));
        this.getSpellAbility().addMode(mode);
        // or exile all enchantments
        Mode mode2 = new Mode();
        mode2.getEffects().add(new ExileAllEffect(new FilterEnchantmentPermanent("enchantments")));
        this.getSpellAbility().addMode(mode2);
        // or exile all planeswalkers.
        Mode mode3 = new Mode();
        mode3.getEffects().add(new ExileAllEffect(new FilterPlaneswalkerPermanent("planeswalkers")));
        this.getSpellAbility().addMode(mode3);
View Full Code Here

        // Flying
        this.addAbility(FlyingAbility.getInstance());
        // When Wispmare enters the battlefield, destroy target enchantment.
        Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect());
        Target target = new TargetPermanent(new FilterEnchantmentPermanent());
        ability.addTarget(target);
        this.addAbility(ability);
        // Evoke {W}
        this.addAbility(new EvokeAbility(this, "{W}"));
    }
View Full Code Here

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

        // When Nikko-Onna enters the battlefield, destroy target enchantment.
        Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false);
        ability.addTarget(new TargetPermanent(new FilterEnchantmentPermanent()));
        this.addAbility(ability);

        // Whenever you cast a Spirit or Arcane spell, you may return Nikko-Onna to its owner's hand.
        this.addAbility(new SpellCastControllerTriggeredAbility(new ReturnToHandSourceEffect(true), new FilterSpiritOrArcaneCard(), true));
    }
View Full Code Here

TOP

Related Classes of mage.filter.common.FilterEnchantmentPermanent

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.