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.

87 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef HL1MP_PLAYER_H
  9. #define HL1MP_PLAYER_H
  10. #pragma once
  11. #include "cbase.h"
  12. #include "hl1_player_shared.h"
  13. #include "hl1_player.h"
  14. #include "takedamageinfo.h"
  15. class CHL1MP_Player;
  16. //=============================================================================
  17. // >> HL1MP_Player
  18. //=============================================================================
  19. class CHL1MP_Player : public CHL1_Player
  20. {
  21. public:
  22. DECLARE_CLASS( CHL1MP_Player, CHL1_Player );
  23. DECLARE_SERVERCLASS();
  24. CHL1MP_Player();
  25. ~CHL1MP_Player( void );
  26. virtual void Event_Killed( const CTakeDamageInfo &info );
  27. virtual void Spawn( void );
  28. virtual void PostThink( void );
  29. virtual void SetAnimation( PLAYER_ANIM playerAnim );
  30. void GiveDefaultItems( void );
  31. void CreateRagdollEntity( void );
  32. void UpdateOnRemove( void );
  33. virtual bool BecomeRagdollOnClient( const Vector &force ) { return true; };
  34. virtual void CreateCorpse( void );
  35. virtual bool BumpWeapon( CBaseCombatWeapon *pWeapon );
  36. virtual void ChangeTeam( int iTeamNum ) OVERRIDE;
  37. void SetPlayerTeamModel( void );
  38. float GetNextModelChangeTime( void ) { return m_flNextModelChangeTime; }
  39. float GetNextTeamChangeTime( void ) { return m_flNextTeamChangeTime; }
  40. void SetPlayerModel( void );
  41. void DoAnimationEvent( PlayerAnimEvent_t event, int nData = 0 );
  42. virtual bool StartObserverMode (int mode)
  43. {
  44. if ( !IsHLTV() )
  45. return false;
  46. return BaseClass::StartObserverMode( mode );
  47. }
  48. void DetonateSatchelCharges( void );
  49. CNetworkVar( int, m_iRealSequence );
  50. private:
  51. CNetworkHandle( CBaseEntity, m_hRagdoll );
  52. CNetworkVar( int, m_iSpawnInterpCounter );
  53. CNetworkQAngle( m_angEyeAngles );
  54. IHL1MPPlayerAnimState* m_PlayerAnimState;
  55. float m_flNextModelChangeTime;
  56. float m_flNextTeamChangeTime;
  57. };
  58. inline CHL1MP_Player *ToHL1MPPlayer( CBaseEntity *pEntity )
  59. {
  60. if ( !pEntity || !pEntity->IsPlayer() )
  61. return NULL;
  62. return dynamic_cast<CHL1MP_Player*>( pEntity );
  63. }
  64. #endif //HL1MP_PLAYER_H