summaryrefslogtreecommitdiff
path: root/game/shared/dod/weapon_dodfireselect.h
blob: 2e00edb02dbb31f30d5115312d468d0a9b19df4b (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================//

#ifndef WEAPON_DODFIRESELECT_H
#define WEAPON_DODFIRESELECT_H

#include "cbase.h"
#include "weapon_dodbasegun.h"

#if defined( CLIENT_DLL )
#define CDODFireSelectWeapon C_DODFireSelectWeapon

#include "c_dod_player.h"
#endif

class CDODFireSelectWeapon : public CWeaponDODBaseGun
{
public:
	DECLARE_CLASS( CDODFireSelectWeapon, CWeaponDODBaseGun );
	DECLARE_NETWORKCLASS(); 
	DECLARE_PREDICTABLE();

	CDODFireSelectWeapon();

	virtual void Spawn();
	virtual void PrimaryAttack( void );
	virtual void SecondaryAttack( void );
	virtual float GetWeaponAccuracy( float flPlayerSpeed );
	virtual float GetFireDelay( void );
	virtual void Drop( const Vector &vecVelocity );

	bool IsSemiAuto( void );

	virtual Activity GetIdleActivity( void );
	virtual Activity GetPrimaryAttackActivity( void );
	virtual Activity GetReloadActivity( void );
	virtual Activity GetDrawActivity( void );

#ifdef CLIENT_DLL
	virtual Vector GetDesiredViewModelOffset( C_DODPlayer *pOwner );

	void ResetViewModelAnimDir( void )
	{
		m_bAnimToSemiAuto = true;
		m_flPosChangeTimer = 0;
	}

	virtual void OnWeaponDropped( void )
	{
		ResetViewModelAnimDir();

		m_bSemiAuto = false;

		BaseClass::OnWeaponDropped();
	}
#endif

private:
	CNetworkVar( bool, m_bSemiAuto );

#ifdef CLIENT_DLL
	bool m_bAnimToSemiAuto;
	float m_flPosChangeTimer;
#endif

private:
	CDODFireSelectWeapon( const CDODFireSelectWeapon & );
};

#endif //WEAPON_DODFIRESELECT_H