]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/constants.qh
Some updates and fixes to nades, new special bonus nades with different powers
[xonotic/xonotic-data.pk3dir.git] / 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 // Revision 19: fog
21 // Revision 20: naggers
22 // Revision 21: entcs for players optimized (position data down from 12 to 7 bytes); waypointsprites in csqc for team radar
23 // Revision 22: hook shot origin
24 #define CSQC_REVISION 22
25
26 const float AS_STRING = 1;
27 const float AS_INT = 2;
28 const float AS_FLOAT_TRUNCATED = 2;
29 const float AS_FLOAT = 8;
30
31 const float TE_CSQC_PICTURE = 100;
32 const float TE_CSQC_RACE = 101;
33 const float TE_CSQC_NEXGUNBEAMPARTICLE = 103;
34 const float TE_CSQC_LIGHTNINGARC = 104;
35 const float TE_CSQC_TEAMNAGGER = 105;
36 const float TE_CSQC_PINGPLREPORT = 106;
37 const float TE_CSQC_TARGET_MUSIC = 107;
38 const float TE_CSQC_WEAPONCOMPLAIN = 108;
39 const float TE_CSQC_NEX_SCOPE = 109;
40 const float TE_CSQC_MINELAYER_MAXMINES = 110;
41 const float TE_CSQC_HAGAR_MAXROCKETS = 111;
42 const float TE_CSQC_VEHICLESETUP = 112;
43 const float TE_CSQC_SVNOTICE = 113;
44
45 const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
46 const float RACE_NET_CHECKPOINT_CLEAR = 1;
47 const float RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder
48 const float RACE_NET_CHECKPOINT_HIT_RACE = 3; // byte checkpoint, short delta, byte lapsdelta, string opponent
49 const float RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT = 4; // byte checkpoint, short delta, byte lapsdelta, string opponent
50 const float RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING = 5; // byte nextcheckpoint, float laptime, short recordtime, string recordholder
51 const float RACE_NET_PENALTY_RACE = 6; // byte penaltytime, string reason
52 const float RACE_NET_PENALTY_QUALIFYING = 7; // byte penaltytime, string reason
53 const float RACE_NET_SERVER_RECORD = 8; // server record, sent to client
54 const float RACE_NET_SPEED_AWARD = 9; // speed award, sent to client
55 const float RACE_NET_SPEED_AWARD_BEST = 10; // all time best speed award, sent to client
56 const float RACE_NET_SERVER_RANKINGS = 11;
57 const float RACE_NET_SERVER_STATUS = 12;
58 const float RANKINGS_CNT = 15;
59
60 const float ENT_CLIENT = 0;
61 const float ENT_CLIENT_DEAD = 1;
62 const float ENT_CLIENT_ENTCS = 2;
63 const float ENT_CLIENT_SCORES_INFO = 3;
64 const float ENT_CLIENT_SCORES = 4;
65 const float ENT_CLIENT_TEAMSCORES = 5;
66 const float ENT_CLIENT_POINTPARTICLES = 6;
67 const float ENT_CLIENT_RAINSNOW = 7;
68 const float ENT_CLIENT_LASER = 8;
69 const float ENT_CLIENT_NAGGER = 9; // flags [votecalledvote]
70 const float ENT_CLIENT_WAYPOINT = 10; // flags origin [team displayrule] [spritename] [spritename2] [spritename3] [lifetime maxdistance hideable]
71 const float ENT_CLIENT_RADARLINK = 11; // flags [startorigin] [endorigin] [startcolor+16*endcolor]
72 const float ENT_CLIENT_PROJECTILE = 12;
73 const float ENT_CLIENT_GIBSPLASH = 13;
74 const float ENT_CLIENT_DAMAGEINFO = 14;
75 const float ENT_CLIENT_CASING = 15;
76 const float ENT_CLIENT_INIT = 16;
77 const float ENT_CLIENT_MAPVOTE = 17;
78 const float ENT_CLIENT_CLIENTDATA = 18;
79 const float ENT_CLIENT_RANDOMSEED = 19;
80 const float ENT_CLIENT_WALL = 20;
81 const float ENT_CLIENT_SPIDERBOT = 21;
82 const float ENT_CLIENT_MODELEFFECT = 22;
83 const float ENT_CLIENT_TUBANOTE = 23;
84 const float ENT_CLIENT_WARPZONE = 24;
85 const float ENT_CLIENT_WARPZONE_CAMERA = 25;
86 const float ENT_CLIENT_TRIGGER_MUSIC = 26;
87 const float ENT_CLIENT_HOOK = 27;
88 const float ENT_CLIENT_LGBEAM = 28;
89 const float ENT_CLIENT_GAUNTLET = 29;
90 const float ENT_CLIENT_ACCURACY = 30;
91 const float ENT_CLIENT_SHOWNAMES = 31;
92 const float ENT_CLIENT_WARPZONE_TELEPORTED = 32;
93 const float ENT_CLIENT_MODEL = 33;
94 const float ENT_CLIENT_ITEM = 34;
95 const float ENT_CLIENT_BUMBLE_RAYGUN = 35;
96 const float ENT_CLIENT_SPAWNPOINT = 36;
97 const float ENT_CLIENT_SPAWNEVENT = 37;
98 const float ENT_CLIENT_NOTIFICATION = 38;
99
100 const float ENT_CLIENT_TURRET = 40;
101 const float ENT_CLIENT_AUXILIARYXHAIR = 50;
102 const float ENT_CLIENT_VEHICLE = 60;
103
104 const float ENT_CLIENT_HEALING_ORB = 80;
105
106 const float SPRITERULE_DEFAULT = 0;
107 const float SPRITERULE_TEAMPLAY = 1;
108
109 const float RADARICON_NONE = 0;
110 const float RADARICON_FLAG = 1;
111 const float RADARICON_FLAGCARRIER = 1;
112 const float RADARICON_HERE = 1; // TODO make these 3 and 4, and make images for them
113 const float RADARICON_DANGER = 1;
114 const float RADARICON_WAYPOINT = 1;
115 const float RADARICON_HELPME = 1;
116 const float RADARICON_CONTROLPOINT = 1;
117 const float RADARICON_GENERATOR = 1;
118 const float RADARICON_OBJECTIVE = 1;
119 const float RADARICON_DOMPOINT = 1;
120 const float RADARICON_POWERUP = 1;
121 const float RADARICON_TAGGED = 1;
122
123 ///////////////////////////
124 // keys pressed
125 const float KEY_FORWARD = 1;
126 const float KEY_BACKWARD = 2;
127 const float KEY_LEFT = 4;
128 const float KEY_RIGHT = 8;
129 const float KEY_JUMP = 16;
130 const float KEY_CROUCH = 32;
131 const float KEY_ATCK = 64;
132 const float KEY_ATCK2 = 128;
133
134 ///////////////////////////
135 // cvar constants
136
137 const float CVAR_SAVE = 1;
138 const float CVAR_NOTIFY = 2;
139 const float CVAR_READONLY = 4;
140
141 ///////////////////////////
142 // csqc communication stuff
143
144 const float STAT_KH_KEYS = 32;
145 const float STAT_CTF_STATE = 33;
146 const float STAT_WEAPONS = 35;
147 const float STAT_SWITCHWEAPON = 36;
148 const float STAT_GAMESTARTTIME = 37;
149 const float STAT_STRENGTH_FINISHED = 38;
150 const float STAT_INVINCIBLE_FINISHED = 39;
151 const float STAT_PRESSED_KEYS = 42;
152 const float STAT_ALLOW_OLDNEXBEAM = 43; // this stat could later contain some other bits of info, like, more server-side particle config
153 const float STAT_FUEL = 44;
154 const float STAT_NB_METERSTART = 45;
155 const float STAT_SHOTORG = 46; // compressShotOrigin
156 const float STAT_LEADLIMIT = 47;
157 const float STAT_WEAPON_CLIPLOAD = 48;
158 const float STAT_WEAPON_CLIPSIZE = 49;
159 const float STAT_NEX_CHARGE = 50;
160 const float STAT_LAST_PICKUP = 51;
161 const float STAT_HUD = 52;
162 const float STAT_NEX_CHARGEPOOL = 53;
163 const float STAT_HIT_TIME = 54;
164 const float STAT_TYPEHIT_TIME = 55;
165 const float STAT_LAYED_MINES = 56;
166 const float STAT_HAGAR_LOAD = 57;
167 const float STAT_SWITCHINGWEAPON = 58;
168 const float STAT_SUPERWEAPONS_FINISHED = 59;
169
170 const float STAT_VEHICLESTAT_HEALTH = 60;
171 const float STAT_VEHICLESTAT_SHIELD = 61;
172 const float STAT_VEHICLESTAT_ENERGY = 62;
173 const float STAT_VEHICLESTAT_AMMO1 = 63;
174 const float STAT_VEHICLESTAT_RELOAD1 = 64;
175 const float STAT_VEHICLESTAT_AMMO2 = 65;
176 const float STAT_VEHICLESTAT_RELOAD2 = 66;
177
178 const float STAT_SECRETS_TOTAL = 70;
179 const float STAT_SECRETS_FOUND = 71;
180
181 const float STAT_RESPAWN_TIME = 72;
182 const float STAT_ROUNDSTARTTIME = 73;
183
184 const float STAT_WEAPONS2 = 74;
185 const float STAT_WEAPONS3 = 75;
186
187 const float STAT_MONSTERS_TOTAL = 76;
188 const float STAT_MONSTERS_KILLED = 77;
189
190 const float STAT_NADE_BONUS = 80;
191 const float STAT_NADE_BONUS_TYPE = 81;
192 const float STAT_NADE_BONUS_SCORE = 82;
193 const float STAT_HEALING_ORB = 83;
194 const float STAT_HEALING_ORB_ALPHA = 84;
195
196 // mod stats (1xx)
197 const float STAT_REDALIVE = 100;
198 const float STAT_BLUEALIVE = 101;
199 const float STAT_YELLOWALIVE = 102;
200 const float STAT_PINKALIVE = 103;
201
202 // freeze tag
203 const float STAT_FROZEN = 104;
204 const float STAT_REVIVE_PROGRESS = 105;
205
206 // domination
207 const float STAT_DOM_TOTAL_PPS = 100;
208 const float STAT_DOM_PPS_RED = 101;
209 const float STAT_DOM_PPS_BLUE = 102;
210 const float STAT_DOM_PPS_PINK = 103;
211 const float STAT_DOM_PPS_YELLOW = 104;
212
213 //const float STAT_SPIDERBOT_AIM 53 // compressShotOrigin
214 //const float STAT_SPIDERBOT_TARGET 54 // compressShotOrigin
215
216 // see DP source, quakedef.h
217 const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
218 const float STAT_MOVEVARS_AIRSTRAFEACCEL_QW = 223;
219 const float STAT_MOVEVARS_MAXSPEED = 244;
220 const float STAT_MOVEVARS_AIRACCEL_QW = 254;
221
222 const float CTF_STATE_ATTACK = 1;
223 const float CTF_STATE_DEFEND = 2;
224 const float CTF_STATE_COMMANDER = 3;
225
226 const float HUD_NORMAL = 0;
227 const float HUD_VEHICLE_FIRST = 10;
228 const float HUD_SPIDERBOT = 10;
229 const float HUD_WAKIZASHI = 11;
230 const float HUD_RAPTOR = 12;
231 const float HUD_BUMBLEBEE = 13;
232 const float HUD_BUMBLEBEE_GUN = 14;
233 const float HUD_VEHICLE_LAST = 14;
234
235 const vector eX = '1 0 0';
236 const vector eY = '0 1 0';
237 const vector eZ = '0 0 1';
238
239 // moved that here so the client knows the max.
240 // # of maps, I'll use arrays for them :P
241 #define MAPVOTE_COUNT 10
242
243 /**
244  * Lower scores are better (e.g. suicides)
245  */
246 #define SFL_LOWER_IS_BETTER 1
247
248 /**
249  * Don't show zero values as scores
250  */
251 #define SFL_HIDE_ZERO 2
252
253 /**
254  * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
255  */
256 #define SFL_ALLOW_HIDE 16
257
258 /**
259  * Display as a rank (with st, nd, rd, th suffix)
260  */
261 #define SFL_RANK 32
262
263 /**
264  * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
265  */
266 #define SFL_TIME 64
267
268 // not an extra constant yet
269 #define SFL_ZERO_IS_WORST SFL_TIME
270
271 /**
272  * Scoring priority (NOTE: PRIMARY is used for fraglimit)
273  */
274 #define SFL_SORT_PRIO_SECONDARY 4
275 #define SFL_SORT_PRIO_PRIMARY 8
276 #define SFL_SORT_PRIO_MASK 12
277
278 /**
279  * Score indices
280  */
281 #define MAX_SCORE 10
282 #define MAX_TEAMSCORE 2
283
284 #define ST_SCORE 0
285 #define SP_KILLS 0
286 #define SP_DEATHS 1
287 #define SP_SUICIDES 2
288 #define SP_SCORE 3
289 // game mode specific indices are not in common/, but in server/scores_rules.qc!
290
291 #ifdef COMPAT_XON010_CHANNELS
292 const float CH_INFO = 0; // only on world and csqc
293 const float CH_TRIGGER = 0; // only on players; compat: FALSELY CONTROLLED BY "Info"
294 const float CH_WEAPON_A = 1; // only on players and entities
295 const float CH_WEAPON_SINGLE = 5; // only on players and entities
296 const float CH_VOICE = 2; // only on players
297 const float CH_BGM_SINGLE = 2; // only on csqc; compat: FALSELY CONTROLLED BY "Voice"
298 const float CH_AMBIENT = 2; // only on csqc; compat: FALSELY CONTROLLED BY "Voice"
299 const float CH_TRIGGER_SINGLE = 3; // only on players, entities, csqc
300 const float CH_SHOTS = 4; // only on players, entities, csqc
301 const float CH_SHOTS_SINGLE = 4; // only on players, entities, csqc
302 const float CH_WEAPON_B = 5; // only on players and entities
303 const float CH_PAIN = 6; // only on players and csqc
304 const float CH_PAIN_SINGLE = 6; // only on players and csqc
305 const float CH_PLAYER = 7; // only on players and entities
306 const float CH_TUBA = 5; // only on csqc
307 #else
308 const float CH_INFO = 0;
309 const float CH_TRIGGER = -3;
310 const float CH_WEAPON_A = -1;
311 const float CH_WEAPON_SINGLE = 1;
312 const float CH_VOICE = -2;
313 const float CH_BGM_SINGLE = 8;
314 const float CH_AMBIENT = -9;
315 const float CH_TRIGGER_SINGLE = 3;
316 const float CH_SHOTS = -4;
317 const float CH_SHOTS_SINGLE = 4;
318 const float CH_WEAPON_B = -1;
319 const float CH_PAIN = -6;
320 const float CH_PAIN_SINGLE = 6;
321 const float CH_PLAYER = -7;
322 const float CH_TUBA = 5;
323 #endif
324
325 const float ATTEN_NONE = 0;
326 const float ATTEN_MIN = 0.015625;
327 const float ATTEN_NORM = 0.5;
328 const float ATTEN_LARGE = 1;
329 const float ATTEN_IDLE = 2;
330 const float ATTEN_STATIC = 3;
331 const float ATTEN_MAX = 3.984375;
332
333 #define VOL_BASE 0.7
334 #define VOL_BASEVOICE 1.0
335
336 // this sets sounds and other properties of the projectiles in csqc
337 const float PROJECTILE_ELECTRO = 1;
338 const float PROJECTILE_ROCKET = 2;
339 const float PROJECTILE_TAG = 3;
340 const float PROJECTILE_CRYLINK = 5;
341 const float PROJECTILE_ELECTRO_BEAM = 6;
342 const float PROJECTILE_GRENADE = 7;
343 const float PROJECTILE_GRENADE_BOUNCING = 8;
344 const float PROJECTILE_MINE = 9;
345 const float PROJECTILE_LASER = 10;
346 const float PROJECTILE_HLAC = 11;
347 const float PROJECTILE_SEEKER = 12;
348 const float PROJECTILE_FLAC = 13;
349 const float PROJECTILE_PORTO_RED = 14;
350 const float PROJECTILE_PORTO_BLUE = 15;
351 const float PROJECTILE_HOOKBOMB = 16;
352 const float PROJECTILE_HAGAR = 17;
353 const float PROJECTILE_HAGAR_BOUNCING = 18;
354 const float PROJECTILE_CRYLINK_BOUNCING = 20;
355 const float PROJECTILE_FIREBALL = 21;
356 const float PROJECTILE_FIREMINE = 22;
357
358 const float PROJECTILE_RAPTORCANNON = 24;
359 const float PROJECTILE_RAPTORBOMB = 25;
360 const float PROJECTILE_RAPTORBOMBLET = 26;
361 const float PROJECTILE_SPIDERROCKET = 27;
362 const float PROJECTILE_WAKIROCKET = 28;
363 const float PROJECTILE_WAKICANNON = 29;
364
365 const float PROJECTILE_BUMBLE_GUN = 30;
366 const float PROJECTILE_BUMBLE_BEAM = 31;
367
368 const float PROJECTILE_MAGE_SPIKE = 32;
369 const float PROJECTILE_SHAMBLER_LIGHTNING = 33;
370
371 const float SPECIES_HUMAN = 0;
372 const float SPECIES_ROBOT_SOLID = 1;
373 const float SPECIES_ALIEN = 2;
374 const float SPECIES_ANIMAL = 3;
375 const float SPECIES_ROBOT_RUSTY = 4;
376 const float SPECIES_ROBOT_SHINY = 5;
377 const float SPECIES_RESERVED = 15;
378
379 #define FRAGS_PLAYER 0
380 #define FRAGS_SPECTATOR -666
381 #define FRAGS_LMS_LOSER -616
382 #define FRAGS_PLAYER_NONSOLID -616
383 // we can use this frags value for both
384
385 // water levels
386 const float WATERLEVEL_NONE = 0;
387 const float WATERLEVEL_WETFEET = 1;
388 const float WATERLEVEL_SWIMMING = 2;
389 const float WATERLEVEL_SUBMERGED = 3;
390
391 const float MAX_SHOT_DISTANCE = 32768;
392
393 // weapon requests
394 const float WR_SETUP = 1; // (SVQC) setup weapon data
395 const float WR_THINK = 2; // (SVQC) logic to run every frame
396 const float WR_CHECKAMMO1 = 3; // (SVQC) checks ammo for weapon
397 const float WR_CHECKAMMO2 = 4; // (SVQC) checks ammo for weapon
398 const float WR_AIM = 5; // (SVQC) runs bot aiming code for this weapon
399 const float WR_PRECACHE = 6; // (CSQC and SVQC) precaches models/sounds used by this weapon
400 const float WR_SUICIDEMESSAGE = 7; // (SVQC) notification number for suicide message (may inspect w_deathtype for details)
401 const float WR_KILLMESSAGE = 8; // (SVQC) notification number for kill message (may inspect w_deathtype for details)
402 const float WR_RELOAD = 9; // (SVQC) does not need to do anything
403 const float WR_RESETPLAYER = 10; // (SVQC) does not need to do anything
404 const float WR_IMPACTEFFECT = 11; // (CSQC) impact effect
405 const float WR_SWITCHABLE = 12; // (CSQC) impact effect
406 const float WR_PLAYERDEATH = 13; // (SVQC) does not need to do anything
407 const float WR_GONETHINK = 14; // (SVQC) logic to run every frame, also if no longer having the weapon as long as the switch away has not been performed
408
409 #define SERVERFLAG_ALLOW_FULLBRIGHT 1
410 #define SERVERFLAG_TEAMPLAY 2
411 #define SERVERFLAG_PLAYERSTATS 4
412
413 // FIXME/EXPLAINME: why?
414 noref var vector autocvar_sv_player_maxs = '16 16 45';
415 noref var vector autocvar_sv_player_mins = '-16 -16 -24';
416 noref var vector autocvar_sv_player_viewoffset = '0 0 20';
417 noref var vector autocvar_sv_player_crouch_maxs = '16 16 25';
418 noref var vector autocvar_sv_player_crouch_mins = '-16 -16 -24';
419 noref var vector autocvar_sv_player_crouch_viewoffset = '0 0 20';
420 noref var vector autocvar_sv_player_headsize = '24 24 12';
421
422 #define PL_VIEW_OFS autocvar_sv_player_viewoffset
423 #define PL_MIN autocvar_sv_player_mins
424 #define PL_MAX autocvar_sv_player_maxs
425 #define PL_CROUCH_VIEW_OFS autocvar_sv_player_crouch_viewoffset
426 #define PL_CROUCH_MIN autocvar_sv_player_crouch_mins
427 #define PL_CROUCH_MAX autocvar_sv_player_crouch_maxs
428 #define PL_HEAD autocvar_sv_player_headsize
429
430 // helpers
431 #define PL_VIEW_OFS_z autocvar_sv_player_viewoffset_z
432 #define PL_MIN_z autocvar_sv_player_mins_z
433 #define PL_MAX_z autocvar_sv_player_maxs_z
434 #define PL_CROUCH_VIEW_OFS_z autocvar_sv_player_crouch_viewoffset_z
435 #define PL_CROUCH_MIN_z autocvar_sv_player_mins_z
436 #define PL_HEAD_x autocvar_sv_player_headsize_x
437 #define PL_HEAD_y autocvar_sv_player_headsize_y
438 #define PL_HEAD_z autocvar_sv_player_headsize_z
439
440 // spawnpoint prios
441 #define SPAWN_PRIO_NEAR_TEAMMATE_FOUND 200
442 #define SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM 100
443 #define SPAWN_PRIO_RACE_PREVIOUS_SPAWN 50
444 #define SPAWN_PRIO_GOOD_DISTANCE 10
445
446 // URI handles
447 #define URI_GET_DISCARD 0
448 #define URI_GET_IPBAN 1
449 #define URI_GET_IPBAN_END 16
450 #define URI_GET_CURL 17
451 #define URI_GET_CURL_END 32
452 #define URI_GET_UPDATENOTIFICATION 33
453 #define URI_GET_URLLIB 128
454 #define URI_GET_URLLIB_END 191