Files
TeslaRel410/restoration/source410/BT/PROJWEAP.HPP
T
CydandClaude Fable 5 57507cb15c BT410 Phase 5.3.10: power/heat wave -- the thermal + electrical economy is LIVE
Weapons dump firing heat into their own sinks, sinks conduct through the
Condenser bank into the central HeatSink, temperatures drive the degradation/
failure alarms, and every powered subsystem tracks its generator through the
electrical state machine. Verified: the authentic fire-discipline game -- a PPC
spikes 77->709K per shot, relaxes to 441K across its 5s reload, and sustained
fire climbs 441->674->838->960K, brushing the authored 1000K degradation
threshold. All calibration values match the BT411 audit exactly (central bank
1.39e6, PPC sink 174000, thresholds 77/1000/2000).

- HEAT: HeatSinkSimulation (@004ad924 absorb->T->load->conduct->alarm),
  ConductHeat/ComputeHeatFlow (@004ad8ac/@004ad9ec two-body equilibrium
  relaxation; flow==0 exactly at uniform T), UpdateHeatLoad (15-sample filter);
  heat-state enum + accessors; installed by the HeatSink ctor.
- WIRE-VERIFIED: HeatSink resource gains linkedSinkIndex -- THE missing
  ancestry int that shifted every descendant block +1 (voltageSourceIndex had
  been reading the linked-sink index: "power sources" appeared to be
  Condensers). Conduction topology wired from it at construction:
  weapons->Condensers1-6->central; Generators->Condensers; Reservoir->central.
- MECHWEAP resource: authentic pip tail (pipPosition int + pipColor 3 floats +
  pipExtendedRange int) per the BT411 verified overlay; with linkedSinkIndex
  this closes the whole +3 alignment mystery (ProjectileWeapon pad deleted).
  True bhk1 reads: PPC recharge 5.0s (not 1.0), discharge 0.99s, range 900.
- POWERSUB: ctor resolves voltageSourceIndex -> GeneratorA-D (wire-verified),
  taps via Generator::TapVoltageSource (-1 when full); PoweredSubsystemSimulation
  (@004b0bd0) electrical FSM (Starting/NoVoltage/Shorted/GeneratorOff/Ready);
  GeneratorSimulation partial (start/short-recovery timers).
- Weapons: power step at sim head; Loading recharge gated on electrical Ready
  (authentic @4bbdf5); FireWeapon dumps firing heat. HEAT UNITS: the chain is
  1e7-native with TWO authoring conventions -- energy weapons store small
  (PPC=11, x1e7 from the energy algebra), ballistics store native (SRM6=5.06e7,
  dumped raw; double-scaling it was the bring-up runaway-temperature bug).
- SENSOR: authentic gating (@004b1c4c) -- power step, electrical-Ready gate,
  heat-state switch (Degradation x0.5 / Failure 0). Verified Ready + 100%.

Deferred: coolant depletion/venting, the novice HeatModelOff gate, the charge
model (TrackSeekVoltage/voltage sag/I2R), weapon gate 1 + jam roll, the central
sink's forward-linked drain. Zero Fail across fire + neutral runs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 23:55:48 -05:00

110 lines
3.3 KiB
C++

//===========================================================================//
// File: projweap.hpp //
// Project: BattleTech Brick: Mech weapons //
// Contents: ProjectileWeapon -- the ballistic (ammo-fed) weapon base //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(PROJWEAP_HPP)
# define PROJWEAP_HPP
# if !defined(MECHWEAP_HPP)
# include <mechweap.hpp>
# endif
# if !defined(POINT3D_HPP)
# include <point3d.hpp>
# endif
//##################### Forward Class Declarations #######################
class Mech;
//###########################################################################
//################ ProjectileWeapon Model Resource #####################
//###########################################################################
//
// WIRE-VERIFIED layout (raw-stream dump, TEST.EGG SRM6s): tracerInterval
// reads 1, ammoBinIndex the true bin roster slot (27/29), minTimeOfFlight
// 0.5, minVoltagePercentToFire 0.3, minJamChance 0.05, and
// MissileLauncher's missileCount lands on 6 (an SRM6!). (The interim
// alignment pad is gone -- the ancestry shortfall was the HeatSink
// linkedSinkIndex + the MechWeapon pip tail, both now real fields.)
//
struct ProjectileWeapon__SubsystemResource:
public MechWeapon::SubsystemResource
{
int tracerInterval;
int ammoBinIndex;
Scalar minTimeOfFlight;
Scalar minVoltagePercentToFire;
Scalar minJamChance;
};
//###########################################################################
//######################### ProjectileWeapon ###########################
//###########################################################################
class ProjectileWeapon:
public MechWeapon
{
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
static Logical
TestClass(Mech &);
Logical
TestInstance() const;
virtual void
FireWeapon();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Per-frame simulation (the ballistic fire state machine).
//
public:
typedef void
(ProjectileWeapon::*Performance)(Scalar time_slice);
void
SetPerformance(Performance performance)
{
Check(this);
activePerformance = (Simulation::Performance)performance;
}
void
ProjectileWeaponSimulation(Scalar time_slice);
public:
typedef ProjectileWeapon__SubsystemResource SubsystemResource;
ProjectileWeapon(
Mech *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource,
SharedData &shared_data = DefaultData
);
~ProjectileWeapon();
protected:
SubsystemConnection ammoBinLink;
int tracerInterval;
int tracerCounter;
int ejectState;
Scalar totalTimeToEject;
Scalar timeToEject;
Scalar percentOfEject;
Scalar minJamChance;
Scalar minTimeOfFlight;
Scalar minVoltagePercentToFire;
Vector3D launchVelocity;
Vector3D tracerOrigin;
Point3D leadPosition;
int tracerModelHandle;
};
#endif