Пример #1
0
  public void processWave(Wave w) {
    GuessFactorWindowSet gfWindow = w.guessFactorWindow(ScanLog.myLocation());
    int gfBin = w.guessFactorIndex(gfWindow.guessFactor);
    int gfBinLow = w.guessFactorIndex(gfWindow.guessFactorLow);
    int gfBinHigh = w.guessFactorIndex(gfWindow.guessFactorHigh);
    BotScan enemyScan = w.targetScan.getInverseScan();

    for (int x = 0; x < _waveRegisters.size(); x++) {
      WaveRegister wr = (WaveRegister) _waveRegisters.get(x);

      wr.registerWaveHit(
          w.targetScan,
          enemyScan,
          w.bulletPower,
          gfWindow.guessFactor,
          gfBin,
          gfBinLow,
          gfBinHigh,
          w.firingWave,
          w.fireTime,
          w.orientation,
          w.escapeAngleRange());
    }

    w.processedWaveBreak = true;
  }
Пример #2
0
  public void onHitByBullet(HitByBulletEvent e) {
    ScanLog.onHitByBullet(e);

    Wave hitWave = processBulletReturnFiringWave(e.getBullet(), e.getTime());

    if (hitWave != NO_WAVE_FOUND) {
      double thisHit =
          (hitWave.targetScan.getDistance() / TYPICAL_DISTANCE)
              * (hitWave.escapeAngleRange() / TYPICAL_ESCAPE_RANGE);
      _weightedEnemyShotsHit += thisHit;
      _weightedEnemyShotsHitThisRound += thisHit;
    }
  }