summaryrefslogtreecommitdiff
path: root/game/server/tf2/tf_obj_resupply.h
blob: 373a32c8538d7344d1356dd9af939cefda20fc59 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Medic's resupply beacon
//
// $NoKeywords: $
//=============================================================================//

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

#include "tf_obj.h"

// ------------------------------------------------------------------------ //
// Resupply defines
#define	RESUPPLY_NUM_PLAYERS_REFILLED		5		// Number of full resupplies before refill need

// An object is considered covered by a resupply station (for purposes of order creation)
// if it is within this distance of the station.
#define RESUPPLY_COVER_DIST			1500



// ------------------------------------------------------------------------ //
// Resupply object that's built by the player
// ------------------------------------------------------------------------ //
class CObjectResupply : public CBaseObject
{
DECLARE_CLASS( CObjectResupply, CBaseObject );

public:
	DECLARE_SERVERCLASS();

	CObjectResupply();

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

	virtual void	Spawn();
	virtual void	GetControlPanelInfo( int nPanelIndex, const char *&pPanelName );
	virtual void	Precache();
	virtual void	DestroyObject( void );

	virtual bool	CalculatePlacement( CBaseTFPlayer *pPlayer );
	virtual	void	SetupAttachedVersion( void );

	// Resupply
	virtual bool	ClientCommand( CBaseTFPlayer *pPlayer, const CCommand &args );

	virtual void	ChangeTeam( int iTeamNum ) OVERRIDE;

	virtual bool	CanTakeEMPDamage( void ) { return true; }

private:
	// Resupply Health 
	bool ResupplyHealth( CBaseTFPlayer *pPlayer, float flFraction );
};

#endif // TF_OBJ_RESUPPLY_H