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.

83 lines
2.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: TF's custom CPlayerResource
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef TF_PLAYER_RESOURCE_H
  8. #define TF_PLAYER_RESOURCE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "tf_player_shared.h"
  13. class CTFPlayerResource : public CPlayerResource, public CGameEventListener
  14. {
  15. DECLARE_CLASS( CTFPlayerResource, CPlayerResource );
  16. public:
  17. DECLARE_SERVERCLASS();
  18. CTFPlayerResource();
  19. virtual void FireGameEvent( IGameEvent *event );
  20. virtual void UpdatePlayerData( void );
  21. virtual void Spawn( void );
  22. virtual void Init( int iIndex ) OVERRIDE;
  23. int GetTotalScore( int iIndex );
  24. void SetPartyLeaderIndex( int iTeam, int iIndex );
  25. int GetPartyLeaderIndex( int iTeam );
  26. void SetEventTeamStatus( int iValue ) { m_iEventTeamStatus = iValue; }
  27. uint32 GetEventTeamStatus( void ) { return m_iEventTeamStatus; }
  28. void SetPlayerClassWhenKilled( int iIndex, int iClass );
  29. protected:
  30. virtual void UpdateConnectedPlayer( int iIndex, CBasePlayer *pPlayer ) OVERRIDE;
  31. virtual void UpdateDisconnectedPlayer( int iIndex ) OVERRIDE;
  32. CNetworkArray( int, m_iTotalScore, MAX_PLAYERS+1 );
  33. CNetworkArray( int, m_iPlayerClass, MAX_PLAYERS+1 );
  34. CNetworkArray( int, m_iMaxHealth, MAX_PLAYERS+1 );
  35. CNetworkArray( int, m_iMaxBuffedHealth, MAX_PLAYERS+1 );
  36. CNetworkArray( bool, m_bArenaSpectator, MAX_PLAYERS+1 );
  37. CNetworkArray( int, m_iActiveDominations, MAX_PLAYERS+1 );
  38. // These variables are only networked in tournament mode
  39. CNetworkArray( float,m_flNextRespawnTime, MAX_PLAYERS+1 );
  40. CNetworkArray( int, m_iChargeLevel, MAX_PLAYERS+1 );
  41. CNetworkArray( int, m_iDamage, MAX_PLAYERS+1 );
  42. CNetworkArray( int, m_iDamageAssist, MAX_PLAYERS+1 );
  43. CNetworkArray( int, m_iDamageBoss, MAX_PLAYERS+1 );
  44. CNetworkArray( int, m_iHealing, MAX_PLAYERS+1 );
  45. CNetworkArray( int, m_iHealingAssist, MAX_PLAYERS+1 );
  46. CNetworkArray( int, m_iDamageBlocked, MAX_PLAYERS+1 );
  47. CNetworkArray( int, m_iCurrencyCollected, MAX_PLAYERS+1 );
  48. CNetworkArray( int, m_iBonusPoints, MAX_PLAYERS+1 );
  49. CNetworkArray( int, m_iPlayerLevel, MAX_PLAYERS+1 );
  50. // Pseudo multidimensional array [MAX_PLAYERS + 1][CTFPlayerShared::kTFStreak_COUNT]
  51. CNetworkArray( int, m_iStreaks, ( ( MAX_PLAYERS + 1 ) * CTFPlayerShared::kTFStreak_COUNT ) );
  52. CNetworkArray( int, m_iUpgradeRefundCredits, MAX_PLAYERS + 1 );
  53. CNetworkArray( int, m_iBuybackCredits, MAX_PLAYERS + 1 );
  54. CNetworkVar( int, m_iPartyLeaderRedTeamIndex );
  55. CNetworkVar( int, m_iPartyLeaderBlueTeamIndex );
  56. CNetworkVar( int, m_iEventTeamStatus );
  57. CNetworkArray( int, m_iPlayerClassWhenKilled, MAX_PLAYERS+1 );
  58. CNetworkArray( MM_PlayerConnectionState_t, m_iConnectionState, MAX_PLAYERS + 1 );
  59. float m_flNextDamageAndHealingSend;
  60. CUtlVector< uint32 > m_vecRedPlayers;
  61. CUtlVector< uint32 > m_vecBluePlayers;
  62. CUtlVector< int > m_vecFreeSlots;
  63. };
  64. #endif // TF_PLAYER_RESOURCE_H