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>
83 lines
1.9 KiB
C++
83 lines
1.9 KiB
C++
//===========================================================================//
|
|
// File: ammobin.cpp //
|
|
// Project: BattleTech Brick: Mech weapons //
|
|
// Contents: AmmoBin -- ammunition store with cook-off heat //
|
|
//---------------------------------------------------------------------------//
|
|
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
|
|
// All Rights reserved worldwide //
|
|
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
|
|
//===========================================================================//
|
|
|
|
#include <bt.hpp>
|
|
#pragma hdrstop
|
|
|
|
#if !defined(AMMOBIN_HPP)
|
|
# include <ammobin.hpp>
|
|
#endif
|
|
|
|
#if !defined(MECH_HPP)
|
|
# include <mech.hpp>
|
|
#endif
|
|
|
|
Derivation
|
|
AmmoBin::ClassDerivations(
|
|
HeatWatcher::ClassDerivations,
|
|
"AmmoBin"
|
|
);
|
|
|
|
AmmoBin::SharedData
|
|
AmmoBin::DefaultData(
|
|
AmmoBin::ClassDerivations,
|
|
Subsystem::MessageHandlers,
|
|
Subsystem::AttributeIndex,
|
|
Subsystem::StateCount
|
|
);
|
|
|
|
AmmoBin::AmmoBin(
|
|
Mech *owner,
|
|
int subsystem_ID,
|
|
SubsystemResource *resource,
|
|
SharedData &shared_data
|
|
):
|
|
HeatWatcher(owner, subsystem_ID, resource, shared_data),
|
|
ammoAlarm(6)
|
|
{
|
|
Check(owner);
|
|
Check_Pointer(resource);
|
|
|
|
ammoCount = resource->ammoCount;
|
|
initialAmmoCount = resource->ammoCount;
|
|
feedRate = resource->feedRate;
|
|
feedTimer = 0.0f;
|
|
ammoClassID = resource->ammoClassID;
|
|
ammoModelFile = resource->ammoModelFile;
|
|
explosionModelFile = resource->explosionModelFile;
|
|
heatPerRound = resource->heatPerRound;
|
|
cookOffArmed = 0;
|
|
cookOffTime = 0;
|
|
reserved = 0;
|
|
|
|
for (int i = 0; i < 12; ++i)
|
|
{
|
|
cookOffState[i] = 0;
|
|
}
|
|
|
|
Check_Fpu();
|
|
}
|
|
|
|
AmmoBin::~AmmoBin()
|
|
{
|
|
}
|
|
|
|
Logical
|
|
AmmoBin::TestClass(Mech &)
|
|
{
|
|
return True;
|
|
}
|
|
|
|
Logical
|
|
AmmoBin::TestInstance() const
|
|
{
|
|
return IsDerivedFrom(ClassDerivations);
|
|
}
|