Package mage.filter

Examples of mage.filter.FilterCard


        // Intimidate
        this.addAbility(IntimidateAbility.getInstance());
        // {X}{B}: Put target artifact or creature card with converted mana cost X from an opponent's graveyard onto the battlefield under your control tapped.
        // Then that player puts the top X cards of his or her library into his or her graveyard.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GethLordOfTheVaultEffect(), new ManaCostsImpl("{X}{B}"));
        ability.addTarget(new TargetCardInOpponentsGraveyard(new FilterCard("artifact or creature card with converted mana cost X from an opponent's graveyard")));
        this.addAbility(ability);
    }
View Full Code Here


    @Override
    public void adjustTargets(Ability ability, Game game) {
        if (ability instanceof SimpleActivatedAbility) {
            int xValue = ability.getManaCostsToPay().getX();
            ability.getTargets().clear();
            FilterCard filter = new FilterCard(new StringBuilder("artifact or creature card with converted mana cost ").append(xValue).append(" from an opponent's graveyard").toString());
            filter.add(Predicates.or(
                new CardTypePredicate(CardType.ARTIFACT),
                new CardTypePredicate(CardType.CREATURE)));
            filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, xValue));
            Target target = new TargetCardInOpponentsGraveyard(filter);
            ability.addTarget(target);
        }
    }
View Full Code Here

        this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DestroyTargetEffect(),
                new PermanentsOnTheBattlefieldCondition(filterCondition),"If you control a Swamp, destroy target nonblack creature"));
        this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterTarget) );

        // Splice onto Arcane-Exile four cards from your graveyard.
        this.addAbility(new SpliceOntoArcaneAbility(new ExileFromGraveCost(new TargetCardInYourGraveyard(4,4, new FilterCard("cards")))));
       

    }
View Full Code Here

}

class EmptyShrineKannushiProtectionAbility extends ProtectionAbility {
    public EmptyShrineKannushiProtectionAbility() {
        super(new FilterCard());
    }
View Full Code Here

        Effect effect = new BoostTargetEffect(xValue,xValue,Duration.EndOfTurn);
        effect.setText("Target creature gets -X/-X until end of turn");
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
        ability.addCost(new TapSourceCost());
        ability.addTarget(new TargetCreaturePermanent());
        ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(1,1,new FilterCard("cards from your graveyard")), "Exile X cards from your graveyard"));
        this.addAbility(ability);

    }
View Full Code Here

        this.expansionSetCode = "ISD";

        this.color.setRed(true);

        // As an additional cost to cast Harvest Pyre, exile X cards from your graveyard.
        this.getSpellAbility().addCost(new ExileXFromYourGraveCost(new FilterCard("cards from your graveyard")));

        // Harvest Pyre deals X damage to target creature.
        this.getSpellAbility().addTarget(new TargetCreaturePermanent());
        this.getSpellAbility().addEffect(new DamageTargetEffect(new GetXValue()));
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
        if (sourcePermanent != null && player != null) {
            int newConvertedCost = sourcePermanent.getCounters().getCount("verse");
            FilterCard filter = new FilterCard("creature card with converted mana cost " + newConvertedCost);
            filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, newConvertedCost));
            filter.add(new CardTypePredicate(CardType.CREATURE));
            TargetCardInLibrary target = new TargetCardInLibrary(filter);
            if (player.searchLibrary(target, game)) {
                for (UUID cardId : target.getTargets()) {
                    Card card = player.getLibrary().getCard(cardId, game);
                    if (card != null) {
View Full Code Here

            int count = Math.min(controller.getLibrary().size(), 5);
            if (count > 0) {
                cards.addAll(controller.getLibrary().getTopCards(game, count));
                controller.lookAtCards(sourceObject.getLogName(), cards, game);
                // pick cards going to graveyard
                TargetCard target = new TargetCard(0,5, Zone.LIBRARY, new FilterCard("cards to put into your graveyard"));
                if (controller.choose(Outcome.Detriment, cards, target, game)) {
                    for (UUID cardId : (List<UUID>)target.getTargets()) {
                        Card card = cards.get(cardId, game);
                        if (card != null) {
                            cards.remove(card);
                            controller.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
                        }
                    }
                }
                // The rest goes back to library in any order
                if (cards.size() > 0) {
                    game.informPlayers(controller.getName() + " puts " + cards.size() + " card" + (cards.size() ==1 ? "":"s"+ " back to his or her library");
                    target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put on your library (last chosen will be on top)"));
                    while (controller.isInGame() && cards.size() > 1) {
                        controller.choose(Outcome.Neutral, cards, target, game);
                        Card card = cards.get(target.getFirstTarget(), game);
                        if (card != null) {
                            cards.remove(card);
View Full Code Here

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

        // At the beginning of your upkeep, look at the top two cards of your library. Put any number of them into your graveyard and the rest on top of your library in any order.
        Effect effect = new LookLibraryAndPickControllerEffect(
                new StaticValue(2), false, new StaticValue(2), new FilterCard(), Zone.LIBRARY, true, false, true, Zone.GRAVEYARD, false);
        effect.setText("look at the top two cards of your library. Put any number of them into your graveyard and the rest on top of your library in any order");
        this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false));
    }
View Full Code Here

        // Delve
        this.addAbility(new DelveAbility());
       
        // Look at the top seven cards of your library. Put two of them into your hand and the rest on the bottom of your library in any order.
        this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(7), false, new StaticValue(2), new FilterCard(), Zone.LIBRARY, false, false));
    }
View Full Code Here

TOP

Related Classes of mage.filter.FilterCard

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.