Ejemplo n.º 1
0
 protected int computeEffectsToRemove(
     final ArrayList<RunningEffect> effectToRemove,
     final RunningEffectManager effectManager,
     int newStateLevel) {
   for (final RunningEffect effect : effectManager) {
     if (!(effect instanceof StateRunningEffect)) {
       continue;
     }
     final State state = ((StateRunningEffect) effect).getState();
     if (state.getStateBaseId() != this.m_value
         || (state.isInamovable()
             && !ApplyState.UNDECURSABLE_STATE.contains(state.getStateBaseId()))) {
       continue;
     }
     effectToRemove.add(effect);
     newStateLevel = state.getLevel() - this.m_levelToDecrease;
   }
   return newStateLevel;
 }
 private Point3 getRandomCellInEffectArea(final FightMap fightMap) {
   final AreaOfEffect areaOfEffect = ((WakfuEffect) this.m_genericEffect).getAreaOfEffect();
   if (areaOfEffect.getType() == AreaOfEffectEnum.EMPTY) {
     return fightMap.getInsideRandomCell();
   }
   final Direction8 dir = this.m_caster.getDirection();
   final Point3 casterCell = this.m_caster.getPosition();
   final Iterable<int[]> iterable =
       ((WakfuEffect) this.m_genericEffect)
           .getAreaOfEffect()
           .getCells(
               this.m_targetCell.getX(),
               this.m_targetCell.getY(),
               this.m_targetCell.getZ(),
               casterCell.getX(),
               casterCell.getY(),
               casterCell.getZ(),
               dir);
   final ArrayList<int[]> cells = new ArrayList<int[]>();
   for (final int[] next : iterable) {
     final int cellX = next[0];
     final int cellY = next[1];
     if (!fightMap.isInMap(cellX, cellY)) {
       continue;
     }
     if (!fightMap.isInside(cellX, cellY)) {
       continue;
     }
     final short cellHeight = fightMap.getCellHeight(cellX, cellY);
     if (cellHeight == -32768) {
       continue;
     }
     cells.add(next);
   }
   if (cells.isEmpty()) {
     EnutrofDepositPlacement.m_logger.error(
         (Object)
             ("Pas de cellule trouvee pour le spawn d'un gisement " + areaOfEffect.getType()));
     return null;
   }
   return new Point3(cells.get(MathHelper.random(cells.size())));
 }