Examples of CardTypePredicate


Examples of mage.filter.predicate.mageobject.CardTypePredicate

        @Override
        public boolean apply(Game game, Ability source) {

            FilterPermanent filterEnchantments = new FilterPermanent();
            filterEnchantments.add(new CardTypePredicate(CardType.ENCHANTMENT));

            for (Permanent permanent : game.getBattlefield().getActivePermanents(filterEnchantments, source.getControllerId(), source.getSourceId(), game)) {
                Player controller = game.getPlayer(permanent.getControllerId());
                if (controller != null) {
                    controller.damage(2, permanent.getId(), game, false, true);
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

        if (ability instanceof SimpleActivatedAbility) {
            int xValue = ability.getManaCostsToPay().getX();
            ability.getTargets().clear();
            FilterCard filter = new FilterCard(new StringBuilder("artifact or creature card with converted mana cost ").append(xValue).append(" from an opponent's graveyard").toString());
            filter.add(Predicates.or(
                new CardTypePredicate(CardType.ARTIFACT),
                new CardTypePredicate(CardType.CREATURE)));
            filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, xValue));
            Target target = new TargetCardInOpponentsGraveyard(filter);
            ability.addTarget(target);
        }
    }
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

        Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
        if (sourcePermanent != null && player != null) {
            int newConvertedCost = sourcePermanent.getCounters().getCount("verse");
            FilterCard filter = new FilterCard("creature card with converted mana cost " + newConvertedCost);
            filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, newConvertedCost));
            filter.add(new CardTypePredicate(CardType.CREATURE));
            TargetCardInLibrary target = new TargetCardInLibrary(filter);
            if (player.searchLibrary(target, game)) {
                for (UUID cardId : target.getTargets()) {
                    Card card = player.getLibrary().getCard(cardId, game);
                    if (card != null) {
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

class TargetControlledPermanentSharingOpponentPermanentCardType extends TargetControlledPermanent {
   
    public TargetControlledPermanentSharingOpponentPermanentCardType() {
        super();
        filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
        setTargetName("nonland permanent you control");
   
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Player player = game.getPlayer(event.getPlayerId());
        if (player != null) {
            FilterCard filter = new FilterCard();
            if (player.chooseUse(Outcome.Benefit, "Choose land? (No = nonland)", game)) {
                filter.add(new CardTypePredicate(CardType.LAND));
            }
            else {
                filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
            }
            Cards cards = new CardsImpl();
            while (player.getLibrary().size() > 0) {
                Card card = player.getLibrary().removeFromTop(game);
                if (filter.match(card, source.getSourceId(), source.getControllerId(), game)) {
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

            game.addEffect(effect, source);
            FilterPermanent filter2 = new FilterPermanent();
            filter2.add(new ControllerIdPredicate(targetPlayer.getId()));
            filter2.add(Predicates.or(new ColorPredicate(ObjectColor.WHITE),
                    new ColorPredicate(ObjectColor.BLUE)));
            filter2.add(new CardTypePredicate(CardType.CREATURE));
            for (Permanent creature : game.getBattlefield().getAllActivePermanents(filter2, targetPlayer.getId(), game)) {
                creature.damage(1, source.getSourceId(), game, false, true);
            }
            return true;
        }
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

        if (cards.size() > 0) {
            controller.revealCards("Genesis Hydra", cards, game);
        }

        FilterCard filter = new FilterPermanentCard("a nonland permanent card with converted mana cost " + count + " or less to put onto the battlefield");
        filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
        filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, count + 1));
        TargetCard target1 = new TargetCard(Zone.LIBRARY, filter);
        target1.setRequired(false);
        if (cards.count(filter, controller.getId(), source.getSourceId(), game) > 0) {
            if (controller.choose(Outcome.PutCardInPlay, cards, target1, game)) {
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

            }
            filter.add(Predicates.or(predicates));

            predicates.clear();
            if (this.tbLand.isSelected()) {
                predicates.add(new CardTypePredicate(CardType.LAND));
            }
            if (this.tbArifiacts.isSelected()) {
                predicates.add(new CardTypePredicate(CardType.ARTIFACT));
            }
            if (this.tbCreatures.isSelected()) {
                predicates.add(new CardTypePredicate(CardType.CREATURE));
            }
            if (this.tbEnchantments.isSelected()) {
                predicates.add(new CardTypePredicate(CardType.ENCHANTMENT));
            }
            if (this.tbInstants.isSelected()) {
                predicates.add(new CardTypePredicate(CardType.INSTANT));
            }
            if (this.tbSorceries.isSelected()) {
                predicates.add(new CardTypePredicate(CardType.SORCERY));
            }
            if (this.tbPlaneswalkers.isSelected()) {
                predicates.add(new CardTypePredicate(CardType.PLANESWALKER));
            }
            filter.add(Predicates.or(predicates));


            if (this.cbExpansionSet.isVisible()) {
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

    }

    @Override
    public boolean apply(Game game, Ability source) {
        FilterArtifactPermanent filter = new FilterArtifactPermanent("noncreature, non-Equipment artifact");
        filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
        filter.add(Predicates.not(new SubtypePredicate("Equipment")));

        List<UUID> affectedPermanents = new ArrayList<UUID>();
        List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game);
        for (Permanent permanent : permanents) {
View Full Code Here

Examples of mage.filter.predicate.mageobject.CardTypePredicate

        Player player = game.getPlayer(source.getControllerId());
       
        FilterPermanent filterAura = new FilterPermanent("Aura");
        FilterCard filterAuraCard = new FilterCard("Aura card");

        filterAura.add(new CardTypePredicate(CardType.ENCHANTMENT));
        filterAura.add(new SubtypePredicate("Aura"));
        filterAura.add(new AuraPermanentCanAttachToPermanentId(bruna));
        filterAuraCard.add(new CardTypePredicate(CardType.ENCHANTMENT));
        filterAuraCard.add(new SubtypePredicate("Aura"));
        filterAuraCard.add(new AuraCardCanAttachToPermanentId(bruna));
       
        if (player == null) {
            return false;
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.