Examples of CardIdPredicate


Examples of mage.filter.predicate.mageobject.CardIdPredicate

        this.power = new MageInt(2);
        this.toughness = new MageInt(3);

        FilterPermanent filter = new FilterPermanent("Kabira Evangel or another Ally");
        filter.add(Predicates.or(
        new CardIdPredicate(this.getId()),
        new SubtypePredicate("Ally")));

        // Whenever Kabira Evangel or another Ally enters the battlefield under your control, you may choose a color. If you do, Allies you control gain protection from the chosen color until end of turn.
        this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new ChooseColorEffect(), filter, true));
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardIdPredicate

        String rule = "you may gain control of target creature for as long as you control Roil Elemental";

        FilterPermanent filter = new FilterPermanent();
        filter.add(new ControllerPredicate(TargetController.YOU));
        filter.add(new CardIdPredicate(this.getId()));

        // Flying
        this.addAbility(FlyingAbility.getInstance());

        // Landfall - Whenever a land enters the battlefield under your control, you may gain control of target creature for as long as you control Roil Elemental.
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardIdPredicate

        this.power = new MageInt(2);
        this.toughness = new MageInt(2);

        FilterPermanent filter = new FilterPermanent("Bala Ged Thief or another Ally");
        filter.add(Predicates.or(
                new CardIdPredicate(this.getId()),
                new SubtypePredicate("Ally")));

        // Whenever Bala Ged Thief or another Ally enters the battlefield under your control, target player reveals a number of cards from his or her hand equal to the number of Allies you control. You choose one of them. That player discards that card.
        Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new BalaGedThiefEffect(), filter, false);
        TargetPlayer target = new TargetPlayer();
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardIdPredicate

                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();
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardIdPredicate

                    FilterCard filterInHand = new FilterCard();
                    filterInHand.setMessage("card from your hand (" + amount + " left in total)");                   
                    targetInHand = new TargetCard(0, 1, Zone.HAND, filterInHand);
                    List<CardIdPredicate> uuidPredicates = new ArrayList<>();
                    for (UUID uuid :selectedObjects) {
                        uuidPredicates.add(new CardIdPredicate(uuid));
                    }
                    filterInHand.add(Predicates.not(Predicates.or(uuidPredicates)));                   
                    if (targetInHand.canChoose(player.getId(), game) &&
                            player.choose(Outcome.Exile, player.getHand(), targetInHand, game)) {
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardIdPredicate

        CardsPutIntoGraveyardWatcher watcher = (CardsPutIntoGraveyardWatcher) game.getState().getWatchers().get("CardsPutIntoGraveyardWatcher");
        if (watcher != null) {
            FilterCard filter = new FilterCreatureCard(textFilter);
            List<CardIdPredicate> uuidPredicates = new ArrayList<>();
            for (UUID uuid :watcher.getCardsPutToGraveyardFromBattlefield()) {
                uuidPredicates.add(new CardIdPredicate(uuid));
            }
            filter.add(Predicates.or(uuidPredicates));
            ability.getTargets().clear();
            ability.addTarget(new TargetCardInGraveyard(filter));
        }
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardIdPredicate

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

        // Change the target of target spell with a single target.
        this.getSpellAbility().addEffect(new ChooseNewTargetsTargetEffect(true, true));
        this.getSpellAbility().addTarget(new TargetSpell(filter2));
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardIdPredicate

        this.color.setRed(true);

        // You may exile a red card with converted mana cost X from your hand rather than pay Blazing Shoal's mana cost.
        FilterOwnedCard filter = new FilterOwnedCard("a red card with converted mana cost X 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))));

        // Target creature gets +X/+0 until end of turn.
        this.getSpellAbility().addEffect(new BoostTargetEffect(new ExileFromHandCostCardConvertedMana(), new StaticValue(0), Duration.EndOfTurn));
        this.getSpellAbility().addTarget(new TargetCreaturePermanent());
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardIdPredicate

       
        String rule = "Gain control of target Vampire for as long as you control Olivia Voldaren";

        FilterPermanent filter2 = new FilterPermanent();
        filter2.add(new ControllerPredicate(TargetController.YOU));
        filter2.add(new CardIdPredicate(this.getId()));

        this.addAbility(FlyingAbility.getInstance());

        // {1}{R}: Olivia Voldaren deals 1 damage to another target creature. That creature becomes a Vampire in addition to its other types. Put a +1/+1 counter on Olivia Voldaren.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{1}{R}"));
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardIdPredicate

        this.color.setRed(true);

        // You may exile a red card from your hand rather than pay Cave-In'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())));      
        this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter))));
       
        // Cave-In deals 2 damage to each creature and each player.
        this.getSpellAbility().addEffect(new DamageEverythingEffect(2));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.