VESSEL.H (6536B)
1 // 2 // Copyright 2020 Electronic Arts Inc. 3 // 4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 5 // software: you can redistribute it and/or modify it under the terms of 6 // the GNU General Public License as published by the Free Software Foundation, 7 // either version 3 of the License, or (at your option) any later version. 8 9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 10 // in the hope that it will be useful, but with permitted additional restrictions 11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 12 // distributed with this program. You should have received a copy of the 13 // GNU General Public License along with permitted additional restrictions 14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection 15 16 /* $Header: /CounterStrike/VESSEL.H 1 3/03/97 10:26a Joe_bostic $ */ 17 /*********************************************************************************************** 18 *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S *** 19 *********************************************************************************************** 20 * * 21 * Project Name : Command & Conquer * 22 * * 23 * File Name : VESSEL.H * 24 * * 25 * Programmer : Joe L. Bostic * 26 * * 27 * Start Date : 03/13/96 * 28 * * 29 * Last Update : March 13, 1996 [JLB] * 30 * * 31 *---------------------------------------------------------------------------------------------* 32 * Functions: * 33 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 34 35 #ifndef VESSEL_H 36 #define VESSEL_H 37 38 #include "drive.h" 39 #include "radio.h" 40 #include "cargo.h" 41 #include "mission.h" 42 #include "target.h" 43 44 class VesselClass : public DriveClass 45 { 46 public: 47 /* 48 ** This points to the controling static characteristic data associated with 49 ** this vessel. 50 */ 51 CCPtr<VesselTypeClass> Class; 52 53 /* 54 ** Has this sea vessel been told to move to a shipyard? If so, then 55 ** when we get there, start the repair process. 56 */ 57 unsigned IsToSelfRepair:1; 58 59 /* 60 ** Is this sea vessel parked next to a shipyard/subpen, and therefore 61 ** in the special self-repair mode? 62 */ 63 unsigned IsSelfRepairing:1; 64 65 /* 66 ** If this is an LST, is it time to shut the door? 67 */ 68 CDTimerClass<FrameTimerClass> DoorShutCountDown; 69 70 /* 71 ** If this is a sub, has the sonar pulse worn off, such that we can 72 ** re-submerge? 73 */ 74 CDTimerClass<FrameTimerClass> PulseCountDown; 75 76 VesselClass(VesselType classid, HousesType house); 77 VesselClass(NoInitClass const & x) : DriveClass(x), Class(x), SecondaryFacing(x) {}; 78 static void * operator new(size_t size); 79 static void * operator new(size_t , void * ptr) {return(ptr);}; 80 static void operator delete(void *ptr); 81 operator VesselType(void) const {return Class->Type;}; 82 83 static void Init(void); 84 85 virtual ~VesselClass(void); 86 virtual ObjectTypeClass const & Class_Of(void) const; 87 88 virtual MZoneType Zone_Check_Type(void) const {return(MZONE_WATER);} 89 int Shape_Number(void) const; 90 void Rotation_AI(void); 91 void Combat_AI(void); 92 bool Edge_Of_World_AI(void); 93 void Repair_AI(void); 94 virtual DirType Turret_Facing(void) const {if (Class->IsTurretEquipped) return(SecondaryFacing.Current());return(PrimaryFacing.Current());} 95 virtual bool Start_Driver(COORDINATE & headto); 96 virtual int Mission_Retreat(void); 97 virtual int Mission_Unload(void); 98 void LST_Open_Door(void); 99 void LST_Close_Door(void); 100 virtual FireDataType Fire_Data(int) const; 101 virtual COORDINATE Fire_Coord(int which) const; 102 virtual MoveType Can_Enter_Cell(CELL cell, FacingType from=FACING_NONE) const; 103 virtual void Draw_It(int x, int y, WindowNumberType window) const; 104 virtual short const * Overlap_List(bool redraw=false) const; 105 virtual DirType Desired_Load_Dir(ObjectClass * passenger, CELL & moveto) const; 106 virtual RadioMessageType Receive_Message(RadioClass * from, RadioMessageType message, long & param); 107 virtual void AI(void); 108 virtual void Per_Cell_Process(PCPType why); 109 virtual void Assign_Destination(TARGET target); 110 virtual int Pip_Count(void) const; 111 112 virtual ResultType Take_Damage(int & damage, int distance, WarheadType warhead, TechnoClass * source=0, bool forced=false); 113 virtual FireErrorType Can_Fire(TARGET target, int which) const; 114 115 virtual void Enter_Idle_Mode(bool initial=false); 116 virtual ActionType What_Action(ObjectClass const * object) const; 117 virtual ActionType What_Action(CELL cell) const; 118 virtual void Active_Click_With(ActionType action, CELL cell); 119 virtual void Active_Click_With(ActionType action, ObjectClass * object); 120 virtual TARGET Greatest_Threat(ThreatType threat) const; 121 virtual bool Is_Allowed_To_Recloak(void) const; 122 #ifdef FIXIT_CARRIER // checked - ajw 9/28/98 123 virtual BulletClass * Fire_At(TARGET target, int which=0); 124 #endif 125 /* 126 ** File I/O. 127 */ 128 static void Read_INI(CCINIClass & ini); 129 static void Write_INI(CCINIClass & ini); 130 static char * INI_Name(void) {return "SHIPS";}; 131 bool Load(Straw & file); 132 bool Save(Pipe & file) const; 133 134 /* 135 ** Scenario and debug support. 136 */ 137 #ifdef CHEAT_KEYS 138 virtual void Debug_Dump(MonoClass *mono) const; 139 #endif 140 141 protected: 142 /* 143 ** This is the facing of the turret. It can be, and usually is, 144 ** rotated independently of the body it is attached to. 145 */ 146 FacingClass SecondaryFacing; 147 148 /* 149 ** Some additional padding in case we need to add data to the class and maintain backwards compatibility for save/load 150 */ 151 unsigned char SaveLoadPadding[32]; 152 153 }; 154 155 #endif