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.

104 lines
3.7 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: CS's custom CPlayerResource
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef CS_PLAYER_RESOURCE_H
  8. #define CS_PLAYER_RESOURCE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "player_resource.h"
  13. extern Vector g_vecDefuserPosition;
  14. extern CBaseEntity* g_pDefuserEntity;
  15. class CCSPlayerResource : public CPlayerResource
  16. {
  17. DECLARE_CLASS( CCSPlayerResource, CPlayerResource );
  18. public:
  19. DECLARE_SERVERCLASS();
  20. DECLARE_DATADESC();
  21. CCSPlayerResource();
  22. virtual void UpdatePlayerData( void );
  23. virtual void Spawn( void );
  24. const Vector GetBombsiteAPosition();
  25. const Vector GetBombsiteBPosition();
  26. const Vector GetHostageRescuePosition( int index );
  27. bool EndMatchNextMapAllVoted( void ) { return m_bEndMatchNextMapAllVoted; }
  28. int GetCompTeammateColor( int iIndex );
  29. void ResetPlayerTeammateColor( int index );
  30. void ForcePlayersPickColors( void );
  31. void SetPlayerTeammateColor( int index, bool bReset );
  32. bool IsAssassinationTarget( int index ) const;
  33. void UpdateAssassinationTargets( const CEconQuestDefinition * pQuest );
  34. protected:
  35. CNetworkVar( int, m_iPlayerC4 ); // entity index of C4 carrier or 0
  36. CNetworkVar( int, m_iPlayerVIP ); // entity index of VIP player or 0
  37. CNetworkArray( bool, m_bHostageAlive, MAX_HOSTAGES );
  38. CNetworkArray( bool, m_isHostageFollowingSomeone, MAX_HOSTAGES );
  39. CNetworkArray( int, m_iHostageEntityIDs, MAX_HOSTAGES );
  40. CNetworkVector( m_bombsiteCenterA );// Location of bombsite A
  41. CNetworkVector( m_bombsiteCenterB );// Location of bombsite B
  42. CNetworkArray( int, m_hostageRescueX, MAX_HOSTAGE_RESCUES );// Locations of all hostage rescue spots
  43. CNetworkArray( int, m_hostageRescueY, MAX_HOSTAGE_RESCUES );
  44. CNetworkArray( int, m_hostageRescueZ, MAX_HOSTAGE_RESCUES );
  45. CNetworkArray( int, m_iMVPs, MAX_PLAYERS + 1 );
  46. CNetworkArray( int, m_iArmor, MAX_PLAYERS + 1 );
  47. CNetworkArray( bool, m_bHasDefuser, MAX_PLAYERS + 1);
  48. CNetworkArray( bool, m_bHasHelmet, MAX_PLAYERS + 1);
  49. CNetworkArray( int, m_iScore, MAX_PLAYERS + 1 );
  50. CNetworkArray( int, m_iCompetitiveRanking, MAX_PLAYERS + 1 );
  51. CNetworkArray( int, m_iCompetitiveWins, MAX_PLAYERS + 1 );
  52. CNetworkArray( int, m_iCompTeammateColor, MAX_PLAYERS + 1 );
  53. #if CS_CONTROLLABLE_BOTS_ENABLED
  54. CNetworkArray( int, m_bControllingBot, MAX_PLAYERS+1 );
  55. CNetworkArray( int, m_iControlledPlayer, MAX_PLAYERS+1 );
  56. CNetworkArray( int, m_iControlledByPlayer, MAX_PLAYERS+1 );
  57. #endif
  58. CNetworkArray( int, m_iBotDifficulty, MAX_PLAYERS+1 ); // Difficulty level of a bot ( -1 if not applicable )
  59. CNetworkArray( string_t, m_szClan, MAX_PLAYERS+1 );
  60. CNetworkArray( int, m_iTotalCashSpent, MAX_PLAYERS + 1 );
  61. CNetworkArray( int, m_iCashSpentThisRound, MAX_PLAYERS + 1 );
  62. CNetworkArray( int, m_nEndMatchNextMapVotes, MAX_PLAYERS + 1 );
  63. CNetworkVar( bool, m_bEndMatchNextMapAllVoted );
  64. CNetworkArray( int, m_nActiveCoinRank, MAX_PLAYERS + 1 );
  65. CNetworkArray( int, m_nMusicID, MAX_PLAYERS + 1 );
  66. CNetworkArray( bool, m_bIsAssassinationTarget, MAX_PLAYERS + 1 );
  67. CNetworkArray( int, m_nPersonaDataPublicLevel, MAX_PLAYERS + 1 );
  68. CNetworkArray( int, m_nPersonaDataPublicCommendsLeader, MAX_PLAYERS + 1 );
  69. CNetworkArray( int, m_nPersonaDataPublicCommendsTeacher, MAX_PLAYERS + 1 );
  70. CNetworkArray( int, m_nPersonaDataPublicCommendsFriendly, MAX_PLAYERS + 1 );
  71. bool m_nAttemptedToGetColor[MAX_PLAYERS + 1];
  72. private:
  73. bool m_foundGoalPositions;
  74. bool m_bPreferencesAssigned_CT;
  75. bool m_bPreferencesAssigned_T;
  76. };
  77. inline CCSPlayerResource* CSPlayerResource()
  78. {
  79. return static_cast<CCSPlayerResource*>(g_pPlayerResource);
  80. }
  81. #endif // CS_PLAYER_RESOURCE_H