Three-trigger keyboard weapon groups: 1=lasers 2=PPCs 3=missiles (task #43)

Interim pod-like grouping ahead of the authentic ConfigureMappables/
ChooseButton mapper channels (decomp-anchored in open-questions):
- Three fire channels like three pod buttons: gBTWeaponTrigger (lasers,
  key 1 or SPACE), gBTPPCTrigger (PPCs, key 2), gBTMissileTrigger
  (missiles, key 3 or CTRL). Keyboard only per user (mouse buttons
  removed).
- EmitterSimulation picks its channel by classID (PPC 3028 vs Emitter
  3016); BT_AUTOFIRE holds all three.
- The BT_BEAM_LOG sampler modulus 30 aliased to ONE weapon under the
  new synchronized 5-beam volleys (5 | 30) -> 31 (coprime).

Verified: all 5 energy weapons fire (31 samples each), aimed hits land,
kill completes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-09 08:31:16 -05:00
co-authored by Claude Fable 5
parent ae8aca0f3f
commit 14c0dd06f5
3 changed files with 42 additions and 29 deletions
+8 -3
View File
@@ -267,12 +267,17 @@ void
PoweredSubsystem::PoweredSubsystemSimulation(time_slice);
// E8 (bring-up trigger): write the weapon's fireImpulse from the player fire input
// (the controls mapper is bypassed). gBTWeaponTrigger is pulsed per-FRAME by mech4
// (the controls mapper is bypassed). The triggers are pulsed per-FRAME by mech4
// (1,0,1,0...) so CheckFireEdge sees clean rising edges for repeated auto-fire under a
// held/forced trigger. HasActiveTarget (E3) limits firing to the mech with a locked
// target (the player) -- enemy emitters read this too but never fire (no target).
extern int gBTWeaponTrigger;
fireImpulse = (Scalar)gBTWeaponTrigger;
// WEAPON GROUPS (task #43, interim keyboard split standing in for the authentic
// ConfigureMappables/ChooseButton mapper channels): lasers (0xBC8=3016) and PPCs
// (0xBD4=3028) read SEPARATE fire channels, like two pod buttons.
extern int gBTWeaponTrigger; // channel 1: lasers
extern int gBTPPCTrigger; // channel 2: PPCs
fireImpulse = (Scalar)(((int)GetClassID() == 3028) ? gBTPPCTrigger
: gBTWeaponTrigger);
Logical fireEdge = CheckFireEdge(); // @004b9608
targetWithinRange = UpdateTargeting(); // @004b9bdc -> this+0x34c