HUD ironing (task #38): authentic Lock producer + simple-X mode

- LOCK rules transcribed from the exported HudSimulation
  (part_013.c:5619-5634): lock requires a target AND your own HUD host
  zone damage < 0.75 (_DAT_004b7ec4 -- a shot-up targeting computer
  drops lock) AND the targeted zone damage < 1.0 (_DAT_004b7ec8;
  whole-mech target checks zone 0 -- a wreck's dead zone can't
  re-lock). Box and ring are now separate signals like the binary:
  gBTHudLockState 1 = target held (hotbox draws), 2 = LOCKED (+ the
  spinning ring).
- SIMPLE-X mode: the ctor's [0x99] minimal-reticle list transcribed
  (@4689-4705: green +-0.02..0.08 cross on the aim translate); Draw
  switches master <-> simple X on the PrimaryHudOn element bit (0x20),
  completing the recovered Execute's state-list logic.
- Canopy diagnosis sharpened (open-questions): blx_cop is the torso
  segment's inside-skeleton mesh enclosing the eye; the black box =
  the skeleton render branch missing its texture + PUNCH cutout (the
  canopy windows are punch texels). A rendering-branch task; stays
  hidden by default.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-08 23:12:58 -05:00
co-authored by Claude Fable 5
parent 18d49491b7
commit 24ea7f13af
5 changed files with 82 additions and 14 deletions
+29 -1
View File
@@ -563,6 +563,7 @@ float gBTHudHeading = 0.0f;
float gBTHudTwist = 0.0f;
float gBTHudTwistLimit = 0.0f;
int gBTHudGroupMask = 0xF;
int gBTHudPrimary = 1; // PrimaryHudOn (element mask 0x20): full HUD vs simple X
// BT_GOTO beeline harness outputs (consumed by the mapper bridge, mechmppr.cpp)
int gBTGotoActive = 0;
float gBTGotoTurn = 0.0f;
@@ -2383,10 +2384,36 @@ void
float hddx = dp.x - localOrigin.linearPosition.x;
float hddz = dp.z - localOrigin.linearPosition.z;
BTSetHudTargetRange((Scalar)sqrtf(hddx*hddx + hddz*hddz));
gBTHudLockState = 2; // locked == crosshair on it
gBTHudLockWorld[0] = dp.x; // the HOTBOX point: top-centre
gBTHudLockWorld[1] = dp.y + (float)dm->CylinderReferenceHeight();
gBTHudLockWorld[2] = dp.z;
// AUTHENTIC LOCK (HudSimulation, part_013.c:5619-5634 [T1]):
// the fire-control LOCK needs (a) a working targeting computer
// -- your own HUD's host zone below 75% damage -- and (b) a
// live targeted zone -- its damage below 1.0 (a whole-mech
// target checks zone 0). So a shot-up cockpit loses the lock
// light, and a destroyed wreck's dead zone can't be re-locked.
int lock = 1;
{
MechSubsystem *hud = (MechSubsystem *)GetHudSubsystem();
if (hud != 0 && hud->GetDamageZoneProxy() != 0)
{
Mech__DamageZone *hz =
(Mech__DamageZone *)hud->GetDamageZoneProxy();
if (hz->damageLevel >= 0.75f) // _DAT_004b7ec4
lock = 0;
}
int tz = MECH_TARGET_SUBIDX(this);
if (tz < 0) tz = 0; // whole-mech -> zone 0
if (lock && tz < dm->damageZoneCount && dm->Zone(tz) != 0
&& dm->Zone(tz)->damageLevel >= 1.0f) // _DAT_004b7ec8
lock = 0;
}
// 1 = target held (hotbox draws); 2 = LOCKED (box + spin ring).
// The binary keeps these separate: the box follows HotBoxVector,
// the ring follows the Lock attr.
gBTHudLockState = lock ? 2 : 1;
}
else
{
@@ -2398,6 +2425,7 @@ void
gBTHudTwist = (float)TorsoHeading(); // RotationOfTorsoHorizontal (attr 4)
gBTHudTwistLimit = (float)GetHorizontalFiringReach();// HorizontalTorsoLimit (attrs 5/6)
gBTHudGroupMask = (int)targetReticle.reticleElementMask & 0xF;
gBTHudPrimary = ((int)targetReticle.reticleElementMask & 0x20) != 0;
}
if (gEnemyMech != 0)