SpectreGunshipDeploymentUpdate.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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: SpectreGunshipDeploymentUpdate.h //////////////////////////////////////////////////////////////////////////
  24. // Author: Mark Lorenzen, April 2003
  25. // Desc: Update module to handle deployment of the SpectreGunship Generals special power.from command center
  26. ///////////////////////////////////////////////////////////////////////////////////////////////////
  27. #pragma once
  28. #ifndef __SPECTRE_GUNSHIP_DEPLOYMENT_UPDATE_H_
  29. #define __SPECTRE_GUNSHIP_DEPLOYMENT_UPDATE_H_
  30. // INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
  31. #include "Common/KindOf.h"
  32. #include "GameLogic/Module/SpecialPowerUpdateModule.h"
  33. // FORWARD REFERENCES /////////////////////////////////////////////////////////////////////////////
  34. class SpecialPowerModule;
  35. class ParticleSystem;
  36. class FXList;
  37. class AudioEventRTS;
  38. enum ParticleSystemID;
  39. enum ScienceType;
  40. //#define MAX_OUTER_NODES 16
  41. //#define PUCK
  42. enum GunshipCreateLocType
  43. {
  44. CREATE_GUNSHIP_AT_EDGE_NEAR_SOURCE,
  45. CREATE_GUNSHIP_AT_EDGE_FARTHEST_FROM_SOURCE,
  46. CREATE_GUNSHIP_AT_EDGE_NEAR_TARGET,
  47. CREATE_GUNSHIP_AT_EDGE_FARTHEST_FROM_TARGET,
  48. };
  49. //-------------------------------------------------------------------------------------------------
  50. //-------------------------------------------------------------------------------------------------
  51. class SpectreGunshipDeploymentUpdateModuleData : public ModuleData
  52. {
  53. public:
  54. SpecialPowerTemplate *m_specialPowerTemplate;
  55. ScienceType m_extraRequiredScience; ///< science required (if any) to actually execute this power
  56. WeaponTemplate *m_howitzerWeaponTemplate;
  57. AsciiString m_gunshipTemplateName;
  58. AsciiString m_gattlingTemplateName;
  59. // AsciiString m_howitzerTemplateName;
  60. RadiusDecalTemplate m_attackAreaDecalTemplate;
  61. RadiusDecalTemplate m_targetingReticleDecalTemplate;
  62. UnsignedInt m_orbitFrames;
  63. Real m_attackAreaRadius;
  64. Real m_targetingReticleRadius;
  65. Real m_gunshipOrbitRadius;
  66. GunshipCreateLocType m_createLoc;
  67. const ParticleSystemTemplate * m_gattlingStrafeFXParticleSystem;
  68. SpectreGunshipDeploymentUpdateModuleData();
  69. static void buildFieldParse(MultiIniFieldParse& p);
  70. private:
  71. };
  72. enum GunshipDeployStatus
  73. {
  74. GUNSHIPDEPLOY_STATUS_INSERTING,
  75. GUNSHIPDEPLOY_STATUS_ORBITING,
  76. GUNSHIPDEPLOY_STATUS_DEPARTING,
  77. GUNSHIPDEPLOY_STATUS_IDLE,
  78. };
  79. //-------------------------------------------------------------------------------------------------
  80. /** The default update module */
  81. //-------------------------------------------------------------------------------------------------
  82. class SpectreGunshipDeploymentUpdate : public SpecialPowerUpdateModule
  83. {
  84. MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( SpectreGunshipDeploymentUpdate, "SpectreGunshipDeploymentUpdate" )
  85. MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( SpectreGunshipDeploymentUpdate, SpectreGunshipDeploymentUpdateModuleData );
  86. public:
  87. SpectreGunshipDeploymentUpdate( Thing *thing, const ModuleData* moduleData );
  88. // virtual destructor prototype provided by memory pool declaration
  89. // SpecialPowerUpdateInterface
  90. virtual Bool initiateIntentToDoSpecialPower(const SpecialPowerTemplate *specialPowerTemplate, const Object *targetObj, const Coord3D *targetPos, const Waypoint *way, UnsignedInt commandOptions );
  91. virtual Bool isSpecialAbility() const { return false; }
  92. virtual Bool isSpecialPower() const { return true; }
  93. virtual Bool isActive() const {return FALSE;}
  94. virtual SpecialPowerUpdateInterface* getSpecialPowerUpdateInterface() { return this; }
  95. virtual CommandOption getCommandOption() const { return (CommandOption)0; }
  96. virtual Bool isPowerCurrentlyInUse( const CommandButton *command = NULL ) const { return FALSE; };
  97. virtual ScienceType getExtraRequiredScience() const { return getSpectreGunshipDeploymentUpdateModuleData()->m_extraRequiredScience; } //Does this object have more than one special power module with the same spTemplate?
  98. virtual void onObjectCreated();
  99. virtual UpdateSleepTime update();
  100. void cleanUp();
  101. virtual Bool doesSpecialPowerHaveOverridableDestinationActive() const { return FALSE; };
  102. virtual Bool doesSpecialPowerHaveOverridableDestination() const { return FALSE; } //Does it have it, even if it's not active?
  103. virtual void setSpecialPowerOverridableDestination( const Coord3D *loc ) {};
  104. // Disabled conditions to process (termination conditions!)
  105. virtual DisabledMaskType getDisabledTypesToProcess() const { return MAKE_DISABLED_MASK4( DISABLED_SUBDUED, DISABLED_UNDERPOWERED, DISABLED_EMP, DISABLED_HACKED ); }
  106. protected:
  107. SpecialPowerModuleInterface* m_specialPowerModule;
  108. Coord3D m_initialTargetPosition;
  109. ObjectID m_gunshipID;
  110. };
  111. #endif // __SPECTRE_GUNSHIP_DEPLOYMENT_UPDATE_H_