summaryrefslogtreecommitdiff
path: root/game/shared/tf/tf_weapon_raygun.h
blob: 0c1ab5bb7df79a2e0b96e0dde035b16ac1826b7e (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
//
//=============================================================================
#ifndef TF_WEAPON_RAYGUN_H
#define TF_WEAPON_RAYGUN_H
#ifdef _WIN32
#pragma once
#endif

#include "tf_weaponbase_gun.h"
#include "tf_weapon_shotgun.h"
#include "tf_weapon_rocketlauncher.h"

// Client specific.
#ifdef CLIENT_DLL
#define CTFRaygun C_TFRaygun
#define CTFDRGPomson C_TFDRGPomson
#endif

class CTFRaygun : public CTFRocketLauncher
{
public:
	DECLARE_CLASS( CTFRaygun, CTFRocketLauncher );
	DECLARE_NETWORKCLASS(); 
	DECLARE_PREDICTABLE();

	CTFRaygun();

	virtual void		Precache();

	virtual int			GetWeaponID( void ) const			{ return TF_WEAPON_RAYGUN; }
	virtual float		GetProjectileSpeed( void );
	virtual float		GetProjectileGravity( void );
	virtual bool		IsViewModelFlipped( void );

	const char*			GetEffectLabelText( void )			{ return "#TF_BISON"; }
	float				GetProgress( void );

	virtual bool		Holster( CBaseCombatWeapon *pSwitchingTo );
	virtual bool		Deploy( void );
	virtual void		ItemPostFrame( void );

	virtual void		PrimaryAttack( void );
	virtual void		ModifyProjectile( CBaseEntity* pProj );

	virtual const char*	GetMuzzleFlashParticleEffect( void );

	virtual float		GetDamage( void ) { return 20.f; }

	virtual bool		IsEnergyWeapon( void ) const { return true; }
	virtual float		Energy_GetShotCost( void ) const
	{
		int iNoDrain = 0;
		CALL_ATTRIB_HOOK_INT( iNoDrain, energy_weapon_no_drain );
		if ( iNoDrain > 0 )
		{
			return 0.0f;
		}

		return 5.f; 
	}
	virtual float		Energy_GetRechargeCost( void ) const { return 5.f; }

#ifdef CLIENT_DLL
	virtual void		DispatchMuzzleFlash( const char* effectName, C_BaseEntity* pAttachEnt );
	void				ClientEffectsThink( void );
	virtual bool		ShouldPlayClientReloadSound() { return true; }
	virtual const char *GetIdleParticleEffect( void ) { return "drg_bison_idle"; }
#endif

	bool				UseNewProjectileCode() const { return m_bUseNewProjectileCode; }

private:

	float				m_flIrradiateTime;
	bool				m_bEffectsThinking;

	CNetworkVar( bool, m_bUseNewProjectileCode );
};


//---------------------------------------------------------
class CTFDRGPomson : public CTFRaygun
{
public:
	DECLARE_CLASS( CTFDRGPomson, CTFRaygun );
	DECLARE_NETWORKCLASS(); 
	DECLARE_PREDICTABLE();

	virtual void		Precache();

	virtual int			GetWeaponID( void ) const				{ return TF_WEAPON_DRG_POMSON; }
	const char*			GetEffectLabelText( void )				{ return "#TF_POMSON_HUD"; }

	virtual const char *GetMuzzleFlashParticleEffect( void )	{ return "drg_pomson_muzzleflash"; }
	virtual const char *GetIdleParticleEffect( void )			{ return "drg_pomson_idle"; }

	virtual void GetProjectileFireSetup( CTFPlayer *pPlayer, Vector vecOffset, Vector *vecSrc, QAngle *angForward, bool bHitTeammates = true, float flEndDist = 2000.f );
};



#endif // TF_WEAPON_RAYGUN_H