GetFightersCountInRange(final ArrayList<ParserObject> args) {
   super();
   this.checkType(args);
   if (args.size() == 1) {
     this.m_maxRange = args.get(0);
   } else if (args.size() == 2) {
     this.m_maxRange = args.get(0);
     this.m_target = args.get(1).getValue().equalsIgnoreCase("target");
   } else if (args.size() == 3) {
     this.m_minRange = args.get(0);
     this.m_maxRange = args.get(1);
     this.m_target = args.get(2).getValue().equalsIgnoreCase("target");
   } else if (args.size() == 4) {
     this.m_minRange = args.get(0);
     this.m_maxRange = args.get(1);
     this.m_target = args.get(2).getValue().equalsIgnoreCase("target");
     this.m_inLine = args.get(3);
   } else if (args.size() == 5) {
     this.m_minRange = args.get(0);
     this.m_maxRange = args.get(1);
     this.m_target = args.get(2).getValue().equalsIgnoreCase("target");
     this.m_inLine = args.get(3);
     this.m_testLoS = args.get(4);
   }
 }
Esempio n. 2
0
 public void update(final DisplayedScreenWorld world, final int deltaTime) {
   this.m_position += deltaTime;
   final ArrayList<DisplayedScreenMap> maps = world.getMaps();
   for (int i = maps.size() - 1; i >= 0; --i) {
     final DisplayedScreenMap map = maps.get(i);
     if (map != null) {
       final DisplayedScreenElement[] elts = map.getElements();
       if (elts != null) {
         for (final DisplayedScreenElement elt : elts) {
           if (elt.isVisible()) {
             final int id = elt.getElement().getCommonProperties().getId();
             if (Sea.WATER_ELEMENTS.contains(id)) {
               final float x = elt.getWorldCellX();
               final float y = elt.getWorldCellY();
               final float d =
                   (float) Math.sqrt(x * x + y * y) + this.m_speed * this.m_position / 1000.0f;
               float amplitude = this.m_amplitude * MathHelper.sinf(6.2831855f * d / this.m_width);
               if (amplitude < 0.0f) {
                 amplitude *= 0.2f;
               }
               final BatchTransformer batchTransformer = elt.getEntitySprite().getTransformer();
               final float tx = batchTransformer.getMatrix().getBuffer()[12];
               final float ty = batchTransformer.getMatrix().getBuffer()[13];
               batchTransformer
                   .getMatrix()
                   .set(
                       new float[] {
                         1.0f + amplitude,
                         0.0f,
                         0.0f,
                         0.0f,
                         0.0f,
                         1.0f + amplitude,
                         0.0f,
                         0.0f,
                         0.0f,
                         0.0f,
                         0.0f,
                         0.0f,
                         tx,
                         ty,
                         0.0f,
                         1.0f
                       });
             }
           }
         }
       }
     }
   }
 }
 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())));
 }