Files
TeslaRel410/restoration/source410/BT/AMMOBIN.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

146 lines
4.4 KiB
C++

//===========================================================================//
// File: ammobin.hpp //
// Project: BattleTech Brick: Mech weapons //
// Contents: AmmoBin -- an ammunition store (with cook-off heat) //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(AMMOBIN_HPP)
# define AMMOBIN_HPP
# if !defined(HEAT_HPP)
# include <heat.hpp>
# endif
//##################### Forward Class Declarations #######################
class Mech;
//###########################################################################
//###################### AmmoBin Model Resource ########################
//###########################################################################
struct AmmoBin__SubsystemResource:
public HeatWatcher::SubsystemResource
{
int ammoClassID;
int ammoModelFile;
int explosionModelFile;
int ammoCount;
Scalar feedRate;
Scalar heatPerRound;
};
//###########################################################################
//############################## AmmoBin ###############################
//###########################################################################
class AmmoBin:
public HeatWatcher
{
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
static Logical
TestClass(Mech &);
Logical
TestInstance() const;
int GetAmmoCount() const { return ammoCount; }
//
// The feed interface the ballistic fire path consumes. Ammo states
// (the 1995 feed alarm): 1 = a round is chambered/ready, 2 = EMPTY.
// FeedAmmo pulls one round (the launcher calls it on a granted shot);
// returns 0 when dry. (Feed-rate pacing + the cook-off heat source
// join with the heat wave; the launcher's own recharge already paces
// shots.)
//
enum {
AmmoLoadedState = 1,
AmmoEmptyState = 2
};
int
GetAmmoState() const
{ Check(this); return (ammoCount > 0) ? AmmoLoadedState : AmmoEmptyState; }
//
// Respawn restock: refill the magazine from the authored count.
//
virtual void
DeathReset(Logical full_reset);
int
FeedAmmo()
{
Check(this);
if (ammoCount <= 0)
{
return 0;
}
--ammoCount;
return 1;
}
public:
typedef AmmoBin__SubsystemResource SubsystemResource;
AmmoBin(
Mech *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource,
SharedData &shared_data = DefaultData
);
~AmmoBin();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Attribute Support. The shipped pool lists this class's attributes
// contiguously after the class name:
// AmmoCount TimeToReady AmmoClassID AmmoState FireCountdownStarted
// and BTL4.RES binds watchers to AmmoState and FireCountdownStarted on
// every bin. AmmoState is a *State name, so it MUST resolve to a
// StateIndicator (see RENDER-ROADMAP.NOTES.md) -- ammoAlarm below is
// one. AmmoBin chains HeatWatcher -> MechSubsystem, so the ids start
// at MechSubsystem::NextAttributeID.
//
public:
enum {
AmmoCountAttributeID = MechSubsystem::NextAttributeID,
TimeToReadyAttributeID,
AmmoClassIDAttributeID,
AmmoStateAttributeID,
FireCountdownStartedAttributeID,
NextAttributeID
};
static const IndexEntry AttributePointers[];
static AttributeIndexSet AttributeIndex;
protected:
int ammoCount;
int initialAmmoCount;
Scalar feedTimer;
Scalar feedRate;
int ammoClassID;
int ammoModelFile;
int explosionModelFile;
Scalar heatPerRound;
int cookOffArmed;
int cookOffTime;
//
// Spends the spare reserved slot rather than growing the class --
// AmmoBin has offset-sensitive neighbours.
//
int fireCountdownStarted; // was: reserved
AlarmIndicator ammoAlarm;
//
// Cook-off heat-source registration state (advanced by the heat sim).
// Reserved until the per-frame path is reconstructed.
//
int cookOffState[12];
};
#endif