]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/defs.qh
Reorganise some more definitions out of defs.qh, show all racers on the radar in...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / defs.qh
1 #pragma once
2
3 #include <common/weapons/_all.qh>
4 #include <common/stats.qh>
5
6 // Globals
7
8 float g_footsteps, g_grappling_hook;
9 float g_warmup_allguns;
10 float g_warmup_allow_timeout;
11 float warmup_stage;
12 float g_jetpack;
13
14 bool sv_ready_restart;
15 bool sv_ready_restart_after_countdown;
16 bool sv_ready_restart_repeatable;
17
18 float sv_clones;
19 float sv_foginterval;
20
21 float player_count;
22 float currentbots;
23 float bots_would_leave;
24
25 .int totalfrags; // NOTE: reused for multiple purposes
26
27 // flag set on worldspawn so that the code knows if it is dedicated or not
28 float server_is_dedicated;
29
30 // Fields
31
32 .void(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) event_damage;
33
34 .bool(entity targ, entity inflictor, float amount, float limit) event_heal;
35
36 //.string       wad;
37 //.string       map;
38
39 //.float        worldtype;
40 // Needed for dynamic clientwalls
41 .bool inactive; // Clientwall disappears when inactive
42 .float alpha_max, alpha_min;
43 .float fade_start, fade_end, fade_vertical_offset;
44 .float default_solid; // Variable to store default .solid for clientwalls
45
46 .float  pain_finished;                  //Added by Supajoe
47 .float  pain_frame;                     //"
48 .float  crouch; // Crouching or not?
49
50 .float superweapons_finished; // NOTE: this field is used only by map entities, it does not directly apply the superweapons stat
51 const .float air_finished = _STAT(AIR_FINISHED);
52
53 .float cnt; // used in too many places
54 .float count;
55 //.float cnt2;
56
57 .float death_time;
58 .float fade_time;
59 .float fade_rate;
60
61 .string mdl;
62
63 .string playermodel;
64 .string playerskin;
65
66 .float species;
67
68 .float  scheduledrespawntime;
69 .float  respawntime;
70 .float  respawntimejitter;
71 .float  respawntimestart;
72 //.float        chasecam;
73
74 .float  damageforcescale;
75 const float MIN_DAMAGEEXTRARADIUS = 2;
76 const float MAX_DAMAGEEXTRARADIUS = 16;
77 .float damageextraradius;
78
79 //.float          gravity;
80
81 .float          dmg;
82
83 // for railgun damage (hitting multiple enemies)
84 .bool railgunhit;
85 .float railgunhitsolidbackup;
86 .vector railgunhitloc;
87
88 .float          dmgtime;
89
90 .float          killcount;
91 .float damage_dealt, typehitsound, killsound;
92
93 .float watersound_finished;
94 .float iscreature;
95 .float damagedbycontents;
96 .float damagedbytriggers;
97 .float teleportable;
98 .vector oldvelocity;
99
100 .float pauseregen_finished;
101 .float pauserothealth_finished;
102 .float pauserotarmor_finished;
103 .float pauserotfuel_finished;
104 // string overrides entity
105 .string item_pickupsound;
106 .entity item_pickupsound_ent;
107 .entity item_model_ent;
108
109 // WEAPONTODO
110 .float autoswitch;
111
112 float intermission_running;
113 float intermission_exittime;
114 float alreadychangedlevel;
115
116 // footstep interval
117 .float nextstep;
118
119 float blockSpectators; //if set, new or existing spectators or observers will be removed unless they become a player within g_maxplayers_spectator_blocktime seconds
120 .float spectatortime; //point in time since the client is spectating or observing
121 void checkSpectatorBlock(entity this);
122
123 .float winning;
124 .float jointime; // time of connecting
125 .float startplaytime; // time of switching from spectator to player
126 .float alivetime; // time of being alive
127 .float motd_actived_time; // used for both motd and campaign_message
128
129 int nJoinAllowed(entity this, entity ignore);
130
131 .float spawnshieldtime;
132 .float item_spawnshieldtime;
133
134 .int playerid;
135 .float noalign;         // if set to 1, the item or spawnpoint won't be dropped to the floor
136
137 .vector death_origin;
138
139 float default_player_alpha;
140 float default_weapon_alpha;
141
142 .float cvar_cl_handicap;
143 .int cvar_cl_gunalign;
144 .float cvar_cl_clippedspectating;
145 .float cvar_cl_autoscreenshot;
146 .float cvar_cl_jetpack_jump;
147 .float cvar_cl_movement_track_canjump;
148 .float cvar_cl_newusekeysupported;
149 .float cvar_cl_cts_noautoswitch;
150 .bool cvar_cl_weapon_switch_reload;
151 .bool cvar_cl_weapon_switch_fallback_to_impulse;
152
153 .string cvar_g_xonoticversion;
154 .string cvar_cl_weaponpriority;
155 .string cvar_cl_weaponpriorities[10];
156 .float cvar_cl_noantilag;
157
158 .string weaponorder_byimpulse;
159
160 .float cvar_cl_allow_uid2name;
161 .float cvar_cl_allow_uidtracking;
162 .bool cvar_cl_allow_uidranking;
163 .string stored_netname;
164
165 string gamemode_name;
166
167 void FixIntermissionClient(entity e);
168 void FixClientCvars(entity e);
169
170 .float respawn_countdown; // next number to count
171
172 float bot_waypoints_for_items;
173
174 // speedrun: when 1, player auto teleports back when capture timeout happens
175 .float speedrunning;
176
177 // database
178 float ServerProgsDB;
179 float TemporaryDB;
180
181 .int team_saved;
182
183 bool some_spawn_has_been_used;
184 int have_team_spawns; // 0 = no team spawns requested, -1 = team spawns requested but none found, 1 = team spawns requested and found
185 int have_team_spawns_forteams; // if Xth bit is 1 then team X has spawns else it has no spawns; team 0 is the "no-team"
186
187 .bool canteamdamage;
188
189 void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force);
190
191 // WEAPONTODO
192 #define DMG_NOWEP (weaponentities[0])
193
194 float sv_maxidle;
195 float sv_maxidle_spectatorsareidle;
196 int sv_maxidle_slots;
197 bool sv_maxidle_slots_countbots;
198
199 float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end);
200
201 // autotaunt system
202 .float cvar_cl_autotaunt;
203 .float cvar_cl_voice_directional;
204 .float cvar_cl_voice_directional_taunt_attenuation;
205
206 int autocvar__independent_players;
207 bool independent_players;
208 #define INDEPENDENT_PLAYERS (autocvar__independent_players ? (autocvar__independent_players > 0) : independent_players)
209 #define IS_INDEPENDENT_PLAYER(e) ((e).solid == SOLID_TRIGGER)
210 #define MAKE_INDEPENDENT_PLAYER(e) (((e).solid = SOLID_TRIGGER), ((e).frags = FRAGS_PLAYER_OUT_OF_GAME))
211
212 string clientstuff;
213 .float phase;
214 .int pressedkeys;
215
216 .string fog;
217
218 string cvar_changes;
219 string cvar_purechanges;
220 float cvar_purechanges_count;
221
222 //float game_starttime; //point in time when the countdown to game start is over
223 //float round_starttime; //point in time when the countdown to round start is over
224
225 void W_Porto_Remove (entity p);
226
227 .int projectiledeathtype;
228
229 .string message2;
230
231 // reset to 0 on weapon switch
232 // may be useful to all weapons
233 .float bulletcounter;
234
235 // Nexball
236 float g_nexball_meter_period;
237
238 .void(entity this) reset; // if set, an entity is reset using this
239 .void(entity this) reset2; // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
240
241 //vector debug_shotorg; // if non-zero, overrides the shot origin of all weapons
242
243 .bool wasplayer;
244
245 float servertime, serverprevtime, serverframetime;
246
247 .float ammo_fuel;
248
249 //flood fields
250 .float nickspamtime; // time of last nick change
251 .float nickspamcount;
252 .float floodcontrol_chat;
253 .float floodcontrol_chatteam;
254 .float floodcontrol_chattell;
255 .float floodcontrol_voice;
256 .float floodcontrol_voiceteam;
257
258 string matchid;
259
260 bool radar_showennemies;
261
262 .int minelayer_mines;
263 .float vortex_charge;
264 .float vortex_charge_rottime;
265 .float vortex_chargepool_ammo;
266 .float oknex_charge;
267 .float oknex_charge_rottime;
268 .float oknex_chargepool_ammo;
269 .int hagar_load;
270
271 .int grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab
272
273 #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
274 // when doing this, hagar can go through clones
275 // #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_BBOX
276
277 .int spectatee_status;
278 .bool zoomstate;
279 .int restriction;
280
281 .entity clientdata;
282 .entity personal;
283
284 string deathmessage;
285
286 .bool just_joined;
287
288 .float cvar_cl_weaponimpulsemode;
289 .int selectweapon; // last selected weapon of the player
290
291 .float ballistics_density;
292
293 //const int FROZEN_NOT                          = 0;
294 const int FROZEN_NORMAL                         = 1;
295 const int FROZEN_TEMP_REVIVING          = 2;
296 const int FROZEN_TEMP_DYING                     = 3;
297
298 .int active;
299 .void (entity this, int act_state) setactive;
300 .entity realowner;
301
302 //float serverflags;
303
304 .bool player_blocked;
305
306 .float revival_time; // time at which player was last revived
307 .float revive_speed; // NOTE: multiplier (anything above 1 is instaheal)
308 .float freeze_time;
309 .entity iceblock;
310 .entity frozen_by; // for ice fields
311
312 .float misc_bulletcounter;      // replaces uzi & hlac bullet counter.
313
314 void PlayerUseKey(entity this);
315
316 USING(spawn_evalfunc_t, vector(entity this, entity player, entity spot, vector current));
317 .spawn_evalfunc_t spawn_evalfunc;
318
319 string modname;
320
321 .int missile_flags;
322 const int MIF_SPLASH = BIT(1);
323 const int MIF_ARC = BIT(2);
324 const int MIF_PROXY = BIT(3);
325 const int MIF_GUIDED_MANUAL = BIT(4);
326 const int MIF_GUIDED_HEAT = BIT(5);
327 const int MIF_GUIDED_LASER = BIT(6);
328 const int MIF_GUIDED_AI = BIT(7);
329 const int MIF_GUIDED_TAG = BIT(7);
330 const int MIF_GUIDED_ALL = MIF_GUIDED_MANUAL | MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG;
331 const int MIF_GUIDED_TRACKING = MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG;
332 const int MIF_GUIDED_CONFUSABLE = MIF_GUIDED_HEAT | MIF_GUIDED_AI;
333
334 #define MISSILE_IS_CONFUSABLE(m) ((m.missile_flags & MIF_GUIDED_CONFUSABLE) ? true : false)
335 #define MISSILE_IS_GUIDED(m) ((m.missile_flags & MIF_GUIDED_ALL) ? true : false)
336 #define MISSILE_IS_TRACKING(m) ((m.missile_flags & MIF_GUIDED_TRACKING) ? true : false)
337
338 ////
339
340 .string cvar_cl_physics;
341
342 .void(entity this, entity player) init_for_player;
343
344 .WepSet dual_weapons;
345
346 IntrusiveList g_monsters;
347 IntrusiveList g_waypoints;
348 IntrusiveList g_vehicles;
349 IntrusiveList g_turrets;
350 IntrusiveList g_mines;
351 IntrusiveList g_projectiles;
352 IntrusiveList g_items;
353 IntrusiveList g_initforplayer;
354 IntrusiveList g_clones;
355 IntrusiveList g_spawnpoints;
356 IntrusiveList g_bot_targets;
357 IntrusiveList g_bot_dodge;
358 IntrusiveList g_damagedbycontents;
359 IntrusiveList g_railgunhit;
360 IntrusiveList g_ladders;
361 IntrusiveList g_locations;
362 IntrusiveList g_saved_team;
363 IntrusiveList g_monster_targets;
364 IntrusiveList g_pathlib_nodes;
365 IntrusiveList g_moveables;
366 STATIC_INIT(defs)
367 {
368         g_monsters = IL_NEW();
369         g_waypoints = IL_NEW();
370         g_vehicles = IL_NEW();
371         g_turrets = IL_NEW();
372         g_mines = IL_NEW();
373         g_projectiles = IL_NEW();
374         g_items = IL_NEW();
375         g_initforplayer = IL_NEW();
376         g_clones = IL_NEW();
377         g_spawnpoints = IL_NEW();
378         g_bot_targets = IL_NEW();
379         g_bot_dodge = IL_NEW();
380         g_damagedbycontents = IL_NEW();
381         g_railgunhit = IL_NEW();
382         g_ladders = IL_NEW();
383         g_locations = IL_NEW();
384         g_saved_team = IL_NEW();
385         g_monster_targets = IL_NEW();
386         g_pathlib_nodes = IL_NEW();
387         g_moveables = IL_NEW();
388 }