summaryrefslogtreecommitdiff
path: root/game/shared/cstrike/cs_shareddefs.h
blob: 3e4143182a2d8513cb198b256bc99525c9b88776 (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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Shared CS definitions.
//
//=============================================================================//

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

/*======================*/
//      Menu stuff      //
/*======================*/

#include <game/client/iviewport.h>

//=============================================================================
// HPE_BEGIN:
// Including Achievement ID Definitions
//=============================================================================

#include "cs_achievementdefs.h"

//=============================================================================
// HPE_END
//=============================================================================

// CS-specific viewport panels
#define PANEL_CLASS_CT				"class_ct"
#define PANEL_CLASS_TER				"class_ter"

// Buy sub menus
#define MENU_PISTOL					"menu_pistol"
#define MENU_SHOTGUN				"menu_shotgun"
#define MENU_RIFLE					"menu_rifle"
#define MENU_SMG					"menu_smg"
#define MENU_MACHINEGUN				"menu_mg"
#define MENU_EQUIPMENT				"menu_equip"


#define MAX_HOSTAGES				12
#define MAX_HOSTAGE_RESCUES			4



 
#define CSTRIKE_DEFAULT_AVATAR "avatar_default_64"
#define CSTRIKE_DEFAULT_T_AVATAR "avatar_default-t_64"
#define CSTRIKE_DEFAULT_CT_AVATAR "avatar_default_64"

extern const float CS_PLAYER_SPEED_RUN;
extern const float CS_PLAYER_SPEED_VIP;
extern const float CS_PLAYER_SPEED_WALK;
extern const float CS_PLAYER_SPEED_SHIELD;
extern const float CS_PLAYER_SPEED_STOPPED;
extern const float CS_PLAYER_SPEED_OBSERVER;

extern const float CS_PLAYER_SPEED_DUCK_MODIFIER;
extern const float CS_PLAYER_SPEED_WALK_MODIFIER;
extern const float CS_PLAYER_SPEED_CLIMB_MODIFIER;


template< class T >
class CUtlVectorInitialized : public CUtlVector< T >
{
public:
	CUtlVectorInitialized( T* pMemory, int numElements ) : CUtlVector< T >( pMemory, numElements )
	{
		this->SetSize( numElements );
	}
};

extern CUtlVectorInitialized< const char * > CTPlayerModels;
extern CUtlVectorInitialized< const char * > TerroristPlayerModels;


// These go in CCSPlayer::m_iAddonBits and get sent to the client so it can create
// grenade models hanging off players.
#define ADDON_FLASHBANG_1		0x001
#define ADDON_FLASHBANG_2		0x002
#define ADDON_HE_GRENADE		0x004
#define ADDON_SMOKE_GRENADE		0x008
#define ADDON_C4				0x010
#define ADDON_DEFUSEKIT			0x020
#define ADDON_PRIMARY			0x040
#define ADDON_PISTOL			0x080
#define ADDON_PISTOL2			0x100
#define NUM_ADDON_BITS			9


// Indices of each weapon slot.
#define WEAPON_SLOT_RIFLE		0	// (primary slot)
#define WEAPON_SLOT_PISTOL		1	// (secondary slot)
#define WEAPON_SLOT_KNIFE		2
#define WEAPON_SLOT_GRENADES	3
#define WEAPON_SLOT_C4			4

#define WEAPON_SLOT_FIRST		0
#define WEAPON_SLOT_LAST		4


// CS Team IDs.
#define TEAM_TERRORIST			2
#define	TEAM_CT					3
#define TEAM_MAXCOUNT			4	// update this if we ever add teams (unlikely)

#define MAX_CLAN_TAG_LENGTH		16	// max for new tags is actually 12, this allows some backward compat.

//=============================================================================
// HPE_BEGIN:
// [menglish] CS specific death animation time now that freeze cam is implemented
//			in order to linger on the players body less 
// [tj] The number of times you must kill a given player to be dominating them
// [menglish] Flags to use upon player death
//=============================================================================

// [menglish] CS specific death animation time now that freeze cam is implemented
//			in order to linger on the players body less 
#define CS_DEATH_ANIMATION_TIME			0.8
 
// [tj] The number of times you must kill a given player to be dominating them
// Should always be more than 1
#define CS_KILLS_FOR_DOMINATION         4

#define CS_DEATH_DOMINATION				0x0001	// killer is dominating victim
#define CS_DEATH_REVENGE				0x0002	// killer got revenge on victim
//=============================================================================
// HPE_END
//=============================================================================


//--------------
// CSPort Specific damage flags
//--------------
#define DMG_HEADSHOT		(DMG_LASTGENERICFLAG<<1)


// The various states the player can be in during the join game process.
enum CSPlayerState
{
	// Happily running around in the game.
	// You can't move though if CSGameRules()->IsFreezePeriod() returns true.
	// This state can jump to a bunch of other states like STATE_PICKINGCLASS or STATE_DEATH_ANIM.
	STATE_ACTIVE=0,

	// This is the state you're in when you first enter the server.
	// It's switching between intro cameras every few seconds, and there's a level info
	// screen up.
	STATE_WELCOME,			// Show the level intro screen.

	// During these states, you can either be a new player waiting to join, or
	// you can be a live player in the game who wants to change teams.
	// Either way, you can't move while choosing team or class (or while any menu is up).
	STATE_PICKINGTEAM,			// Choosing team.
	STATE_PICKINGCLASS,			// Choosing class.

	STATE_DEATH_ANIM,			// Playing death anim, waiting for that to finish.
	STATE_DEATH_WAIT_FOR_KEY,	// Done playing death anim. Waiting for keypress to go into observer mode.
	STATE_OBSERVER_MODE,		// Noclipping around, watching players, etc.
	NUM_PLAYER_STATES
};


enum e_RoundEndReason
{
    Invalid_Round_End_Reason = -1,
    Target_Bombed,
    VIP_Escaped,						
    VIP_Assassinated,
    Terrorists_Escaped,
    CTs_PreventEscape,
    Escaping_Terrorists_Neutralized,
    Bomb_Defused,
    CTs_Win,
    Terrorists_Win,
    Round_Draw,
    All_Hostages_Rescued,
    Target_Saved,
    Hostages_Not_Rescued,
    Terrorists_Not_Escaped,
    VIP_Not_Escaped,
    Game_Commencing,
    RoundEndReason_Count    
};

#define PUSHAWAY_THINK_INTERVAL		(1.0f / 20.0f)

enum
{
	CS_CLASS_NONE=0,

	// Terrorist classes (keep in sync with FIRST_T_CLASS/LAST_T_CLASS).
	CS_CLASS_PHOENIX_CONNNECTION,
	CS_CLASS_L337_KREW,
	CS_CLASS_ARCTIC_AVENGERS,
	CS_CLASS_GUERILLA_WARFARE,

	// CT classes (keep in sync with FIRST_CT_CLASS/LAST_CT_CLASS).
	CS_CLASS_SEAL_TEAM_6,
	CS_CLASS_GSG_9,
	CS_CLASS_SAS,
	CS_CLASS_GIGN,

	CS_NUM_CLASSES
};

//=============================================================================
// HPE_BEGIN:
// [menglish] List of equipment dropped by players with freeze panel callouts
//============================================================================= 
enum
{
	DROPPED_C4,
	DROPPED_DEFUSE,
	DROPPED_WEAPON,
	DROPPED_GRENADE, // This could be an HE greande, flashbang, or smoke
	DROPPED_COUNT
}; 
//=============================================================================
// HPE_END
//=============================================================================


//=============================================================================
//
// MVP reasons
//
enum CSMvpReason_t
{
	CSMVP_UNDEFINED = 0,
	CSMVP_ELIMINATION,
	CSMVP_BOMBPLANT,
	CSMVP_BOMBDEFUSE,
	CSMVP_HOSTAGERESCUE,
};


// Keep these in sync with CSClasses.
#define FIRST_T_CLASS	CS_CLASS_PHOENIX_CONNNECTION
#define LAST_T_CLASS	CS_CLASS_GUERILLA_WARFARE

#define FIRST_CT_CLASS	CS_CLASS_SEAL_TEAM_6
#define LAST_CT_CLASS	CS_CLASS_GIGN

#define CS_MUZZLEFLASH_NONE -1
#define CS_MUZZLEFLASH_NORM	0
#define CS_MUZZLEFLASH_X	1

class CCSClassInfo
{
public:
	const char		*m_pClassName;
};

const CCSClassInfo* GetCSClassInfo( int i );

extern const char *pszWinPanelCategoryHeaders[];

#endif // CS_SHAREDDEFS_H