feat(SNNBot): fire only when aim is locked on target
Bot now conserves ammo by firing only when aimLocked=true (error < 1.5°). During WAITING phase, checks aimLocked flag before firing FIRE_POWER; calls setFire(0.0) when not locked. Prevents wasted shots on moving targets. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -385,7 +385,10 @@ method run*(bot: SNNBot) =
|
|||||||
|
|
||||||
of WAITING:
|
of WAITING:
|
||||||
aimTo(bot.targetAngle, gunDir)
|
aimTo(bot.targetAngle, gunDir)
|
||||||
discard setFire(FIRE_POWER)
|
if bot.aimLocked:
|
||||||
|
discard setFire(FIRE_POWER)
|
||||||
|
else:
|
||||||
|
discard setFire(0.0)
|
||||||
let err = abs(normalizeRelativeAngle(bot.targetAngle - gunDir))
|
let err = abs(normalizeRelativeAngle(bot.targetAngle - gunDir))
|
||||||
if err < AIM_TOL:
|
if err < AIM_TOL:
|
||||||
bot.phase = EVALUATE
|
bot.phase = EVALUATE
|
||||||
|
|||||||
Reference in New Issue
Block a user