//===========================================================================// // File: missile.hpp // // Project: BattleTech // // Contents: Implementation details for missiles // //---------------------------------------------------------------------------// // Date Who Modification // // -------- --- ---------------------------------------------------------- // // // //---------------------------------------------------------------------------// // Copyright (C) 1995, Virtual World Entertainment, Inc. // // All Rights reserved worldwide // // This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL // //===========================================================================// // // STAGED header -- no missile.hpp survives (only the MISSILE.TCP fragment). // Interface reconstructed from the binary (ctor @004bf5b4, integrator // @004bef78, vtable @00512f2c, 0x368 bytes) and the surviving SEEKER.HPP / // MISTHRST.HPP that name the two hosted subsystems. See MISSILE.NOTES.md. // #if !defined(MISSILE_HPP) # define MISSILE_HPP # if !defined(PROJTILE_HPP) # include # endif # if !defined(DAMAGE_HPP) # include # endif //##################### Forward Class Declarations ####################### class Mech; class Seeker; class MissileThruster; //########################################################################### //############################## Missile ################################ //########################################################################### class Missile: public Projectile { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Shared Data Support // public: static Derivation ClassDerivations; static SharedData DefaultData; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Subsystem roster (ctor build order @004bf5b4: Seeker first, // MissileThruster second -- MISSILE.TCP's GetSubsystem indices). // public: enum { SeekerSubsystem = 0, MissileThrusterSubsystem = 1, SubsystemCount = 2 // binary this[0x49] == 2 }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Model Support // public: typedef void (Missile::*Performance)(Scalar time_slice); // // @004bef78 -- the per-frame integrate-guidance-and-collide pass: // age the round, re-lead the target (Seeker), bleed the thruster // burn, steer + integrate, then the proximity fuse / lifetime // retire. // void MoveAndCollide(Scalar time_slice); void SetPerformance(Performance performance) { Check(this); activePerformance = (Simulation::Performance)performance; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Construction and Destruction // public: typedef Projectile::MakeMessage MakeMessage; static Missile* Make(MakeMessage *creation_message); Missile( MakeMessage *creation_message, SharedData &shared_data = DefaultData ); ~Missile(); // // Flight seed, called by the launcher right after construction: the // launcher link (the inflictor carried into the hit), the homing // target, the salvo-split cluster damage record, and the launch // speed. Builds the Seeker/MissileThruster roster (the binary's // spawn descriptor carried these into the ctor; our MakeMessage // doesn't, so the roster waits for the target). // void Launch( Mech *launcher, Entity *target, Damage &damage, Scalar launch_speed ); Logical TestInstance() const; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Resource creation // public: static ResourceDescription::ResourceID CreateModelResource( ResourceFile *resource_file, const char *model_name, NotationFile *model_file, const ResourceDirectories *directories ); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Local Data (binary offsets past the Projectile base: 0x340..0x364) // protected: Scalar lifetime; // @0x340 max time-of-flight Scalar ageFraction; // @0x344 age/lifetime, clamped 1.0 Scalar age; // @0x35c accumulated flight time int detonationFlag; // @0x364 proximity/contact mode // // Staged flight state (the binary keeps these in the Entity motion // block; named members until the raw-offset motion wave). // Vector3D flightVelocity; Scalar fuseRadius; EntityID launcherEntityID; Damage damageData; int telemetryCountdown; }; #endif