WEAPON.H (6018B)
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/WEAPON.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 : WEAPON.H * 24 * * 25 * Programmer : Joe L. Bostic * 26 * * 27 * Start Date : 05/17/96 * 28 * * 29 * Last Update : May 17, 1996 [JLB] * 30 * * 31 *---------------------------------------------------------------------------------------------* 32 * Functions: * 33 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 34 35 36 #ifndef WEAPON_H 37 #define WEAPON_H 38 39 40 /********************************************************************** 41 ** This is the constant data associated with a weapon. Some objects 42 ** can have multiple weapons and this class is used to isolate and 43 ** specify this data in a convenient and selfcontained way. 44 */ 45 class WeaponTypeClass 46 { 47 public: 48 WeaponTypeClass(char const * name); 49 WeaponTypeClass(NoInitClass const &) {} 50 ~WeaponTypeClass(void); 51 52 void * operator new(size_t); 53 static void * operator new(size_t , void * ptr) {return(ptr);}; 54 void operator delete(void * pointer); 55 56 char const * Name(void) const {return(IniName);} 57 bool Read_INI(CCINIClass & ini); 58 static WeaponTypeClass * As_Pointer(WeaponType weapon); 59 void Code_Pointers(void) {} 60 void Decode_Pointers(void) {} 61 ThreatType Allowed_Threats(void) const; 62 bool Is_Wall_Destroyer(void) const; 63 64 /* 65 ** This is both the weapon type number and the index number into 66 ** the weapon array. 67 */ 68 int ID; 69 70 /* 71 ** This is the identifying name of this weapon. 72 */ 73 char const * IniName; 74 75 /* 76 ** Increase the weapon speed if the target is flying. 77 */ 78 unsigned IsTurboBoosted:1; 79 80 /* 81 ** If potential targets of this weapon should be scanned for 82 ** nearby friendly structures and if found, firing upon the target 83 ** would be discouraged, then this flag will be true. 84 */ 85 unsigned IsSupressed:1; 86 87 /* 88 ** If this weapon is equipped with a camera that reveals the 89 ** area around the firer, then this flag will be true. 90 */ 91 unsigned IsCamera:1; 92 93 /* 94 ** If this weapon requires charging before it can fire, then this 95 ** flag is true. In actuality, this only applies to the Tesla coil 96 ** which has specific charging animation. The normal rate of fire 97 ** value suffices for all other cases. 98 */ 99 unsigned IsElectric:1; 100 101 /* 102 ** This is the number of shots this weapon first (in rapid succession). 103 ** The normal value is 1, but for the case of two shooter weapons such as 104 ** the double barreled gun turrets of the Mammoth tank, this value will be 105 ** set to 2. 106 */ 107 int Burst; 108 109 /* 110 ** This is the unit class of the projectile fired. A subset of the unit types 111 ** represent projectiles. It is one of these classes that is specified here. 112 ** If this object does not fire anything, then this value will be BULLET_NONE. 113 */ 114 BulletTypeClass const * Bullet; 115 116 /* 117 ** This is the damage (explosive load) to be assigned to the projectile that 118 ** this object fires. For the rare healing weapon, this value is negative. 119 */ 120 int Attack; 121 122 /* 123 ** Speed of the projectile launched. 124 */ 125 MPHType MaxSpeed; 126 127 /* 128 ** Warhead to attach to the projectile. 129 */ 130 WarheadTypeClass const * WarheadPtr; 131 132 /* 133 ** Objects that fire (which can be buildings as well) will fire at a 134 ** frequency controlled by this value. This value serves as a count 135 ** down timer between shots. The smaller the value, the faster the 136 ** rate of fire. 137 */ 138 int ROF; 139 140 /* 141 ** When this object fires, the range at which it's projectiles travel is 142 ** controlled by this value. The value represents the number of cells the 143 ** projectile will travel. Objects outside of this range will not be fired 144 ** upon (in normal circumstances). 145 */ 146 LEPTON Range; 147 148 /* 149 ** This is the typical sound generated when firing. 150 */ 151 VocType Sound; 152 153 /* 154 ** This is the animation to display at the firing coordinate. 155 */ 156 AnimType Anim; 157 }; 158 159 160 #endif 161 162