diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/hl2/c_basehlplayer.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/hl2/c_basehlplayer.h')
| -rw-r--r-- | game/client/hl2/c_basehlplayer.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/game/client/hl2/c_basehlplayer.h b/game/client/hl2/c_basehlplayer.h new file mode 100644 index 0000000..c6507e9 --- /dev/null +++ b/game/client/hl2/c_basehlplayer.h @@ -0,0 +1,81 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $Workfile: $ +// $NoKeywords: $ +//=============================================================================// + +#if !defined( C_BASEHLPLAYER_H ) +#define C_BASEHLPLAYER_H +#ifdef _WIN32 +#pragma once +#endif + + +#include "c_baseplayer.h" +#include "c_hl2_playerlocaldata.h" + +class C_BaseHLPlayer : public C_BasePlayer +{ +public: + DECLARE_CLASS( C_BaseHLPlayer, C_BasePlayer ); + DECLARE_CLIENTCLASS(); + DECLARE_PREDICTABLE(); + + C_BaseHLPlayer(); + + virtual void OnDataChanged( DataUpdateType_t updateType ); + + void Weapon_DropPrimary( void ); + + float GetFOV(); + void Zoom( float FOVOffset, float time ); + float GetZoom( void ); + bool IsZoomed( void ) { return m_HL2Local.m_bZooming; } + + bool IsSprinting( void ) { return m_HL2Local.m_bitsActiveDevices & bits_SUIT_DEVICE_SPRINT; } + bool IsFlashlightActive( void ) { return m_HL2Local.m_bitsActiveDevices & bits_SUIT_DEVICE_FLASHLIGHT; } + bool IsBreatherActive( void ) { return m_HL2Local.m_bitsActiveDevices & bits_SUIT_DEVICE_BREATHER; } + + virtual int DrawModel( int flags ); + virtual void BuildTransformations( CStudioHdr *hdr, Vector *pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList &boneComputed ); + + LadderMove_t *GetLadderMove() { return &m_HL2Local.m_LadderMove; } + virtual void ExitLadder(); + bool IsSprinting() const { return m_fIsSprinting; } + + // Input handling + virtual bool CreateMove( float flInputSampleTime, CUserCmd *pCmd ); + void PerformClientSideObstacleAvoidance( float flFrameTime, CUserCmd *pCmd ); + void PerformClientSideNPCSpeedModifiers( float flFrameTime, CUserCmd *pCmd ); + + bool IsWeaponLowered( void ) { return m_HL2Local.m_bWeaponLowered; } + +public: + + C_HL2PlayerLocalData m_HL2Local; + EHANDLE m_hClosestNPC; + float m_flSpeedModTime; + bool m_fIsSprinting; + +private: + C_BaseHLPlayer( const C_BaseHLPlayer & ); // not defined, not accessible + + bool TestMove( const Vector &pos, float fVertDist, float radius, const Vector &objPos, const Vector &objDir ); + + float m_flZoomStart; + float m_flZoomEnd; + float m_flZoomRate; + float m_flZoomStartTime; + + bool m_bPlayUseDenySound; // Signaled by PlayerUse, but can be unset by HL2 ladder code... + float m_flSpeedMod; + float m_flExitSpeedMod; + + +friend class CHL2GameMovement; +}; + + +#endif |