Files
TeslaRel410/restoration/source410/BT/PROJWEAP.CPP
T
CydandClaude Fable 5 1cab46ae72 Mech phase 2: reconstruct ProjectileWeapon + MissileLauncher + AmmoBin -- weapon family complete
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>
2026-07-20 00:27:08 -05:00

91 lines
2.3 KiB
C++

//===========================================================================//
// File: projweap.cpp //
// Project: BattleTech Brick: Mech weapons //
// Contents: ProjectileWeapon -- ballistic (ammo-fed) weapon base //
//---------------------------------------------------------------------------//
// 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(PROJWEAP_HPP)
# include <projweap.hpp>
#endif
#if !defined(MECH_HPP)
# include <mech.hpp>
#endif
Derivation
ProjectileWeapon::ClassDerivations(
MechWeapon::ClassDerivations,
"ProjectileWeapon"
);
ProjectileWeapon::SharedData
ProjectileWeapon::DefaultData(
ProjectileWeapon::ClassDerivations,
Subsystem::MessageHandlers,
Subsystem::AttributeIndex,
Subsystem::StateCount
);
ProjectileWeapon::ProjectileWeapon(
Mech *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource,
SharedData &shared_data
):
MechWeapon(owner, subsystem_ID, subsystem_resource, shared_data),
ammoBinLink()
{
Check(owner);
Check_Pointer(subsystem_resource);
tracerInterval = subsystem_resource->tracerInterval;
minTimeOfFlight = subsystem_resource->minTimeOfFlight;
minJamChance = subsystem_resource->minJamChance;
minVoltagePercentToFire = subsystem_resource->minVoltagePercentToFire;
tracerCounter = 0;
ejectState = 0;
totalTimeToEject = 0.0f;
timeToEject = 0.0f;
percentOfEject = 0.0f;
tracerModelHandle = 0;
leadPosition = Point3D(0.0f, 0.0f, 0.0f);
launchVelocity = Vector3D(0.0f, 0.0f, 0.0f);
tracerOrigin = Vector3D(0.0f, 0.0f, 0.0f);
Check_Fpu();
}
ProjectileWeapon::~ProjectileWeapon()
{
}
Logical
ProjectileWeapon::TestClass(Mech &)
{
return True;
}
Logical
ProjectileWeapon::TestInstance() const
{
return IsDerivedFrom(ClassDerivations);
}
//
// The ballistic discharge (ammo feed, jam roll, tracer, projectile spawn).
// Not yet reconstructed.
//
void
ProjectileWeapon::FireWeapon()
{
Fail("ProjectileWeapon::FireWeapon -- projweap.cpp not yet reconstructed");
}