Пример #1
0
  @Override
  public synchronized void moveNoCollision(double time) {
    if (2 * relativeTime >= SKILL_BOUND) { // Half Period
      clearTask();
      owner().setRepel(false);
      owner().removeDive();
    } else {
      relativeTime += INCREMENT;

      Pointt currentPosition = position(relativeTime);
      Pointt veryClose = position(relativeTime + DELTA);
      owner().setMovingAngle(currentPosition.angle(veryClose));
      owner().setPosition(currentPosition);

      for (int i = 1; i < 10; i++) {
        synchronized (game().visualEffects()) {
          game()
              .visualEffects()
              .add(
                  new UniversalEffect(
                      position(relativeTime - i * INCREMENT / 5),
                      DragonFly.repInstances[0],
                      DragonFly.standardColors,
                      (2 * (10 - i) + 1) / FADE_TIME,
                      0,
                      owner().movingAngle(),
                      UniversalEffect.STAND_STILL,
                      UniversalEffect.FADING,
                      UniversalEffect.SHRINKING_SCALE));
        }
      }
    }
  }
Пример #2
0
  @Override
  public synchronized void moveNoCollision(double time) {
    if (2 * relativeTime >= SKILL_BOUND) { // Half Period
      clearTask();
      owner().increaseSplitFire();
      owner()
          .setAttackSpeed(
              Math.max(owner().attackSpeed() - ATTACK_SPEED_DECREMENT, ATTACK_SPEED_MINIMUM));

      synchronized (owner()) {
        owner().rescheduleAttack(0);
      }

      owner().removeDive();
    } else {
      relativeTime += INCREMENT;
      owner().setHealth(owner().health() + healthIncrement, Units.MAGICAL_DAMAGE);

      Pointt currentPosition = position(relativeTime);
      Pointt veryClose = position(relativeTime + DELTA);
      owner().setMovingAngle(currentPosition.angle(veryClose));
      owner().setPosition(currentPosition);

      for (int i = 1; i < 10; i++) {
        synchronized (game().visualEffects()) {
          game()
              .visualEffects()
              .add(
                  new UniversalEffect(
                      position(relativeTime - i * INCREMENT / 5),
                      DragonFly.repInstances[0],
                      DragonFly.standardColors,
                      (i + 1) / FADE_TIME,
                      0,
                      owner().movingAngle(),
                      UniversalEffect.STAND_STILL,
                      UniversalEffect.FADING,
                      UniversalEffect.FIX_SCALE));
        }
      }

      if (owner().pathOfVenoms().activate()) {
        Venom toBeAdd =
            new Venom(game(), owner(), owner().position(), 0, 0, PathOfVenoms.VENOM_TYPE);
        synchronized (owner().projectiles()) {
          owner().projectiles().add(toBeAdd);
        }

        synchronized (owner().venoms()) {
          owner().venoms().add(toBeAdd);
        }

        toBeAdd.schedule();
      }

      int random = Maths.RANDOM.nextInt(Petaluridae.repInstances[0].parts().size());
      ArrayList<Area> part = new ArrayList<>();
      part.add(new Area(Petaluridae.repInstances[0].parts().get(random)));

      synchronized (game().visualEffects()) {
        game()
            .visualEffects()
            .add(
                new UniversalEffect(
                    owner().position(),
                    new RepInstance(part),
                    Petaluridae.standardColors.get(random),
                    UniversalEffect.DEFAULT_COUNT_DOWN,
                    0,
                    Maths.randomAngle(),
                    UniversalEffect.STAND_STILL,
                    UniversalEffect.FADING,
                    UniversalEffect.FIX_SCALE));
      }
    }
  }