summaryrefslogtreecommitdiff
path: root/game/shared/dod/weapon_dodbipodgun.h
blob: 7c0bb5691a74cbdb0ab6fd928299e4fa4c198548 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================//

#include "cbase.h" 
#include "shake.h" 
#include "weapon_dodfullauto.h"

#if defined( CLIENT_DLL )
	#define CDODBipodWeapon C_DODBipodWeapon
#endif

class CDODBipodWeapon : public CDODFullAutoWeapon
{
public:
	DECLARE_CLASS( CDODBipodWeapon, CDODFullAutoWeapon );
	DECLARE_NETWORKCLASS(); 
	DECLARE_PREDICTABLE();

	CDODBipodWeapon();

	virtual void Spawn();
	virtual void Precache();
	virtual void Drop( const Vector &vecVelocity );
	virtual void SecondaryAttack( void );
	virtual bool Reload( void );

	virtual float GetWeaponAccuracy( float flPlayerSpeed );

	virtual Activity GetUndeployActivity( void );
	virtual Activity GetDeployActivity( void );
	virtual Activity GetPrimaryAttackActivity( void );
	virtual Activity GetReloadActivity( void );
	virtual Activity GetIdleActivity( void );

	virtual bool CanDrop( void );
	virtual bool CanHolster( void );

	inline void SetDeployed( bool bDeployed );
	inline bool IsDeployed( void ) { return m_bDeployed; }

	virtual void ItemBusyFrame( void );
	virtual void ItemPostFrame( void );
	void BipodThink( void );

	bool AttemptToDeploy( void );
	bool CheckDeployEnt( void );

	bool TestDeploy( float *flDeployedHeight, CBaseEntity **pDeployedOn, float *flYawLimitLeft = NULL, float *flYawLimitRight = NULL );
	bool TestDeployAngle( CDODPlayer *pPlayer, float *flDeployedHeight, CBaseEntity **pDeployedOn, QAngle angles );

	bool FindYawLimits( float *flLeftLimit, float *flRightLimit );

	virtual void DoFireEffects();

	void DeployBipod( float flHeight, CBaseEntity *pDeployedOn, float flYawLimitLeft, float flYawLimitRight );
	void UndeployBipod( void );

	virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_NONE; }

#ifdef CLIENT_DLL
	virtual int GetWorldModelIndex( void );
	virtual void CheckForAltWeapon( int iCurrentState );

	virtual void OverrideMouseInput( float *x, float *y );
#endif

private:
	CDODBipodWeapon( const CDODBipodWeapon & );

	CNetworkVar( bool, m_bDeployed );

	CNetworkVar( int, m_iDeployedModelIndex );
	CNetworkVar( int, m_iDeployedReloadModelIndex );
	CNetworkVar( int, m_iProneDeployedReloadModelIndex );

	int m_iCurrentWorldModel;

	EHANDLE m_hDeployedOnEnt;
	float m_flDeployedHeight;
	float m_flNextDeployCheckTime;

	Vector m_DeployedEntOrigin;

	bool m_bDuckedWhenDeployed;

#ifdef CLIENT_DLL
	bool m_bUseDeployedReload;
#endif
};