The base all ~30 mech subsystems derive from. Reconstructed against the 4.10 structure per the MECHSUB.NOTES analysis (NOT backdated from BT411's divergent version): - Header: expanded with the real mech-specific member set (statusAlarm = AlarmIndicator, vitalSubsystem, alarmModel, criticalReference, collisionCriticalHitWeight, printSimulationState, configureActivePress, resource). Dropped the speculative MessageHandlers static -- MechSubsystem reuses the base Subsystem sets (inherited Simulation handlers/attrs/statecount). - CPP: statics (ClassDerivations/DefaultData), both ctors (light name+classID and resource), dtor, TestClass/TestInstance, and the damage API on the 4.10 per-type model -- GetSubsystemDamageLevel/SetSubsystemDamageLevel read/write the real DamageZone::damageLevel [0,1]; ForceCriticalFailure; TakeDamage delegates to the zone. Both ctors build the damage zone the base leaves NULL. Deferred (documented): the Mech__DamageZone per-type armour STREAM wiring (ctors use a trivial armour-free base DamageZone placeholder for now) and CreateStreamedSubsystem (model-load stream format). These are refinements above the ctor frontier, not boot blockers. Compile-verified (BT: 24 ok); full tree still links clean. Next: the subsystem roster (GAUSS/PPC/SENSOR source + .TCP partials + decomp). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
160 lines
4.3 KiB
C++
160 lines
4.3 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;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Status model
|
|
//
|
|
public:
|
|
enum TechStatusType {
|
|
Destroyed = 0,
|
|
Damaged = 1,
|
|
CoolantLeaking = 2,
|
|
Overheating = 3,
|
|
AmmoBurning = 4,
|
|
Jammed = 5,
|
|
BadPower = 6,
|
|
TechStatusTypeCount
|
|
};
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// 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();
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Local Data
|
|
//
|
|
protected:
|
|
Mech
|
|
*owner;
|
|
AlarmIndicator
|
|
statusAlarm;
|
|
Logical
|
|
vitalSubsystem;
|
|
ResourceDescription::ResourceID
|
|
alarmModel;
|
|
Scalar
|
|
criticalReference;
|
|
Scalar
|
|
collisionCriticalHitWeight;
|
|
Logical
|
|
printSimulationState;
|
|
int
|
|
configureActivePress;
|
|
SubsystemResource
|
|
*resource;
|
|
};
|
|
|
|
#endif
|