blob: 1833f93203765d7982263d6bcb9d24c700509c9e (
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
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: CTF AmmoPack.
//
//=============================================================================//
#ifndef TF_POWERUP_H
#define TF_POWERUP_H
#ifdef _WIN32
#pragma once
#endif
#include "items.h"
#define TF_POWERUP_LIFETIME 30.0f // normal powerup timeout
enum powerupsize_t
{
POWERUP_SMALL,
POWERUP_MEDIUM,
POWERUP_FULL,
POWERUP_SIZES,
};
extern float PackRatios[POWERUP_SIZES];
//=============================================================================
//
// CTF Powerup class.
//
class CTFPowerup : public CItem
{
public:
DECLARE_CLASS( CTFPowerup, CItem );
CTFPowerup();
void Spawn( void );
CBaseEntity* Respawn( void );
virtual void Precache();
void Materialize( void );
virtual bool ValidTouch( CBasePlayer *pPlayer );
virtual bool MyTouch( CBasePlayer *pPlayer );
void DropSingleInstance( Vector &vecLaunchVel, CBaseCombatCharacter *pThrower, float flThrowerTouchDelay, float flResetTime = 0.1f );
bool IsDisabled( void );
void SetDisabled( bool bDisabled );
virtual float GetRespawnDelay( void ) { return g_pGameRules->FlItemRespawnTime( this ); }
// Input handlers
void InputEnable( inputdata_t &inputdata );
void InputDisable( inputdata_t &inputdata );
void InputToggle( inputdata_t &inputdata );
virtual powerupsize_t GetPowerupSize( void ) { return POWERUP_FULL; }
virtual const char *GetPowerupModel( void );
virtual const char *GetDefaultPowerupModel( void ) = 0;
virtual bool ItemCanBeTouchedByPlayer( CBasePlayer *pPlayer );
virtual float GetLifeTime() { return TF_POWERUP_LIFETIME; }
protected:
void Materialize_Internal( void );
bool m_bDisabled;
bool m_bRespawning;
bool m_bThrownSingleInstance;
bool m_bAutoMaterialize;
string_t m_iszModel;
float m_flThrowerTouchTime;
DECLARE_DATADESC();
};
#endif // TF_POWERUP_H
|