summaryrefslogtreecommitdiff
path: root/game/client/tf2/c_obj_sentrygun.h
blob: c66fd818c8a9c47f1697119fc445d22967bdd849 (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

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

//-----------------------------------------------------------------------------
// Purpose: Base Sentrygun
//-----------------------------------------------------------------------------
class C_ObjectSentrygun : public C_BaseObject
{
	DECLARE_CLASS( C_ObjectSentrygun, C_BaseObject );
public:
	DECLARE_CLIENTCLASS();
	DECLARE_ENTITY_PANEL();

	C_ObjectSentrygun();
	virtual void	GetBoneControllers(float controllers[MAXSTUDIOBONES]);
	virtual int		DrawModel( int flags );
	virtual void	SetDormant( bool bDormant );
	virtual void	PreDataUpdate( DataUpdateType_t updateType );
	virtual void	PostDataUpdate( DataUpdateType_t updateType );
	virtual void	OnDataChanged( DataUpdateType_t updateType );
	virtual float	GetInitialBuilderYaw();
	int				GetAmmoLeft( void ) { return m_iAmmo; }
	virtual void	FinishedBuilding( void );

	virtual void	ClientThink( void );

private:
	bool	IsTurtled( void ) { return m_bTurtled; }

	// Turret Functions
	bool	MoveTurret( void );

	// Recompute sentrygun orientation...
	void RecomputeOrientation();

public:

	int				m_iRightBound;
	int				m_iLeftBound;
	bool			m_bTurningRight;

	// Movement
	int				m_iBaseTurnRate;
	float			m_fTurnRate;
	QAngle			m_vecCurAngles;
	QAngle			m_vecGoalAngles;
	Vector			m_vecCurDishAngles;

	float			m_fBoneXRotator;
	float			m_fBoneYRotator;
	int				m_iAmmo;

	// Turtling
	bool			m_bTurtled;
	bool			m_bLastTurtled;
	float			m_flStartedTurtlingAt;
	float			m_flStartedUnTurtlingAt;

	int				m_nAnimationParity;
 	int				m_nLastAnimationParity;

	// Networked from server
	EHANDLE			m_hEnemy;


	QAngle			m_angPrevLocalAngles;
	int				m_nOrientationParity;
	int				m_nPrevOrientationParity;

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

class C_ObjectSentrygunPlasma : public C_ObjectSentrygun
{
	DECLARE_CLASS( C_ObjectSentrygunPlasma, C_ObjectSentrygun );
public:
	C_ObjectSentrygunPlasma();
	DECLARE_CLIENTCLASS();

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

class C_ObjectSentrygunRocketlauncher : public C_ObjectSentrygun
{
	DECLARE_CLASS( C_ObjectSentrygunRocketlauncher, C_ObjectSentrygun );
public:
	C_ObjectSentrygunRocketlauncher();
	DECLARE_CLIENTCLASS();

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

#endif // C_OBJ_SENTRYGUN_H