Package mage.filter

Examples of mage.filter.FilterSpell


public class TargetSpell extends TargetObject<TargetSpell> {

  protected FilterSpell filter;

  public TargetSpell() {
    this(1, 1, new FilterSpell());
  }
View Full Code Here


    }

    public FilterSpellOrPermanent(String name) {
        super(name);
        permanentFilter = new FilterPermanent();
        spellFilter = new FilterSpell();
    }
View Full Code Here

        Permanent doorOfDestinies = game.getPermanent(getSourceId());
        if (doorOfDestinies != null) {
            String subtype = (String) game.getState().getValue(doorOfDestinies.getId() + "_type");
            if (subtype != null) {
                if (event.getType() == GameEvent.EventType.SPELL_CAST) {
                    FilterSpell filter = new FilterSpell();
                    filter.add(new ControllerPredicate(TargetController.YOU));
                    filter.add(new SubtypePredicate(subtype));
                    Spell spell = game.getStack().getSpell(event.getTargetId());
                    if (spell != null && filter.match(spell, controllerId, game)) {
                        return true;
                    }
                }
            }
        }
View Full Code Here

public class TargetSpell extends TargetObject {

    protected FilterSpell filter;

    public TargetSpell() {
        this(1, 1, new FilterSpell());
    }
View Full Code Here

        this.addAbility(new ChancellorAbility(new ChancellorOfTheAnnexEffect()));

        this.addAbility(FlyingAbility.getInstance());

        // Whenever an opponent casts a spell, counter it unless that player pays {1}.
        this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new GenericManaCost(1)), new FilterSpell(), false, SetTargetPointer.SPELL));
    }
View Full Code Here

        this.expansionSetCode = "WTH";

        this.color.setGreen(true);

        // Creatures can't be the targets of spells.
        CantBeTargetedAllEffect cantTargetEffect = new CantBeTargetedAllEffect(new FilterCreaturePermanent("Creatures"), new FilterSpell("spells"), Duration.WhileOnBattlefield);
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, cantTargetEffect));
    }
View Full Code Here

        this.expansionSetCode = "CSP";

        this.color.setBlue(true);

        // Whenever an opponent casts a spell, you may reveal the top card of your library. If you do, counter that spell if it has the same converted mana cost as the revealed card.
        this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, new CounterbalanceEffect(), new FilterSpell(), true, SetTargetPointer.SPELL));
    }
View Full Code Here

        ability.addTarget(new TargetPlayer());
        this.addAbility(ability);
       
        // {U}{U}, Sacrifice Mindreaver: Counter target spell with the same name as a card exiled with mindreaver.
        ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{U}{U}"));
        FilterSpell filter = new FilterSpell("spell with the same name as a card exiled with mindreaver");
        filter.add(new MindreaverNamePredicate(this.getId()));
        ability.addTarget(new TargetSpell(filter));
        ability.addCost(new SacrificeSourceCost());
        this.addAbility(ability);
    }
View Full Code Here

        this.expansionSetCode = "JOU";

        this.color.setBlue(true);

        // Counter target spell. Its controller puts the top four cards of his or her library into his or her graveyard.
        this.getSpellAbility().addTarget(new TargetSpell(new FilterSpell()));
        this.getSpellAbility().addEffect(new CountermandEffect());
    }
View Full Code Here

        this.expansionSetCode = "BOK";

        this.color.setBlue(true);

        // Counter target spell. That spell's controller reveals his or her hand, then discards each card with the same name as a card spliced onto that spell.
        this.getSpellAbility().addTarget(new TargetSpell(new FilterSpell()));
        this.getSpellAbility().addEffect(new MinamosMeddlingCounterTargetEffect());
    }
View Full Code Here

TOP

Related Classes of mage.filter.FilterSpell

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.