Package mage.filter

Examples of mage.filter.FilterCard


        this.expansionSetCode = "EXO";

        this.color.setBlue(true);

        // Buyback-Discard two cards.
        this.addAbility(new BuybackAbility(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards")))));
        // Counter target spell.
        this.getSpellAbility().addEffect(new CounterTargetEffect());
        this.getSpellAbility().addTarget(new TargetSpell());
    }
View Full Code Here


    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Card sourceCard = game.getCard(source.getSourceId());

        if (sourceCard != null && player != null) {
            FilterCard filter = new FilterCard("card with converted mana cost " + sourceCard.getManaCost().convertedManaCost());
            filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, sourceCard.getManaCost().convertedManaCost()));
            TargetCardInLibrary target = new TargetCardInLibrary(1, filter);
            if (player.searchLibrary(target, game)) {
                if (target.getTargets().size() > 0) {
                    Cards revealed = new CardsImpl();
                    for (UUID cardId : target.getTargets()) {
View Full Code Here

     * @param game
     */
    protected void putCardsBack(Ability source, Player player, Cards cards, Game game) {
        switch(targetZoneLookedCards) {
            case LIBRARY:
                TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard(this.getPutBackText()));
                while (player.isInGame() && cards.size() > 1) {
                    player.choose(Outcome.Neutral, cards, target, game);
                    Card card = cards.get(target.getFirstTarget(), game);
                    if (card != null) {
                        cards.remove(card);
View Full Code Here

* @author BetaSteward_at_googlemail.com
*/
public class TargetCardInYourGraveyard extends TargetCard {

    public TargetCardInYourGraveyard() {
        this(1, 1, new FilterCard("card from your graveyard"));
    }
View Full Code Here

public class TargetDiscard extends TargetCard {

    private UUID playerId;

    public TargetDiscard(UUID playerId) {
        this(1, 1, new FilterCard(), playerId);
    }
View Full Code Here

        if (spliceAbilities.size() > 0) {
            Player controller = game.getPlayer(abilityToModify.getControllerId());
            if (controller.chooseUse(Outcome.Benefit, "Splice a card?", game)) {
                Cards cardsToReveal = new CardsImpl();
                do {
                    FilterCard filter = new FilterCard("a card to splice");
                    ArrayList<Predicate<MageObject>> idPredicates = new ArrayList<>();
                    for (SpliceOntoArcaneAbility ability : spliceAbilities) {
                        idPredicates.add(new CardIdPredicate((ability.getSourceId())));
                    }
                    filter.add(Predicates.or(idPredicates));
                    TargetCardInHand target = new TargetCardInHand(filter);
                    controller.chooseTarget(Outcome.Benefit, target, abilityToModify, game);
                    UUID cardId = target.getFirstTarget();
                    if (cardId != null) {
                        SpliceOntoArcaneAbility selectedAbility = null;
View Full Code Here

* @author BetaSteward_at_googlemail.com
*/
public class TargetCardInGraveyard extends TargetCard {

    public TargetCardInGraveyard() {
        this(1, 1, new FilterCard("card from a graveyard"));
    }
View Full Code Here

class IntuitionEffect extends SearchEffect {

   

    public IntuitionEffect() {
        super(new TargetCardInLibrary(3, new FilterCard()), Outcome.Benefit);
        staticText = "Search your library for three cards and reveal them. Target opponent chooses one. Put that card into your hand and the rest into your graveyard. Then shuffle your library";
    }
View Full Code Here

                        cards.add(card);
                    }
                }
                player.revealCards("Reveal", cards, game);
               
                TargetCard targetCard = new TargetCard(Zone.PICK, new FilterCard());
               
                while(!opponent.choose(Outcome.Neutral, cards, targetCard, game));
                Card card = cards.get(targetCard.getFirstTarget(), game);
                if (card != null) {
                    cards.remove(card);
View Full Code Here

* @author BetaSteward_at_googlemail.com
*/
public class TargetCardInHand extends TargetCard {

    public TargetCardInHand() {
        this(1, 1, new FilterCard());
    }
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.