]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/common/constants.qh
added a simple 'warmup' indicator to the scoreboard
[divverent/nexuiz.git] / data / qcsrc / common / constants.qh
1 // COMMIT-TODO: Update if necessary before committing
2 // Revision 1: additional statistics sent (flag caps, returns, deaths)
3 // Revision 2: Mapvote preview pictures
4 // Revision 3: optimized map vote protocol
5 // Revision 4: CSQC config var system
6 // Revision 5: mapvote time fix
7 // Revision 6: more robust against packet loss/delays, also show not yet connected clients
8 // Revision 7: packet loss column
9 // Revision 8: race
10 // Revision 9: race delta
11 // Revision 10: scoreboard force
12 // Revision 11: scoreboard unforce; spectator support beginning
13 // Revision 12: smaller scores updates (SERVER: requires new engine)
14 // Revision 13: pointparticles
15 // Revision 14: laser
16 // Revision 15: zoom
17 // Revision 16: multi-weapons
18 // Revision 17: multi-weaponimpulses
19 // Revision 18: warmup
20 #define CSQC_REVISION 18
21
22 // probably put these in common/
23 // so server/ and client/ can be synced better
24 const float GAME_DEATHMATCH             = 1;
25 const float GAME_TEAM_DEATHMATCH        = 2;
26 const float GAME_DOMINATION             = 3;
27 const float GAME_CTF                    = 4;
28 const float GAME_RUNEMATCH              = 5;
29 const float GAME_LMS                    = 6;
30 const float GAME_ARENA          = 7;
31 const float GAME_KEYHUNT                = 8;
32 const float GAME_ASSAULT                = 9;
33 const float GAME_ONSLAUGHT      = 10;
34 const float GAME_RACE   = 11;
35
36 const float AS_STRING           = 1;
37 const float AS_INT              = 2;
38 const float AS_FLOAT_TRUNCATED  = 2;
39 const float AS_FLOAT            = 8;
40
41 const float ENT_CLIENT = 0;
42 const float ENT_CLIENT_DEAD = 1;
43 const float ENT_CLIENT_ENTCS = 2;
44 const float ENT_CLIENT_SCORES_INFO = 3;
45 const float ENT_CLIENT_SCORES = 4;
46 const float ENT_CLIENT_TEAMSCORES = 5;
47 const float ENT_CLIENT_POINTPARTICLES = 6;
48 const float ENT_CLIENT_RAINSNOW = 7;
49 const float ENT_CLIENT_LASER = 8;
50
51 ///////////////////////////
52 // key constants
53
54 //
55 // these are the key numbers that should be passed to Key_Event
56 //
57 const float K_TAB                       =       9;
58 const float K_ENTER             =       13;
59 const float K_ESCAPE            =       27;
60 const float K_SPACE             =       32;
61
62 // normal keys should be passed as lowercased ascii
63
64 const float K_BACKSPACE =       127;
65 const float K_UPARROW           =       128;
66 const float K_DOWNARROW =       129;
67 const float K_LEFTARROW =       130;
68 const float K_RIGHTARROW        =       131;
69
70 const float K_ALT               =       132;
71 const float K_CTRL      =       133;
72 const float K_SHIFT     =       134;
73 const float K_F1                =       135;
74 const float K_F2                =       136;
75 const float K_F3                =       137;
76 const float K_F4                =       138;
77 const float K_F5                =       139;
78 const float K_F6                =       140;
79 const float K_F7                =       141;
80 const float K_F8                =       142;
81 const float K_F9                =       143;
82 const float K_F10               =       144;
83 const float K_F11               =       145;
84 const float K_F12               =       146;
85 const float K_INS               =       147;
86 const float K_DEL               =       148;
87 const float K_PGDN      =       149;
88 const float K_PGUP      =       150;
89 const float K_HOME      =       151;
90 const float K_END               =       152;
91
92 const float K_KP_HOME                   =       160;
93 const float K_KP_UPARROW                =       161;
94 const float K_KP_PGUP                   =       162;
95 const float K_KP_LEFTARROW      =       163;
96 const float K_KP_5                      =       164;
97 const float K_KP_RIGHTARROW     =       165;
98 const float K_KP_END                    =       166;
99 const float K_KP_DOWNARROW      =       167;
100 const float K_KP_PGDN                   =       168;
101 const float K_KP_ENTER          =       169;
102 const float K_KP_INS            =       170;
103 const float K_KP_DEL                    =       171;
104 const float K_KP_SLASH          =       172;
105 const float K_KP_MINUS          =       173;
106 const float K_KP_PLUS                   =       174;
107
108 const float K_PAUSE             =       255;
109
110 //
111 // joystick buttons
112 //
113 const float K_JOY1              =       768;
114 const float K_JOY2              =       769;
115 const float K_JOY3              =       770;
116 const float K_JOY4              =       771;
117
118 //
119 // aux keys are for multi-buttoned joysticks to generate so they can use
120 // the normal binding process
121 //
122 const float K_AUX1              =       772;
123 const float K_AUX2              =       773;
124 const float K_AUX3              =       774;
125 const float K_AUX4              =       775;
126 const float K_AUX5              =       776;
127 const float K_AUX6              =       777;
128 const float K_AUX7              =       778;
129 const float K_AUX8              =       779;
130 const float K_AUX9              =       780;
131 const float K_AUX10             =       781;
132 const float K_AUX11             =       782;
133 const float K_AUX12             =       783;
134 const float K_AUX13             =       784;
135 const float K_AUX14             =       785;
136 const float K_AUX15             =       786;
137 const float K_AUX16             =       787;
138 const float K_AUX17             =       788;
139 const float K_AUX18             =       789;
140 const float K_AUX19             =       790;
141 const float K_AUX20             =       791;
142 const float K_AUX21             =       792;
143 const float K_AUX22             =       793;
144 const float K_AUX23             =       794;
145 const float K_AUX24             =       795;
146 const float K_AUX25             =       796;
147 const float K_AUX26             =       797;
148 const float K_AUX27             =       798;
149 const float K_AUX28             =       799;
150 const float K_AUX29             =       800;
151 const float K_AUX30             =       801;
152 const float K_AUX31             =       802;
153 const float K_AUX32             =       803;
154
155 //
156 // mouse buttons generate virtual keys
157 //
158 const float K_MOUSE1            =       512;
159 const float K_MOUSE2            =       513;
160 const float K_MOUSE3            =       514;
161 const float K_MWHEELUP  =       515;
162 const float K_MWHEELDOWN        =       516;
163 const float K_MOUSE4            =       517;
164 const float K_MOUSE5            =       518;
165 const float K_MOUSE6            =       519;
166 const float K_MOUSE7            =       520;
167 const float K_MOUSE8            =       521;
168 const float K_MOUSE9            =       522;
169 const float K_MOUSE10           =       523;
170 const float K_MOUSE11           =       524;
171 const float K_MOUSE12           =       525;
172 const float K_MOUSE13           =       526;
173 const float K_MOUSE14           =       527;
174 const float K_MOUSE15           =       528;
175 const float K_MOUSE16           =       529;
176
177 ///////////////////////////
178 // cvar constants
179
180 float CVAR_SAVE         = 1;
181 float CVAR_NOTIFY       = 2;
182 float CVAR_READONLY     = 4;
183
184 ///////////////////////////
185 // csqc communication stuff
186
187 const float ENTCS_MSG_END = 0;
188 const float ENTCS_MSG_ONS_GPS = 1;
189 const float ENTCS_MSG_ONS_REMOVE = 2;
190 const float ENTCS_MSG_INIT = 3;
191
192 const float TE_CSQC_INIT = 100;
193 const float TE_CSQC_PING = 101;
194 const float TE_CSQC_CAPTURES = 102;
195 const float TE_CSQC_RETURNS = 103;
196 const float TE_CSQC_DEATHS = 104;
197 const float TE_CSQC_PICTURE = 105;
198 const float TE_CSQC_MAPVOTE = 106;
199 const float TE_CSQC_CONFIG = 107;
200 const float TE_CSQC_SCORESINFO = 108;
201 const float TE_CSQC_RACE = 109;
202 const float TE_CSQC_FORCESCOREBOARD = 110;
203 const float TE_CSQC_SPECTATING = 111;
204 const float TE_CSQC_SPAWN = 112;
205 const float TE_CSQC_ZOOMNOTIFY = 113;
206 const float TE_CSQC_HOLDANGLES = 114;
207 const float TE_CSQC_WARMUP = 115;
208
209 const float STAT_KH_KEYS = 32;
210 const float STAT_CTF_STATE = 33;
211 const float STAT_SYS_TICRATE = 34;
212 const float STAT_WEAPONS = 35;
213 const float STAT_SWITCHWEAPON = 36;
214 const float CTF_STATE_ATTACK = 1;
215 const float CTF_STATE_DEFEND = 2;
216 const float CTF_STATE_COMMANDER = 3;
217
218 // moved that here so the client knows the max.
219 // # of maps, I'll use arrays for them :P
220 #define MAPVOTE_COUNT 10
221 const float MAPVOTE_NET_INIT = 0;
222 const float MAPVOTE_NET_UPDATE = 1;
223 const float MAPVOTE_NET_PIC = 2;
224 const float MAPVOTE_NET_OWNVOTE = 3;
225
226 const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
227 const float RACE_NET_CHECKPOINT_CLEAR = 1;
228 const float RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder
229 const float RACE_NET_CHECKPOINT_HIT_RACE = 3; // byte checkpoint, short delta, byte lapsdelta, string opponent
230 const float RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT = 4; // byte checkpoint, short delta, byte lapsdelta, string opponent
231 const float RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING = 5; // byte nextcheckpoint, float laptime, short recordtime, string recordholder
232
233 /**
234  * Lower scores are better (e.g. suicides)
235  */
236 #define SFL_LOWER_IS_BETTER     1
237
238 /**
239  * Don't show zero values as scores
240  */
241 #define SFL_HIDE_ZERO           2
242
243 /**
244  * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
245  */
246 #define SFL_ALLOW_HIDE         16
247
248 /**
249  * Display as a rank (with st, nd, rd, th suffix)
250  */
251 #define SFL_RANK               32
252
253 /**
254  * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
255  */
256 #define SFL_TIME               64
257
258 // not an extra constant yet
259 #define SFL_ZERO_IS_WORST SFL_TIME
260
261 /**
262  * Scoring priority (NOTE: PRIMARY is used for fraglimit)
263  */
264 #define SFL_SORT_PRIO_SECONDARY 4
265 #define SFL_SORT_PRIO_PRIMARY   8
266 #define SFL_SORT_PRIO_MASK     12
267
268 /**
269  * Score indices
270  */
271 #define MAX_SCORE 10
272 #define MAX_TEAMSCORE 2
273
274 #define ST_SCORE 0
275 #define SP_KILLS 0
276 #define SP_DEATHS 1
277 #define SP_SUICIDES 2
278 #define SP_SCORE 3
279 // game mode specific indices are not in common/, but in server/scores_rules.qc!
280
281 // Weapon indexes
282 // %weaponaddpoint
283 float WEP_FIRST                         =  1;
284 float WEP_LASER                         =  1; float WEPBIT_LASER                        = 1; // always: 2^(w-1)
285 float WEP_SHOTGUN                       =  2; float WEPBIT_SHOTGUN                      = 2;
286 float WEP_UZI                           =  3; float WEPBIT_UZI                          = 4;
287 float WEP_GRENADE_LAUNCHER      =  4; float WEPBIT_GRENADE_LAUNCHER     = 8;
288 float WEP_ELECTRO                       =  5; float WEPBIT_ELECTRO                      = 16;
289 float WEP_CRYLINK                       =  6; float WEPBIT_CRYLINK                      = 32;
290 float WEP_NEX                           =  7; float WEPBIT_NEX                          = 64;
291 float WEP_HAGAR                         =  8; float WEPBIT_HAGAR                        = 128;
292 float WEP_ROCKET_LAUNCHER       =  9; float WEPBIT_ROCKET_LAUNCHER      = 256;
293 float WEP_PORTO                         = 10; float WEPBIT_PORTO                        = 512;
294 float WEP_MINSTANEX                     = 11; float WEPBIT_MINSTANEX            = 1024;
295 float WEP_LAST                          = 11; float WEPBIT_ALL              = 2047;
296 float WEP_COUNT             = 12;
297
298 float   IT_UNLIMITED_AMMO       = 1;
299 // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
300 float   IT_SHELLS                               = 256;
301 float   IT_NAILS                                = 512;
302 float   IT_ROCKETS                              = 1024;
303 float   IT_CELLS                                = 2048;
304 float   IT_SUPERWEAPON                  = 4096;
305 float   IT_AMMO                                 = 7936;
306 float   IT_STRENGTH                             = 8192;
307 float   IT_INVINCIBLE                   = 16384;
308 float   IT_HEALTH                               = 32768;
309 // union:
310         // for items:
311         float   IT_KEY1                                 = 131072;
312         float   IT_KEY2                                 = 262144;
313         // for players:
314         float   IT_RED_FLAG_TAKEN               = 32768;
315         float   IT_RED_FLAG_LOST                = 65536;
316         float   IT_RED_FLAG_CARRING             = 98304;
317         float   IT_BLUE_FLAG_TAKEN              = 131072;
318         float   IT_BLUE_FLAG_LOST               = 262144;
319         float   IT_BLUE_FLAG_CARRING    = 393216;
320 // end
321 float   IT_5HP                                  = 524288;
322 float   IT_25HP                                 = 1048576;
323 float   IT_ARMOR_SHARD                  = 2097152;
324 float   IT_ARMOR                                = 4194304;