]> de.git.xonotic.org Git - voretournament/voretournament.git/blob - data/qcsrc/common/constants.qh
44f19165628906b02041ddb79bec533dc1518ab9
[voretournament/voretournament.git] / data / qcsrc / common / constants.qh
1 // COMMIT-TODO: Update if necessary before committing\r
2 // Revision 1: additional statistics sent (flag caps, returns, deaths)\r
3 // Revision 2: Mapvote preview pictures\r
4 // Revision 3: optimized map vote protocol\r
5 // Revision 4: CSQC config var system\r
6 // Revision 5: mapvote time fix\r
7 // Revision 6: more robust against packet loss/delays, also show not yet connected clients\r
8 // Revision 7: packet loss column\r
9 // Revision 8: race\r
10 // Revision 9: race delta\r
11 // Revision 10: scoreboard force\r
12 // Revision 11: scoreboard unforce; spectator support beginning\r
13 // Revision 12: smaller scores updates (SERVER: requires new engine)\r
14 // Revision 13: pointparticles\r
15 // Revision 14: laser\r
16 // Revision 15: zoom\r
17 // Revision 16: multi-weapons\r
18 // Revision 17: multi-weaponimpulses\r
19 // Revision 18: warmup\r
20 // Revision 19: fog\r
21 // Revision 20: naggers\r
22 // Revision 21: entcs for players optimized (position data down from 12 to 7 bytes); waypointsprites in csqc for team radar\r
23 // Revision 22: grabber shot origin\r
24 #define CSQC_REVISION 22\r
25 \r
26 // probably put these in common/\r
27 // so server/ and client/ can be synced better\r
28 const float GAME_DEATHMATCH             = 1;\r
29 const float GAME_TEAM_DEATHMATCH        = 2;\r
30 const float GAME_DOMINATION             = 3;\r
31 const float GAME_CTF                    = 4;\r
32 const float GAME_LMS                    = 5;\r
33 const float GAME_ARENA          = 6;\r
34 const float GAME_KEYHUNT                = 7;\r
35 const float GAME_ASSAULT                = 8;\r
36 const float GAME_ONSLAUGHT      = 9;\r
37 const float GAME_RACE   = 10;\r
38 const float GAME_CTS = 11;\r
39 const float GAME_CA             = 12;\r
40 const float GAME_RPG            = 13;\r
41 \r
42 const float AS_STRING           = 1;\r
43 const float AS_INT              = 2;\r
44 const float AS_FLOAT_TRUNCATED  = 2;\r
45 const float AS_FLOAT            = 8;\r
46 \r
47 const float TE_CSQC_PICTURE = 100;\r
48 const float TE_CSQC_RACE = 101;\r
49 const float TE_CSQC_SPAWN = 102;\r
50 const float TE_CSQC_ZCURVEPARTICLES = 103;\r
51 const float TE_CSQC_LIGHTNINGARC = 104;\r
52 const float TE_CSQC_TEAMNAGGER = 105;\r
53 const float TE_CSQC_PINGPLREPORT = 106;\r
54 const float TE_CSQC_OTHERPLREPORT = 107;\r
55 const float TE_CSQC_VOTE = 108;\r
56 const float TE_CSQC_VOTERESET = 109;\r
57 const float TE_CSQC_ANNOUNCE = 110;\r
58 const float TE_CSQC_TARGET_MUSIC = 111;\r
59 \r
60 const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder\r
61 const float RACE_NET_CHECKPOINT_CLEAR = 1;\r
62 const float RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder\r
63 const float RACE_NET_CHECKPOINT_HIT_RACE = 3; // byte checkpoint, short delta, byte lapsdelta, string opponent\r
64 const float RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT = 4; // byte checkpoint, short delta, byte lapsdelta, string opponent\r
65 const float RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING = 5; // byte nextcheckpoint, float laptime, short recordtime, string recordholder\r
66 const float RACE_NET_PENALTY_RACE = 6; // byte penaltytime, string reason\r
67 const float RACE_NET_PENALTY_QUALIFYING = 7; // byte penaltytime, string reason\r
68 const float RACE_NET_SERVER_RECORD = 8; // server record, sent to client\r
69 const float RACE_NET_SPEED_AWARD = 9; // speed award, sent to client\r
70 const float RACE_NET_SPEED_AWARD_BEST = 10; // all time best speed award, sent to client\r
71 const float RACE_NET_SERVER_RANKINGS = 11;\r
72 const float RACE_NET_SERVER_STATUS = 12;\r
73 const float RANKINGS_CNT = 15;\r
74 \r
75 const float ENT_CLIENT = 0;\r
76 const float ENT_CLIENT_DEAD = 1;\r
77 const float ENT_CLIENT_ENTCS = 2;\r
78 const float ENT_CLIENT_SCORES_INFO = 3;\r
79 const float ENT_CLIENT_SCORES = 4;\r
80 const float ENT_CLIENT_TEAMSCORES = 5;\r
81 const float ENT_CLIENT_POINTPARTICLES = 6;\r
82 const float ENT_CLIENT_RAINSNOW = 7;\r
83 const float ENT_CLIENT_LASER = 8;\r
84 const float ENT_CLIENT_NAGGER = 9; // flags [votecalledvote]\r
85 const float ENT_CLIENT_WAYPOINT = 10; // flags origin [team displayrule] [spritename] [spritename2] [spritename3] [lifetime maxdistance hideable]\r
86 const float ENT_CLIENT_RADARLINK = 11; // flags [startorigin] [endorigin] [startcolor+16*endcolor]\r
87 const float ENT_CLIENT_PROJECTILE = 12;\r
88 const float ENT_CLIENT_GIBSPLASH = 13;\r
89 const float ENT_CLIENT_DAMAGEINFO = 14;\r
90 const float ENT_CLIENT_CASING = 15;\r
91 const float ENT_CLIENT_INIT = 16;\r
92 const float ENT_CLIENT_MAPVOTE = 17;\r
93 const float ENT_CLIENT_CLIENTDATA = 18;\r
94 const float ENT_CLIENT_RANDOMSEED = 19;\r
95 const float ENT_CLIENT_WALL = 20;\r
96 // const float ENT_CLIENT_SPIDERBOT = 21;\r
97 const float ENT_CLIENT_MODELEFFECT = 22;\r
98 const float ENT_CLIENT_WARPZONE = 23;\r
99 const float ENT_CLIENT_WARPZONE_CAMERA = 24;\r
100 const float ENT_CLIENT_TRIGGER_MUSIC = 25;\r
101 \r
102 const float ENT_CLIENT_TURRET = 40;\r
103 \r
104 const float SPRITERULE_DEFAULT = 0;\r
105 const float SPRITERULE_TEAMPLAY = 1;\r
106 \r
107 const float RADARICON_FLAG = 1;\r
108 const float RADARICON_FLAGCARRIER = 1;\r
109 const float RADARICON_HERE = 1; // TODO make these 3 and 4, and make images for them\r
110 const float RADARICON_DANGER = 1;\r
111 const float RADARICON_WAYPOINT = 1;\r
112 const float RADARICON_HELPME = 1;\r
113 const float RADARICON_CONTROLPOINT = 1;\r
114 const float RADARICON_GENERATOR = 1;\r
115 const float RADARICON_OBJECTIVE = 1;\r
116 const float RADARICON_DOMPOINT = 1;\r
117 const float RADARICON_POWERUP = 1;\r
118 \r
119 ///////////////////////////\r
120 // key constants\r
121 \r
122 //\r
123 // these are the key numbers that should be passed to Key_Event\r
124 //\r
125 const float K_TAB                       =       9;\r
126 const float K_ENTER             =       13;\r
127 const float K_ESCAPE            =       27;\r
128 const float K_SPACE             =       32;\r
129 \r
130 // normal keys should be passed as lowercased ascii\r
131 \r
132 const float K_BACKSPACE =       127;\r
133 const float K_UPARROW           =       128;\r
134 const float K_DOWNARROW =       129;\r
135 const float K_LEFTARROW =       130;\r
136 const float K_RIGHTARROW        =       131;\r
137 \r
138 const float K_ALT               =       132;\r
139 const float K_CTRL      =       133;\r
140 const float K_SHIFT     =       134;\r
141 const float K_F1                =       135;\r
142 const float K_F2                =       136;\r
143 const float K_F3                =       137;\r
144 const float K_F4                =       138;\r
145 const float K_F5                =       139;\r
146 const float K_F6                =       140;\r
147 const float K_F7                =       141;\r
148 const float K_F8                =       142;\r
149 const float K_F9                =       143;\r
150 const float K_F10               =       144;\r
151 const float K_F11               =       145;\r
152 const float K_F12               =       146;\r
153 const float K_INS               =       147;\r
154 const float K_DEL               =       148;\r
155 const float K_PGDN      =       149;\r
156 const float K_PGUP      =       150;\r
157 const float K_HOME      =       151;\r
158 const float K_END               =       152;\r
159 \r
160 const float K_KP_HOME                   =       160;\r
161 const float K_KP_UPARROW                =       161;\r
162 const float K_KP_PGUP                   =       162;\r
163 const float K_KP_LEFTARROW      =       163;\r
164 const float K_KP_5                      =       164;\r
165 const float K_KP_RIGHTARROW     =       165;\r
166 const float K_KP_END                    =       166;\r
167 const float K_KP_DOWNARROW      =       167;\r
168 const float K_KP_PGDN                   =       168;\r
169 const float K_KP_ENTER          =       169;\r
170 const float K_KP_INS            =       170;\r
171 const float K_KP_DEL                    =       171;\r
172 const float K_KP_SLASH          =       172;\r
173 const float K_KP_MINUS          =       173;\r
174 const float K_KP_PLUS                   =       174;\r
175 \r
176 const float K_PAUSE             =       255;\r
177 \r
178 //\r
179 // joystick buttons\r
180 //\r
181 const float K_JOY1              =       768;\r
182 const float K_JOY2              =       769;\r
183 const float K_JOY3              =       770;\r
184 const float K_JOY4              =       771;\r
185 \r
186 //\r
187 // aux keys are for multi-buttoned joysticks to generate so they can use\r
188 // the normal binding process\r
189 //\r
190 const float K_AUX1              =       772;\r
191 const float K_AUX2              =       773;\r
192 const float K_AUX3              =       774;\r
193 const float K_AUX4              =       775;\r
194 const float K_AUX5              =       776;\r
195 const float K_AUX6              =       777;\r
196 const float K_AUX7              =       778;\r
197 const float K_AUX8              =       779;\r
198 const float K_AUX9              =       780;\r
199 const float K_AUX10             =       781;\r
200 const float K_AUX11             =       782;\r
201 const float K_AUX12             =       783;\r
202 const float K_AUX13             =       784;\r
203 const float K_AUX14             =       785;\r
204 const float K_AUX15             =       786;\r
205 const float K_AUX16             =       787;\r
206 const float K_AUX17             =       788;\r
207 const float K_AUX18             =       789;\r
208 const float K_AUX19             =       790;\r
209 const float K_AUX20             =       791;\r
210 const float K_AUX21             =       792;\r
211 const float K_AUX22             =       793;\r
212 const float K_AUX23             =       794;\r
213 const float K_AUX24             =       795;\r
214 const float K_AUX25             =       796;\r
215 const float K_AUX26             =       797;\r
216 const float K_AUX27             =       798;\r
217 const float K_AUX28             =       799;\r
218 const float K_AUX29             =       800;\r
219 const float K_AUX30             =       801;\r
220 const float K_AUX31             =       802;\r
221 const float K_AUX32             =       803;\r
222 \r
223 //\r
224 // mouse buttons generate virtual keys\r
225 //\r
226 const float K_MOUSE1            =       512;\r
227 const float K_MOUSE2            =       513;\r
228 const float K_MOUSE3            =       514;\r
229 const float K_MWHEELUP  =       515;\r
230 const float K_MWHEELDOWN        =       516;\r
231 const float K_MOUSE4            =       517;\r
232 const float K_MOUSE5            =       518;\r
233 const float K_MOUSE6            =       519;\r
234 const float K_MOUSE7            =       520;\r
235 const float K_MOUSE8            =       521;\r
236 const float K_MOUSE9            =       522;\r
237 const float K_MOUSE10           =       523;\r
238 const float K_MOUSE11           =       524;\r
239 const float K_MOUSE12           =       525;\r
240 const float K_MOUSE13           =       526;\r
241 const float K_MOUSE14           =       527;\r
242 const float K_MOUSE15           =       528;\r
243 const float K_MOUSE16           =       529;\r
244 \r
245 ///////////////////////////\r
246 // keys pressed\r
247 const float KEY_FORWARD         =       1;\r
248 const float KEY_BACKWARD        =       2;\r
249 const float KEY_LEFT            =       4;\r
250 const float KEY_RIGHT           =       8;\r
251 const float KEY_JUMP            =       16;\r
252 const float KEY_CROUCH          =       32;\r
253 \r
254 ///////////////////////////\r
255 // cvar constants\r
256 \r
257 float CVAR_SAVE         = 1;\r
258 float CVAR_NOTIFY       = 2;\r
259 float CVAR_READONLY     = 4;\r
260 \r
261 ///////////////////////////\r
262 // csqc communication stuff\r
263 \r
264 const float STAT_KH_KEYS = 32;\r
265 const float STAT_CTF_STATE = 33;\r
266 const float STAT_WEAPONS = 35;\r
267 const float STAT_SWITCHWEAPON = 36;\r
268 const float STAT_GAMESTARTTIME = 37;\r
269 const float STAT_STRENGTH_FINISHED = 38;\r
270 const float STAT_INVINCIBLE_FINISHED = 39;\r
271 const float STAT_DAMAGE_HITS = 40; // Used by the weapon stats code, represents the total amount of damage done to other players\r
272 const float STAT_DAMAGE_FIRED = 41;// Used by the weapon stats code, represents the total amount of potential damage fired\r
273 const float STAT_PRESSED_KEYS = 42;\r
274 const float STAT_ALLOW_OLDNEXBEAM = 43; // this stat could later contain some other bits of info, like, more server-side particle config\r
275 const float STAT_FUEL = 44;\r
276 const float STAT_NB_METERSTART = 45;\r
277 const float STAT_SHOTORG = 46; // compressShotOrigin\r
278 const float STAT_LEADLIMIT = 47;\r
279 const float STAT_WINNING = 48;\r
280 const float STAT_WEAPON_CLIPLOAD = 49;\r
281 const float STAT_WEAPON_CLIPSIZE = 50;\r
282 const float STAT_LAST_PICKUP = 51;\r
283 const float STAT_VORE_LOAD = 52;\r
284 const float STAT_VORE_DIGESTING = 53;\r
285 const float STAT_VORE_EATEN = 54;\r
286 const float STAT_VORE_CANLEAVE = 55;\r
287 const float STAT_VORE_CANSWALLOW = 56;\r
288 const float STAT_SBRING1_TYPE = 57;\r
289 const float STAT_SBRING1_CLIP = 58;\r
290 const float STAT_SBRING2_TYPE = 59;\r
291 const float STAT_SBRING2_CLIP = 60;\r
292 const float CTF_STATE_ATTACK = 1;\r
293 const float CTF_STATE_DEFEND = 2;\r
294 const float CTF_STATE_COMMANDER = 3;\r
295 \r
296 const float STAT_HUD = 61;\r
297 const float HUD_NORMAL = 0;\r
298 \r
299 // moved that here so the client knows the max.\r
300 // # of maps, I'll use arrays for them :P\r
301 #define MAPVOTE_COUNT 10\r
302 \r
303 /**\r
304  * Lower scores are better (e.g. suicides)\r
305  */\r
306 #define SFL_LOWER_IS_BETTER     1\r
307 \r
308 /**\r
309  * Don't show zero values as scores\r
310  */\r
311 #define SFL_HIDE_ZERO           2\r
312 \r
313 /**\r
314  * Allow a column to be hidden (do not automatically add it even if it is a sorting key)\r
315  */\r
316 #define SFL_ALLOW_HIDE         16\r
317 \r
318 /**\r
319  * Display as a rank (with st, nd, rd, th suffix)\r
320  */\r
321 #define SFL_RANK               32\r
322 \r
323 /**\r
324  * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)\r
325  */\r
326 #define SFL_TIME               64\r
327 \r
328 // not an extra constant yet\r
329 #define SFL_ZERO_IS_WORST SFL_TIME\r
330 \r
331 /**\r
332  * Scoring priority (NOTE: PRIMARY is used for fraglimit)\r
333  */\r
334 #define SFL_SORT_PRIO_SECONDARY 4\r
335 #define SFL_SORT_PRIO_PRIMARY   8\r
336 #define SFL_SORT_PRIO_MASK     12\r
337 \r
338 /**\r
339  * Score indices\r
340  */\r
341 #define MAX_SCORE 10\r
342 #define MAX_TEAMSCORE 2\r
343 \r
344 #define ST_SCORE 0\r
345 #define SP_KILLS 0\r
346 #define SP_DEATHS 1\r
347 #define SP_SUICIDES 2\r
348 #define SP_SCORE 3\r
349 // game mode specific indices are not in common/, but in server/scores_rules.qc!\r
350 \r
351 // this assignment must match menu/voretournament/dialog_settings_misc.c!\r
352 float   CHAN_AUTO                               = 0;\r
353         // on world: announcers, ...                     INFO\r
354         // on players: item pickup                       ITEMS\r
355         // on entities: UNUSED\r
356         // on csqc: UNUSED\r
357 float   CHAN_WEAPON                             = 1; // Weapon fire\r
358         // on world: UNUSED\r
359         // on players: weapon firing                     WEAPONS\r
360         // on entities: turret firing                    WEAPONS\r
361         // on csqc: UNUSED\r
362 float   CHAN_VOICE                              = 2; // Voice/Radio\r
363         // on world: UNUSED\r
364         // on players: voice                             VOICE\r
365         // on entities: ambient                          AMBIENT\r
366         // on csqc: background music                     BGM\r
367 float   CHAN_TRIGGER                    = 3; // Triggers/Items\r
368         // on world: UNUSED\r
369         // on players: item pickup                       ITEMS\r
370         // on entities: platforms moving etc.            ITEMS\r
371         // on csqc: UNUSED\r
372 float   CHAN_PROJECTILE                 = 4; // Projectiles\r
373         // on world: UNUSED\r
374         // on players: projectiles hitting player        SHOTS\r
375         // on entities: projectiles                      SHOTS\r
376         // on csqc: projectile sounds                    SHOTS\r
377 float   CHAN_WEAPON2                    = 5; // Nex fire (separated as it is a very long sound)\r
378         // on world: UNUSED\r
379         // on players: weapon firing                     WEAPONS\r
380         // on entities: turret firing                    WEAPONS\r
381         // on csqc: UNUSED\r
382 float   CHAN_PAIN                               = 6; // Pain\r
383         // on world: UNUSED\r
384         // on players: pain                              PAIN\r
385         // on entities: projectiles flying               SHOTS\r
386         // on csqc: player pain                          PAIN\r
387 float   CHAN_PLAYER                             = 7; // Player body\r
388         // on world: UNUSED\r
389         // on players: player sounds                     PLAYER\r
390         // on entities: player sounds                    PLAYER\r
391         // on csqc: UNUSED\r
392 \r
393 float   ATTN_NONE                               = 0;\r
394 float   ATTN_MIN                                = 0.015625;\r
395 float   ATTN_NORM                               = 0.5;\r
396 float   ATTN_IDLE                               = 2;\r
397 float   ATTN_STATIC                             = 3;\r
398 float   ATTN_MAX                                = 3.984375;\r
399 \r
400 #define VOL_BASE 0.3\r
401 #define VOL_BASEVOICE 0.5\r
402 \r
403 // this sets sounds and other properties of the projectiles in csqc\r
404 float PROJECTILE_EXAMPLE = 1; // VoreTournament doesn't use any projectiles by default, so this example will guide us if any will be added in the future\r
405 \r
406 float SPECIES_HUMAN        =  0;\r
407 float SPECIES_ROBOT_SOLID  =  1;\r
408 float SPECIES_ALIEN        =  2;\r
409 float SPECIES_ANIMAL       =  3;\r
410 float SPECIES_ROBOT_RUSTY  =  4;\r
411 float SPECIES_ROBOT_SHINY  =  5;\r
412 float SPECIES_RESERVED     = 15;\r
413 \r
414 // Deathtypes (weapon deathtypes are the IT_* constants below)\r
415 // NOTE: when adding death types, please add an explanation to Docs/spamlog.txt too.\r
416 float DEATH_SPECIAL_START = 10000;\r
417 float DEATH_FALL = 10000;\r
418 float DEATH_TELEFRAG = 10001;\r
419 float DEATH_DROWN = 10002;\r
420 float DEATH_HURTTRIGGER = 10003;\r
421 float DEATH_LAVA = 10004;\r
422 float DEATH_SLIME = 10005;\r
423 float DEATH_KILL = 10006;\r
424 float DEATH_NOAMMO = 10007;\r
425 float DEATH_SWAMP = 10008;\r
426 float DEATH_TEAMCHANGE = 10009;\r
427 float DEATH_AUTOTEAMCHANGE = 10010;\r
428 float DEATH_CAMP = 10011;\r
429 float DEATH_SHOOTING_STAR = 10012;\r
430 float DEATH_ROT = 10013;\r
431 float DEATH_MIRRORDAMAGE = 10014;\r
432 float DEATH_TOUCHEXPLODE = 10015;\r
433 float DEATH_CHEAT = 10016;\r
434 float DEATH_FIRE = 10017;\r
435 float DEATH_TURRET = 10020;\r
436 float DEATH_QUIET = 10021;\r
437 float DEATH_DIGESTION = 10022;\r
438 float DEATH_REGURGITATION = 10023;\r
439 float DEATH_STOMACHKICK = 10024;\r
440 \r
441 float DEATH_SBMINIGUN = 10030;\r
442 float DEATH_SBROCKET  = 10031;\r
443 float DEATH_SBCRUSH   = 10032;\r
444 float DEATH_SBBLOWUP  = 10033;\r
445 \r
446 float DEATH_WAKIGUN    = 10040;\r
447 float DEATH_WAKIROCKET = 10041;\r
448 float DEATH_WAKIBLOWUP = 10042;\r
449 \r
450 float DEATH_CUSTOM = 10300;\r
451 \r
452 \r
453 float DEATH_WEAPONMASK = 0xFF;\r
454 float DEATH_HITTYPEMASK = 0x1F00; // which is WAY below 10000 used for normal deaths\r
455 float HITTYPE_SECONDARY = 0x100;\r
456 float HITTYPE_SPLASH = 0x200;\r
457 float HITTYPE_BOUNCE = 0x400;\r
458 float HITTYPE_HEADSHOT = 0x800;\r
459 float HITTYPE_RESERVED = 0x1000; // unused yet\r
460 \r
461 // macros to access these\r
462 #define DEATH_ISSPECIAL(t)            ((t) >= DEATH_SPECIAL_START)\r
463 #define DEATH_WEAPONOFWEAPONDEATH(t)  ((t) & DEATH_WEAPONMASK)\r
464 #define DEATH_ISWEAPON(t,w)           (!DEATH_ISSPECIAL(t) && DEATH_WEAPONOFWEAPONDEATH(t) == (w))\r
465 #define DEATH_WEAPONOF(t)             (DEATH_ISSPECIAL(t) ? 0 : DEATH_WEAPONOFWEAPONDEATH(t))\r
466 #define WEP_VALID(w)                  ((w) >= WEP_FIRST && (w) <= WEP_LAST)\r
467 \r
468 #define FRAGS_PLAYER 0\r
469 #define FRAGS_SPECTATOR -666\r
470 #define FRAGS_LMS_LOSER -616\r
471 #define FRAGS_PLAYER_NONSOLID -616\r
472 // we can use this frags value for both\r
473 \r
474 //misc. stuff\r
475 #define NEWLINES "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"\r
476 \r
477 // water levels\r
478 float WATERLEVEL_NONE = 0;\r
479 float WATERLEVEL_WETFEET = 1;\r
480 float WATERLEVEL_SWIMMING = 2;\r
481 float WATERLEVEL_SUBMERGED = 3;\r
482 \r
483 float MAX_SHOT_DISTANCE = 32768;\r