The last eight stubs plus the two chain layers they actually need (PoweredSubsystem @004b13ac and ProjectileWeapon @004bc7cc were DECLARED in our headers all along -- only their definitions were missing). These are the notation->stream converters the 1995 authoring pipeline ran; missions read prebuilt streams and never call them, so the verification standard is compile + link + the raw decomp's key fingerprints -- and those fingerprints convicted the donors three more times: - The heat chain: Condenser, Reservoir AND PoweredSubsystem all chain ONE shared parser (@004ae150, reconstructed in full from the decomp -- the BT411 donor's body was its own TODO stub with a miscited address). It reads the five thermal scalars and the conduction-graph link (the linkedSinkIndex our wire-format work dump-verified from the runtime side, with the +2 segment-table bias), and HeatSink adds no keys of its own. - The Emitter's SeekVoltage LADDER is a notation ENTRY LIST walked in file order (curve rungs in sequence, the RecommendedIndex entry by name); the donor flattened it to one keyed read, which would author one-rung ladders against the runtime's real five-rung ones. MakeEntryList/GetFirstEntry is the engine's own idiom. - PipColor and MuzzleVelocity parse through the engine's authentic Convert_From_Ascii overloads (RGBColor / Vector3D); the donors' sscanf substitutes were port drift. Explosion and alarm models resolve as model FAMILIES (ModelListResourceType == the literal 1 in the binary; the donor comment calling it GameModelResourceType was wrong-name-right-number). Entry reads target the SUBSYSTEM notation file -- the decomp's fifth argument at every site; several donors wrote model_file. Class IDs stamp through OUR reader's enum symbols (they parse the real BTL4.RES streams today, and the 3000-base enum lands exactly on the binary's 0xBBB.. ids; 0x0BCD is the weapon-base stamp every concrete leaf overwrites). Stubs: NONE. Every function in restoration/source410 now has a body. Mission soak clean. Remaining reconstruction is depth, not holes: the mech4/mech3 archaeology (IntegrateMotion, the master-perf disasm, the stream builders that seed the 0xC/0x100 flags), HUD blocks 4-6, and the live networked/rig verifications queued for when a pod is available. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
143 lines
4.3 KiB
C++
143 lines
4.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);
|
|
Logical
|
|
CheckForJam();
|
|
|
|
//
|
|
// The "sim live" novice lockout (the owning BTPlayer's simLive
|
|
// experience flag): novice ballistics never jam.
|
|
//
|
|
Logical
|
|
LiveFireEnabled();
|
|
|
|
public:
|
|
typedef ProjectileWeapon__SubsystemResource SubsystemResource;
|
|
|
|
//
|
|
// The authoring-side stream converter (binary @004bc7cc); defined in
|
|
// projweap.cpp.
|
|
//
|
|
static int
|
|
CreateStreamedSubsystem(
|
|
ResourceFile *resource_file,
|
|
NotationFile *model_file,
|
|
const char *model_name,
|
|
const char *subsystem_name,
|
|
SubsystemResource *subsystem_resource,
|
|
NotationFile *subsystem_file,
|
|
const ResourceDirectories *directories,
|
|
int passes = 1
|
|
);
|
|
|
|
ProjectileWeapon(
|
|
Mech *owner,
|
|
int subsystem_ID,
|
|
SubsystemResource *subsystem_resource,
|
|
SharedData &shared_data = DefaultData
|
|
);
|
|
~ProjectileWeapon();
|
|
|
|
//
|
|
// The linked bin's round count, or -1 when no bin is linked. The
|
|
// cockpit's ammo readout needs this from BT_L4 and the link itself
|
|
// is protected (the binary read the resolved bin's count direct).
|
|
//
|
|
int
|
|
GetAmmoCount();
|
|
|
|
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
|