]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/constants.qh
#include this
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / constants.qh
1 #ifndef CONSTANTS_H
2 #define CONSTANTS_H
3
4 #if defined(CSQC)
5     #include "util-pre.qh"
6     #include "../client/sys-pre.qh"
7     #include "../dpdefs/csprogsdefs.qc"
8     #include "../client/sys-post.qh"
9     #include "../client/Defs.qc"
10     #include "../dpdefs/keycodes.qc"
11 #elif defined(MENUQC)
12     #include "util-pre.qh"
13     #include "../menu/sys-pre.qh"
14     #include "../dpdefs/menudefs.qc"
15     #include "../dpdefs/keycodes.qc"
16     #include "../menu/sys-post.qh"
17     #include "../menu/config.qh"
18     #include "../warpzonelib/mathlib.qh"
19     #include "util.qh"
20     #include "test.qh"
21     #include "../menu/oo/base.qh"
22     #include "playerstats.qh"
23     #include "teams.qh"
24 #elif defined(SVQC)
25     #include "util-pre.qh"
26     #include "../server/sys-pre.qh"
27     #include "../dpdefs/progsdefs.qc"
28     #include "../dpdefs/dpextensions.qc"
29     #include "../server/sys-post.qh"
30     #include "../warpzonelib/anglestransform.qh"
31     #include "../warpzonelib/mathlib.qh"
32     #include "../warpzonelib/common.qh"
33     #include "../warpzonelib/util_server.qh"
34     #include "../warpzonelib/server.qh"
35 #endif
36
37 const int AS_STRING = 1;
38 const int AS_INT = 2;
39 const int AS_FLOAT_TRUNCATED = 2;
40 const int AS_FLOAT = 8;
41
42 const int TE_CSQC_PICTURE = 100;
43 const int TE_CSQC_RACE = 101;
44 const int TE_CSQC_VORTEXBEAMPARTICLE = 103;
45 const int TE_CSQC_ARC = 104;
46 const int TE_CSQC_TEAMNAGGER = 105;
47 const int TE_CSQC_PINGPLREPORT = 106;
48 const int TE_CSQC_TARGET_MUSIC = 107;
49 const int TE_CSQC_WEAPONCOMPLAIN = 108;
50 const int TE_CSQC_VORTEX_SCOPE = 109;
51 const int TE_CSQC_MINELAYER_MAXMINES = 110;
52 const int TE_CSQC_HAGAR_MAXROCKETS = 111;
53 const int TE_CSQC_VEHICLESETUP = 112;
54 const int TE_CSQC_SVNOTICE = 113;
55 const int TE_CSQC_SHOCKWAVEPARTICLE = 114;
56
57 const int RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
58 const int RACE_NET_CHECKPOINT_CLEAR = 1;
59 const int RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder
60 const int RACE_NET_CHECKPOINT_HIT_RACE = 3; // byte checkpoint, short delta, byte lapsdelta, string opponent
61 const int RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT = 4; // byte checkpoint, short delta, byte lapsdelta, string opponent
62 const int RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING = 5; // byte nextcheckpoint, float laptime, short recordtime, string recordholder
63 const int RACE_NET_PENALTY_RACE = 6; // byte penaltytime, string reason
64 const int RACE_NET_PENALTY_QUALIFYING = 7; // byte penaltytime, string reason
65 const int RACE_NET_SERVER_RECORD = 8; // server record, sent to client
66 const int RACE_NET_SPEED_AWARD = 9; // speed award, sent to client
67 const int RACE_NET_SPEED_AWARD_BEST = 10; // all time best speed award, sent to client
68 const int RACE_NET_SERVER_RANKINGS = 11;
69 const int RACE_NET_SERVER_STATUS = 12;
70 const int RANKINGS_CNT = 15;
71
72 const int ENT_CLIENT = 0;
73 const int ENT_CLIENT_DEAD = 1;
74 const int ENT_CLIENT_ENTCS = 2;
75 const int ENT_CLIENT_SCORES_INFO = 3;
76 const int ENT_CLIENT_SCORES = 4;
77 const int ENT_CLIENT_TEAMSCORES = 5;
78 const int ENT_CLIENT_POINTPARTICLES = 6;
79 const int ENT_CLIENT_RAINSNOW = 7;
80 const int ENT_CLIENT_LASER = 8;
81 const int ENT_CLIENT_NAGGER = 9; // flags [votecalledvote]
82 const int ENT_CLIENT_WAYPOINT = 10; // flags origin [team displayrule] [spritename] [spritename2] [spritename3] [lifetime maxdistance hideable]
83 const int ENT_CLIENT_RADARLINK = 11; // flags [startorigin] [endorigin] [startcolor+16*endcolor]
84 const int ENT_CLIENT_PROJECTILE = 12;
85 const int ENT_CLIENT_GIBSPLASH = 13;
86 const int ENT_CLIENT_DAMAGEINFO = 14;
87 const int ENT_CLIENT_CASING = 15;
88 const int ENT_CLIENT_INIT = 16;
89 const int ENT_CLIENT_MAPVOTE = 17;
90 const int ENT_CLIENT_CLIENTDATA = 18;
91 const int ENT_CLIENT_RANDOMSEED = 19;
92 const int ENT_CLIENT_WALL = 20;
93 const int ENT_CLIENT_SPIDERBOT = 21;
94 const int ENT_CLIENT_MODELEFFECT = 22;
95 const int ENT_CLIENT_TUBANOTE = 23;
96 const int ENT_CLIENT_WARPZONE = 24;
97 const int ENT_CLIENT_WARPZONE_CAMERA = 25;
98 const int ENT_CLIENT_TRIGGER_MUSIC = 26;
99 const int ENT_CLIENT_HOOK = 27;
100 const int ENT_CLIENT_ARC_BEAM = 29; // WEAPONTODO: fix numbers
101 const int ENT_CLIENT_ACCURACY = 30;
102 const int ENT_CLIENT_SHOWNAMES = 31;
103 const int ENT_CLIENT_WARPZONE_TELEPORTED = 32;
104 const int ENT_CLIENT_MODEL = 33;
105 const int ENT_CLIENT_ITEM = 34;
106 const int ENT_CLIENT_BUMBLE_RAYGUN = 35;
107 const int ENT_CLIENT_SPAWNPOINT = 36;
108 const int ENT_CLIENT_SPAWNEVENT = 37;
109 const int ENT_CLIENT_NOTIFICATION = 38;
110 const int ENT_CLIENT_ELIMINATEDPLAYERS = 39;
111 const int ENT_CLIENT_TURRET = 40;
112 const int ENT_CLIENT_AUXILIARYXHAIR = 50;
113 const int ENT_CLIENT_VEHICLE = 60;
114
115 const int ENT_CLIENT_HEALING_ORB = 80;
116
117 const int SPRITERULE_DEFAULT = 0;
118 const int SPRITERULE_TEAMPLAY = 1;
119
120 const int RADARICON_NONE = 0;
121 const int RADARICON_FLAG = 1;
122 const int RADARICON_FLAGCARRIER = 1;
123 const int RADARICON_HERE = 1; // TODO make these 3 and 4, and make images for them
124 const int RADARICON_DANGER = 1;
125 const int RADARICON_WAYPOINT = 1;
126 const int RADARICON_HELPME = 1;
127 const int RADARICON_CONTROLPOINT = 1;
128 const int RADARICON_GENERATOR = 1;
129 const int RADARICON_OBJECTIVE = 1;
130 const int RADARICON_DOMPOINT = 1;
131 const int RADARICON_POWERUP = 1;
132 const int RADARICON_TAGGED = 1;
133
134 ///////////////////////////
135 // keys pressed
136 const int KEY_FORWARD = 1;
137 const int KEY_BACKWARD = 2;
138 const int KEY_LEFT = 4;
139 const int KEY_RIGHT = 8;
140 const int KEY_JUMP = 16;
141 const int KEY_CROUCH = 32;
142 const int KEY_ATCK = 64;
143 const int KEY_ATCK2 = 128;
144
145 ///////////////////////////
146 // cvar constants
147
148 const int CVAR_SAVE = 1;
149 const int CVAR_NOTIFY = 2;
150 const int CVAR_READONLY = 4;
151
152 ///////////////////////////
153 // csqc communication stuff
154
155 const int CTF_STATE_ATTACK = 1;
156 const int CTF_STATE_DEFEND = 2;
157 const int CTF_STATE_COMMANDER = 3;
158
159 const int HUD_NORMAL = 0;
160 const int HUD_VEHICLE_FIRST = 10;
161 const int HUD_SPIDERBOT = 10;
162 const int HUD_WAKIZASHI = 11;
163 const int HUD_RAPTOR = 12;
164 const int HUD_BUMBLEBEE = 13;
165 const int HUD_BUMBLEBEE_GUN = 14;
166 const int HUD_VEHICLE_LAST = 14;
167
168 const vector eX = '1 0 0';
169 const vector eY = '0 1 0';
170 const vector eZ = '0 0 1';
171
172 // moved that here so the client knows the max.
173 // # of maps, I'll use arrays for them :P
174 const int MAPVOTE_COUNT = 30;
175
176 /**
177  * Lower scores are better (e.g. suicides)
178  */
179 const int SFL_LOWER_IS_BETTER = 1;
180
181 /**
182  * Don't show zero values as scores
183  */
184 const int SFL_HIDE_ZERO = 2;
185
186 /**
187  * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
188  */
189 const int SFL_ALLOW_HIDE = 16;
190
191 /**
192  * Display as a rank (with st, nd, rd, th suffix)
193  */
194 const int SFL_RANK = 32;
195
196 /**
197  * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
198  */
199 const int SFL_TIME = 64;
200
201 // not an extra constant yet
202 #define SFL_ZERO_IS_WORST SFL_TIME
203
204 /**
205  * Scoring priority (NOTE: PRIMARY is used for fraglimit)
206  */
207 const int SFL_SORT_PRIO_SECONDARY = 4;
208 const int SFL_SORT_PRIO_PRIMARY = 8;
209 const int SFL_SORT_PRIO_MASK = 12;
210
211 /**
212  * Score indices
213  */
214 #define MAX_SCORE 10
215 #define MAX_TEAMSCORE 2
216
217 const int ST_SCORE = 0;
218 const int SP_KILLS = 0;
219 const int SP_DEATHS = 1;
220 const int SP_SUICIDES = 2;
221 const int SP_SCORE = 3;
222 // game mode specific indices are not in common/, but in server/scores_rules.qc!
223
224 const int CH_INFO = 0;
225 const int CH_TRIGGER = -3;
226 const int CH_WEAPON_A = -1;
227 const int CH_WEAPON_SINGLE = 1;
228 const int CH_VOICE = -2;
229 const int CH_BGM_SINGLE = 8;
230 const int CH_AMBIENT = -9;
231 const int CH_TRIGGER_SINGLE = 3;
232 const int CH_SHOTS = -4;
233 const int CH_SHOTS_SINGLE = 4;
234 const int CH_WEAPON_B = -1;
235 const int CH_PAIN = -6;
236 const int CH_PAIN_SINGLE = 6;
237 const int CH_PLAYER = -7;
238 const int CH_PLAYER_SINGLE = 7;
239 const int CH_TUBA_SINGLE = 5;
240
241 const float ATTEN_NONE = 0;
242 const float ATTEN_MIN = 0.015625;
243 const float ATTEN_NORM = 0.5;
244 const float ATTEN_LARGE = 1;
245 const float ATTEN_IDLE = 2;
246 const float ATTEN_STATIC = 3;
247 const float ATTEN_MAX = 3.984375;
248
249 const float VOL_BASE = 0.7;
250 const float VOL_BASEVOICE = 1.0;
251
252 // WEAPONTODO: move this into separate/new projectile handling code // this sets sounds and other properties of the projectiles in csqc
253 const int PROJECTILE_ELECTRO = 1;
254 const int PROJECTILE_ROCKET = 2;
255 const int PROJECTILE_TAG = 3;
256 const int PROJECTILE_CRYLINK = 5;
257 const int PROJECTILE_ELECTRO_BEAM = 6;
258 const int PROJECTILE_GRENADE = 7;
259 const int PROJECTILE_GRENADE_BOUNCING = 8;
260 const int PROJECTILE_MINE = 9;
261 const int PROJECTILE_BLASTER = 10;
262 const int PROJECTILE_HLAC = 11;
263 const int PROJECTILE_SEEKER = 12;
264 const int PROJECTILE_FLAC = 13;
265 const int PROJECTILE_PORTO_RED = 14;
266 const int PROJECTILE_PORTO_BLUE = 15;
267 const int PROJECTILE_HOOKBOMB = 16;
268 const int PROJECTILE_HAGAR = 17;
269 const int PROJECTILE_HAGAR_BOUNCING = 18;
270 const int PROJECTILE_CRYLINK_BOUNCING = 20;
271 const int PROJECTILE_FIREBALL = 21;
272 const int PROJECTILE_FIREMINE = 22;
273
274 const int PROJECTILE_RAPTORCANNON = 24;
275 const int PROJECTILE_RAPTORBOMB = 25;
276 const int PROJECTILE_RAPTORBOMBLET = 26;
277 const int PROJECTILE_SPIDERROCKET = 27;
278 const int PROJECTILE_WAKIROCKET = 28;
279 const int PROJECTILE_WAKICANNON = 29;
280
281 const int PROJECTILE_BUMBLE_GUN = 30;
282 const int PROJECTILE_BUMBLE_BEAM = 31;
283
284 const int PROJECTILE_MAGE_SPIKE = 32;
285 const int PROJECTILE_SHAMBLER_LIGHTNING = 33;
286
287 const int PROJECTILE_RPC = 60;
288
289 const int SPECIES_HUMAN = 0;
290 const int SPECIES_ROBOT_SOLID = 1;
291 const int SPECIES_ALIEN = 2;
292 const int SPECIES_ANIMAL = 3;
293 const int SPECIES_ROBOT_RUSTY = 4;
294 const int SPECIES_ROBOT_SHINY = 5;
295 const int SPECIES_RESERVED = 15;
296
297 const int FRAGS_PLAYER = 0;
298 const int FRAGS_SPECTATOR = -666;
299 const int FRAGS_LMS_LOSER = -616;
300 const int FRAGS_PLAYER_NONSOLID = -616;
301 // we can use this frags value for both
302
303 // water levels
304 const int WATERLEVEL_NONE = 0;
305 const int WATERLEVEL_WETFEET = 1;
306 const int WATERLEVEL_SWIMMING = 2;
307 const int WATERLEVEL_SUBMERGED = 3;
308 const int SERVERFLAG_ALLOW_FULLBRIGHT = 1;
309 const int SERVERFLAG_TEAMPLAY = 2;
310 const int SERVERFLAG_PLAYERSTATS = 4;
311
312 // FIXME/EXPLAINME: why?
313 vector autocvar_sv_player_maxs = '16 16 45';
314 vector autocvar_sv_player_mins = '-16 -16 -24';
315 vector autocvar_sv_player_viewoffset = '0 0 20';
316 vector autocvar_sv_player_crouch_maxs = '16 16 25';
317 vector autocvar_sv_player_crouch_mins = '-16 -16 -24';
318 vector autocvar_sv_player_crouch_viewoffset = '0 0 20';
319 vector autocvar_sv_player_headsize = '24 24 12';
320
321 #define PL_VIEW_OFS autocvar_sv_player_viewoffset
322 #define PL_MIN autocvar_sv_player_mins
323 #define PL_MAX autocvar_sv_player_maxs
324 #define PL_CROUCH_VIEW_OFS autocvar_sv_player_crouch_viewoffset
325 #define PL_CROUCH_MIN autocvar_sv_player_crouch_mins
326 #define PL_CROUCH_MAX autocvar_sv_player_crouch_maxs
327 #define PL_HEAD autocvar_sv_player_headsize
328
329 // helpers
330 #define PL_VIEW_OFS_z autocvar_sv_player_viewoffset.z
331 #define PL_MIN_z autocvar_sv_player_mins.z
332 #define PL_MAX_z autocvar_sv_player_maxs.z
333 #define PL_CROUCH_VIEW_OFS_z autocvar_sv_player_crouch_viewoffset.z
334 #define PL_CROUCH_MIN_z autocvar_sv_player_mins.z
335 #define PL_HEAD_x autocvar_sv_player_headsize.x
336 #define PL_HEAD_y autocvar_sv_player_headsize.y
337 #define PL_HEAD_z autocvar_sv_player_headsize.z
338
339 // spawnpoint prios
340 const int SPAWN_PRIO_NEAR_TEAMMATE_FOUND = 200;
341 const int SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM = 100;
342 const int SPAWN_PRIO_RACE_PREVIOUS_SPAWN = 50;
343 const int SPAWN_PRIO_GOOD_DISTANCE = 10;
344
345 // URI handles
346 const int URI_GET_DISCARD = 0;
347 const int URI_GET_IPBAN = 1;
348 const int URI_GET_IPBAN_END = 16;
349 const int URI_GET_CURL = 17;
350 const int URI_GET_CURL_END = 32;
351 const int URI_GET_UPDATENOTIFICATION = 33;
352 const int URI_GET_URLLIB = 128;
353 const int URI_GET_URLLIB_END = 191;
354
355 // gametype votes
356 const int GTV_AVAILABLE = 0;
357 // for later use in per-map gametype filtering
358 const int GTV_FORBIDDEN = 2;
359 #endif