Package mage.filter.common

Examples of mage.filter.common.FilterPlaneswalkerPermanent


        count++;
        if (count >= this.minNumberOfTargets)
          return true;
      }
    }
    for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) {
      if (permanent.canBeTargetedBy(targetSource) && filter.match(permanent)) {
        count++;
        if (count >= this.minNumberOfTargets)
          return true;
      }
View Full Code Here


      Player player = game.getPlayer(playerId);
      if (player != null && player.canBeTargetedBy(targetSource) && filter.match(player)) {
        possibleTargets.add(playerId);
      }
    }
    for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) {
      if (permanent.canBeTargetedBy(targetSource) && filter.match(permanent)) {
        possibleTargets.add(permanent.getId());
      }
    }
    return possibleTargets;
View Full Code Here

                if (count >= this.minNumberOfTargets) {
                    return true;
                }
            }
        }
        for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) {
            if (filter.match(permanent, game)) {
                count++;
                if (count >= this.minNumberOfTargets) {
                    return true;
                }
View Full Code Here

            Player player = game.getPlayer(playerId);
            if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) {
                possibleTargets.add(playerId);
            }
        }
        for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) {
            if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, game)) {
                possibleTargets.add(permanent.getId());
            }
        }
        return possibleTargets;
View Full Code Here

            Player player = game.getPlayer(playerId);
            if (player != null && filter.match(player, game)) {
                possibleTargets.add(playerId);
            }
        }
        for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) {
            if (filter.match(permanent, game)) {
                possibleTargets.add(permanent.getId());
            }
        }
        return possibleTargets;
View Full Code Here

                String[] groups = command.split(";");
                for (int i = 1; i < groups.length; i++) {
                    String group = groups[i];
                    if (group.startsWith("planeswalker=")) {
                        String planeswalkerName = group.substring(group.indexOf("planeswalker=") + 13);
                        for (Permanent permanent :game.getBattlefield().getAllActivePermanents(new FilterPlaneswalkerPermanent(), game)) {
                            if (permanent.getLogName().equals(planeswalkerName)) {
                                defenderId = permanent.getId();                                       
                            }
                        }
                    }
View Full Code Here

        // chooses one of them, and the rest are put into their owners' graveyards.
        // This is called the "planeswalker uniqueness rule."
        if (planeswalkers.size() > 1) {  //don't bother checking if less than 2 planeswalkers in play
            for (Permanent planeswalker: planeswalkers) {
                for (String planeswalkertype: planeswalker.getSubtype()) {
                    FilterPlaneswalkerPermanent filterPlaneswalker = new FilterPlaneswalkerPermanent();
                    filterPlaneswalker.add(new SubtypePredicate(planeswalkertype));
                    filterPlaneswalker.add(new ControllerIdPredicate(planeswalker.getControllerId()));
                    if (getBattlefield().contains(filterPlaneswalker, planeswalker.getControllerId(), this, 2)) {
                        Player controller = this.getPlayer(planeswalker.getControllerId());
                        if (controller != null) {
                            Target targetPlaneswalkerToKeep = new TargetPermanent(filterPlaneswalker);
                            targetPlaneswalkerToKeep.setTargetName(new StringBuilder(planeswalker.getName()).append(" to keep?").toString());
View Full Code Here

                if (count >= this.minNumberOfTargets) {
                    return true;
                }
            }
        }
        for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) {
            // removed canBeTargeted because it's not correct to check for attacking target
            if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, game)) {
                count++;
                if (count >= this.minNumberOfTargets) {
                    return true;
View Full Code Here

        Mode mode2 = new Mode();
        mode2.getEffects().add(new ExileAllEffect(new FilterEnchantmentPermanent("enchantments")));
        this.getSpellAbility().addMode(mode2);
        // or exile all planeswalkers.
        Mode mode3 = new Mode();
        mode3.getEffects().add(new ExileAllEffect(new FilterPlaneswalkerPermanent("planeswalkers")));
        this.getSpellAbility().addMode(mode3);
    }
View Full Code Here

TOP

Related Classes of mage.filter.common.FilterPlaneswalkerPermanent

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.