summaryrefslogtreecommitdiff
path: root/game/shared/tf/tf_weapon_wrench.h
blob: 2cc9f9beacdca2c0bd8abbd269f812eea2e5ac94 (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
107
108
109
110
111
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================

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

#include "tf_weaponbase_melee.h"
#include "tf_item_wearable.h"

#ifdef CLIENT_DLL
#define CTFWrench C_TFWrench
#define CTFRobotArm C_TFRobotArm
#define CTFWearableRobotArm C_TFWearableRobotArm
#endif

//=============================================================================
//
// Wrench class.
//
class CTFWrench : public CTFWeaponBaseMelee
{
public:

	DECLARE_CLASS( CTFWrench, CTFWeaponBaseMelee );
	DECLARE_NETWORKCLASS(); 
	DECLARE_PREDICTABLE();

	CTFWrench();

	virtual void		Spawn();
	virtual int			GetWeaponID( void ) const			{ return TF_WEAPON_WRENCH; }
	virtual void		Smack( void );

	virtual bool		Holster( CBaseCombatWeapon *pSwitchingTo );

	bool				IsPDQ( void ) { int iMode = 0; CALL_ATTRIB_HOOK_INT( iMode, wrench_builds_minisentry ); return iMode==1; };
	float				GetConstructionValue( void );
	float				GetRepairValue( void );
#ifdef GAME_DLL
	virtual void		Equip( CBaseCombatCharacter *pOwner );
	virtual void		Detach();

	void				ApplyBuildingHealthUpgrade( void );

	void				OnFriendlyBuildingHit( CBaseObject *pObject, CTFPlayer *pPlayer, Vector hitLoc );
#else
	virtual void		ItemPostFrame();
#endif


private:
	bool				m_bReloadDown;
	CTFWrench( const CTFWrench & ) {}
};

//=============================================================================
//
// Robot Arm class.
//
class CTFRobotArm : public CTFWrench
{
public:
	DECLARE_CLASS( CTFRobotArm, CTFWrench );
	DECLARE_NETWORKCLASS();
	DECLARE_PREDICTABLE();

	CTFRobotArm();

	virtual void		Precache();

#ifdef GAME_DLL
	virtual void		Equip( CBaseCombatCharacter *pOwner );
	virtual void		Drop( const Vector &vecVelocity );
	virtual void		UpdateOnRemove( void );
	void				RemoveRobotArm();
	virtual void		OnActiveStateChanged( int iOldState );
	virtual int			GetDamageCustom();
	virtual float		GetForceScale( void );
	virtual bool 		HideAttachmentsAndShowBodygroupsWhenPerformingWeaponIndependentTaunt() const OVERRIDE { return false; }
#endif

	virtual void		PrimaryAttack();

	virtual void		Smack( void );
	virtual void		WeaponIdle( void );

	virtual void		DoViewModelAnimation( void );

private:
	CNetworkHandle( CTFWearable, m_hRobotArm );

	int					m_iComboCount;
	float				m_flLastComboHit;
	bool				m_bBigIdle;
	bool				m_bBigHit;
};

class CTFWearableRobotArm : public CTFWearable
{
public:
	DECLARE_CLASS( CTFWearableRobotArm, CTFWearable );
	DECLARE_NETWORKCLASS();
};

#endif // TF_WEAPON_WRENCH_H