NeutronMissileSlowDeathUpdate.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. ** Command & Conquer Generals Zero Hour(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. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: NeutronMissileSlowDeathUpdate.h //////////////////////////////////////////////////////////
  24. // Author: Colin Day, April 2002
  25. // Desc: Update module for the neutron missile superweapon object
  26. ///////////////////////////////////////////////////////////////////////////////////////////////////
  27. #pragma once
  28. #ifndef __NEUTRONMISSILESlowDeathBehavior_H_
  29. #define __NEUTRONMISSILESlowDeathBehavior_H_
  30. // INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
  31. #include "GameLogic/Module/SlowDeathBehavior.h"
  32. class FXList;
  33. // ------------------------------------------------------------------------------------------------
  34. // ------------------------------------------------------------------------------------------------
  35. enum NeutronBlast
  36. {
  37. NEUTRON_BLAST_1 = 0,
  38. NEUTRON_BLAST_2,
  39. NEUTRON_BLAST_3,
  40. NEUTRON_BLAST_4,
  41. NEUTRON_BLAST_5,
  42. NEUTRON_BLAST_6,
  43. NEUTRON_BLAST_7,
  44. NEUTRON_BLAST_8,
  45. NEUTRON_BLAST_9,
  46. MAX_NEUTRON_BLASTS // keep this last
  47. };
  48. // ------------------------------------------------------------------------------------------------
  49. // ------------------------------------------------------------------------------------------------
  50. struct BlastInfo
  51. {
  52. Bool enabled; ///< this blast is enabled
  53. Real delay; ///< delay after death to start the regular blast
  54. Real scorchDelay; ///< delay after death to start a scorch blast
  55. Real innerRadius; ///< inner radius of damage
  56. Real outerRadius; ///< outer radius of damage
  57. Real maxDamage; ///< max amount
  58. Real minDamage; ///< any object in the outerradius will always have at least this much damage done
  59. Real toppleSpeed; ///< speed to topple things at
  60. Real pushForceMag; ///< magnitude of the physics force to push objects
  61. };
  62. // ------------------------------------------------------------------------------------------------
  63. // ------------------------------------------------------------------------------------------------
  64. class NeutronMissileSlowDeathBehaviorModuleData : public SlowDeathBehaviorModuleData
  65. {
  66. public:
  67. NeutronMissileSlowDeathBehaviorModuleData( void );
  68. static void buildFieldParse(MultiIniFieldParse& p);
  69. BlastInfo m_blastInfo[ MAX_NEUTRON_BLASTS ]; ///< blast information
  70. Real m_scorchSize; ///< size of scorch mark
  71. const FXList *m_fxList; ///< the actual fx list that creates all the visuals.
  72. };
  73. // ------------------------------------------------------------------------------------------------
  74. // ------------------------------------------------------------------------------------------------
  75. class NeutronMissileSlowDeathBehavior : public SlowDeathBehavior
  76. {
  77. MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( NeutronMissileSlowDeathBehavior, "NeutronMissileSlowDeathBehavior" )
  78. MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( NeutronMissileSlowDeathBehavior, NeutronMissileSlowDeathBehaviorModuleData )
  79. public:
  80. NeutronMissileSlowDeathBehavior( Thing *thing, const ModuleData* moduleData );
  81. // virtual destructor prototype provided by memory pool declaration
  82. virtual UpdateSleepTime update( void ); ///< the update call
  83. protected:
  84. void doBlast( const BlastInfo *blastInfo ); ///< do blast
  85. void doScorchBlast( const BlastInfo *blastInfo ); ///< do a scorch blast ring
  86. UnsignedInt m_activationFrame; ///< frame we were activated on
  87. Bool m_completedBlasts[ MAX_NEUTRON_BLASTS ]; ///< blasts indexes we've already done
  88. Bool m_completedScorchBlasts[ MAX_NEUTRON_BLASTS ]; ///< scorch blast indexes we've already done
  89. Bool m_scorchPlaced; ///< TRUE once we've placed the scorch mark
  90. };
  91. #endif // end __NEUTRONMISSILESlowDeathBehavior_H_