Team Fortress 2 Source Code as on 22/4/2020
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.

103 lines
2.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef TF_CLASSDATA_H
  7. #define TF_CLASSDATA_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. //-----------------------------------------------------------------------------
  12. // Cache structure for the TF player class data (includes citizen).
  13. //-----------------------------------------------------------------------------
  14. #define MAX_PLAYERCLASS_SOUND_LENGTH 128
  15. #define TF_NAME_LENGTH 128
  16. #define DEATH_SOUND_FIRST ( DEATH_SOUND_GENERIC )
  17. #define DEATH_SOUND_LAST ( DEATH_SOUND_EXPLOSION )
  18. #define DEATH_SOUND_MVM_FIRST ( DEATH_SOUND_GENERIC_MVM )
  19. #define DEATH_SOUND_MVM_LAST ( DEATH_SOUND_EXPLOSION_MVM )
  20. #define DEATH_SOUND_GIANT_MVM_FIRST ( DEATH_SOUND_GENERIC_GIANT_MVM )
  21. #define DEATH_SOUND_GIANT_MVM_LAST ( DEATH_SOUND_EXPLOSION_GIANT_MVM )
  22. enum DeathSoundType_t
  23. {
  24. DEATH_SOUND_GENERIC = 0,
  25. DEATH_SOUND_CRIT,
  26. DEATH_SOUND_MELEE,
  27. DEATH_SOUND_EXPLOSION,
  28. DEATH_SOUND_GENERIC_MVM,
  29. DEATH_SOUND_CRIT_MVM,
  30. DEATH_SOUND_MELEE_MVM,
  31. DEATH_SOUND_EXPLOSION_MVM,
  32. DEATH_SOUND_GENERIC_GIANT_MVM,
  33. DEATH_SOUND_CRIT_GIANT_MVM,
  34. DEATH_SOUND_MELEE_GIANT_MVM,
  35. DEATH_SOUND_EXPLOSION_GIANT_MVM,
  36. DEATH_SOUND_TOTAL
  37. };
  38. struct TFPlayerClassData_t
  39. {
  40. char m_szClassName[TF_NAME_LENGTH];
  41. char m_szModelName[TF_NAME_LENGTH];
  42. char m_szHWMModelName[TF_NAME_LENGTH];
  43. char m_szHandModelName[TF_NAME_LENGTH];
  44. char m_szLocalizableName[TF_NAME_LENGTH];
  45. float m_flMaxSpeed;
  46. int m_nMaxHealth;
  47. int m_nMaxArmor;
  48. int m_aWeapons[TF_PLAYER_WEAPON_COUNT];
  49. int m_aGrenades[TF_PLAYER_GRENADE_COUNT];
  50. int m_aAmmoMax[TF_AMMO_COUNT];
  51. int m_aBuildable[TF_PLAYER_BLUEPRINT_COUNT];
  52. bool m_bDontDoAirwalk;
  53. bool m_bDontDoNewJump;
  54. bool m_bParsed;
  55. Vector m_vecThirdPersonOffset;
  56. #ifdef GAME_DLL
  57. // sounds
  58. char m_szDeathSound[ DEATH_SOUND_TOTAL ][MAX_PLAYERCLASS_SOUND_LENGTH];
  59. #endif
  60. TFPlayerClassData_t();
  61. const char *GetModelName() const;
  62. #ifdef GAME_DLL
  63. const char *GetDeathSound( int nType );
  64. #endif
  65. void Parse( const char *pszClassName );
  66. void ParseData( KeyValues *pKeyValuesData );
  67. void AddAdditionalPlayerDeathSounds( void );
  68. };
  69. class CTFPlayerClassDataMgr : public CAutoGameSystem
  70. {
  71. public:
  72. CTFPlayerClassDataMgr();
  73. virtual bool Init( void );
  74. TFPlayerClassData_t *Get( unsigned int iClass );
  75. void AddAdditionalPlayerDeathSounds( void );
  76. private:
  77. TFPlayerClassData_t m_aTFPlayerClassData[TF_CLASS_COUNT_ALL];
  78. };
  79. extern CTFPlayerClassDataMgr *g_pTFPlayerClassDataMgr;
  80. // Legacy.
  81. TFPlayerClassData_t *GetPlayerClassData( unsigned int iClass );
  82. #endif // TF_CLASSDATA_H