InactiveBody.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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: InactiveBody.h ///////////////////////////////////////////////////////////////////////////
  24. // Author: Colin Day, November 2001
  25. // Desc: An inactive body module, they are indestructable and largely cannot be
  26. // affected by things in the world.
  27. ///////////////////////////////////////////////////////////////////////////////////////////////////
  28. #pragma once
  29. #ifndef __INACTIVEBODY_H_
  30. #define __INACTIVEBODY_H_
  31. // INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
  32. #include "GameLogic/Module/BodyModule.h"
  33. //-------------------------------------------------------------------------------------------------
  34. /** Inactive body module */
  35. //-------------------------------------------------------------------------------------------------
  36. class InactiveBody : public BodyModule
  37. {
  38. MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( InactiveBody, "InactiveBody" )
  39. MAKE_STANDARD_MODULE_MACRO( InactiveBody )
  40. public:
  41. InactiveBody( Thing *thing, const ModuleData* moduleData );
  42. // virtual destructor prototype provided by memory pool declaration
  43. virtual void attemptDamage( DamageInfo *damageInfo ); ///< try to damage this object
  44. virtual void attemptHealing( DamageInfo *damageInfo ); ///< try to heal this object
  45. virtual Real estimateDamage( DamageInfoInput& damageInfo ) const;
  46. virtual Real getHealth() const; ///< get current health
  47. virtual BodyDamageType getDamageState() const;
  48. virtual void setDamageState( BodyDamageType newState ); ///< control damage state directly. Will adjust hitpoints.
  49. virtual void setAflame( Bool setting ){}///< This is a major change like a damage state.
  50. void onVeterancyLevelChanged( VeterancyLevel oldLevel, VeterancyLevel newLevel, Bool provideFeedback ) { /* nothing */ }
  51. virtual void setArmorSetFlag(ArmorSetType ast) { /* nothing */ }
  52. virtual void clearArmorSetFlag(ArmorSetType ast) { /* nothing */ }
  53. virtual Bool testArmorSetFlag(ArmorSetType ast){ return FALSE; }
  54. virtual void internalChangeHealth( Real delta );
  55. private:
  56. Bool m_dieCalled;
  57. };
  58. #endif // __INACTIVEBODY_H_