WEAPON.H 5.8 KB

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