JetSlowDeathBehavior.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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: JetSlowDeathBehavior.h ///////////////////////////////////////////////////////////////////
  24. // Author: Colin Day
  25. // Desc: Death sequence for jets
  26. ///////////////////////////////////////////////////////////////////////////////////////////////////
  27. #pragma once
  28. #ifndef __JET_SLOW_DEATH_BEHAVIOR_H_
  29. #define __JET_SLOW_DEATH_BEHAVIOR_H_
  30. // USER INCLUDES //////////////////////////////////////////////////////////////////////////////////
  31. #include "Common/AudioEventRTS.h"
  32. #include "GameLogic/Module/BehaviorModule.h"
  33. #include "GameLogic/Module/SlowDeathBehavior.h"
  34. // FORWARD REFERENCES /////////////////////////////////////////////////////////////////////////////
  35. class FXList;
  36. //-------------------------------------------------------------------------------------------------
  37. //-------------------------------------------------------------------------------------------------
  38. class JetSlowDeathBehaviorModuleData : public SlowDeathBehaviorModuleData
  39. {
  40. public:
  41. JetSlowDeathBehaviorModuleData( void );
  42. static void buildFieldParse( MultiIniFieldParse &p );
  43. const FXList *m_fxOnGroundDeath; ///< fx list executed on death when destoyed on ground
  44. const ObjectCreationList *m_oclOnGroundDeath; ///< ocl list executed on death when destroyed on ground
  45. const FXList *m_fxInitialDeath; ///< FXList for initial death
  46. const ObjectCreationList *m_oclInitialDeath; ///< OCL for initial death
  47. UnsignedInt m_delaySecondaryFromInitialDeath; ///< delay (in frames) from initial death, to the secondary event
  48. const FXList *m_fxSecondary; ///< FXList for secondary event
  49. const ObjectCreationList *m_oclSecondary; ///< OCL for secondary event
  50. const FXList *m_fxHitGround; ///< FXList for hit ground
  51. const ObjectCreationList *m_oclHitGround; ///< OCL for hit ground
  52. UnsignedInt m_delayFinalBlowUpFromHitGround; ///< delay (in frames) from hit ground, to final explosion
  53. const FXList *m_fxFinalBlowUp; ///< FxList for final blow up
  54. const ObjectCreationList *m_oclFinalBlowUp; ///< OCL for final blow up
  55. Real m_rollRate; ///< our initial roll rate
  56. Real m_rollRateDelta; ///< how our roll rate changes over time
  57. Real m_pitchRate; ///< spin speed on another axis after hitting the ground
  58. Real m_fallHowFast; ///< a fraction of gravity we use to modify the jet locmotor lift
  59. AudioEventRTS m_deathLoopSound; ///< looping death sound
  60. };
  61. // ------------------------------------------------------------------------------------------------
  62. // ------------------------------------------------------------------------------------------------
  63. class JetSlowDeathBehavior : public SlowDeathBehavior
  64. {
  65. MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( JetSlowDeathBehavior, "JetSlowDeathBehavior" )
  66. MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( JetSlowDeathBehavior, JetSlowDeathBehaviorModuleData )
  67. public:
  68. JetSlowDeathBehavior( Thing *thing, const ModuleData* moduleData );
  69. // virtual destructor prototype provided by memory pool declaration
  70. // slow death methods
  71. virtual void onDie( const DamageInfo *damageInfo );
  72. virtual void beginSlowDeath( const DamageInfo *damageInfo );
  73. virtual UpdateSleepTime update( void );
  74. protected:
  75. UnsignedInt m_timerDeathFrame; ///< fame we died on
  76. UnsignedInt m_timerOnGroundFrame; ///< frame we landed on the ground on
  77. Real m_rollRate; ///< our roll rate
  78. AudioEventRTS m_deathLoopSound; ///< death loop sound
  79. };
  80. #endif // end __JET_SLOW_DEATH_BEHAVIOR_H_