summaryrefslogtreecommitdiff
path: root/game/shared/tf2/tf_obj_driver_machinegun_shared.h
blob: 436d421af8b471b849d62c96367d0cb53b2f51d3 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Vehicle mounted machinegun that the driver controls
//
//=============================================================================//

#ifndef TF_OBJ_DRIVER_MACHINEGUN_H
#define TF_OBJ_DRIVER_MACHINEGUN_H
#ifdef _WIN32
#pragma once
#endif

#include "tf_obj_basedrivergun_shared.h"

#if defined( CLIENT_DLL )
#define CObjectDriverMachinegun C_ObjectDriverMachinegun
#endif

// ------------------------------------------------------------------------ //
// Mounted machinegun
// ------------------------------------------------------------------------ //
class CObjectDriverMachinegun : public CBaseObjectDriverGun
{
DECLARE_CLASS( CObjectDriverMachinegun, CBaseObjectDriverGun );

public:
	DECLARE_NETWORKCLASS();
	DECLARE_PREDICTABLE();

	CObjectDriverMachinegun();

	virtual void	Spawn();
	virtual void	Precache();

	// Firing
	virtual bool	CanFireNow( void );
	virtual void	Fire( CBaseTFPlayer *pDriver );

	// Turning
	virtual Vector	GetFireOrigin( void );
	virtual void	SetTargetAngles( const QAngle &vecAngles );

#if defined( CLIENT_DLL )
	void			GetBoneControllers( float controllers[MAXSTUDIOBONECTRLS] );
	virtual void	DrawHudElements( void );
#endif

	// Ammo
	void			RechargeThink( void );

private:
	float	m_flNextAttack;
	int		m_nBarrelAttachment;
	int		m_nAmmoType;
	CNetworkVar( int, m_nAmmoCount );
	int		m_nMaxAmmoCount;

private:
	CObjectDriverMachinegun( const CObjectDriverMachinegun & ); // not defined, not accessible
};

#endif // TF_OBJ_DRIVER_MACHINEGUN_H