summaryrefslogtreecommitdiff
path: root/game/client/cstrike/c_plantedc4.h
blob: b5ae7c7e69ac98a9ef035fa5d4a1c06b0076b662 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//
//=============================================================================//
#ifndef C_PLANTEDC4_H
#define C_PLANTEDC4_H

#include "cbase.h"
#include "in_buttons.h"
#include "decals.h"

#include "c_cs_player.h"

#include "utlvector.h"

// ------------------------------------------------------------------------------------------ //
// CPlantedC4 class.
// For now to show the planted c4 on the radar - client proxy to remove the CBaseAnimating 
// network vars?
// ------------------------------------------------------------------------------------------ //

class C_PlantedC4 : public C_BaseAnimating
{
public:
	DECLARE_CLASS( C_PlantedC4, CBaseAnimating );
	DECLARE_CLIENTCLASS();

	C_PlantedC4();
	virtual ~C_PlantedC4();

	void Explode( void );
	void Spawn( void );
	virtual void SetDormant( bool bDormant );

	void ClientThink( void );

	int GetSecondsRemaining( void ) { return ceil( m_flC4Blow - gpGlobals->curtime ); }

	inline bool IsBombActive( void ) { return m_bBombTicking; }
	CNetworkVar( bool, m_bBombTicking );

	float m_flNextGlow;
	float m_flNextBeep;

	float m_flC4Blow;
	float m_flTimerLength;

	CNetworkVar( float, m_flDefuseLength );	
	CNetworkVar( float, m_flDefuseCountDown ); 

	float GetDefuseProgress( void )
	{	
		float flProgress = 1.0f;

		if( m_flDefuseLength > 0.0 )
		{
			flProgress = ( ( m_flDefuseCountDown - gpGlobals->curtime ) / m_flDefuseLength );
		}

		return flProgress;
	}

	float	m_flNextRadarFlashTime;	// next time to change flash state
	bool	m_bRadarFlash;			// is the flash on or off
	CNewParticleEffect *m_pC4Explosion; // client side explosion particle effect for the bomb
};

extern CUtlVector< C_PlantedC4* > g_PlantedC4s;

#endif //C_PLANTEDC4_H