Package mage.filter

Examples of mage.filter.FilterCard


    @Override
    public boolean apply(Game game, Ability source) {
        ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
        filter2.add(new ColorPredicate(choice.getColor()));
        filter2.setMessage(choice.getChoice());
        setAbility(new ProtectionAbility(new FilterCard(filter2)));
        return super.apply(game, source);
    }
View Full Code Here


                }
            }
        }
        player.revealCards("Merfolk Wayfinder", cardsToReveal, game);

        TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
        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

    @Override
    public boolean apply(Game game, Ability source) {
        Player targetPlayer = game.getPlayer(source.getFirstTarget());
        Player player = game.getPlayer(source.getControllerId());
        if (player != null && targetPlayer != null) {
            TargetCardInLibrary target = new TargetCardInLibrary(0, amount, new FilterCard("cards to exile"));
            if (player.searchLibrary(target, game, targetPlayer.getId())) {
                List<UUID> targets = target.getTargets();
                for (UUID targetId : targets) {
                    Card card = targetPlayer.getLibrary().remove(targetId, game);
                    if (card != null) {
View Full Code Here

                            source.getSourceId(), source.getControllerId());
                }
            }
            if (cards.size() > 0) {
                TargetCard target2 = new TargetCard(Zone.PICK,
                        new FilterCard(
                        "card to put on the bottom of your library"));
                while (player.isInGame() && cards.size() > 1) {
                    player.choose(Outcome.Benefit, cards, target2,
                            game);
                    Card card = cards.get(target2.getFirstTarget(), game);
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        MageObject sourceObject = game.getObject(source.getSourceId());
        if (controller != null && sourceObject != null) {
            FilterCard filter = new FilterCard("card in your hand to exile");
            FilterCard filter2 = new FilterCard("(move the window) card exiled by " + sourceObject.getLogName() + " to put on top of library");
            TargetCardInHand target = new TargetCardInHand(0, controller.getHand().size(), filter);
            target.setRequired(false);
            int amountExiled = 0;
            if (target.canChoose(source.getControllerId(), game) && target.choose(Outcome.Neutral, source.getControllerId(), source.getSourceId(), game)) {
                if (!target.getTargets().isEmpty()) {
View Full Code Here

    @Override
    public void trigger(Game game, UUID controllerId) {
        this.getTargets().clear();
        int intValue = amount.calculate(game, this, null);
        FilterCard filter = new FilterCard("Spirit card with converted mana cost " + intValue + " or less from your graveyard");
        filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan,  intValue + 1));
        filter.add(new SubtypePredicate("Spirit"));
        this.addTarget(new TargetCardInYourGraveyard(filter));
        super.trigger(game, controllerId); //To change body of generated methods, choose Tools | Templates.
    }
View Full Code Here

     * */
    //TODO implement may look at exile cards
    @Override
    public void mulligan(UUID playerId) {
        Player player = getPlayer(playerId);
        TargetCardInHand target = new TargetCardInHand(1, player.getHand().size(), new FilterCard("card to mulligan"));
        target.setNotTarget(true);
        target.setRequired(false);
        if (player.choose(Outcome.Exile, player.getHand(), target, this)){
            int numCards = target.getTargets().size();
            for(UUID uuid : target.getTargets()){
View Full Code Here

    public void adjustCosts(Ability ability, Game game) {
        Player player = game.getPlayer(controllerId);
        if (player == null || !(ability instanceof SpellAbility)) {
            return;
        }
        Target target = new TargetCardInYourGraveyard(1, Integer.MAX_VALUE, new FilterCard());
        target.setTargetName("cards to delve from your graveyard");
        if (!target.canChoose(sourceId, controllerId, game)) {
            return;
        }
        if (!CardUtil.isCheckPlayableMode(ability) && player.chooseUse(Outcome.Detriment, "Delve cards from your graveyard?", game)) {
View Full Code Here

                        Zone fromZone = game.getState().getZone(cardId);
                        this.moveCardToLibraryWithInfo(card, source.getSourceId(), game, fromZone, false, false);
                    }
                }
            } else {
                TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library (last one chosen will be bottommost)"));
                target.setRequired(true);
                while (isInGame() && cards.size() > 1) {
                    this.choose(Outcome.Neutral, cards, target, game);
                    Card chosenCard = cards.get(target.getFirstTarget(), game);
                    if (chosenCard != null) {
View Full Code Here

                        Zone fromZone = game.getState().getZone(cardId);
                        this.moveCardToLibraryWithInfo(card, source.getSourceId(), game, fromZone, true, false);
                    }
                }
            } else {
                TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the top of your library (last one chosen will be topmost)"));
                target.setRequired(true);
                while (isInGame() && cards.size() > 1) {
                    this.choose(Outcome.Neutral, cards, target, game);
                    Card chosenCard = cards.get(target.getFirstTarget(), game);
                    if (chosenCard != null) {
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.