Package mage.filter

Examples of mage.filter.Filter.match()


          if (perm.moveToZone(Zone.GRAVEYARD, null, this, false))
            somethingHappened = true;
        }
        else {
          Filter auraFilter = perm.getSpellAbility().getTargets().get(0).getFilter();
          if (!auraFilter.match(attachedTo) || attachedTo.hasProtectionFrom(perm)) {
            if (perm.moveToZone(Zone.GRAVEYARD, null, this, false))
              somethingHappened = true;
          }
        }
      }
View Full Code Here


    public boolean apply(Card input, Game game) {
        final Permanent permanent = game.getPermanent(toBeCheckedPermanentId);
        Filter filter;
        for (Target target : input.getSpellAbility().getTargets()) {
            filter = target.getFilter();
            if (filter.match(permanent, game)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

    public boolean apply(Permanent input, Game game) {
        final Permanent permanent = game.getPermanent(toBeCheckedPermanentId);
        Filter filter;
        for (Target target : input.getSpellAbility().getTargets()) {
            filter = target.getFilter();
            if (filter.match(permanent, game)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

                                    if (movePermanentToGraveyardWithInfo(perm)) {
                                        somethingHappened = true;
                                    }
                                }
                            } else {
                                if (!auraFilter.match(attachedTo, this) || attachedTo.cantBeEnchantedBy(perm, this)) {
                                    // handle bestow unattachment
                                    Card card = this.getCard(perm.getId());
                                    if (card != null && card.getCardType().contains(CardType.CREATURE)) {
                                        UUID wasAttachedTo = perm.getAttachedTo();
                                        perm.attachTo(null, this);
View Full Code Here

                                somethingHappened = true;
                            }
                        }
                        else {
                            Filter auraFilter = perm.getSpellAbility().getTargets().get(0).getFilter();
                            if (!auraFilter.match(attachedToPlayer, this) || attachedToPlayer.hasProtectionFrom(perm, this)) {
                                if (movePermanentToGraveyardWithInfo(perm)) {
                                    somethingHappened = true;
                                }
                            }
                        }
View Full Code Here

            Filter filter = new FilterBasicLandCard();
            do {
                card = library.removeFromTop(game);
                if (card != null) {
                   
                    if (filter.match(card, game)) {
                        player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
                    } else {
                        cards.add(card);
                    }
                }
View Full Code Here

                        player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
                    } else {
                        cards.add(card);
                    }
                }
            } while (library.size() > 0 && card != null && !filter.match(card, game));

            if (!cards.isEmpty()) {
                for (Card cardToGrave: cards.getCards(game)) {
                    player.moveCardToGraveyardWithInfo(cardToGrave, source.getSourceId(), game, Zone.LIBRARY);
                }
View Full Code Here

                for(Card enchantment : exileZone.getCards(game)) {
                    if (filterAura.match(enchantment, game)) {
                        boolean canTarget = false;
                        for (Target target : enchantment.getSpellAbility().getTargets()) {
                            Filter filter = target.getFilter();
                            if (filter.match(newPermanent, game)) {
                                canTarget = true;
                                break;
                            }
                        }
                        if (!canTarget) {
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.