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
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
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
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
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
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
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
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
102 const float ENT_CLIENT_TURRET = 40;
\r
104 const float SPRITERULE_DEFAULT = 0;
\r
105 const float SPRITERULE_TEAMPLAY = 1;
\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
119 ///////////////////////////
\r
123 // these are the key numbers that should be passed to Key_Event
\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
130 // normal keys should be passed as lowercased ascii
\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
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
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
176 const float K_PAUSE = 255;
\r
179 // joystick buttons
\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
187 // aux keys are for multi-buttoned joysticks to generate so they can use
\r
188 // the normal binding process
\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
224 // mouse buttons generate virtual keys
\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
245 ///////////////////////////
\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
254 ///////////////////////////
\r
257 float CVAR_SAVE = 1;
\r
258 float CVAR_NOTIFY = 2;
\r
259 float CVAR_READONLY = 4;
\r
261 ///////////////////////////
\r
262 // csqc communication stuff
\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_VORE_LOAD = 48;
\r
280 const float STAT_VORE_DIGESTING = 49;
\r
281 const float STAT_VORE_EATEN = 50;
\r
282 const float STAT_VORE_CANLEAVE = 51;
\r
283 const float CTF_STATE_ATTACK = 1;
\r
284 const float CTF_STATE_DEFEND = 2;
\r
285 const float CTF_STATE_COMMANDER = 3;
\r
287 const float STAT_HUD = 52;
\r
288 const float HUD_NORMAL = 0;
\r
290 // moved that here so the client knows the max.
\r
291 // # of maps, I'll use arrays for them :P
\r
292 #define MAPVOTE_COUNT 10
\r
295 * Lower scores are better (e.g. suicides)
\r
297 #define SFL_LOWER_IS_BETTER 1
\r
300 * Don't show zero values as scores
\r
302 #define SFL_HIDE_ZERO 2
\r
305 * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
\r
307 #define SFL_ALLOW_HIDE 16
\r
310 * Display as a rank (with st, nd, rd, th suffix)
\r
312 #define SFL_RANK 32
\r
315 * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
\r
317 #define SFL_TIME 64
\r
319 // not an extra constant yet
\r
320 #define SFL_ZERO_IS_WORST SFL_TIME
\r
323 * Scoring priority (NOTE: PRIMARY is used for fraglimit)
\r
325 #define SFL_SORT_PRIO_SECONDARY 4
\r
326 #define SFL_SORT_PRIO_PRIMARY 8
\r
327 #define SFL_SORT_PRIO_MASK 12
\r
332 #define MAX_SCORE 10
\r
333 #define MAX_TEAMSCORE 2
\r
337 #define SP_DEATHS 1
\r
338 #define SP_SUICIDES 2
\r
340 // game mode specific indices are not in common/, but in server/scores_rules.qc!
\r
342 // this assignment must match menu/voretournament/dialog_settings_misc.c!
\r
343 float CHAN_AUTO = 0;
\r
344 // on world: announcers, ... INFO
\r
345 // on players: item pickup ITEMS
\r
346 // on entities: UNUSED
\r
348 float CHAN_WEAPON = 1; // Weapon fire
\r
349 // on world: UNUSED
\r
350 // on players: weapon firing WEAPONS
\r
351 // on entities: turret firing WEAPONS
\r
353 float CHAN_VOICE = 2; // Voice/Radio
\r
354 // on world: UNUSED
\r
355 // on players: voice VOICE
\r
356 // on entities: ambient AMBIENT
\r
357 // on csqc: background music BGM
\r
358 float CHAN_TRIGGER = 3; // Triggers/Items
\r
359 // on world: UNUSED
\r
360 // on players: item pickup ITEMS
\r
361 // on entities: platforms moving etc. ITEMS
\r
363 float CHAN_PROJECTILE = 4; // Projectiles
\r
364 // on world: UNUSED
\r
365 // on players: projectiles hitting player SHOTS
\r
366 // on entities: projectiles SHOTS
\r
367 // on csqc: projectile sounds SHOTS
\r
368 float CHAN_WEAPON2 = 5; // Nex fire (separated as it is a very long sound)
\r
369 // on world: UNUSED
\r
370 // on players: weapon firing WEAPONS
\r
371 // on entities: turret firing WEAPONS
\r
373 float CHAN_PAIN = 6; // Pain
\r
374 // on world: UNUSED
\r
375 // on players: pain PAIN
\r
376 // on entities: projectiles flying SHOTS
\r
377 // on csqc: player pain PAIN
\r
378 float CHAN_PLAYER = 7; // Player body
\r
379 // on world: UNUSED
\r
380 // on players: player sounds PLAYER
\r
381 // on entities: player sounds PLAYER
\r
384 float ATTN_NONE = 0;
\r
385 float ATTN_MIN = 0.015625;
\r
386 float ATTN_NORM = 0.5;
\r
387 float ATTN_IDLE = 2;
\r
388 float ATTN_STATIC = 3;
\r
389 float ATTN_MAX = 3.984375;
\r
391 #define VOL_BASE 0.7
\r
392 #define VOL_BASEVOICE 1.0
\r
394 // this sets sounds and other properties of the projectiles in csqc
\r
395 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
397 float SPECIES_HUMAN = 0;
\r
398 float SPECIES_ROBOT_SOLID = 1;
\r
399 float SPECIES_ALIEN = 2;
\r
400 float SPECIES_ANIMAL = 3;
\r
401 float SPECIES_ROBOT_RUSTY = 4;
\r
402 float SPECIES_ROBOT_SHINY = 5;
\r
403 float SPECIES_RESERVED = 15;
\r
405 // Deathtypes (weapon deathtypes are the IT_* constants below)
\r
406 // NOTE: when adding death types, please add an explanation to Docs/spamlog.txt too.
\r
407 float DEATH_SPECIAL_START = 10000;
\r
408 float DEATH_FALL = 10000;
\r
409 float DEATH_TELEFRAG = 10001;
\r
410 float DEATH_DROWN = 10002;
\r
411 float DEATH_HURTTRIGGER = 10003;
\r
412 float DEATH_LAVA = 10004;
\r
413 float DEATH_SLIME = 10005;
\r
414 float DEATH_KILL = 10006;
\r
415 float DEATH_NOAMMO = 10007;
\r
416 float DEATH_SWAMP = 10008;
\r
417 float DEATH_TEAMCHANGE = 10009;
\r
418 float DEATH_AUTOTEAMCHANGE = 10010;
\r
419 float DEATH_CAMP = 10011;
\r
420 float DEATH_SHOOTING_STAR = 10012;
\r
421 float DEATH_ROT = 10013;
\r
422 float DEATH_MIRRORDAMAGE = 10014;
\r
423 float DEATH_TOUCHEXPLODE = 10015;
\r
424 float DEATH_CHEAT = 10016;
\r
425 float DEATH_FIRE = 10017;
\r
426 float DEATH_TURRET = 10020;
\r
427 float DEATH_QUIET = 10021;
\r
428 float DEATH_DIGESTION = 10022;
\r
429 float DEATH_STOMACHKICK = 10023;
\r
431 float DEATH_SBMINIGUN = 10030;
\r
432 float DEATH_SBROCKET = 10031;
\r
433 float DEATH_SBCRUSH = 10032;
\r
434 float DEATH_SBBLOWUP = 10033;
\r
436 float DEATH_WAKIGUN = 10040;
\r
437 float DEATH_WAKIROCKET = 10041;
\r
438 float DEATH_WAKIBLOWUP = 10042;
\r
440 float DEATH_CUSTOM = 10300;
\r
443 float DEATH_WEAPONMASK = 0xFF;
\r
444 float DEATH_HITTYPEMASK = 0x1F00; // which is WAY below 10000 used for normal deaths
\r
445 float HITTYPE_SECONDARY = 0x100;
\r
446 float HITTYPE_SPLASH = 0x200;
\r
447 float HITTYPE_BOUNCE = 0x400;
\r
448 float HITTYPE_HEADSHOT = 0x800;
\r
449 float HITTYPE_RESERVED = 0x1000; // unused yet
\r
451 // macros to access these
\r
452 #define DEATH_ISSPECIAL(t) ((t) >= DEATH_SPECIAL_START)
\r
453 #define DEATH_WEAPONOFWEAPONDEATH(t) ((t) & DEATH_WEAPONMASK)
\r
454 #define DEATH_ISWEAPON(t,w) (!DEATH_ISSPECIAL(t) && DEATH_WEAPONOFWEAPONDEATH(t) == (w))
\r
455 #define DEATH_WEAPONOF(t) (DEATH_ISSPECIAL(t) ? 0 : DEATH_WEAPONOFWEAPONDEATH(t))
\r
456 #define WEP_VALID(w) ((w) >= WEP_FIRST && (w) <= WEP_LAST)
\r
458 #define FRAGS_PLAYER 0
\r
459 #define FRAGS_SPECTATOR -666
\r
460 #define FRAGS_LMS_LOSER -616
\r
461 #define FRAGS_PLAYER_NONSOLID -616
\r
462 // we can use this frags value for both
\r
465 #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
468 float WATERLEVEL_NONE = 0;
\r
469 float WATERLEVEL_WETFEET = 1;
\r
470 float WATERLEVEL_SWIMMING = 2;
\r
471 float WATERLEVEL_SUBMERGED = 3;
\r
473 float MAX_SHOT_DISTANCE = 32768;
\r