Package mage.filter

Examples of mage.filter.FilterSpell


    public HornOfPlenty(UUID ownerId) {
        super(ownerId, 298, "Horn of Plenty", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{6}");
        this.expansionSetCode = "MMQ";

        // Whenever a player casts a spell, he or she may pay {1}. If that player does, he or she draws a card at the beginning of the next end step.
        this.addAbility(new SpellCastAllTriggeredAbility(new HornOfPlentyEffect(), new FilterSpell("a spell"), false, true));
    }
View Full Code Here


    @Override
    public void adjustTargets(Ability ability, Game game) {
        if (ability instanceof SpellAbility) {
            int xValue = ability.getManaCostsToPay().getX();
            ability.getTargets().clear();
            FilterSpell newfilter = new FilterSpell(new StringBuilder("spell with converted mana cost ").append(xValue).toString());
            newfilter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, xValue));
            Target target = new TargetSpell(newfilter);
            ability.addTarget(target);
        }

    }
View Full Code Here

    @Override
    public void adjustTargets(Ability ability, Game game) {
        if (ability instanceof EntersBattlefieldTriggeredAbility) {
            int numberFaeries = game.getState().getBattlefield().countAll(filter, ability.getControllerId(), game);
            FilterSpell xFilter = new FilterSpell(new StringBuilder("spell with converted mana cost ").append(numberFaeries).append(" or less").toString());
            xFilter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, numberFaeries + 1));
            ability.getTargets().clear();
            ability.addTarget(new TargetSpell(xFilter));
        }
    }
View Full Code Here

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

        // Counter target spell. Put an X/X green Ooze creature token onto the battlefield, where X is that spell's converted mana cost.
        this.getSpellAbility().addTarget(new TargetSpell(new FilterSpell()));
        this.getSpellAbility().addEffect(new MysticGenesisEffect());

    }
View Full Code Here

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

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

        // Buyback {3}
        this.addAbility(new BuybackAbility("{3}"));

        // Counter target spell with converted mana cost X.
        this.getSpellAbility().addEffect(new CounterTargetEffect());
        this.getSpellAbility().addTarget(new TargetSpell(new FilterSpell("spell with converted mana cost X")));
    }
View Full Code Here

    @Override
    public void adjustTargets(Ability ability, Game game) {
        if (ability instanceof SpellAbility) {
            ability.getTargets().clear();
            FilterSpell filter = new FilterSpell("spell with converted mana cost X");
            filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, ability.getManaCostsToPay().getX()));
            ability.addTarget(new TargetSpell(filter));
        }
    }
View Full Code Here

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

        // Counter target spell. Its controller loses 3 life.
        this.getSpellAbility().addTarget(new TargetSpell(new FilterSpell()));
        this.getSpellAbility().addEffect(new CounterTargetEffect());
        this.getSpellAbility().addEffect(new LoseLifeTargetControllerEffect(3));

    }
View Full Code Here

    private class CustomTargetSpell extends TargetObject {

        protected FilterSpell filter;

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

        // Counter up to two target spells.
        Effect effect = new CounterTargetEffect();
        effect.setText("Counter up to two target spells");
        this.getSpellAbility().addEffect(effect);
        this.getSpellAbility().addTarget(new TargetSpell(0, 2, new FilterSpell()));
    }
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.