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.

148 lines
4.8 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: CS's custom C_PlayerResource
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef C_CS_PLAYERRESOURCE_H
  8. #define C_CS_PLAYERRESOURCE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "cs_shareddefs.h"
  13. #include "c_playerresource.h"
  14. #include "cstrike15_item_inventory.h"
  15. #define MAX_DECORATED_PLAYER_NAME_LENGTH ( ( MAX_NETWORKID_LENGTH * 10 ) + 20 )
  16. enum EDecoratedPlayerNameFlag_t
  17. {
  18. k_EDecoratedPlayerNameFlag_Simple = 0,
  19. k_EDecoratedPlayerNameFlag_AddBotToNameIfControllingBot = ( 1 << 0 ),
  20. k_EDecoratedPlayerNameFlag_DontUseNameOfControllingPlayer = ( 1 << 1 ),
  21. k_EDecoratedPlayerNameFlag_DontShowClanName = ( 1 << 2 ),
  22. k_EDecoratedPlayerNameFlag_DontMakeStringSafe = ( 1 << 3 ),
  23. k_EDecoratedPlayerNameFlag_DontUseAssassinationTargetName = ( 1 << 4 ),
  24. };
  25. class C_CS_PlayerResource : public C_PlayerResource
  26. {
  27. DECLARE_CLASS( C_CS_PlayerResource, C_PlayerResource );
  28. public:
  29. DECLARE_CLIENTCLASS();
  30. C_CS_PlayerResource();
  31. virtual ~C_CS_PlayerResource();
  32. virtual void OnDataChanged(DataUpdateType_t updateType);
  33. bool IsVIP( int iIndex );
  34. bool HasC4( int iIndex );
  35. bool IsHostageAlive(int iIndex);
  36. bool IsHostageFollowingSomeone(int iIndex);
  37. int GetHostageEntityID(int iIndex);
  38. const Vector GetBombsiteAPosition();
  39. const Vector GetBombsiteBPosition();
  40. const Vector GetHostageRescuePosition( int index );
  41. int GetNumMVPs( int iIndex );
  42. bool HasDefuser( int iIndex );
  43. bool HasHelmet( int iIndex );
  44. int GetArmor( int iIndex );
  45. int GetScore( int iIndex );
  46. int GetCompetitiveRanking( int iIndex );
  47. int GetCompetitiveWins( int iIndex );
  48. int GetCompTeammateColor( int iIndex );
  49. int GetTotalCashSpent( int iIndex );
  50. int GetCashSpentThisRound( int iIndex );
  51. const char *GetClanTag( int index );
  52. int GetActiveCoinRank( int iIndex );
  53. int GetMusicID( int iIndex );
  54. int GetPersonaDataPublicLevel( int iIndex );
  55. int GetPersonaDataPublicCommendsLeader( int iIndex );
  56. int GetPersonaDataPublicCommendsTeacher( int iIndex );
  57. int GetPersonaDataPublicCommendsFriendly( int iIndex );
  58. int GetEndMatchNextMapVote( int iIndex );
  59. bool EndMatchNextMapAllVoted( void );
  60. const wchar_t* GetDecoratedPlayerName( int name, OUT_Z_BYTECAP(bufflen) wchar_t* buffer, int bufflen, EDecoratedPlayerNameFlag_t flags );
  61. #if CS_CONTROLLABLE_BOTS_ENABLED
  62. virtual const char *GetPlayerName( int index ) OVERRIDE;
  63. bool IsControllingBot( int index );
  64. int GetControlledPlayer( int index );
  65. int GetControlledByPlayer( int index );
  66. #endif
  67. bool IsAssassinationTarget( int index );
  68. int GetBotDifficulty( int index );
  69. #if defined ENABLE_CLIENT_INVENTORIES_FOR_OTHER_PLAYERS
  70. CCSPlayerInventory * GetInventory( int index );
  71. #endif
  72. protected:
  73. virtual void UpdatePlayerName( int slot ) OVERRIDE;
  74. bool m_bDisableAssassinationTargetNameOverride;
  75. int m_iPlayerC4; // entity index of C4 carrier or 0
  76. int m_iPlayerVIP; // entity index of VIP player or 0
  77. Vector m_bombsiteCenterA;
  78. Vector m_bombsiteCenterB;
  79. bool m_bHostageAlive[MAX_HOSTAGES];
  80. bool m_isHostageFollowingSomeone[MAX_HOSTAGES];
  81. int m_iHostageEntityIDs[MAX_HOSTAGES];
  82. int m_hostageRescueX[MAX_HOSTAGE_RESCUES];
  83. int m_hostageRescueY[MAX_HOSTAGE_RESCUES];
  84. int m_hostageRescueZ[MAX_HOSTAGE_RESCUES];
  85. int m_iMVPs[ MAX_PLAYERS + 1 ];
  86. bool m_bHasDefuser[ MAX_PLAYERS + 1 ];
  87. bool m_bHasHelmet[ MAX_PLAYERS + 1 ];
  88. int m_iArmor[ MAX_PLAYERS + 1 ];
  89. int m_iScore[ MAX_PLAYERS + 1 ];
  90. int m_iCompetitiveRanking[ MAX_PLAYERS + 1 ];
  91. int m_iCompetitiveWins[ MAX_PLAYERS + 1 ];
  92. int m_iCompTeammateColor[MAX_PLAYERS + 1];
  93. #if CS_CONTROLLABLE_BOTS_ENABLED
  94. bool m_bControllingBot[ MAX_PLAYERS + 1 ];
  95. int m_iControlledPlayer[ MAX_PLAYERS + 1 ];
  96. int m_iControlledByPlayer[ MAX_PLAYERS + 1 ];
  97. char m_szPlayerNames[ MAX_PLAYERS + 1 ][ MAX_PLAYER_NAME_LENGTH ];
  98. #endif
  99. int m_iBotDifficulty[ MAX_PLAYERS + 1 ]; // Difficulty level of a bot ( -1 if not applicable )
  100. char m_szClan[MAX_PLAYERS+1][MAX_CLAN_TAG_LENGTH];
  101. int m_iTotalCashSpent[ MAX_PLAYERS + 1 ];
  102. int m_iCashSpentThisRound[ MAX_PLAYERS + 1 ];
  103. int m_nEndMatchNextMapVotes[ MAX_PLAYERS + 1 ];
  104. bool m_bEndMatchNextMapAllVoted;
  105. int m_nActiveCoinRank[ MAX_PLAYERS + 1 ];
  106. int m_nMusicID[ MAX_PLAYERS + 1 ];
  107. bool m_bIsAssassinationTarget[ MAX_PLAYERS + 1 ];
  108. int m_nPersonaDataPublicLevel[ MAX_PLAYERS + 1 ];
  109. int m_nPersonaDataPublicCommendsLeader[ MAX_PLAYERS + 1 ];
  110. int m_nPersonaDataPublicCommendsTeacher[ MAX_PLAYERS + 1 ];
  111. int m_nPersonaDataPublicCommendsFriendly[ MAX_PLAYERS + 1 ];
  112. #if defined ENABLE_CLIENT_INVENTORIES_FOR_OTHER_PLAYERS
  113. CCSPlayerInventory m_Inventory[ MAX_PLAYERS + 1 ];
  114. #endif
  115. };
  116. C_CS_PlayerResource *GetCSResources( void );
  117. #endif // C_CS_PLAYERRESOURCE_H