VESSEL.H 6.0 KB

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