summaryrefslogtreecommitdiff
path: root/game/shared/tf/tf_item_constants.h
blob: d2b77ad7017808923bb13180b2c276bdbedb4223 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================

#ifndef TFITEMCONSTANTS_H		// ECON_ITEM_CONSTANTS_H is used by src/common/econ_item_view.h
#define TFITEMCONSTANTS_H
#ifdef _WIN32
#pragma once
#endif


//-----------------------------------------------------------------------------
// Weapon Types
//-----------------------------------------------------------------------------
enum
{
	TF_WPN_TYPE_PRIMARY = 0,
	TF_WPN_TYPE_SECONDARY,
	TF_WPN_TYPE_MELEE,
	TF_WPN_TYPE_GRENADE,
	TF_WPN_TYPE_BUILDING,
	TF_WPN_TYPE_PDA,
	TF_WPN_TYPE_ITEM1,
	TF_WPN_TYPE_ITEM2,
	TF_WPN_TYPE_HEAD,
	TF_WPN_TYPE_MISC,
	TF_WPN_TYPE_MELEE_ALLCLASS,
	TF_WPN_TYPE_SECONDARY2,
	TF_WPN_TYPE_PRIMARY2,


	//
	// ADD NEW ITEMS HERE TO AVOID BREAKING DEMOS
	//

	TF_WPN_TYPE_COUNT,
};

//-----------------------------------------------------------------------------
// Purpose: Slots for items within loadouts
//-----------------------------------------------------------------------------
enum loadout_positions_t
{
	LOADOUT_POSITION_INVALID = -1,

	// Weapons & Equipment
	LOADOUT_POSITION_PRIMARY = 0,
	LOADOUT_POSITION_SECONDARY,
	LOADOUT_POSITION_MELEE,
	LOADOUT_POSITION_UTILITY,
	LOADOUT_POSITION_BUILDING,
	LOADOUT_POSITION_PDA,
	LOADOUT_POSITION_PDA2,

	// Wearables. If you add new wearable slots, make sure you add them to IsWearableSlot() below this.
	LOADOUT_POSITION_HEAD,
	LOADOUT_POSITION_MISC,

	// other
	LOADOUT_POSITION_ACTION,

	// More wearables, yay!
	LOADOUT_POSITION_MISC2,

	// taunts
	LOADOUT_POSITION_TAUNT,
	LOADOUT_POSITION_TAUNT2,
	LOADOUT_POSITION_TAUNT3,
	LOADOUT_POSITION_TAUNT4,
	LOADOUT_POSITION_TAUNT5,
	LOADOUT_POSITION_TAUNT6,
	LOADOUT_POSITION_TAUNT7,
	LOADOUT_POSITION_TAUNT8,

#ifdef STAGING_ONLY
	// Extra PDA mod slots 
	LOADOUT_POSITION_PDA_ADDON1,
	LOADOUT_POSITION_PDA_ADDON2,

	LOADOUT_POSITION_PDA3,
	//LOADOUT_POSITION_MISC3,
	//LOADOUT_POSITION_MISC4,
	//LOADOUT_POSITION_MISC5,
	//LOADOUT_POSITION_MISC6,
	//LOADOUT_POSITION_MISC7,
	//LOADOUT_POSITION_MISC8,
	//LOADOUT_POSITION_MISC9,
	//LOADOUT_POSITION_MISC10,
	LOADOUT_POSITION_BUILDING2,
#endif // STAGING_ONLY

	CLASS_LOADOUT_POSITION_COUNT,
};

enum account_loadout_positions_t
{
	ACCOUNT_LOADOUT_POSITION_ACCOUNT1,
	ACCOUNT_LOADOUT_POSITION_ACCOUNT2,
	ACCOUNT_LOADOUT_POSITION_ACCOUNT3,

	ACCOUNT_LOADOUT_POSITION_COUNT,
};

// We use this to determine the maximum number of wearable instances we'll send from the server down to
// connected clients. This was previously hardcoded to be 8 and because of the way RecvPropUtlVector works
// we can't easily change this without doing some kludgy work and breaking network/demo compatibility. In
// the shorter term, we'll break compatibility in staging where no-one cares but leave public unchanged.
#ifdef STAGING_ONLY
	#define	LOADOUT_MAX_WEARABLES_COUNT ( CLASS_LOADOUT_POSITION_COUNT )
#else
	#define	LOADOUT_MAX_WEARABLES_COUNT ( 8 /* !!! -- LOADOUT_POSITION_COUNT - 3 */ )
#endif

inline bool IsMiscSlot( int iSlot )
{
	return iSlot == LOADOUT_POSITION_MISC
		|| iSlot == LOADOUT_POSITION_MISC2
		|| iSlot == LOADOUT_POSITION_HEAD
#ifdef STAGING_ONLY
		//|| iSlot == LOADOUT_POSITION_MISC3
		//|| iSlot == LOADOUT_POSITION_MISC4
		//|| iSlot == LOADOUT_POSITION_MISC5
		//|| iSlot == LOADOUT_POSITION_MISC6
		//|| iSlot == LOADOUT_POSITION_MISC7
		//|| iSlot == LOADOUT_POSITION_MISC8
		//|| iSlot == LOADOUT_POSITION_MISC9
		//|| iSlot == LOADOUT_POSITION_MISC10
#endif // STAGING_ONLY
		;
}

inline bool IsBuildingSlot( int iSlot )
{
	return iSlot == LOADOUT_POSITION_BUILDING
#ifdef STAGING_ONLY
		|| iSlot == LOADOUT_POSITION_BUILDING2
#endif // STAGING_ONLY
		;
}

inline bool IsTauntSlot( int iSlot )
{
	return iSlot == LOADOUT_POSITION_TAUNT
		|| iSlot == LOADOUT_POSITION_TAUNT2
		|| iSlot == LOADOUT_POSITION_TAUNT3
		|| iSlot == LOADOUT_POSITION_TAUNT4
		|| iSlot == LOADOUT_POSITION_TAUNT5
		|| iSlot == LOADOUT_POSITION_TAUNT6
		|| iSlot == LOADOUT_POSITION_TAUNT7
		|| iSlot == LOADOUT_POSITION_TAUNT8;
}

inline bool IsWearableSlot( int iSlot ) 
{
	return iSlot == LOADOUT_POSITION_HEAD
		|| iSlot == LOADOUT_POSITION_MISC
		|| iSlot == LOADOUT_POSITION_ACTION
		|| IsMiscSlot( iSlot )
		|| IsTauntSlot( iSlot );
}

inline bool IsQuestSlot( int iSlot )
{
	return iSlot == ACCOUNT_LOADOUT_POSITION_ACCOUNT1
		|| iSlot == ACCOUNT_LOADOUT_POSITION_ACCOUNT2
		|| iSlot == ACCOUNT_LOADOUT_POSITION_ACCOUNT3;
}

inline bool IsValidItemSlot( int iSlot )
{
	return iSlot > LOADOUT_POSITION_INVALID && iSlot < CLASS_LOADOUT_POSITION_COUNT;
}

inline bool IsValidPickupWeaponSlot( int iSlot )
{
	return iSlot == LOADOUT_POSITION_PRIMARY
		|| iSlot == LOADOUT_POSITION_SECONDARY
		|| iSlot == LOADOUT_POSITION_MELEE;
}


// The total number of loadouts to track for each player.
// Right now, hardcoded to match TF's 10 classes.
#define LOADOUT_COUNT					(10+1)	// 0th class is undefined

// Halloween! (Shared by GC and game client.)
enum EHalloweenMap
{
	kHalloweenMap_MannManor,
	kHalloweenMap_Viaduct,
	kHalloweenMap_Lakeside,
	kHalloweenMap_Hightower,

	kHalloweenMapCount
};

enum EHalloweenGiftSpawnMetaInfo
{
	kHalloweenGiftMeta_IsUnderworldOnViaduct_DEPRECATED		= 0x01,
};

#endif // TFITEMCONSTANTS_H