Examples of CardTypePredicate


Examples of mage.filter.predicate.mageobject.CardTypePredicate

        this("creature");
    }

    public FilterCreaturePermanent(String name) {
        super(name);
        this.add(new CardTypePredicate(CardType.CREATURE));
    }   
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

        this.add(new CardTypePredicate(CardType.CREATURE));
    }   
   
    public FilterCreaturePermanent(String subtype, String name) {
        super(name);
        this.add(new CardTypePredicate(CardType.CREATURE));
        this.add(new SubtypePredicate(subtype));
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

        this("enchantment");
    }

    public FilterEnchantmentPermanent(String name) {
        super(name);
        this.add(new CardTypePredicate(CardType.ENCHANTMENT));
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

        this("nonland permanent");
    }

    public FilterNonlandPermanent(String name) {
        super(name);
        this.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

        this("artifact");
    }

    public FilterArtifactCard(String name) {
        super(name);
        this.add(new CardTypePredicate(CardType.ARTIFACT));
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

        this("land you control");
    }

    public FilterControlledLandPermanent(String name) {
        super(name);
        this.add(new CardTypePredicate(CardType.LAND));
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

    }

    @Override
    public boolean apply(Game game, Ability source) {
        FilterPermanent filter = new FilterPermanent();
        filter.add(new CardTypePredicate(CardType.CREATURE));
        filter.add(new ColorPredicate(ObjectColor.GREEN));
        for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
            if (permanent.getTurnsOnBattlefield() == 0) {
                permanent.addCounters(CounterType.P1P1.createInstance(), game);
            }
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            FilterCard filter = new FilterCard("instant card");
            filter.add(new CardTypePredicate(CardType.INSTANT));
            Card[] cards = player.getGraveyard().getCards(filter, game).toArray(new Card[0]);
            if (cards.length > 0) {
                Random rnd = new Random();
                Card card = cards[rnd.nextInt(cards.length)];
                card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

                && ((DamagedPlayerEvent) event).isCombatDamage()) {
            Player player = game.getPlayer(event.getTargetId());
            if (player != null) {
                FilterPermanent filter = new FilterPermanent("an artifact or enchantment controlled by " + player.getName());
                filter.add(Predicates.or(
                    new CardTypePredicate(CardType.ARTIFACT),
                    new CardTypePredicate(CardType.ENCHANTMENT)));
                filter.add(new ControllerIdPredicate(event.getTargetId()));

                this.getTargets().clear();
                this.addTarget(new TargetPermanent(filter));
                return true;
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

        if (controller != null) {
            FilterCard protectionFilter = new FilterCard();
            ChoiceColorOrArtifact choice = new ChoiceColorOrArtifact();
            if (controller.choose(outcome, choice, game)) {
                if (choice.isArtifactSelected()) {
                    protectionFilter.add(new CardTypePredicate(CardType.ARTIFACT));
                } else {
                    protectionFilter.add(new ColorPredicate(choice.getColor()));
                }

                protectionFilter.setMessage(choice.getChoice());
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.