j133 strafe fire detection: correct the enemy energy delta for the server's +3*power hit bonus and our own damage, never drop a too-large drop (TR_STRAFE_FIRE_FIX, default on); catch 98.89%->100% of enemy fires on the 70-battle corpus
This commit is contained in:
@@ -599,6 +599,10 @@ method onBulletFired*(bot: ModularBot, e: BulletFiredEvent) =
|
||||
|
||||
method onBulletHit*(bot: ModularBot, e: BulletHitBotEvent) =
|
||||
inc bot.realHits
|
||||
# j133 fire-detection fix: our damage to the enemy inflates the enemy's
|
||||
# energy drop this tick (it can push the enemy's own fire past the 3.0 power
|
||||
# cap and get it rejected). Tell the strafe detector, which undoes it.
|
||||
bot.strafeMover.noteDamageDealt(e.damage)
|
||||
# Capture the rack BEFORE resolveOwnBullet drops the bullet's mode slot.
|
||||
let hitMode = bot.bulletMode.getOrDefault(e.bullet.bulletId, vb.rm1v1)
|
||||
# onBulletHit only fires for our own bullets (victimId != myId); see json_parse.nim.
|
||||
@@ -648,6 +652,11 @@ method onBulletHitBullet*(bot: ModularBot, e: BulletHitBulletEvent) =
|
||||
e.hitBullet.ownerId, bot.tick, false)
|
||||
|
||||
method onHitByBullet*(bot: ModularBot, e: HitByBulletEvent) =
|
||||
# j133 fire-detection fix: server rules.kt gives the SHOOTER a `3*power`
|
||||
# energy bonus when its bullet hits us, which masks the cost of a fire in the
|
||||
# same tick. Forward the enemy bullet's power so the strafe detector adds it
|
||||
# back before classifying the energy delta.
|
||||
bot.strafeMover.noteEnemyBulletHit(e.bullet.power)
|
||||
# Feeds the ram bullet-rain abort window. Accumulate REAL ENERGY (the server's
|
||||
# 4p/6p-2 damage), not raw firepower, so `damageRatePerTurn` is a real
|
||||
# energy/turn rate (see movements/ram_decision.bulletDamage).
|
||||
|
||||
Reference in New Issue
Block a user