ProjectileWeapon (: MechWeapon) -- ballistic (ammo-fed) base: ammo-bin link,
tracer/eject/jam/lead members. MissileLauncher (: ProjectileWeapon) -- salvo
launcher, using the surviving CODE MISLANCH.HPP (missileCount + per-salvo damage
split). AmmoBin (: HeatWatcher) -- ammo store with cook-off heat. All ctors chain
their parents + init from resource; fire paths staged.
Weapon family now COMPLETE: MechWeapon -> {Emitter -> PPC, GaussRifle;
ProjectileWeapon -> MissileLauncher} + AmmoBin. The surviving PPC.CPP/GAUSS.CPP
link against the reconstructed Emitter base. BT: 36 ok.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
86 lines
2.5 KiB
C++
86 lines
2.5 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; }
|
|
|
|
public:
|
|
typedef AmmoBin__SubsystemResource SubsystemResource;
|
|
|
|
AmmoBin(
|
|
Mech *owner,
|
|
int subsystem_ID,
|
|
SubsystemResource *subsystem_resource,
|
|
SharedData &shared_data = DefaultData
|
|
);
|
|
~AmmoBin();
|
|
|
|
protected:
|
|
int ammoCount;
|
|
int initialAmmoCount;
|
|
Scalar feedTimer;
|
|
Scalar feedRate;
|
|
int ammoClassID;
|
|
int ammoModelFile;
|
|
int explosionModelFile;
|
|
Scalar heatPerRound;
|
|
int cookOffArmed;
|
|
int cookOffTime;
|
|
int 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
|