Files
TeslaRel410/restoration/source410/BT/MECHSUB.HPP
T
CydandClaude Fable 5 4168f1ad4d BT410 5.3.47: the whole authored watcher set is published -- cockpit renders in the pod
Ladder rungs, each run-verified on the pod rig: ReportLeak (HeatSink),
GeneratorOn (Generator -- member existed, publication missing),
ConfigureActivePress (MechSubsystem -- likewise), AmmoState +
FireCountdownStarted + the rest of the AmmoBin table.

THE PINNED RANGE IS NOW THE AUTHENTIC SHAPE.  Publishing ReportLeak on
HeatSink and ConfigureActivePress on MechSubsystem shifts the chain down two,
and MechWeapon's bridge to its binary-pinned PercentDone (0x12) collapses
from THREE guessed pads to ONE -- which is exactly the arithmetic the shipped
string pool predicts (MechSubsystem 1, HeatableSubsystem 3, HeatSink 6,
PoweredSubsystem 5).  Three pads of guesswork replaced by a real attribute
and a real base-class row.  HeatableSubsystem and Torso rebase onto
MechSubsystem::AttributeIndex; MechControlsMapper does not (it derives from
Subsystem directly).

Types were chosen deliberately this time, per the AudioWatcher families the
engine instantiates (Motion / Hinge / Scalar / StateIndicator): every *State
name resolves to a StateIndicator, ReportLeak is a Scalar.

RESULT: the pod run now gets past every authored watcher and DRAWS THE FULL
COCKPIT -- sensor cluster, myomers, cooling, the weapon panels, kills/deaths
-- with the board booted and audio running.  It then exits without flushing
its redirected stdout, so the exit reason is not yet known; next step is a
run with the redirect removed so the console is readable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 08:09:56 -05:00

225 lines
7.0 KiB
C++

//===========================================================================//
// File: mechsub.hpp //
// Project: BattleTech //
// Contents: Implementation details for mech subsystems //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(MECHSUB_HPP)
# define MECHSUB_HPP
# if !defined(SUBSYSTM_HPP)
# include <subsystm.hpp>
# endif
# if !defined(ALARM_HPP)
# include <alarm.hpp>
# endif
//##################### Forward Class Declarations #######################
class Mech;
class Damage;
//###########################################################################
//#################### MechSubsystem Model Resource #####################
//###########################################################################
struct MechSubsystem__SubsystemResource:
public Subsystem::SubsystemResource
{
Scalar armorByFacing[5];
Scalar structureReference;
int vitalSubsystemIndex;
char videoObjectName[128];
ResourceDescription::ResourceID
alarmModel;
int alarmModelReserved[2];
int printSimulationState;
Scalar collisionCriticalHitWeight;
Scalar criticalReference;
};
//###########################################################################
//########################## MechSubsystem ##############################
//###########################################################################
class MechSubsystem:
public Subsystem
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared Data Support
//
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Attribute Support. The shipped pool puts ConfigureActivePress
// immediately after the class name MechSubsystem, i.e. it is this
// class's one attribute and the FIRST id past Subsystem's. BTL4.RES
// binds it on Avionics, Myomers and every weapon -- all of which chain
// through here. The member has been in this class all along; only the
// publication was missing.
//
// Everything downstream shifts by one, which is the AUTHENTIC shape:
// with this row in place MechWeapon needs exactly ONE bridging pad to
// land PercentDone on its binary-pinned 0x12 (it needed three before
// ReportLeak and this were published).
//
public:
enum {
ConfigureActivePressAttributeID = Subsystem::NextAttributeID, // 2
NextAttributeID // 3
};
static const IndexEntry AttributePointers[];
static AttributeIndexSet AttributeIndex;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Status model
//
public:
enum TechStatusType {
Destroyed = 0,
Damaged = 1,
CoolantLeaking = 2,
Overheating = 3,
AmmoBurning = 4,
Jammed = 5,
BadPower = 6,
TechStatusTypeCount
};
//
// The subsystem SIMULATION states (binary PrintState @4ac8c0 string
// pool: "Destroyed" @0050df7f, "Exploding" @0050df8c). DestroyedState
// (1) is the hard-failure gate every weapon simulation checks
// (`GetSimulationState() == 1` -- emitter @4baab9, ballistic @4bbd36).
//
enum {
DestroyedState = Simulation::DefaultState + 1,
ExplodingState,
MechSubsystemStateCount
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Test Class Support
//
public:
static Logical
TestClass(Mech &);
Logical
TestInstance() const;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction and Destruction
//
public:
typedef MechSubsystem__SubsystemResource SubsystemResource;
MechSubsystem(
Mech *owner,
int subsystem_ID,
const char *subsystem_name,
RegisteredClass::ClassID class_id,
SharedData &shared_data = DefaultData
);
MechSubsystem(
Mech *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource,
SharedData &shared_data = DefaultData
);
~MechSubsystem();
static int
CreateStreamedSubsystem(
NotationFile *model_file,
const char *model_name,
const char *subsystem_name,
SubsystemResource *subsystem_resource,
NotationFile *subsystem_file,
const ResourceDirectories *directories,
int passes = 1
);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Damage support
//
public:
virtual void
TakeDamage(Damage &damage);
Scalar
GetSubsystemDamageLevel() const;
void
SetSubsystemDamageLevel(Scalar level);
void
ForceCriticalFailure();
//
// Critical-hit application (binary @4ac07c): run the damage through
// TakeDamage and return how much the subsystem's own zone level
// actually moved (the crit accountant charges it against the entry's
// damagePercentage allotment).
//
Scalar
ApplyDamageAndMeasure(Damage &damage);
Logical
IsVitalSubsystem() const { Check(this); return vitalSubsystem; }
//
// The respawn restore (engine base virtual, SUBSYSTM.HPP:184 -- the
// pair with DeathShutdown). Mech::Reset sweeps every roster slot;
// the base heals the subsystem's private zone and clears the
// Destroyed simulation state (the weapon hard gate). full_reset is
// the binary's reset_command (every recovered override ignores it).
//
virtual void
DeathReset(Logical full_reset);
//
// The NOVICE-experience lockout predicate (binary @4ac9c8): a novice
// pilot's advanced cockpit controls (condenser valves, coolant flush,
// cooling toggles) are locked out. Owner mech -> playerLink ->
// experience level == novice. Unlinked mechs read UNLOCKED.
//
Logical
NoviceLockout();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Local Data
//
protected:
Mech
*owner;
AlarmIndicator
statusAlarm;
Logical
vitalSubsystem;
ResourceDescription::ResourceID
alarmModel;
Scalar
criticalReference;
Scalar
collisionCriticalHitWeight;
Logical
printSimulationState;
int
configureActivePress;
SubsystemResource
*resource;
};
#endif