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.

81 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $NoKeywords: $
  7. //=============================================================================//
  8. #if !defined( C_BASEHLPLAYER_H )
  9. #define C_BASEHLPLAYER_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "c_baseplayer.h"
  14. #include "c_hl2_playerlocaldata.h"
  15. class C_BaseHLPlayer : public C_BasePlayer
  16. {
  17. public:
  18. DECLARE_CLASS( C_BaseHLPlayer, C_BasePlayer );
  19. DECLARE_CLIENTCLASS();
  20. DECLARE_PREDICTABLE();
  21. C_BaseHLPlayer();
  22. virtual void OnDataChanged( DataUpdateType_t updateType );
  23. void Weapon_DropPrimary( void );
  24. float GetFOV();
  25. void Zoom( float FOVOffset, float time );
  26. float GetZoom( void );
  27. bool IsZoomed( void ) { return m_HL2Local.m_bZooming; }
  28. bool IsSprinting( void ) { return m_HL2Local.m_bitsActiveDevices & bits_SUIT_DEVICE_SPRINT; }
  29. bool IsFlashlightActive( void ) { return m_HL2Local.m_bitsActiveDevices & bits_SUIT_DEVICE_FLASHLIGHT; }
  30. bool IsBreatherActive( void ) { return m_HL2Local.m_bitsActiveDevices & bits_SUIT_DEVICE_BREATHER; }
  31. virtual int DrawModel( int flags );
  32. virtual void BuildTransformations( CStudioHdr *hdr, Vector *pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList &boneComputed );
  33. LadderMove_t *GetLadderMove() { return &m_HL2Local.m_LadderMove; }
  34. virtual void ExitLadder();
  35. bool IsSprinting() const { return m_fIsSprinting; }
  36. // Input handling
  37. virtual bool CreateMove( float flInputSampleTime, CUserCmd *pCmd );
  38. void PerformClientSideObstacleAvoidance( float flFrameTime, CUserCmd *pCmd );
  39. void PerformClientSideNPCSpeedModifiers( float flFrameTime, CUserCmd *pCmd );
  40. bool IsWeaponLowered( void ) { return m_HL2Local.m_bWeaponLowered; }
  41. public:
  42. C_HL2PlayerLocalData m_HL2Local;
  43. EHANDLE m_hClosestNPC;
  44. float m_flSpeedModTime;
  45. bool m_fIsSprinting;
  46. private:
  47. C_BaseHLPlayer( const C_BaseHLPlayer & ); // not defined, not accessible
  48. bool TestMove( const Vector &pos, float fVertDist, float radius, const Vector &objPos, const Vector &objDir );
  49. float m_flZoomStart;
  50. float m_flZoomEnd;
  51. float m_flZoomRate;
  52. float m_flZoomStartTime;
  53. bool m_bPlayUseDenySound; // Signaled by PlayerUse, but can be unset by HL2 ladder code...
  54. float m_flSpeedMod;
  55. float m_flExitSpeedMod;
  56. friend class CHL2GameMovement;
  57. };
  58. #endif