Package mage.filter.common

Examples of mage.filter.common.FilterCreatureForCombat


    return attackers;
  }

  @Override
  public List<Permanent> getAvailableBlockers(Game game) {
    FilterCreatureForCombat blockFilter = new FilterCreatureForCombat();
    List<Permanent> blockers = game.getBattlefield().getAllActivePermanents(blockFilter, playerId);
    return blockers;
  }
View Full Code Here


  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getFirstTarget());
    if (player != null) {
      for (Permanent creature: game.getBattlefield().getAllActivePermanents(new FilterCreatureForCombat(), player.getId())) {
        if (creature.canAttack(game)) {
          game.getCombat().declareAttacker(creature.getId(), source.getSourceId(), game);
        }
      }
      return true;
View Full Code Here

//    return blockers;
//  }

  protected List<Permanent> getOpponentBlockers(UUID opponentId, Game game) {
    logger.fine("getOpponentBlockers");
    FilterCreatureForCombat blockFilter = new FilterCreatureForCombat();
    List<Permanent> blockers = game.getBattlefield().getAllActivePermanents(blockFilter, opponentId);
    return blockers;
  }
View Full Code Here

                                defenderId = permanent.getId();                                       
                            }
                        }
                    }
                }
                FilterCreatureForCombat filter = new FilterCreatureForCombat();
                filter.add(new NamePredicate(groups[0]));
                filter.add(Predicates.not(new AttackingPredicate()));
                Permanent attacker = findPermanent(filter, playerId, game);
                if (attacker != null && attacker.canAttack(defenderId, game)) {
                    this.declareAttacker(attacker.getId(), defenderId, game, false);
                }
            }
View Full Code Here

        return  getAvailableAttackers(null, game);
    }
   
    @Override
    public List<Permanent> getAvailableAttackers(UUID defenderId, Game game) {
        FilterCreatureForCombat filter = new FilterCreatureForCombat();
        List<Permanent> attackers = game.getBattlefield().getAllActivePermanents(filter, playerId, game);
        for (Iterator<Permanent> i = attackers.iterator(); i.hasNext();) {
            Permanent entry = i.next();
            if (!entry.canAttack(defenderId, game)) {
                i.remove();
View Full Code Here

    }

    @Override
    public void selectAttackers(Game game, UUID attackingPlayerId) {
        updateGameStatePriority("selectAttackers", game);
        FilterCreatureForCombat filter = filterCreatureForCombat.copy();
        filter.add(new ControllerIdPredicate(attackingPlayerId));
        while (!abort) {
            if (passedAllTurns ||
               (!getUserData().getUserSkipPrioritySteps().isStopOnDeclareAttackersDuringSkipAction() && (passedTurn || passedUntilEndOfTurn || passedUntilNextMain) )) {
                return;
            }
View Full Code Here

TOP

Related Classes of mage.filter.common.FilterCreatureForCombat

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.