HijackerUpdate.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. ///////////////////////////////////////////////////////////////////////////////////////////////////
  24. //
  25. // FILE: HijackerUpdate.h /////////////////////////////////////////////////////////////////////////
  26. // Author: Mark Lorenzen, July 2002
  27. // Desc: Allows hijacker to keep with his hijacked vehicle (though hidden) until it dies, then
  28. // to become a hijacker once more
  29. //
  30. /////////////////////////////////////////////////////////////////////////////////////////////////
  31. #pragma once
  32. #ifndef __HIJACKER_UPDATE_H
  33. #define __HIJACKER_UPDATE_H
  34. #include "GameLogic/Module/UpdateModule.h"
  35. //-------------------------------------------------------------------------------------------------
  36. class HijackerUpdateModuleData : public UpdateModuleData
  37. {
  38. public:
  39. AsciiString m_attachToBone;
  40. AsciiString m_parachuteName;
  41. //StickBombUpdateModuleData();
  42. static void buildFieldParse(MultiIniFieldParse& p)
  43. {
  44. UpdateModuleData::buildFieldParse(p);
  45. static const FieldParse dataFieldParse[] =
  46. {
  47. { "AttachToTargetBone", INI::parseAsciiString, NULL, offsetof( HijackerUpdateModuleData, m_attachToBone ) },
  48. { "ParachuteName", INI::parseAsciiString, NULL, offsetof( HijackerUpdateModuleData, m_parachuteName ) },
  49. { 0, 0, 0, 0 }
  50. };
  51. p.add(dataFieldParse);
  52. }
  53. };
  54. //-------------------------------------------------------------------------------------------------
  55. class HijackerUpdate : public UpdateModule
  56. {
  57. MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( HijackerUpdate, "HijackerUpdate" )
  58. MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( HijackerUpdate, HijackerUpdateModuleData )
  59. public:
  60. HijackerUpdate( Thing *thing, const ModuleData* moduleData );
  61. // virtual destructor prototype provided by memory pool declaration
  62. virtual UpdateSleepTime update(); ///< called once per frame
  63. void setTargetObject( const Object *object );
  64. Object* getTargetObject() const;
  65. void setUpdate(Bool u ) {m_update = u;}
  66. void setIsInVehicle(Bool i ) {m_isInVehicle = i;}
  67. private:
  68. ObjectID m_targetID;
  69. Coord3D m_ejectPos;
  70. Bool m_update;
  71. Bool m_isInVehicle;
  72. Bool m_wasTargetAirborne;
  73. // DieModuleInterface *m_ejectPilotDMI; // point to ejectpilotdiemodule
  74. // of target vehicle if it has one
  75. };
  76. #endif // __HIJACKER_UPDATE_H