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
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#ifndef TF_AMMO_PACK_H
#define TF_AMMO_PACK_H
#ifdef _WIN32
#pragma once
#endif
#include "items.h"
typedef enum
{
AP_NORMAL = 0,
AP_HALLOWEEN,
AP_CHRISTMAS,
} AmmoPackType_t;
class CTFAmmoPack : public CItem
{
public:
DECLARE_CLASS( CTFAmmoPack, CItem );
DECLARE_SERVERCLASS();
CTFAmmoPack()
{
m_PackType = AP_NORMAL;
}
virtual void Spawn();
virtual void Precache();
void EXPORT DropSoundThink( void );
void EXPORT FlyThink( void );
void EXPORT PackTouch( CBaseEntity *pOther );
void InitWeaponDrop( CTFPlayer *pPlayer, CTFWeaponBase *pWeapon, int nSkin, bool bEmpty, bool bIsSuicide );
virtual unsigned int PhysicsSolidMaskForEntity( void ) const;
int GiveAmmo( int iCount, int iAmmoType );
void MakeEmptyPack( void ) { m_bEmptyPack = true; }
void MakeHolidayPack( void );
void SetBonusScale( float flBonusScale = 1.f );
void SetPickupThinkTime( float flNewThinkTime );
static CTFAmmoPack *Create( const Vector &vecOrigin, const QAngle &vecAngles, CBaseEntity *pOwner, const char *pszModelName );
float GetCreationTime( void ) { return m_flCreationTime; }
void SetInitialVelocity( Vector &vecVelocity );
void SetHealthInstead( bool bHealth ) { m_bHealthInstead = bHealth; }
const char* MakeHolidayAmmoPack( const char* inModelName, CBaseEntity *pOwner, const CTakeDamageInfo &info );
bool m_bObjGib;
private:
int m_iAmmo[TF_AMMO_COUNT];
float m_flCreationTime;
bool m_bEmptyPack; // If true, the pack gives nothing when picked up.
bool m_bHealthInstead; // If true, the pack gives health instead of ammo
bool m_bAllowOwnerPickup;
bool m_bNoPickup;
float m_flBonusScale;
AmmoPackType_t m_PackType;
CNetworkVector( m_vecInitialVelocity );
private:
CTFAmmoPack( const CTFAmmoPack & );
DECLARE_DATADESC();
};
#endif //TF_AMMO_PACK_H
|