The heat economy now bites back, verified under sustained fire: - Ballistic gate 1 (@4bbd36): destroyed-state or own-sink FailureHeat pins full recoil + the unavailable alarm (the NoAmmo roach-motel re-asserts). - CheckForJam (@4bbfcc): p = 0.41*T/failT clamped [minJamChance, 1.0], rolled per granted shot against the MUNGA uniform Random. Interim heat-degraded gate stands in for the deferred LiveFireEnabled novice switch (the exact spurious-cold-jam trap the BT411 port documented). VERIFIED: SRM6s jam at T~1200-1320 after riding past the authored 1000-degree threshold, and stay jammed (mission-reset recovery only) -- authentic. - Emitter hard gate (@4baab9): FailureHeat drops the beam state + charge each frame; SELF-RECOVERING once conduction cools the sink below failure. VERIFIED: the PPC settles into an emergent thermal duty cycle -- fire at ~1930K, spike to 2562K, shutdown, cool, refire -- firing exactly as fast as its sink sheds heat; the lasers oscillate around ~2200K. Zero Fail. Deferred: LiveFireEnabled/HeatModelOff experience gates, mech-disabled gate halves, coolant depletion, jam recovery via mission reset. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
112 lines
3.4 KiB
C++
112 lines
3.4 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);
|
|
Logical
|
|
CheckForJam();
|
|
|
|
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
|