aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/server/hl2/weapon_flaregun.h
blob: 5fcfac34a1b1e9cc8a91e0209bf07193e3b96126 (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: 
//
//=============================================================================//

#include "basehlcombatweapon.h"
#include "soundenvelope.h"

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

#define	SF_FLARE_NO_DLIGHT	0x00000001
#define	SF_FLARE_NO_SMOKE	0x00000002
#define	SF_FLARE_INFINITE	0x00000004
#define	SF_FLARE_START_OFF	0x00000008

#define	FLARE_DURATION		30.0f
#define FLARE_DECAY_TIME	10.0f
#define FLARE_BLIND_TIME	6.0f

//---------------------
// Flare
//---------------------

class CFlare : public CBaseCombatCharacter
{
public:
	DECLARE_CLASS( CFlare, CBaseCombatCharacter );

	CFlare();
	~CFlare();

	static CFlare *	GetActiveFlares( void );
	CFlare *		GetNextFlare( void ) const { return m_pNextFlare; }

	static CFlare *Create( Vector vecOrigin, QAngle vecAngles, CBaseEntity *pOwner, float lifetime );

	virtual unsigned int PhysicsSolidMaskForEntity( void ) const;

	void	Spawn( void );
	void	Precache( void );
	int		Restore( IRestore &restore );
	void	Activate( void );

	void	StartBurnSound( void );

	void	Start( float lifeTime );
	void	Die( float fadeTime );
	void	Launch( const Vector &direction, float speed );

	Class_T Classify( void );

	void	FlareTouch( CBaseEntity *pOther );
	void	FlareBurnTouch( CBaseEntity *pOther );
	void	FlareThink( void );

	void	InputStart( inputdata_t &inputdata );
	void	InputDie( inputdata_t &inputdata );
	void	InputLaunch( inputdata_t &inputdata );

	DECLARE_SERVERCLASS();
	DECLARE_DATADESC();

	static CFlare *activeFlares;

	CBaseEntity *m_pOwner;
	int			m_nBounces;			// how many times has this flare bounced?
	CNetworkVar( float, m_flTimeBurnOut );	// when will the flare burn out?
	CNetworkVar( float, m_flScale );
	float		m_flDuration;
	float		m_flNextDamage;
	
	CSoundPatch	*m_pBurnSound;
	bool		m_bFading;
	CNetworkVar( bool, m_bLight );
	CNetworkVar( bool, m_bSmoke );
	CNetworkVar( bool, m_bPropFlare );

	bool		m_bInActiveList;
	CFlare *	m_pNextFlare;

	void		RemoveFromActiveFlares( void );
	void		AddToActiveFlares( void );
};

//---------------------
// Flaregun
//---------------------
class CFlaregun:public CBaseHLCombatWeapon
{
public:
	DECLARE_CLASS( CFlaregun, CBaseHLCombatWeapon );

	DECLARE_SERVERCLASS();

	void Precache( void );
	void PrimaryAttack( void );
	void SecondaryAttack( void );
};

#endif // WEAPON_FLAREGUN_H