MISSION.H (7387B)
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/MISSION.H 1 3/03/97 10:25a 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 : MISSION.H * 24 * * 25 * Programmer : Joe L. Bostic * 26 * * 27 * Start Date : April 23, 1994 * 28 * * 29 * Last Update : April 23, 1994 [JLB] * 30 * * 31 *---------------------------------------------------------------------------------------------* 32 * Functions: * 33 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 34 35 #ifndef MISSION_H 36 #define MISSION_H 37 38 #include "object.h" 39 #include "monoc.h" 40 41 /**************************************************************************** 42 ** This handles order assignment and tracking. The order is used to guide 43 ** overall AI processing. 44 */ 45 class MissionClass : public ObjectClass 46 { 47 public: 48 49 /* 50 ** This the tactical strategy to use. It is used by the unit script. This 51 ** is a general guide for unit AI processing. 52 */ 53 MissionType Mission; 54 MissionType SuspendedMission; 55 56 /* 57 ** The order queue is used for orders that should take effect when the vehicle 58 ** has reached the center point of a cell. The queued order number is +1 when stored here 59 ** so that 0 will indicated there is no queued order. 60 */ 61 MissionType MissionQueue; 62 63 int Status; 64 65 /*--------------------------------------------------------------------- 66 ** Constructors, Destructors, and overloaded operators. 67 */ 68 MissionClass(RTTIType rtti, int id); 69 MissionClass(NoInitClass const & x) : ObjectClass(x), Timer(x) {}; 70 virtual ~MissionClass(void) {}; 71 72 /*--------------------------------------------------------------------- 73 ** Member function prototypes. 74 */ 75 #ifdef CHEAT_KEYS 76 void Debug_Dump(MonoClass *mono) const; 77 #endif 78 79 void Shorten_Mission_Timer(void) {Timer = 0;} 80 virtual MissionType Get_Mission(void) const; 81 virtual void Assign_Mission(MissionType mission); 82 virtual bool Commence(void); 83 virtual void AI(void); 84 85 /* 86 ** Support functions. 87 */ 88 virtual int Mission_Sleep(void); 89 virtual int Mission_Ambush(void); 90 virtual int Mission_Attack(void); 91 virtual int Mission_Capture(void); 92 virtual int Mission_Guard(void); 93 virtual int Mission_Guard_Area(void); 94 virtual int Mission_Harvest(void); 95 virtual int Mission_Hunt(void); 96 // virtual int Mission_Timed_Hunt(void); 97 virtual int Mission_Move(void); 98 virtual int Mission_Retreat(void); 99 virtual int Mission_Return(void); 100 virtual int Mission_Stop(void); 101 virtual int Mission_Unload(void); 102 virtual int Mission_Enter(void); 103 virtual int Mission_Construction(void); 104 virtual int Mission_Deconstruction(void); 105 virtual int Mission_Repair(void); 106 virtual int Mission_Missile(void); 107 virtual void Set_Mission(MissionType mission); 108 static bool Is_Recruitable_Mission(MissionType mission); 109 110 static char const * Mission_Name(MissionType order); 111 static MissionType Mission_From_Name(char const *name); 112 virtual void Override_Mission(MissionType mission, TARGET, TARGET); 113 virtual bool Restore_Mission(void); 114 115 private: 116 117 /* 118 ** This the thread processing timer. When this value counts down to zero, then 119 ** more script processing may occur. 120 */ 121 CDTimerClass<FrameTimerClass> Timer; 122 }; 123 124 125 /**************************************************************************** 126 ** This is the mission control (pun) that controls how each mission behaves 127 ** when it comes to interacting with the game world. Example; some 128 ** missions allow the object to scatter from threats, while others require 129 ** the object to remain in place. This kind of characteristics are specfied 130 ** by this class. 131 */ 132 class MissionControlClass 133 { 134 public: 135 MissionControlClass(void); 136 137 bool Read_INI(CCINIClass & ini); 138 int Normal_Delay(void) const {return(TICKS_PER_MINUTE * Rate);} 139 int AA_Delay(void) const {return(TICKS_PER_MINUTE * AARate);} 140 141 /* 142 ** This is the mission identifier that this mission represents. 143 */ 144 MissionType Mission; 145 146 char const * Name(void) const; 147 148 /* 149 ** If the object should not be considered a threat when it 150 ** comes to target scanning, then this will be true. 151 */ 152 unsigned IsNoThreat:1; 153 154 /* 155 ** If objects in this mission should avoid targeting the enemy and 156 ** also avoid responding to the enemy, then this will be true. 157 */ 158 unsigned IsZombie:1; 159 160 /* 161 ** An ojbect that can be recruited into a team must be on a mission 162 ** of this type. 163 */ 164 unsigned IsRecruitable:1; 165 166 /* 167 ** If the object can behave normally except that it cannot 168 ** move to another location, then this flag will be true. 169 */ 170 unsigned IsParalyzed:1; 171 172 /* 173 ** If an object on this mission is damaged, it is allowed to 174 ** retaliate? 175 */ 176 unsigned IsRetaliate:1; 177 178 /* 179 ** Is the object allowed to scatter from immediate threats? 180 */ 181 unsigned IsScatter:1; 182 183 /* 184 ** This specifies the time to delay between calls to the mission handler for those cases 185 ** where the delay could be indefinate. The exception would be when timing is critical. 186 ** Typical use of this would be to regulate the delay between mundane mission processing 187 ** in order to achieve less game overhead. 188 */ 189 fixed Rate; 190 191 /* 192 ** Anti-Aircraft buildings (and units) in guard or guard area mode will use this override 193 ** delay interval instead of the normal "Rate" value. 194 */ 195 fixed AARate; 196 }; 197 198 199 #endif