Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1114 lines
36 KiB

  1. //======= Copyright (c) 1996-2009, Valve Corporation, All rights reserved. ======
  2. //
  3. // Purpose: Definitions that are shared by the game DLL and the client DLL.
  4. //
  5. //===============================================================================
  6. #ifndef SHAREDDEFS_H
  7. #define SHAREDDEFS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "bittools.h"
  12. #define TICK_INTERVAL (gpGlobals->interval_per_tick)
  13. #define TIME_TO_TICKS( dt ) ( (int)( 0.5f + (float)(dt) / TICK_INTERVAL ) )
  14. #define TICKS_TO_TIME( t ) ( TICK_INTERVAL *( t ) )
  15. #define ROUND_TO_TICKS( t ) ( TICK_INTERVAL * TIME_TO_TICKS( t ) )
  16. #define TICK_NEVER_THINK (-1)
  17. #if defined( TF_DLL )
  18. #define ANIMATION_CYCLE_BITS 10
  19. #else
  20. #define ANIMATION_CYCLE_BITS 15
  21. #endif
  22. #define ANIMATION_CYCLE_MINFRAC (1.0f / (1<<ANIMATION_CYCLE_BITS))
  23. // Each mod defines these for itself.
  24. class CViewVectors
  25. {
  26. public:
  27. CViewVectors() {}
  28. CViewVectors(
  29. Vector vView,
  30. Vector vHullMin,
  31. Vector vHullMax,
  32. Vector vDuckHullMin,
  33. Vector vDuckHullMax,
  34. Vector vDuckView,
  35. Vector vObsHullMin,
  36. Vector vObsHullMax,
  37. Vector vDeadViewHeight )
  38. {
  39. m_vView = vView;
  40. m_vHullMin = vHullMin;
  41. m_vHullMax = vHullMax;
  42. m_vDuckHullMin = vDuckHullMin;
  43. m_vDuckHullMax = vDuckHullMax;
  44. m_vDuckView = vDuckView;
  45. m_vObsHullMin = vObsHullMin;
  46. m_vObsHullMax = vObsHullMax;
  47. m_vDeadViewHeight = vDeadViewHeight;
  48. }
  49. // Height above entity position where the viewer's eye is.
  50. Vector m_vView;
  51. Vector m_vHullMin;
  52. Vector m_vHullMax;
  53. Vector m_vDuckHullMin;
  54. Vector m_vDuckHullMax;
  55. Vector m_vDuckView;
  56. Vector m_vObsHullMin;
  57. Vector m_vObsHullMax;
  58. Vector m_vDeadViewHeight;
  59. };
  60. // Height above entity position where the viewer's eye is.
  61. #define VEC_VIEW g_pGameRules->GetViewVectors()->m_vView
  62. #define VEC_HULL_MIN g_pGameRules->GetViewVectors()->m_vHullMin
  63. #define VEC_HULL_MAX g_pGameRules->GetViewVectors()->m_vHullMax
  64. #define VEC_DUCK_HULL_MIN g_pGameRules->GetViewVectors()->m_vDuckHullMin
  65. #define VEC_DUCK_HULL_MAX g_pGameRules->GetViewVectors()->m_vDuckHullMax
  66. #define VEC_DUCK_VIEW g_pGameRules->GetViewVectors()->m_vDuckView
  67. #define VEC_OBS_HULL_MIN g_pGameRules->GetViewVectors()->m_vObsHullMin
  68. #define VEC_OBS_HULL_MAX g_pGameRules->GetViewVectors()->m_vObsHullMax
  69. #define VEC_DEAD_VIEWHEIGHT g_pGameRules->GetViewVectors()->m_vDeadViewHeight
  70. #define WATERJUMP_HEIGHT 8
  71. #define MAX_CLIMB_SPEED 200
  72. #if defined(TF_DLL) || defined(TF_CLIENT_DLL) || defined( CSTRIKE15 )
  73. #define TIME_TO_DUCK_MSECS 200
  74. #else
  75. #define TIME_TO_DUCK_MSECS 400
  76. #endif
  77. #define TIME_TO_UNDUCK_MSECS 200
  78. inline float FractionDucked( int msecs )
  79. {
  80. return clamp( (float)msecs / (float)TIME_TO_DUCK_MSECS, 0.0f, 1.0f );
  81. }
  82. inline float FractionUnDucked( int msecs )
  83. {
  84. return clamp( (float)msecs / (float)TIME_TO_UNDUCK_MSECS, 0.0f, 1.0f );
  85. }
  86. #if defined( CSTRIKE15 )
  87. #define MAX_WEAPON_SLOTS 6 // hud item selection slots
  88. #define MAX_WEAPON_POSITIONS 6 // max number of items within a slot
  89. #define MAX_ITEM_TYPES 6 // hud item selection slots
  90. #define MAX_WEAPONS 64 // Max number of weapons available
  91. #else
  92. #define MAX_WEAPON_SLOTS 11 // hud item selection slots
  93. #define MAX_WEAPON_POSITIONS 20 // max number of items within a slot
  94. #define MAX_ITEM_TYPES 6 // hud item selection slots
  95. #define MAX_WEAPONS 64 // Max number of weapons available
  96. #endif
  97. #define MAX_ITEMS 5 // hard coded item types
  98. #define WEAPON_NOCLIP -1 // clip sizes set to this tell the weapon it doesn't use a clip
  99. #define MAX_AMMO_TYPES 32 // ???
  100. #define MAX_AMMO_SLOTS 32 // not really slots
  101. #define HUD_PRINTNOTIFY 1
  102. #define HUD_PRINTCONSOLE 2
  103. #define HUD_PRINTTALK 3
  104. #define HUD_PRINTCENTER 4
  105. // Vote creation or processing failure codes
  106. typedef enum
  107. {
  108. VOTE_FAILED_GENERIC = 0,
  109. VOTE_FAILED_TRANSITIONING_PLAYERS,
  110. VOTE_FAILED_RATE_EXCEEDED,
  111. VOTE_FAILED_YES_MUST_EXCEED_NO,
  112. VOTE_FAILED_QUORUM_FAILURE,
  113. VOTE_FAILED_ISSUE_DISABLED,
  114. VOTE_FAILED_MAP_NOT_FOUND,
  115. VOTE_FAILED_MAP_NAME_REQUIRED,
  116. VOTE_FAILED_FAILED_RECENTLY,
  117. VOTE_FAILED_FAILED_RECENT_KICK,
  118. VOTE_FAILED_FAILED_RECENT_CHANGEMAP,
  119. VOTE_FAILED_FAILED_RECENT_SWAPTEAMS,
  120. VOTE_FAILED_FAILED_RECENT_SCRAMBLETEAMS,
  121. VOTE_FAILED_FAILED_RECENT_RESTART,
  122. VOTE_FAILED_TEAM_CANT_CALL,
  123. VOTE_FAILED_WAITINGFORPLAYERS,
  124. VOTE_FAILED_PLAYERNOTFOUND,
  125. VOTE_FAILED_CANNOT_KICK_ADMIN,
  126. VOTE_FAILED_SCRAMBLE_IN_PROGRESS,
  127. VOTE_FAILED_SWAP_IN_PROGRESS,
  128. VOTE_FAILED_SPECTATOR,
  129. VOTE_FAILED_DISABLED,
  130. VOTE_FAILED_NEXTLEVEL_SET,
  131. VOTE_FAILED_REMATCH,
  132. VOTE_FAILED_TOO_EARLY_SURRENDER,
  133. VOTE_FAILED_CONTINUE,
  134. VOTE_FAILED_MATCH_PAUSED,
  135. VOTE_FAILED_MATCH_NOT_PAUSED,
  136. VOTE_FAILED_NOT_IN_WARMUP,
  137. VOTE_FAILED_NOT_10_PLAYERS,
  138. VOTE_FAILED_TIMEOUT_ACTIVE,
  139. VOTE_FAILED_TIMEOUT_INACTIVE,
  140. VOTE_FAILED_TIMEOUT_EXHAUSTED,
  141. VOTE_FAILED_CANT_ROUND_END,
  142. VOTE_FAILED_MAX,
  143. } vote_create_failed_t;
  144. #define MAX_VOTE_DETAILS_LENGTH 64
  145. #define INVALID_ISSUE -1
  146. #define MAX_VOTE_OPTIONS 5
  147. enum
  148. {
  149. VOTEISSUE_UNDEFINED = -1,
  150. VOTEISSUE_KICK,
  151. VOTEISSUE_CHANGELEVEL,
  152. VOTEISSUE_NEXTLEVEL,
  153. VOTEISSUE_SWAPTEAMS,
  154. VOTEISSUE_SCRAMBLE,
  155. VOTEISSUE_RESTARTGAME,
  156. VOTEISSUE_SURRENDER,
  157. VOTEISSUE_REMATCH,
  158. VOTEISSUE_CONTINUE,
  159. VOTEISSUE_PAUSEMATCH,
  160. VOTEISSUE_UNPAUSEMATCH,
  161. VOTEISSUE_LOADBACKUP,
  162. VOTEISSUE_ENDWARMUP,
  163. VOTEISSUE_STARTTIMEOUT,
  164. VOTEISSUE_ENDTIMEOUT,
  165. VOTEISSUE_READYFORMATCH,
  166. VOTEISSUE_NOTREADYFORMATCH,
  167. VOTEISSUE_LAST
  168. };
  169. enum CastVote
  170. {
  171. VOTE_OPTION1, // Use this for Yes
  172. VOTE_OPTION2, // Use this for No
  173. VOTE_OPTION3,
  174. VOTE_OPTION4,
  175. VOTE_OPTION5,
  176. VOTE_UNCAST
  177. };
  178. enum AmmoPosition_t
  179. {
  180. AMMO_POSITION_PRIMARY = 1,
  181. AMMO_POSITION_SECONDARY = 2
  182. };
  183. //===================================================================================================================
  184. // Close caption flags
  185. #define CLOSE_CAPTION_WARNIFMISSING ( 1<<0 )
  186. #define CLOSE_CAPTION_FROMPLAYER ( 1<<1 )
  187. #define CLOSE_CAPTION_GENDER_MALE ( 1<<2 )
  188. #define CLOSE_CAPTION_GENDER_FEMALE ( 1<<3 )
  189. //===================================================================================================================
  190. // Hud Element hiding flags
  191. #define HIDEHUD_WEAPONSELECTION ( 1<<0 ) // Hide ammo count & weapon selection
  192. #define HIDEHUD_FLASHLIGHT ( 1<<1 )
  193. #define HIDEHUD_ALL ( 1<<2 )
  194. #define HIDEHUD_HEALTH ( 1<<3 ) // Hide health & armor / suit battery
  195. #define HIDEHUD_PLAYERDEAD ( 1<<4 ) // Hide when local player's dead
  196. #define HIDEHUD_NEEDSUIT ( 1<<5 ) // Hide when the local player doesn't have the HEV suit
  197. #define HIDEHUD_MISCSTATUS ( 1<<6 ) // Hide miscellaneous status elements (trains, pickup history, death notices, etc)
  198. #define HIDEHUD_CHAT ( 1<<7 ) // Hide all communication elements (saytext, voice icon, etc)
  199. #define HIDEHUD_CROSSHAIR ( 1<<8 ) // Hide crosshairs
  200. #define HIDEHUD_VEHICLE_CROSSHAIR ( 1<<9 ) // Hide vehicle crosshair
  201. #define HIDEHUD_INVEHICLE ( 1<<10 )
  202. #define HIDEHUD_BONUS_PROGRESS ( 1<<11 ) // Hide bonus progress display (for bonus map challenges)
  203. #define HIDEHUD_RADAR ( 1<<12 ) // Hides the radar in CS1.5
  204. #define HIDEHUD_MINISCOREBOARD ( 1<<13 ) // Hides the miniscoreboard in CS1.5
  205. #define HIDEHUD_BITCOUNT 14
  206. //===================================================================================================================
  207. // suit usage bits
  208. #define bits_SUIT_DEVICE_SPRINT 0x00000001
  209. #define bits_SUIT_DEVICE_FLASHLIGHT 0x00000002
  210. #define bits_SUIT_DEVICE_BREATHER 0x00000004
  211. #define MAX_SUIT_DEVICES 3
  212. //===================================================================================================================
  213. // Player Defines
  214. // Max number of players in a game ( see const.h for ABSOLUTE_PLAYER_LIMIT (256 ) )
  215. // The Source engine is really designed for 32 or less players. If you raise this number above 32, you better know what you are doing
  216. // and have a good answer for a bunch of perf question related to player simulation, thinking logic, tracelines, networking overhead, etc.
  217. // But if you are brave or are doing something interesting, go for it... ywb 9/22/03
  218. //You might be wondering why these aren't multiple of 2. Well the reason is that if servers decide to have HLTV or Replay enabled we need the extra slot.
  219. //This is ok since MAX_PLAYERS is used for code specific things like arrays and loops, but it doesn't really means that this is the max number of players allowed
  220. //Since this is decided by the gamerules (and it can be whatever number as long as its less than MAX_PLAYERS).
  221. #if defined( CSTRIKE_DLL )
  222. #define MAX_PLAYERS 64 // Absolute max players supported
  223. #else
  224. #define MAX_PLAYERS 33 // Absolute max players supported
  225. #endif
  226. #define MAX_PLACE_NAME_LENGTH 18
  227. //===================================================================================================================
  228. // Team Defines
  229. #define TEAM_ANY -1 // for some team query methods
  230. #define TEAM_INVALID -1
  231. #define TEAM_UNASSIGNED 0 // not assigned to a team
  232. #define TEAM_SPECTATOR 1 // spectator team
  233. // Start your team numbers after this
  234. #define LAST_SHARED_TEAM TEAM_SPECTATOR
  235. // The first team that's game specific (i.e. not unassigned / spectator)
  236. #define FIRST_GAME_TEAM (LAST_SHARED_TEAM+1)
  237. #define MAX_TEAMS 32 // Max number of teams in a game
  238. #define MAX_TEAM_NAME_LENGTH 32 // Max length of a team's name
  239. #define MAX_TEAM_FLAG_ICON_LENGTH 8 // Max length of a team's flag icon (just the singlular country code)
  240. #define MAX_TEAM_LOGO_ICON_LENGTH 8 // Max length of a team's flag icon (just the singlular country code)
  241. #define MAX_TEAM_FLAG_HTML_LENGTH 64 // Max length of a team's flag html string
  242. //#define TEAM_FLAG_IMG_STRING "<img src='flag_%s.png' height='26' width='52'/>"
  243. #define TEAM_FLAG_IMG_STRING "<img src='flag_%s.png'/>"//resource/Flash/images/flags/
  244. #define TEAM_LOGO_IMG_STRING "%s.png"
  245. #define TEAM_FLAG_IMG_MOV_STRING "%s"//.png
  246. // Weapon m_iState
  247. #define WEAPON_NOT_CARRIED 0 // Weapon is on the ground
  248. #define WEAPON_IS_CARRIED_BY_PLAYER 1 // This client is carrying this weapon.
  249. #define WEAPON_IS_ACTIVE 2 // This client is carrying this weapon and it's the currently held weapon
  250. // -----------------------------------------
  251. // Skill Level
  252. // -----------------------------------------
  253. #define SKILL_EASY 1
  254. #define SKILL_MEDIUM 2
  255. #define SKILL_HARD 3
  256. // Weapon flags
  257. // -----------------------------------------
  258. // Flags - NOTE: KEEP g_ItemFlags IN WEAPON_PARSE.CPP UPDATED WITH THESE
  259. // -----------------------------------------
  260. #define ITEM_FLAG_SELECTONEMPTY (1<<0)
  261. #define ITEM_FLAG_NOAUTORELOAD (1<<1)
  262. #define ITEM_FLAG_NOAUTOSWITCHEMPTY (1<<2)
  263. #define ITEM_FLAG_LIMITINWORLD (1<<3)
  264. #define ITEM_FLAG_EXHAUSTIBLE (1<<4) // A player can totally exhaust their ammo supply and lose this weapon
  265. #define ITEM_FLAG_DOHITLOCATIONDMG (1<<5) // This weapon take hit location into account when applying damage
  266. #define ITEM_FLAG_NOAMMOPICKUPS (1<<6) // Don't draw ammo pickup sprites/sounds when ammo is received
  267. #define ITEM_FLAG_NOITEMPICKUP (1<<7) // Don't draw weapon pickup when this weapon is picked up by the player
  268. // NOTE: KEEP g_ItemFlags IN WEAPON_PARSE.CPP UPDATED WITH THESE
  269. // Humans only have left and right hands, though we might have aliens with more
  270. // than two, sigh
  271. #if defined( CSTRIKE15 )
  272. #define MAX_VIEWMODELS 2
  273. #else
  274. #define MAX_VIEWMODELS 2
  275. #endif
  276. #define MAX_BEAM_ENTS 10
  277. #define TRACER_TYPE_DEFAULT 0x00000001
  278. #define TRACER_TYPE_GUNSHIP 0x00000002
  279. #define TRACER_TYPE_STRIDER 0x00000004 // Here ya go, Jay!
  280. #define TRACER_TYPE_GAUSS 0x00000008
  281. #define TRACER_TYPE_WATERBULLET 0x00000010
  282. #define MUZZLEFLASH_TYPE_DEFAULT 0x00000001
  283. #define MUZZLEFLASH_TYPE_GUNSHIP 0x00000002
  284. #define MUZZLEFLASH_TYPE_STRIDER 0x00000004
  285. // Muzzle flash definitions (for the flags field of the "MuzzleFlash" DispatchEffect)
  286. enum
  287. {
  288. MUZZLEFLASH_AR2 = 0,
  289. MUZZLEFLASH_SHOTGUN,
  290. MUZZLEFLASH_SMG1,
  291. MUZZLEFLASH_SMG2,
  292. MUZZLEFLASH_PISTOL,
  293. MUZZLEFLASH_COMBINE,
  294. MUZZLEFLASH_357,
  295. MUZZLEFLASH_RPG,
  296. MUZZLEFLASH_COMBINE_TURRET,
  297. MUZZLEFLASH_FIRSTPERSON = 0x100,
  298. };
  299. // Tracer Flags
  300. #define TRACER_FLAG_WHIZ 0x0001
  301. #define TRACER_FLAG_USEATTACHMENT 0x0002
  302. #define TRACER_DONT_USE_ATTACHMENT -1
  303. // Entity Dissolve types
  304. enum
  305. {
  306. ENTITY_DISSOLVE_NORMAL = 0,
  307. ENTITY_DISSOLVE_ELECTRICAL,
  308. ENTITY_DISSOLVE_ELECTRICAL_LIGHT,
  309. ENTITY_DISSOLVE_CORE,
  310. // NOTE: Be sure to up the bits if you make more dissolve types
  311. ENTITY_DISSOLVE_BITS = 3
  312. };
  313. // ---------------------------
  314. // Hit Group standards
  315. // ---------------------------
  316. #define HITGROUP_GENERIC 0
  317. #define HITGROUP_HEAD 1
  318. #define HITGROUP_CHEST 2
  319. #define HITGROUP_STOMACH 3
  320. #define HITGROUP_LEFTARM 4
  321. #define HITGROUP_RIGHTARM 5
  322. #define HITGROUP_LEFTLEG 6
  323. #define HITGROUP_RIGHTLEG 7
  324. #define HITGROUP_GEAR 10 // alerts NPC, but doesn't do damage or bleed (1/100th damage)
  325. //
  326. // Enumerations for setting player animation.
  327. //
  328. enum PLAYER_ANIM
  329. {
  330. PLAYER_IDLE,
  331. PLAYER_WALK,
  332. PLAYER_JUMP,
  333. PLAYER_SUPERJUMP,
  334. PLAYER_DIE,
  335. PLAYER_ATTACK1,
  336. PLAYER_IN_VEHICLE,
  337. // TF Player animations
  338. PLAYER_RELOAD,
  339. PLAYER_START_AIMING,
  340. PLAYER_LEAVE_AIMING,
  341. };
  342. #ifdef HL2_DLL
  343. // HL2 has 600 gravity by default
  344. // NOTE: The discrete ticks can have quantization error, so these numbers are biased a little to
  345. // make the heights more exact
  346. #define PLAYER_FATAL_FALL_SPEED 922.5f // approx 60 feet sqrt( 2 * gravity * 60 * 12 )
  347. #define PLAYER_MAX_SAFE_FALL_SPEED 526.5f // approx 20 feet sqrt( 2 * gravity * 20 * 12 )
  348. #define PLAYER_LAND_ON_FLOATING_OBJECT 173 // Can fall another 173 in/sec without getting hurt
  349. #define PLAYER_MIN_BOUNCE_SPEED 173
  350. #define PLAYER_FALL_PUNCH_THRESHOLD 303.0f // won't punch player's screen/make scrape noise unless player falling at least this fast - at least a 76" fall (sqrt( 2 * g * 76))
  351. #else
  352. #define PLAYER_FATAL_FALL_SPEED 1024 // approx 60 feet
  353. #define PLAYER_MAX_SAFE_FALL_SPEED 580 // approx 20 feet
  354. #define PLAYER_LAND_ON_FLOATING_OBJECT 200 // Can go another 200 units without getting hurt
  355. #define PLAYER_MIN_BOUNCE_SPEED 200
  356. #define PLAYER_FALL_PUNCH_THRESHOLD (float)350 // won't punch player's screen/make scrape noise unless player falling at least this fast.
  357. #endif
  358. #define DAMAGE_FOR_FALL_SPEED 100.0f / ( PLAYER_FATAL_FALL_SPEED - PLAYER_MAX_SAFE_FALL_SPEED ) // damage per unit per second.
  359. #define AUTOAIM_2DEGREES 0.0348994967025
  360. #define AUTOAIM_5DEGREES 0.08715574274766
  361. #define AUTOAIM_8DEGREES 0.1391731009601
  362. #define AUTOAIM_10DEGREES 0.1736481776669
  363. #define AUTOAIM_20DEGREES 0.3490658503989
  364. #define AUTOAIM_SCALE_DEFAULT 1.0f
  365. #define AUTOAIM_SCALE_DIRECT_ONLY 0.0f
  366. // instant damage
  367. // For a means of resolving these consts into debug string text, see function
  368. // CTakeDamageInfo::DebugGetDamageTypeString(unsigned int DamageType, char *outbuf, unsigned int outbuflength )
  369. #define DMG_GENERIC 0 // generic damage was done
  370. #define DMG_CRUSH (1 << 0) // crushed by falling or moving object.
  371. // NOTE: It's assumed crush damage is occurring as a result of physics collision, so no extra physics force is generated by crush damage.
  372. // DON'T use DMG_CRUSH when damaging entities unless it's the result of a physics collision. You probably want DMG_CLUB instead.
  373. #define DMG_BULLET (1 << 1) // shot
  374. #define DMG_SLASH (1 << 2) // cut, clawed, stabbed
  375. #define DMG_BURN (1 << 3) // heat burned
  376. #define DMG_VEHICLE (1 << 4) // hit by a vehicle
  377. #define DMG_FALL (1 << 5) // fell too far
  378. #define DMG_BLAST (1 << 6) // explosive blast damage
  379. #define DMG_CLUB (1 << 7) // crowbar, punch, headbutt
  380. #define DMG_SHOCK (1 << 8) // electric shock
  381. #define DMG_SONIC (1 << 9) // sound pulse shockwave
  382. #define DMG_ENERGYBEAM (1 << 10) // laser or other high energy beam
  383. #define DMG_PREVENT_PHYSICS_FORCE (1 << 11) // Prevent a physics force
  384. #define DMG_NEVERGIB (1 << 12) // with this bit OR'd in, no damage type will be able to gib victims upon death
  385. #define DMG_ALWAYSGIB (1 << 13) // with this bit OR'd in, any damage type can be made to gib victims upon death.
  386. #define DMG_DROWN (1 << 14) // Drowning
  387. #define DMG_PARALYZE (1 << 15) // slows affected creature down
  388. #define DMG_NERVEGAS (1 << 16) // nerve toxins, very bad
  389. #define DMG_POISON (1 << 17) // blood poisoning - heals over time like drowning damage
  390. #define DMG_RADIATION (1 << 18) // radiation exposure
  391. #define DMG_DROWNRECOVER (1 << 19) // drowning recovery
  392. #define DMG_ACID (1 << 20) // toxic chemicals or acid burns
  393. #define DMG_SLOWBURN (1 << 21) // in an oven
  394. #define DMG_REMOVENORAGDOLL (1<<22) // with this bit OR'd in, no ragdoll will be created, and the target will be quietly removed.
  395. // use this to kill an entity that you've already got a server-side ragdoll for
  396. #define DMG_PHYSGUN (1<<23) // Hit by manipulator. Usually doesn't do any damage.
  397. #define DMG_PLASMA (1<<24) // Shot by Cremator
  398. #define DMG_AIRBOAT (1<<25) // Hit by the airboat's gun
  399. #define DMG_DISSOLVE (1<<26) // Dissolving!
  400. #define DMG_BLAST_SURFACE (1<<27) // A blast on the surface of water that cannot harm things underwater
  401. #define DMG_DIRECT (1<<28)
  402. #define DMG_BUCKSHOT (1<<29) // not quite a bullet. Little, rounder, different.
  403. // NOTE: DO NOT ADD ANY MORE CUSTOM DMG_ TYPES. MODS USE THE DMG_LASTGENERICFLAG BELOW, AND
  404. // IF YOU ADD NEW DMG_ TYPES, THEIR TYPES WILL BE HOSED. WE NEED A BETTER SOLUTION.
  405. // TODO: keep this up to date so all the mod-specific flags don't overlap anything.
  406. #define DMG_LASTGENERICFLAG DMG_BUCKSHOT
  407. // settings for m_takedamage
  408. #define DAMAGE_NO 0
  409. #define DAMAGE_EVENTS_ONLY 1 // Call damage functions, but don't modify health
  410. #define DAMAGE_YES 2
  411. #define DAMAGE_AIM 3
  412. enum RelativeDamagedDirection_t
  413. {
  414. DAMAGED_DIR_NONE = 0,
  415. DAMAGED_DIR_FRONT,
  416. DAMAGED_DIR_BACK,
  417. DAMAGED_DIR_LEFT,
  418. DAMAGED_DIR_RIGHT,
  419. DAMAGED_DIR_TOTAL
  420. };
  421. // Spectator Movement modes
  422. enum
  423. {
  424. OBS_MODE_NONE = 0, // not in spectator mode
  425. OBS_MODE_DEATHCAM, // special mode for death cam animation
  426. OBS_MODE_FREEZECAM, // zooms to a target, and freeze-frames on them
  427. OBS_MODE_FIXED, // view from a fixed camera position
  428. OBS_MODE_IN_EYE, // follow a player in first person view
  429. OBS_MODE_CHASE, // follow a player in third person view
  430. OBS_MODE_ROAMING, // free roaming
  431. NUM_OBSERVER_MODES,
  432. };
  433. #define LAST_PLAYER_OBSERVERMODE OBS_MODE_ROAMING
  434. // Force Camera Restrictions with mp_forcecamera
  435. enum {
  436. OBS_ALLOW_ALL = 0, // allow all modes, all targets
  437. OBS_ALLOW_TEAM, // allow only own team & first person, no PIP
  438. OBS_ALLOW_NONE, // don't allow any spectating after death (fixed & fade to black)
  439. OBS_ALLOW_NUM_MODES,
  440. };
  441. enum
  442. {
  443. TYPE_TEXT = 0, // just display this plain text
  444. TYPE_INDEX, // lookup text & title in stringtable
  445. TYPE_URL, // show this URL
  446. TYPE_FILE, // show this local file
  447. } ;
  448. // [Forrest] Replaced text window command string with TEXTWINDOW_CMD enumeration
  449. // of options. Passing a command string is dangerous and allowed a server network
  450. // message to run arbitrary commands on the client.
  451. enum
  452. {
  453. TEXTWINDOW_CMD_NONE = 0,
  454. TEXTWINDOW_CMD_JOINGAME,
  455. TEXTWINDOW_CMD_CHANGETEAM,
  456. TEXTWINDOW_CMD_IMPULSE101,
  457. TEXTWINDOW_CMD_MAPINFO,
  458. TEXTWINDOW_CMD_CLOSED_HTMLPAGE,
  459. TEXTWINDOW_CMD_CHOOSETEAM,
  460. };
  461. // VGui Screen Flags
  462. enum
  463. {
  464. VGUI_SCREEN_ACTIVE = 0x1,
  465. VGUI_SCREEN_VISIBLE_TO_TEAMMATES = 0x2,
  466. VGUI_SCREEN_ATTACHED_TO_VIEWMODEL = 0x4,
  467. VGUI_SCREEN_TRANSPARENT = 0x8,
  468. VGUI_SCREEN_ONLY_USABLE_BY_OWNER = 0x10,
  469. VGUI_SCREEN_MAX_BITS = 5
  470. };
  471. typedef enum
  472. {
  473. USE_OFF = 0,
  474. USE_ON = 1,
  475. USE_SET = 2,
  476. USE_TOGGLE = 3
  477. } USE_TYPE;
  478. // basic team colors
  479. #define COLOR_RED Color(255, 64, 64, 255)
  480. #define COLOR_BLUE Color(153, 204, 255, 255)
  481. #define COLOR_YELLOW Color(255, 178, 0, 255)
  482. #define COLOR_GREEN Color(153, 255, 153, 255)
  483. #define COLOR_GREY Color(204, 204, 204, 255)
  484. #define COLOR_WHITE Color(255, 255, 255, 255)
  485. #define COLOR_BLACK Color(0, 0, 0, 255)
  486. // All NPCs need this data
  487. enum
  488. {
  489. DONT_BLEED = -1,
  490. BLOOD_COLOR_RED = 0,
  491. BLOOD_COLOR_YELLOW,
  492. BLOOD_COLOR_GREEN,
  493. BLOOD_COLOR_MECH,
  494. #if defined( HL2_EPISODIC )
  495. BLOOD_COLOR_ANTLION, // FIXME: Move to Base HL2
  496. BLOOD_COLOR_ZOMBIE, // FIXME: Move to Base HL2
  497. BLOOD_COLOR_ANTLION_WORKER,
  498. BLOOD_COLOR_BLOB,
  499. BLOOD_COLOR_BLOB_FROZEN,
  500. #endif // HL2_EPISODIC
  501. #if defined( INFESTED_DLL )
  502. BLOOD_COLOR_BLOB,
  503. BLOOD_COLOR_BLOB_FROZEN,
  504. #endif // INFESTED_DLL
  505. BLOOD_COLOR_BRIGHTGREEN,
  506. };
  507. //-----------------------------------------------------------------------------
  508. // Vehicles may have more than one passenger.
  509. // This enum may be expanded by derived classes
  510. //-----------------------------------------------------------------------------
  511. enum PassengerRole_t
  512. {
  513. VEHICLE_ROLE_NONE = -1,
  514. VEHICLE_ROLE_DRIVER = 0, // Only one driver
  515. LAST_SHARED_VEHICLE_ROLE,
  516. };
  517. //-----------------------------------------------------------------------------
  518. // Water splash effect flags
  519. //-----------------------------------------------------------------------------
  520. enum
  521. {
  522. FX_WATER_IN_SLIME = 0x1,
  523. };
  524. // Shared think context stuff
  525. #define MAX_CONTEXT_LENGTH 32
  526. #define NO_THINK_CONTEXT -1
  527. // entity flags, CBaseEntity::m_iEFlags
  528. enum
  529. {
  530. EFL_KILLME = (1<<0), // This entity is marked for death -- This allows the game to actually delete ents at a safe time
  531. EFL_DORMANT = (1<<1), // Entity is dormant, no updates to client
  532. EFL_NOCLIP_ACTIVE = (1<<2), // Lets us know when the noclip command is active.
  533. EFL_SETTING_UP_BONES = (1<<3), // Set while a model is setting up its bones.
  534. EFL_KEEP_ON_RECREATE_ENTITIES = (1<<4), // This is a special entity that should not be deleted when we restart entities only
  535. EFL_DIRTY_SHADOWUPDATE = (1<<5), // Client only- need shadow manager to update the shadow...
  536. EFL_NOTIFY = (1<<6), // Another entity is watching events on this entity (used by teleport)
  537. // The default behavior in ShouldTransmit is to not send an entity if it doesn't
  538. // have a model. Certain entities want to be sent anyway because all the drawing logic
  539. // is in the client DLL. They can set this flag and the engine will transmit them even
  540. // if they don't have a model.
  541. EFL_FORCE_CHECK_TRANSMIT = (1<<7),
  542. EFL_BOT_FROZEN = (1<<8), // This is set on bots that are frozen.
  543. EFL_SERVER_ONLY = (1<<9), // Non-networked entity.
  544. EFL_NO_AUTO_EDICT_ATTACH = (1<<10), // Don't attach the edict; we're doing it explicitly
  545. // Some dirty bits with respect to abs computations
  546. EFL_DIRTY_ABSTRANSFORM = (1<<11),
  547. EFL_DIRTY_ABSVELOCITY = (1<<12),
  548. EFL_DIRTY_ABSANGVELOCITY = (1<<13),
  549. EFL_DIRTY_SURROUNDING_COLLISION_BOUNDS = (1<<14),
  550. EFL_DIRTY_SPATIAL_PARTITION = (1<<15),
  551. EFL_HAS_PLAYER_CHILD= (1<<16), // One of the child entities is a player.
  552. EFL_IN_SKYBOX = (1<<17), // This is set if the entity detects that it's in the skybox.
  553. // This forces it to pass the "in PVS" for transmission.
  554. EFL_USE_PARTITION_WHEN_NOT_SOLID = (1<<18), // Entities with this flag set show up in the partition even when not solid
  555. EFL_TOUCHING_FLUID = (1<<19), // Used to determine if an entity is floating
  556. // FIXME: Not really sure where I should add this...
  557. EFL_IS_BEING_LIFTED_BY_BARNACLE = (1<<20),
  558. EFL_NO_ROTORWASH_PUSH = (1<<21), // I shouldn't be pushed by the rotorwash
  559. EFL_NO_THINK_FUNCTION = (1<<22),
  560. EFL_NO_GAME_PHYSICS_SIMULATION = (1<<23),
  561. EFL_CHECK_UNTOUCH = (1<<24),
  562. EFL_DONTBLOCKLOS = (1<<25), // I shouldn't block NPC line-of-sight
  563. EFL_DONTWALKON = (1<<26), // NPC;s should not walk on this entity
  564. EFL_NO_DISSOLVE = (1<<27), // These guys shouldn't dissolve
  565. EFL_NO_MEGAPHYSCANNON_RAGDOLL = (1<<28), // Mega physcannon can't ragdoll these guys.
  566. EFL_NO_WATER_VELOCITY_CHANGE = (1<<29), // Don't adjust this entity's velocity when transitioning into water
  567. EFL_NO_PHYSCANNON_INTERACTION = (1<<30), // Physcannon can't pick these up or punt them
  568. EFL_NO_DAMAGE_FORCES = (1<<31), // Doesn't accept forces from physics damage
  569. };
  570. //-----------------------------------------------------------------------------
  571. // EFFECTS
  572. //-----------------------------------------------------------------------------
  573. const int FX_BLOODSPRAY_DROPS = 0x01;
  574. const int FX_BLOODSPRAY_GORE = 0x02;
  575. const int FX_BLOODSPRAY_CLOUD = 0x04;
  576. const int FX_BLOODSPRAY_ALL = 0xFF;
  577. //-----------------------------------------------------------------------------
  578. #define MAX_SCREEN_OVERLAYS 10
  579. // These are the types of data that hang off of CBaseEntities and the flag bits used to mark their presence
  580. enum
  581. {
  582. GROUNDLINK = 0,
  583. TOUCHLINK,
  584. STEPSIMULATION,
  585. MODELSCALE,
  586. POSITIONWATCHER,
  587. PHYSICSPUSHLIST,
  588. VPHYSICSUPDATEAI,
  589. VPHYSICSWATCHER,
  590. // Must be last and <= 32
  591. NUM_DATAOBJECT_TYPES,
  592. };
  593. class CBaseEntity;
  594. //-----------------------------------------------------------------------------
  595. // Bullet firing information
  596. //-----------------------------------------------------------------------------
  597. class CBaseEntity;
  598. enum FireBulletsFlags_t
  599. {
  600. FIRE_BULLETS_FIRST_SHOT_ACCURATE = 0x1, // Pop the first shot with perfect accuracy
  601. FIRE_BULLETS_DONT_HIT_UNDERWATER = 0x2, // If the shot hits its target underwater, don't damage it
  602. FIRE_BULLETS_ALLOW_WATER_SURFACE_IMPACTS = 0x4, // If the shot hits water surface, still call DoImpactEffect
  603. FIRE_BULLETS_TEMPORARY_DANGER_SOUND = 0x8, // Danger sounds added from this impact can be stomped immediately if another is queued
  604. FIRE_BULLETS_NO_PIERCING_SPARK = 0x16, // do a piercing spark effect when a bullet penetrates an alien
  605. FIRE_BULLETS_HULL = 0x32, // bullet trace is a hull rather than a line
  606. FIRE_BULLETS_ANGULAR_SPREAD = 0x64, // bullet spread is based on uniform random change to angles rather than gaussian search
  607. };
  608. struct FireBulletsInfo_t
  609. {
  610. FireBulletsInfo_t()
  611. {
  612. m_iShots = 1;
  613. m_vecSpread.Init( 0, 0, 0 );
  614. m_flDistance = 8192;
  615. m_iTracerFreq = 4;
  616. m_flDamage = 0.0f;
  617. m_flPlayerDamage = 0.0f;
  618. m_pAttacker = NULL;
  619. m_nFlags = 0;
  620. m_pAdditionalIgnoreEnt = NULL;
  621. m_flDamageForceScale = 1.0f;
  622. #ifdef _DEBUG
  623. m_iAmmoType = -1;
  624. m_vecSrc.Init( VEC_T_NAN, VEC_T_NAN, VEC_T_NAN );
  625. m_vecDirShooting.Init( VEC_T_NAN, VEC_T_NAN, VEC_T_NAN );
  626. #endif
  627. m_bPrimaryAttack = true;
  628. }
  629. FireBulletsInfo_t( int nShots, const Vector &vecSrc, const Vector &vecDir, const Vector &vecSpread, float flDistance, int nAmmoType, bool bPrimaryAttack = true )
  630. {
  631. m_iShots = nShots;
  632. m_vecSrc = vecSrc;
  633. m_vecDirShooting = vecDir;
  634. m_vecSpread = vecSpread;
  635. m_flDistance = flDistance;
  636. m_iAmmoType = nAmmoType;
  637. m_iTracerFreq = 4;
  638. m_flDamage = 0;
  639. m_flPlayerDamage = 0;
  640. m_pAttacker = NULL;
  641. m_nFlags = 0;
  642. m_pAdditionalIgnoreEnt = NULL;
  643. m_flDamageForceScale = 1.0f;
  644. m_bPrimaryAttack = bPrimaryAttack;
  645. }
  646. int m_iShots;
  647. Vector m_vecSrc;
  648. Vector m_vecDirShooting;
  649. Vector m_vecSpread;
  650. float m_flDistance;
  651. int m_iAmmoType;
  652. int m_iTracerFreq;
  653. float m_flDamage;
  654. float m_flPlayerDamage; // Damage to be used instead of m_flDamage if we hit a player
  655. int m_nFlags; // See FireBulletsFlags_t
  656. float m_flDamageForceScale;
  657. CBaseEntity *m_pAttacker;
  658. CBaseEntity *m_pAdditionalIgnoreEnt;
  659. bool m_bPrimaryAttack;
  660. };
  661. //-----------------------------------------------------------------------------
  662. // Purpose: Data for making the MOVETYPE_STEP entities appear to simulate every frame
  663. // We precompute the simulation and then meter it out each tick during networking of the
  664. // entities origin and orientation. Uses a bit more bandwidth, but it solves the NPCs interacting
  665. // with elevators/lifts bugs.
  666. //-----------------------------------------------------------------------------
  667. struct StepSimulationStep
  668. {
  669. int nTickCount;
  670. Vector vecOrigin;
  671. Quaternion qRotation;
  672. };
  673. struct StepSimulationData
  674. {
  675. // Are we using the Step Simulation Data
  676. bool m_bOriginActive;
  677. bool m_bAnglesActive;
  678. // This is the pre-pre-Think position, orientation (Quaternion) and tick count
  679. StepSimulationStep m_Previous2;
  680. // This is the pre-Think position, orientation (Quaternion) and tick count
  681. StepSimulationStep m_Previous;
  682. // This is a potential mid-think position, orientation (Quaternion) and tick count
  683. // Used to mark motion discontinuities that happen between thinks
  684. StepSimulationStep m_Discontinuity;
  685. // This is the goal or post-Think position and orientation (and Quaternion for blending) and next think time tick
  686. StepSimulationStep m_Next;
  687. QAngle m_angNextRotation;
  688. // This variable is used so that we only compute networked origin/angles once per tick
  689. int m_nLastProcessTickCount;
  690. // The computed/interpolated network origin/angles to use
  691. Vector m_vecNetworkOrigin;
  692. int m_networkCell[3];
  693. QAngle m_angNetworkAngles;
  694. };
  695. //-----------------------------------------------------------------------------
  696. // Purpose: Simple state tracking for changing model sideways shrinkage during barnacle swallow
  697. //-----------------------------------------------------------------------------
  698. struct ModelScale
  699. {
  700. float m_flModelScaleStart;
  701. float m_flModelScaleGoal;
  702. float m_flModelScaleFinishTime;
  703. float m_flModelScaleStartTime;
  704. };
  705. #include "soundflags.h"
  706. #include "SoundEmitterSystem/isoundemittersystembase.h"
  707. struct CSoundParameters;
  708. //-----------------------------------------------------------------------------
  709. // Purpose: Aggregates and sets default parameters for EmitSound function calls
  710. //-----------------------------------------------------------------------------
  711. struct EmitSound_t
  712. {
  713. EmitSound_t() :
  714. m_nChannel( 0 ),
  715. m_pSoundName( 0 ),
  716. m_flVolume( VOL_NORM ),
  717. m_SoundLevel( SNDLVL_NONE ),
  718. m_nFlags( 0 ),
  719. m_nPitch( PITCH_NORM ),
  720. m_pOrigin( 0 ),
  721. m_flSoundTime( 0.0f ),
  722. m_pflSoundDuration( 0 ),
  723. m_bEmitCloseCaption( true ),
  724. m_bWarnOnMissingCloseCaption( false ),
  725. m_bWarnOnDirectWaveReference( false ),
  726. m_nSpeakerEntity( -1 ),
  727. m_UtlVecSoundOrigin(),
  728. m_hSoundScriptHash( SOUNDEMITTER_INVALID_HASH ),
  729. m_nSoundEntryVersion( 1 )
  730. {
  731. }
  732. EmitSound_t( const CSoundParameters &src );
  733. int m_nChannel;
  734. char const *m_pSoundName;
  735. float m_flVolume;
  736. soundlevel_t m_SoundLevel;
  737. int m_nFlags;
  738. int m_nPitch;
  739. const Vector *m_pOrigin;
  740. float m_flSoundTime; ///< NOT DURATION, but rather, some absolute time in the future until which this sound should be delayed
  741. float *m_pflSoundDuration;
  742. bool m_bEmitCloseCaption;
  743. bool m_bWarnOnMissingCloseCaption;
  744. bool m_bWarnOnDirectWaveReference;
  745. int m_nSpeakerEntity;
  746. mutable CUtlVector< Vector > m_UtlVecSoundOrigin; ///< Actual sound origin(s) (can be multiple if sound routed through speaker entity(ies) )
  747. mutable HSOUNDSCRIPTHASH m_hSoundScriptHash;
  748. int m_nSoundEntryVersion;
  749. };
  750. #define MAX_ACTORS_IN_SCENE 16
  751. //-----------------------------------------------------------------------------
  752. // Multiplayer specific defines
  753. //-----------------------------------------------------------------------------
  754. #define MAX_CONTROL_POINTS 8
  755. #define MAX_CONTROL_POINT_GROUPS 8
  756. // Maximum number of points that a control point may need owned to be cappable
  757. #define MAX_PREVIOUS_POINTS 3
  758. // The maximum number of teams the control point system knows how to deal with
  759. #define MAX_CONTROL_POINT_TEAMS 8
  760. // Maximum length of the cap layout string
  761. #define MAX_CAPLAYOUT_LENGTH 32
  762. // Maximum length of the current round printname
  763. #define MAX_ROUND_NAME 32
  764. // Maximum length of the current round name
  765. #define MAX_ROUND_IMAGE_NAME 64
  766. // Score added to the team score for a round win
  767. #define TEAMPLAY_ROUND_WIN_SCORE 1
  768. enum
  769. {
  770. CP_WARN_NORMAL = 0,
  771. CP_WARN_FINALCAP,
  772. CP_WARN_NO_ANNOUNCEMENTS
  773. };
  774. // YWB: 3/12/2007
  775. // Changing the following #define for Prediction Error checking (See gamemovement.cpp for overview) will to 1 or 2 enables the system, 0 turns it off
  776. // Level 1 enables it, but doesn't force "full precision" networking, so you can still get lots of errors in position/velocity/etc.
  777. // Level 2 enables it but also forces origins/angles to be sent full precision, so other fields can be error / tolerance checked
  778. // NOTE: This stuff only works on a listen server since it punches a hole from the client .dll to server .dll!!!
  779. #define PREDICTION_ERROR_CHECK_LEVEL 0
  780. // Set to 1 to spew a call stack in DiffPrint() for the existing side when the other side is missing
  781. #define PREDICTION_ERROR_CHECK_STACKS_FOR_MISSING 0
  782. //-----------------------------------------------------------------------------
  783. // Round timer states
  784. //-----------------------------------------------------------------------------
  785. enum
  786. {
  787. RT_STATE_SETUP, // Timer is in setup mode
  788. RT_STATE_NORMAL, // Timer is in normal mode
  789. };
  790. enum
  791. {
  792. SIMULATION_TIME_WINDOW_BITS = 8,
  793. };
  794. //-----------------------------------------------------------------------------
  795. // Commentary Mode
  796. //-----------------------------------------------------------------------------
  797. #if defined(TF_DLL) || defined(TF_CLIENT_DLL)
  798. #define GAME_HAS_NO_USE_KEY
  799. //-----------------------------------------------------------------------------
  800. // Multiplayer overrides
  801. //-----------------------------------------------------------------------------
  802. #if defined( SPROP_COORD )
  803. #undef SPROP_COORD
  804. #endif
  805. #define SPROP_COORD SPROP_COORD_MP
  806. #endif
  807. //-----------------------------------------------------------------------------
  808. // Cell origin values
  809. //-----------------------------------------------------------------------------
  810. #define CELL_COUNT( bits ) ( (MAX_COORD_INTEGER*2) / (1 << (bits)) ) // How many cells on an axis based on the bit size of the cell
  811. #define CELL_COUNT_BITS( bits ) MINIMUM_BITS_NEEDED( CELL_COUNT( bits ) ) // How many bits are necessary to respresent that cell
  812. #define CELL_BASEENTITY_ORIGIN_CELL_BITS 5 // default amount of entropy bits for base entity
  813. // The player's method of starting / stopping commentary
  814. #ifdef GAME_HAS_NO_USE_KEY
  815. #define COMMENTARY_BUTTONS (IN_ATTACK | IN_ATTACK2 | IN_USE)
  816. #else
  817. #ifdef PORTAL2
  818. #define COMMENTARY_BUTTONS (IN_USE | IN_REMOTE_VIEW)
  819. #else
  820. #define COMMENTARY_BUTTONS (IN_USE)
  821. #endif
  822. #endif
  823. bool IsHeadTrackingEnabled();
  824. // If this is defined, all of the scopeguard objects are NULL'd out to reduce overhead
  825. #if defined( CSTRIKE15 ) //&& !defined( _GAMECONSOLE ) // Split screen removed from console.
  826. #define SPLIT_SCREEN_STUBS
  827. #endif
  828. #if defined(TF_DLL) || defined(TF_CLIENT_DLL)
  829. #if defined( SPLIT_SCREEN_STUBS )
  830. #define MAX_SPLITSCREEN_PLAYERS 1
  831. #else
  832. #define MAX_SPLITSCREEN_PLAYERS 2
  833. #endif
  834. #elif defined( PORTAL2 )
  835. #define MAX_SPLITSCREEN_PLAYERS 2
  836. #elif defined ( CSTRIKE15 )
  837. #if defined( _GAMECONSOLE )
  838. #define MAX_SPLITSCREEN_PLAYERS 1 // Split screen removed from console.
  839. #else
  840. #define MAX_SPLITSCREEN_PLAYERS 1
  841. #endif
  842. #else
  843. #define MAX_SPLITSCREEN_PLAYERS 1
  844. #endif
  845. inline bool IsSplitScreenSupported()
  846. {
  847. return ( MAX_SPLITSCREEN_PLAYERS > 1 ) ? true : false;
  848. }
  849. //-----------------------------------------------------------------------------
  850. // For invalidate physics recursive
  851. //-----------------------------------------------------------------------------
  852. enum InvalidatePhysicsBits_t
  853. {
  854. POSITION_CHANGED = 0x1,
  855. ANGLES_CHANGED = 0x2,
  856. VELOCITY_CHANGED = 0x4,
  857. ANIMATION_CHANGED = 0x8, // Means cycle has changed, or any other event which would cause render-to-texture shadows to need to be rerendeded
  858. BOUNDS_CHANGED = 0x10, // Means render bounds have changed, so shadow decal projection is required, etc.
  859. SEQUENCE_CHANGED = 0x20, // Means sequence has changed, only interesting when surrounding bounds depends on sequence
  860. };
  861. enum Class_T
  862. {
  863. CLASS_NONE = 0,
  864. CLASS_PLAYER,
  865. CLASS_PLAYER_ALLY,
  866. CLASS_PLAYER_ALLY_VITAL,
  867. CLASS_ANTLION,
  868. CLASS_BARNACLE,
  869. CLASS_BLOB,
  870. CLASS_BULLSEYE,
  871. //CLASS_BULLSQUID,
  872. CLASS_CITIZEN_PASSIVE,
  873. CLASS_CITIZEN_REBEL,
  874. CLASS_COMBINE,
  875. CLASS_COMBINE_GUNSHIP,
  876. CLASS_CONSCRIPT,
  877. CLASS_HEADCRAB,
  878. //CLASS_HOUNDEYE,
  879. CLASS_MANHACK,
  880. CLASS_METROPOLICE,
  881. CLASS_MILITARY,
  882. CLASS_SCANNER,
  883. CLASS_STALKER,
  884. CLASS_VORTIGAUNT,
  885. CLASS_ZOMBIE,
  886. CLASS_PROTOSNIPER,
  887. CLASS_MISSILE,
  888. CLASS_FLARE,
  889. CLASS_EARTH_FAUNA,
  890. CLASS_HACKED_ROLLERMINE,
  891. CLASS_COMBINE_HUNTER,
  892. LAST_SHARED_ENTITY_CLASS,
  893. };
  894. // Factions
  895. #define FACTION_NONE 0 // Not assigned a faction. Entities not assigned a faction will not do faction tests.
  896. #define LAST_SHARED_FACTION (FACTION_NONE)
  897. #define NUM_SHARED_FACTIONS (FACTION_NONE + 1)
  898. enum ModelScaleType_t
  899. {
  900. HIERARCHICAL_MODEL_SCALE,
  901. NONHIERARCHICAL_MODEL_SCALE
  902. };
  903. //-----------------------------------------------------------------------------
  904. // Econ Item testing
  905. //-----------------------------------------------------------------------------
  906. enum testitem_itemtypes_t
  907. {
  908. TI_TYPE_UNKNOWN = -1,
  909. TI_TYPE_WEAPON = 0,
  910. TI_TYPE_HEADGEAR,
  911. TI_TYPE_MISC1,
  912. TI_TYPE_MISC2,
  913. TI_TYPE_COUNT,
  914. };
  915. //-----------------------------------------------------------------------------
  916. // Generic activity lookup support
  917. //-----------------------------------------------------------------------------
  918. enum
  919. {
  920. kActivityLookup_Unknown = -2, // hasn't been searched for
  921. kActivityLookup_Missing = -1, // has been searched for but wasn't found
  922. };
  923. // Used by base entity for spotted by masks
  924. static int const kNumSpottedByMask = ALIGN_VALUE( MAX_PLAYERS, 32 ) / 32;
  925. #endif // SHAREDDEFS_H