WEAPON.H 5.9 KB

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