Package mage.filter

Examples of mage.filter.FilterCard


    private FilterCard filter;
    private int amount;

    public SpellsCostReductionAllEffect(int amount) {
        this(new FilterCard("All Spells "), amount);
    }
View Full Code Here


    @Override
    protected void actionWithSelectedCards(Cards cards, Game game, Ability source, String windowName) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null && foundCardsToPick > 0) {
            if (!optional || player.chooseUse(Outcome.DrawCard, getMayText(), game)) {
                FilterCard pickFilter = filter.copy();
                pickFilter.setMessage(getPickText());
                TargetCard target = new TargetCard((upTo ? 0:numberToPick.calculate(game, source, this)),numberToPick.calculate(game, source, this), Zone.PICK, pickFilter);
                if (player.choose(Outcome.DrawCard, cards, target, game)) {
                    Cards reveal = new CardsImpl();
                    for (UUID cardId : (List<UUID>)target.getTargets()) {
                        Card card = cards.get(cardId, game);
View Full Code Here

public class ExileCardYouChooseTargetOpponentEffect extends OneShotEffect {

    private FilterCard filter;

    public ExileCardYouChooseTargetOpponentEffect() {
        this(new FilterCard("a card"));
    }
View Full Code Here

public class GainProtectionFromColorTargetEffect extends GainAbilityTargetEffect {
   
    protected ChoiceColor choice;

    public GainProtectionFromColorTargetEffect(Duration duration) {
        super(new ProtectionAbility(new FilterCard()), duration);
        choice = new ChoiceColor();
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
        if (creature != null) {
            FilterCard protectionFilter = (FilterCard)((ProtectionAbility)ability).getFilter();
            protectionFilter.add(new ColorPredicate(choice.getColor()));
            protectionFilter.setMessage(choice.getChoice());
            ((ProtectionAbility)ability).setFilter(protectionFilter);
            creature.addAbility(ability, source.getSourceId(), game);
            return true;
        }
        return false;
View Full Code Here

public class GainProtectionFromTypeTargetEffect extends GainAbilityTargetEffect {

    private String typeName;

    public GainProtectionFromTypeTargetEffect(Duration duration, FilterCard protectionFrom) {
        super(new ProtectionAbility(new FilterCard()), duration);
        ((ProtectionAbility)ability).setFilter(protectionFrom);
        typeName = protectionFrom.getMessage();
        staticText = "Target creature gains protection from " + typeName + " " + duration.toString();
    }
View Full Code Here

public class PlayTheTopCardEffect extends AsThoughEffectImpl {

    private FilterCard filter;

    public PlayTheTopCardEffect() {
        this(new FilterCard());
        staticText = "You may play the top card of your library";
    }
View Full Code Here

        Cards cardsInHand = new CardsImpl(Zone.PICK);
        cardsInHand.addAll(targetPlayer.getHand());

        int count = Math.min(cardsInHand.size(), numberOfAllies);

        TargetCard target = new TargetCard(count, Zone.PICK, new FilterCard());
        Cards revealedCards = new CardsImpl();

        if (targetPlayer.choose(Outcome.DrawCard, cardsInHand, target, game)) {
            List<UUID> targets = target.getTargets();
            for (UUID targetId : targets) {
                Card card = game.getCard(targetId);
                if (card != null) {
                    revealedCards.add(card);
                }
            }
        }

        TargetCard targetInHand = new TargetCard(Zone.PICK, new FilterCard("card to discard"));

        if (!revealedCards.isEmpty()) {
            targetPlayer.revealCards("Bala Ged Thief", revealedCards, game);
            you.choose(Outcome.Neutral, revealedCards, targetInHand, game);
            Card card = revealedCards.get(targetInHand.getFirstTarget(), game);
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if(player != null){
            TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(Math.min(amount, player.getGraveyard().size()), new FilterCard());
            if (player.chooseTarget(outcome, target, source, game)) {
                for (UUID targetId: target.getTargets()) {
                    Card card = player.getGraveyard().get(targetId, game);
                    if (card != null) {
                        card.moveToZone(Zone.EXILED, source.getSourceId(), game, false);
View Full Code Here

    }

    private FilterCard filter2;

    public BraveTheElementsEffect() {
        super(new ProtectionAbility(new FilterCard()), Duration.EndOfTurn, filter1);
        filter2 = (FilterCard)((ProtectionAbility)getFirstAbility()).getFilter();
        staticText = "Choose a color. White creatures you control gain protection from the chosen color until end of turn";
    }
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.