MISSION.H 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. ** Command & Conquer(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: F:\projects\c&c\vcs\code\mission.h_v 2.16 16 Oct 1995 16:45:46 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 : MISSION.H *
  26. * *
  27. * Programmer : Joe L. Bostic *
  28. * *
  29. * Start Date : April 23, 1994 *
  30. * *
  31. * Last Update : April 23, 1994 [JLB] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef MISSION_H
  37. #define MISSION_H
  38. #include "object.h"
  39. #include "monoc.h"
  40. /****************************************************************************
  41. ** This handles order assignment and tracking. The order is used to guide
  42. ** overall AI processing.
  43. */
  44. class MissionClass : public ObjectClass
  45. {
  46. public:
  47. /*
  48. ** This the tactical strategy to use. It is used by the unit script. This
  49. ** is a general guide for unit AI processing.
  50. */
  51. MissionType Mission;
  52. MissionType SuspendedMission;
  53. /*
  54. ** The order queue is used for orders that should take effect when the vehicle
  55. ** has reached the center point of a cell. The queued order number is +1 when stored here
  56. ** so that 0 will indicated there is no queued order.
  57. */
  58. MissionType MissionQueue;
  59. char Status;
  60. /*---------------------------------------------------------------------
  61. ** Constructors, Destructors, and overloaded operators.
  62. */
  63. MissionClass(void);
  64. virtual ~MissionClass(void) {};
  65. /*---------------------------------------------------------------------
  66. ** Member function prototypes.
  67. */
  68. #ifdef CHEAT_KEYS
  69. void Debug_Dump(MonoClass *mono) const;
  70. #endif
  71. virtual MissionType Get_Mission(void) const;
  72. virtual void Assign_Mission(MissionType mission);
  73. virtual bool Commence(void);
  74. virtual void AI(void);
  75. /*
  76. ** Support functions.
  77. */
  78. virtual int Mission_Sleep(void);
  79. virtual int Mission_Ambush(void);
  80. virtual int Mission_Attack(void);
  81. virtual int Mission_Capture(void);
  82. virtual int Mission_Guard(void);
  83. virtual int Mission_Guard_Area(void);
  84. virtual int Mission_Harvest(void);
  85. virtual int Mission_Hunt(void);
  86. virtual int Mission_Timed_Hunt(void);
  87. virtual int Mission_Move(void);
  88. virtual int Mission_Retreat(void);
  89. virtual int Mission_Return(void);
  90. virtual int Mission_Stop(void);
  91. virtual int Mission_Unload(void);
  92. virtual int Mission_Enter(void);
  93. virtual int Mission_Construction(void);
  94. virtual int Mission_Deconstruction(void);
  95. virtual int Mission_Repair(void);
  96. virtual int Mission_Missile(void);
  97. virtual void Set_Mission(MissionType mission);
  98. static char const * Mission_Name(MissionType order);
  99. static MissionType Mission_From_Name(char const *name);
  100. virtual void Override_Mission(MissionType mission, TARGET, TARGET);
  101. virtual bool Restore_Mission(void);
  102. /*
  103. ** File I/O.
  104. */
  105. virtual void Code_Pointers(void);
  106. virtual void Decode_Pointers(void);
  107. private:
  108. /*
  109. ** This the thread processing timer. When this value counts down to zero, then
  110. ** more script processing may occur.
  111. */
  112. TCountDownTimerClass Timer;
  113. /*
  114. ** These are the order names as ASCII strings.
  115. */
  116. static char const * Missions[MISSION_COUNT];
  117. };
  118. #endif