feat(ModularBot): melee targeting — multi-enemy tracker, per-enemy gun fitness, radar auto-switch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-20 12:25:10 +02:00
parent 30d00ba163
commit ab473c6b68
9 changed files with 375 additions and 174 deletions
+4 -3
View File
@@ -19,8 +19,9 @@ proc shouldFire*(currentGunDir, targetAngle, gunHeat: float): bool =
elif delta < -180.0: delta += 360.0
abs(delta) <= AimThresholdDeg and gunHeat <= 0.0
proc selectShot*(t: VirtualTracker): (GunId, int, float) =
proc selectShot*(t: VirtualTracker, targetId: int = -1): (GunId, int, float) =
## Returns (gunId, powerBinIdx, power) — the shot to take this tick.
let gunId = t.bestGun()
let (binIdx, power) = t.bestPower(gunId)
## Pass targetId to pick the best gun for that specific enemy.
let gunId = t.bestGun(targetId)
let (binIdx, power) = t.bestPower(gunId, targetId)
result = (gunId, binIdx, power)