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

117 lines
2.8 KiB
C++

//===========================================================================//
// File: mislanch.cpp //
// Project: BattleTech Brick: Mech weapons //
// Contents: MissileLauncher -- a projectile weapon that fires missile salvos //
//---------------------------------------------------------------------------//
// 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(MISLANCH_HPP)
# include <mislanch.hpp>
#endif
#if !defined(MECH_HPP)
# include <mech.hpp>
#endif
Derivation
MissileLauncher::ClassDerivations(
ProjectileWeapon::ClassDerivations,
"MissileLauncher"
);
MissileLauncher::SharedData
MissileLauncher::DefaultData(
MissileLauncher::ClassDerivations,
Subsystem::MessageHandlers,
Subsystem::AttributeIndex,
Subsystem::StateCount
);
MissileLauncher::MissileLauncher(
Mech *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource,
SharedData &default_data
):
ProjectileWeapon(owner, subsystem_ID, subsystem_resource, default_data)
{
Check(owner);
Check_Pointer(subsystem_resource);
missileCount = subsystem_resource->missileCount;
//
// A salvo delivers missileCount missiles; split the per-shot damage across
// the salvo. (The per-missile launch mechanics live in FireWeapon, staged.)
//
if (missileCount > 0)
{
damageData.burstCount = missileCount;
damageData.damageAmount = damageData.damageAmount / (Scalar)missileCount;
}
Check_Fpu();
}
MissileLauncher::~MissileLauncher()
{
}
Logical
MissileLauncher::TestInstance() const
{
return IsDerivedFrom(ClassDerivations);
}
//
//#############################################################################
// Damage / death.
//#############################################################################
//
void
MissileLauncher::TakeDamage(Damage &damage)
{
Check(this);
ProjectileWeapon::TakeDamage(damage);
}
void
MissileLauncher::DeathReset(Logical /*full_reset*/)
{
Check(this);
}
//
// The missile-salvo discharge. Not yet reconstructed.
//
void
MissileLauncher::FireWeapon()
{
Fail("MissileLauncher::FireWeapon -- mislanch.cpp not yet reconstructed");
}
//
// Model-load-time construction. Not yet reconstructed.
//
Logical
MissileLauncher::CreateStreamedSubsystem(
ResourceFile *,
NotationFile *,
const char *,
const char *,
SubsystemResource *,
NotationFile *,
const ResourceDirectories *,
int
)
{
Fail("MissileLauncher::CreateStreamedSubsystem -- mislanch.cpp not yet reconstructed");
return False;
}