Combat: FIX missile direct damage 6x over-application -- damage once per salvo (task #62)

User live regression: missiles killed a mech in ~2 shots ("takes way more than 2
normally"). Root cause -- DamageZone::TakeDamage (arcade @0041e4e0 == WinTesla
DAMAGE.cpp:379) is `damageLevel += amount*scale` and IGNORES burstCount. So the
arcade's ONE cluster Missile per trigger lands its damageAmount EXACTLY ONCE; the
missileCount/burstCount split is cosmetic for zone damage (only gyro-bounce +
splash-falloff read burstCount). The port re-expresses that one cluster as N
flying rounds and was damaging on EVERY round = ~missileCount x too lethal on the
direct hit (mirrors the splash over-application fixed in 145a69f).

Fix (mislanch.cpp FireWeapon): only the salvo-LEAD round (i==0) carries damage
(damageData.damageAmount) AND the cluster splash; the other N-1 rounds are VISUAL
(damage 0) -- the tracer ripple, no extra damage. AC unaffected (one round/shot,
not a cluster).

Verified (BT_DMG_LOG [dmghit] trace): per-hit missile damage = clean 5.83, burst
1, once. Missiles-ONLY (BT_AF_MISSILE now independent of BT_AUTOFIRE), single
enemy, 45s: 8 damaging hits, top zone reaches only 0.18, NO death (was death in
~3 pulls) -- "way more than 2" restored. Earlier test deaths were BT_AUTOFIRE
firing laser+PPC+missiles combined, not missiles alone.

KB: combat-damage.md documents burstCount-ignored + the N-round cluster trap
(direct + splash both once-per-salvo).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-13 20:01:44 -05:00
co-authored by Claude Opus 4.8
parent 145a69f865
commit fa0b825b60
4 changed files with 52 additions and 29 deletions
+5 -3
View File
@@ -3730,10 +3730,12 @@ void
LBE4ControlsManager::ButtonJoystickThumbLow, // 0x46
LBE4ControlsManager::ButtonJoystickThumbHigh, // 0x47
};
// DEV: BT_AF_MISSILE=1 also pulses the missile group (ThumbHigh) so a
// headless rig can exercise the launcher (splash verification, task #62).
// DEV: BT_AF_MISSILE=1 pulses the missile group (ThumbHigh). INDEPENDENT
// of BT_AUTOFIRE (which drives the main gun group) so a headless rig can
// exercise MISSILES ONLY -- isolates missile damage/splash from laser+PPC
// fire (task #62 TTK verification).
static const int s_afMissile = getenv("BT_AF_MISSILE") ? 1 : 0;
const int autofireMsl = (s_afMissile && gBTDrive.fireForced && targetInArc) ? s_afPhase : 0;
const int autofireMsl = (s_afMissile && targetInArc) ? s_afPhase : 0;
int want[4];
want[0] = ((gBTLaserKey && targetInArc) || autofire) ? 1 : 0;
want[1] = (gBTPinkyKey && targetInArc) ? 1 : 0; // key '4' (was unmapped)