Package mage.filter.predicate.mageobject

Examples of mage.filter.predicate.mageobject.ColorPredicate


                    if (!controller.isInGame()) {
                        return false;
                    }
                }
                FilterCard filter = new FilterCard();
                filter.add(new ColorPredicate(choice.getColor()));
                filter.setMessage(choice.getChoice());

                Ability ability = new ProtectionAbility(filter) ;
                game.addEffect(new GainAbilityControlledEffect(ability, Duration.EndOfTurn), source);
                game.addEffect(new GainAbilityControllerEffect(ability, Duration.EndOfTurn), source);
View Full Code Here


            ChoiceColor choice = new ChoiceColor();
            controller.choose(outcome, choice, game);
            if (choice.getColor() != null) {
                final int damage = source.getManaCostsToPay().getX();
                FilterPermanent filter = new FilterCreaturePermanent();
                filter.add(new ColorPredicate(choice.getColor()));
                for (Permanent permanent:game.getBattlefield().getActivePermanents(filter, source.getControllerId(), id, game)) {
                    permanent.damage(damage, source.getSourceId(), game, false, true);
                }
                return true;
            }
View Full Code Here

        this.color.setBlue(true);

        // You may pay 1 life and exile a blue card from your hand rather than pay Force of Will's mana cost.
        FilterOwnedCard filter = new FilterOwnedCard("blue card from your hand");
        filter.add(new ColorPredicate(ObjectColor.BLUE));
        filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself

        AlternativeCostSourceAbility ability = new AlternativeCostSourceAbility(new PayLifeCost(1));
        ability.addCost(new ExileFromHandCost(new TargetCardInHand(filter)));
        this.addAbility(ability);         
View Full Code Here

        this.subtype.add("Arcane");
        this.color.setBlack(true);

        // You may exile a black card with converted mana cost X from your hand rather than pay Sickening Shoal's mana cost.
        FilterOwnedCard filter = new FilterOwnedCard("a black card with converted mana cost X from your hand");
        filter.add(new ColorPredicate(ObjectColor.BLACK));
        filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
        this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));

        // Target creature gets -X/-X until end of turn.
        DynamicValue x = new SignInversionDynamicValue(new ExileFromHandCostCardConvertedMana());
View Full Code Here

        this.color.setRed(true);

        // You may exile a red card from your hand rather than pay Pyrokinesis's mana cost.
        FilterOwnedCard filter = new FilterOwnedCard("a red card from your hand");
        filter.add(new ColorPredicate(ObjectColor.RED));
        filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
        this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));
       
        // Pyrokinesis deals 4 damage divided as you choose among any number of target creatures.
        this.getSpellAbility().addEffect(new DamageMultiEffect(4));
View Full Code Here

        this.subtype.add("Arcane");
        this.color.setWhite(true);

        // You may exile a white card with converted mana cost X from your hand rather than pay Shining Shoal's mana cost
        FilterOwnedCard filter = new FilterOwnedCard("a white card with converted mana cost X from your hand");
        filter.add(new ColorPredicate(ObjectColor.WHITE));
        filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
        this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));

        // The next X damage that a source of your choice would deal to you and/or creatures you control this turn is dealt to target creature or player instead.
        this.getSpellAbility().addEffect(new ShiningShoalPreventDamageTargetEffect(Duration.EndOfTurn, new ExileFromHandCostCardConvertedMana()));
View Full Code Here

        this.expansionSetCode = "ALL";

        this.color.setBlack(true);

        FilterOwnedCard filter = new FilterOwnedCard("black card from your hand");
        filter.add(new ColorPredicate(ObjectColor.BLACK));
        filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
       
        // You may pay 1 life and exile a black card from your hand rather than pay Contagion's mana cost.
        AlternativeCostSourceAbility ability = new AlternativeCostSourceAbility(new PayLifeCost(1));
        ability.addCost(new ExileFromHandCost(new TargetCardInHand(filter)));
View Full Code Here

        this.subtype.add("Arcane");
        this.color.setGreen(true);

        // You may exile a green card with converted mana cost X from your hand rather than pay Nourishing Shoal's mana cost.
        FilterOwnedCard filter = new FilterOwnedCard("a green card with converted mana cost X from your hand");
        filter.add(new ColorPredicate(ObjectColor.GREEN));
        filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
        this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));

        // You gain X life.
        this.getSpellAbility().addEffect(new GainLifeEffect(new ExileFromHandCostCardConvertedMana()));
View Full Code Here

                && ((DamagedPlayerEvent) event).isCombatDamage()
                && event.getSourceId().equals(sourceId)) {

            FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature that player controls");
            filter.add(new ControllerIdPredicate(event.getPlayerId()));
            filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
            filter.setMessage("nonblack creature controlled by " + game.getPlayer(event.getTargetId()).getName());
            this.getTargets().clear();
            this.addTarget(new TargetPermanent(filter));
            return true;
        }
View Full Code Here

        this.subtype.add("Arcane");
        this.color.setBlue(true);

        // You may exile a blue card with converted mana cost X from your hand rather than pay Disrupting Shoal's mana cost.
        FilterOwnedCard filter = new FilterOwnedCard("a blue card with converted mana cost X from your hand");
        filter.add(new ColorPredicate(ObjectColor.BLUE));
        filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself
        this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));

        // 2/1/2005: Disrupting Shoal can target any spell, but does nothing unless that spell's converted mana cost is X.
        // Counter target spell if its converted mana cost is X.
View Full Code Here

TOP

Related Classes of mage.filter.predicate.mageobject.ColorPredicate

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.