ObjectStatusBits.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. ** Command & Conquer Generals(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. // ObjectStatusBits.h /////////////////////////////////////////////////////////////////////////////
  24. // Part of header detangling
  25. // JKMCD Aug 2002
  26. #pragma once
  27. #ifndef __OBJECTSTATUSBITS_H__
  28. #define __OBJECTSTATUSBITS_H__
  29. //-------------------------------------------------------------------------------------------------
  30. /** Object status bits */
  31. //-------------------------------------------------------------------------------------------------
  32. enum ObjectStatusBits
  33. {
  34. OBJECT_STATUS_NONE = 0, ///< no status bit
  35. OBJECT_STATUS_DESTROYED = (1 << 0), ///< has been destroyed, pending delete
  36. OBJECT_STATUS_CAN_ATTACK = (1 << 1), ///< used by garrissoned buildings, is OR'ed with KINDOF_CAN_ATTACK in isAbleToAttack()
  37. OBJECT_STATUS_UNDER_CONSTRUCTION = (1 << 2), ///< object is being constructed and is not yet complete
  38. OBJECT_STATUS_UNSELECTABLE = (1 << 3), ///< This is a negative condition since these statuses are overrides. ie their presence forces the condition, but their absence means nothing
  39. OBJECT_STATUS_NO_COLLISIONS = (1 << 4), ///< object should be ignored for object-object collisions (but not object-ground); used for thing like collapsing parachutes that are intangible
  40. OBJECT_STATUS_NO_ATTACK = (1 << 5), ///< Absolute override to being able to attack
  41. OBJECT_STATUS_AIRBORNE_TARGET = (1 << 6), ///< InTheAir as far as AntiAir weapons are concerned only.
  42. OBJECT_STATUS_PARACHUTING = (1 << 7), ///< object is on a parachute
  43. OBJECT_STATUS_REPULSOR = (1 << 8), ///< object repulses "KINDOF_CAN_BE_REPULSED" objects.
  44. OBJECT_STATUS_HIJACKED = (1 << 9), ///< unit is in the possesion of an enemy criminal, call the authorities
  45. OBJECT_STATUS_AFLAME = (1 << 10), ///< This object is on fire.
  46. OBJECT_STATUS_BURNED = (1 << 11), ///< This object has already burned as much as it can.
  47. OBJECT_STATUS_WET = (1 << 12), ///< object has been soaked with water
  48. OBJECT_STATUS_IS_FIRING_WEAPON = (1 << 13), ///< Object is firing a weapon, now. Not true for special attacks. --Lorenzen
  49. OBJECT_STATUS_BRAKING = (1 << 14), ///< Object is braking, and subverts the physics.
  50. OBJECT_STATUS_STEALTHED = (1 << 15), ///< Object is currently "stealthed"
  51. OBJECT_STATUS_DETECTED = (1 << 16), ///< Object is in range of a stealth-detector unit (meaningless if STEALTHED not set)
  52. OBJECT_STATUS_CAN_STEALTH = (1 << 17), ///< Object has ability to stealth allowing the stealth update module to run.
  53. OBJECT_STATUS_SOLD = (1 << 18), ///< Object is being sold
  54. OBJECT_STATUS_UNDERGOING_REPAIR = (1 << 19), ///< Object is awaiting/undergoing a repair order that has been issued
  55. OBJECT_STATUS_RECONSTRUCTING = (1 << 20), ///< Reconstructing
  56. OBJECT_STATUS_MASKED = (1 << 21), ///< Masked objects are not selectable and targetable by players or AI
  57. OBJECT_STATUS_IS_ATTACKING = (1 << 22), ///< Object is in the general Attack state (incl. aim, approach, etc.). Note that IS_FIRING_WEAPON and IS_AIMING_WEAPON is a subset of this!
  58. OBJECT_STATUS_IS_USING_ABILITY = (1 << 23), ///< Object is in the process of preparing or firing a special ability.
  59. OBJECT_STATUS_IS_AIMING_WEAPON = (1 << 24), ///< Object is aiming a weapon, now. Not true for special attacks.
  60. OBJECT_STATUS_NO_ATTACK_FROM_AI = (1 << 25), ///< attacking this object may not be done from commandSource == CMD_FROM_AI
  61. OBJECT_STATUS_IGNORING_STEALTH = (1 << 26), ///< temporarily ignoring all stealth bits. (used only for some special-case mine clearing stuff.)
  62. OBJECT_STATUS_IS_CARBOMB = (1 << 27), ///< Object is now a carbomb.
  63. // add more status bits here ... don't forget to add to the string table below!!!
  64. };
  65. #ifdef DEFINE_OBJECT_STATUS_NAMES
  66. static const char *TheObjectStatusBitNames[] =
  67. {
  68. "DESTROYED",
  69. "CAN_ATTACK",
  70. "UNDER_CONSTRUCTION",
  71. "UNSELECTABLE",
  72. "NO_COLLISIONS",
  73. "NO_ATTACK",
  74. "AIRBORNE_TARGET",
  75. "PARACHUTING",
  76. "REPULSOR",
  77. "HIJACKED",
  78. "AFLAME",
  79. "BURNED",
  80. "WET",
  81. "IS_FIRING_WEAPON",
  82. "IS_BRAKING",
  83. "STEALTHED",
  84. "DETECTED",
  85. "CAN_STEALTH",
  86. "SOLD",
  87. "UNDERGOING_REPAIR",
  88. "RECONSTRUCTING",
  89. "MASKED",
  90. "IS_ATTACKING",
  91. "USING_ABILITY",
  92. "IS_AIMING_WEAPON",
  93. "NO_ATTACK_FROM_AI",
  94. "IGNORING_STEALTH",
  95. "IS_CARBOMB",
  96. NULL ///< leave this last please
  97. };
  98. #endif
  99. #endif /* __OBJECTSTATUSBITS_H__ */