summaryrefslogtreecommitdiff
path: root/game/shared/tf/tf_weapon_invis.h
blob: bbd762cce3e7c1ac81d21dc0e68f13aa23728b77 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: PDA Weapon
//
//=============================================================================

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

#include "tf_shareddefs.h"
#include "tf_weaponbase.h"
#include "tf_gamerules.h"

// Client specific.
#if defined( CLIENT_DLL ) 
#define CTFWeaponInvis C_TFWeaponInvis
#endif

enum invis_weapontypes_t
{
	INVIS_BASE = 0,
	INVIS_FEIGN_DEATH,
	INVIS_MOTION_CLOAK,
};

class CTFWeaponInvis : public CTFWeaponBase
{
public:
	DECLARE_CLASS( CTFWeaponInvis, CTFWeaponBase );
	DECLARE_NETWORKCLASS(); 
	DECLARE_PREDICTABLE();

#if !defined( CLIENT_DLL ) 
	DECLARE_DATADESC();
#endif

	CTFWeaponInvis() {}

	virtual void	Spawn();
	virtual void	OnActiveStateChanged( int iOldState );
	virtual void	PrimaryAttack( void );
	virtual void	SecondaryAttack();
	virtual bool	Deploy( void );

	virtual void	HideThink( void );
	virtual bool	Holster( CBaseCombatWeapon *pSwitchingTo );

	virtual int		GetWeaponID( void ) const						{ return TF_WEAPON_INVIS; }
	virtual bool	ShouldDrawCrosshair( void )						{ return false; }
	virtual bool	HasPrimaryAmmo()								{ return true; }
	virtual bool	CanBeSelected()									{ return true; }

	virtual bool	VisibleInWeaponSelection( void )				{ return false; }

	virtual bool	ShouldShowControlPanels( void )					{ return true; }

	virtual void	SetWeaponVisible( bool visible );

	virtual void	ItemBusyFrame( void );

	int				GetInvisType( void ) { int iMode = 0; CALL_ATTRIB_HOOK_INT( iMode, set_weapon_mode ); return iMode; };
	virtual bool	HasFeignDeath( void ) { return (GetInvisType() == INVIS_FEIGN_DEATH); }
	virtual bool	HasMotionCloak( void ) { return (GetInvisType() == INVIS_MOTION_CLOAK); } 

	virtual void	SetFeignDeathState( bool bEnabled );
	virtual void	SetCloakRates( void );

	virtual bool	ActivateInvisibilityWatch( void );
	virtual void	CleanupInvisibilityWatch( void );

	virtual	bool	AllowsAutoSwitchTo( void )						{ return false; }
	virtual bool	CanDeploy( void )								{ return false; }

	virtual const char *GetViewModel( int viewmodelindex  ) const;

#ifndef CLIENT_DLL
	virtual void	GetControlPanelInfo( int nPanelIndex, const char *&pPanelName );
#endif

private:

	CTFWeaponInvis( const CTFWeaponInvis & ) {}
};

#endif // TF_WEAPON_INVIS_H