Issue #27: projectiles carry the weapon's real damage type (ballistic)

Playtest matchlog forensics: across 2,591 applied-damage events in two
rounds, Ballistic (type 1) damage NEVER appeared -- Collision/Explosive/
Laser/Energy only -- despite 136 projectile impacts and autocannon/Gauss
mechs.  The weapon parses its authentic damageData.damageType correctly
(mechweap.cpp:316 maps "BallisticDamage" -> 1), but BTPushProjectile
never carried the type and every projectile-impact site in mech4.cpp
hardcoded ExplosiveDamageType.  So autocannon/Gauss rounds were scaled
against armor by damageScale[Explosive] instead of damageScale[Ballistic]
(the model indexes a distinct scale cell per damage type) -- every
ballistic weapon did the wrong damage all night.

Lasers/PPCs were unaffected (their SendDamageMessage path carries the
weapon's own damageData); missiles happen to BE Explosive so only
autocannon & Gauss were mis-scaled.

BTProjectile gains a damageType field, threaded from the firing weapon
(damageData.damageType) at launch through to the impact dispatch;
missiles resolve Explosive from their own streamed type, autocannon/
Gauss now resolve Ballistic.  The missile-splash template stays
Explosive.  Enum is anonymous so the field casts to Enumeration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-23 01:09:13 -05:00
co-authored by Claude Opus 4.8
parent 76eaddc4a8
commit 02a41f165f
4 changed files with 30 additions and 7 deletions
+13
View File
@@ -258,6 +258,19 @@ Band effects: `MechDeathHandler::Tick` fires the CURRENT band descriptor on any
(the binary's changed-flag semantics, workflow-verified) — a damaged mech under fire smokes/
burns per hit; the earlier crossing-only gate was over-tight (the metronome was SHKWAVE).
## Ballistic damage type -- FIXED (2026-07-23, issue #27) [T2]
Playtest matchlog forensics (2,591 applied-damage events over 2 rounds): the damageType
histogram had Collision/Explosive/Laser/Energy but **Ballistic (type 1) NEVER appeared**,
despite 136 projectile impacts + autocannon/Gauss mechs. The weapon parses its authentic
`damageData.damageType` right (mechweap.cpp:316, "BallisticDamage"->1), but `BTPushProjectile`
dropped it and every mech4.cpp projectile-impact site hardcoded `ExplosiveDamageType` -- so
autocannon/Gauss scaled against armor via `damageScale[Explosive]` not `damageScale[Ballistic]`
(distinct cells: `damageLevel += amount * damageScale[type]`). Lasers/PPCs were correct (their
`SendDamageMessage` carries the weapon damageData); only the projectile path flattened. FIX:
`BTProjectile` gains a `damageType` field, threaded from the weapon at launch through to impact
(missiles still resolve Explosive from their own type; autocannon/Gauss now Ballistic). The
missile-SPLASH template stays Explosive. [T2 verify: an autocannon mech produces type=1 DMG.]
## Damage delivery + the real damage model
`Entity::TakeDamageMessage(id, size, inflictingEntityID, zone, Damage&)``target->Dispatch`.
**Base handler IGNORES zone==1** (`Entity::TakeDamageMessageHandler`, ENTITY.cpp:878 — returns on