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