summaryrefslogtreecommitdiff
path: root/game/server/tf2/tf_obj_respawn_station.h
blob: 6290f17e56a0670750310f599e4ad066e6c89bc0 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Portable respawn station
//
// $NoKeywords: $
//=============================================================================//

#ifndef TF_OBJ_RESPAWN_STATION_H
#define TF_OBJ_RESPAWN_STATION_H

//-----------------------------------------------------------------------------
// forward declarations
//-----------------------------------------------------------------------------
class CBaseEntity;

//-----------------------------------------------------------------------------
// Respawn station defines
//-----------------------------------------------------------------------------
#define RESPAWN_STATION_MINS			Vector(-60, -45, 0)
#define RESPAWN_STATION_MAXS			Vector( 60,  45, 140)

#define RESPAWN_STATION_BUILD_MINS		Vector(-60, -45, 0)
#define RESPAWN_STATION_BUILD_MAXS		Vector( 60,  40, 140)

#define RESPAWN_EFFECT_TIME 5.0f
#define	RESPAWN_BEAM_HEIGHT 800.0f

//-----------------------------------------------------------------------------
// Portable respawn station
//-----------------------------------------------------------------------------
class CObjectRespawnStation : public CBaseObject
{
DECLARE_CLASS( CObjectRespawnStation, CBaseObject );

public:
	DECLARE_SERVERCLASS();
	DECLARE_DATADESC();

	CObjectRespawnStation();

	// Gets called when someone respawns on this station
	void PerformRespawnEffect();

	static CObjectRespawnStation* Create(const Vector &vOrigin, const QAngle &vAngles);

	virtual void	Precache();
	virtual void	Spawn();

	virtual bool	WantsCover()	{ return true; }

	// Object using!
	virtual void	Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );

	virtual bool	CanTakeEMPDamage( void ) { return false; }

	// Map specified as the initial spawnpoint for a team
	bool	IsInitialSpawnPoint( void );

protected:
	float	m_fLastRespawnTime;
	int		m_iSpriteTexture;
	bool	m_bIsInitialSpawnPoint;
};

//-----------------------------------------------------------------------------
// Plays a respawn effect on a respawn station...
//-----------------------------------------------------------------------------
void PlayRespawnEffect(CBaseEntity *pRespawnStation);

#endif // TF_OBJ_RESPAWN_STATION_H