3 #include <common/weapons/_all.qh>
4 #include <common/stats.qh>
8 float g_footsteps, g_grappling_hook;
9 float g_warmup_allguns;
10 float g_warmup_allow_timeout;
14 bool sv_ready_restart;
15 bool sv_ready_restart_after_countdown;
16 bool sv_ready_restart_repeatable;
23 float bots_would_leave;
25 .int totalfrags; // NOTE: reused for multiple purposes
27 // flag set on worldspawn so that the code knows if it is dedicated or not
28 float server_is_dedicated;
32 .void(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) event_damage;
34 .bool(entity targ, entity inflictor, float amount, float limit) event_heal;
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
46 .float pain_finished; //Added by Supajoe
47 .float pain_frame; //"
48 .float crouch; // Crouching or not?
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);
53 .float cnt; // used in too many places
68 .float scheduledrespawntime;
70 .float respawntimejitter;
71 .float respawntimestart;
74 .float damageforcescale;
75 const float MIN_DAMAGEEXTRARADIUS = 2;
76 const float MAX_DAMAGEEXTRARADIUS = 16;
77 .float damageextraradius;
83 // for railgun damage (hitting multiple enemies)
85 .float railgunhitsolidbackup;
86 .vector railgunhitloc;
91 .float damage_dealt, typehitsound, killsound;
93 .float watersound_finished;
95 .float damagedbycontents;
96 .float damagedbytriggers;
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;
112 float intermission_running;
113 float intermission_exittime;
114 float alreadychangedlevel;
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);
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
129 int nJoinAllowed(entity this, entity ignore);
131 .float spawnshieldtime;
132 .float item_spawnshieldtime;
135 .float noalign; // if set to 1, the item or spawnpoint won't be dropped to the floor
137 .vector death_origin;
139 float default_player_alpha;
140 float default_weapon_alpha;
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;
153 .string cvar_g_xonoticversion;
154 .string cvar_cl_weaponpriority;
155 .string cvar_cl_weaponpriorities[10];
156 .float cvar_cl_noantilag;
158 .string weaponorder_byimpulse;
160 .float cvar_cl_allow_uid2name;
161 .float cvar_cl_allow_uidtracking;
162 .bool cvar_cl_allow_uidranking;
163 .string stored_netname;
165 string gamemode_name;
167 void FixIntermissionClient(entity e);
168 void FixClientCvars(entity e);
170 .float respawn_countdown; // next number to count
172 float bot_waypoints_for_items;
174 // speedrun: when 1, player auto teleports back when capture timeout happens
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"
189 void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force);
192 #define DMG_NOWEP (weaponentities[0])
195 float sv_maxidle_spectatorsareidle;
196 int sv_maxidle_slots;
197 bool sv_maxidle_slots_countbots;
199 float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end);
202 .float cvar_cl_autotaunt;
203 .float cvar_cl_voice_directional;
204 .float cvar_cl_voice_directional_taunt_attenuation;
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))
219 string cvar_purechanges;
220 float cvar_purechanges_count;
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
225 void W_Porto_Remove (entity p);
227 .int projectiledeathtype;
231 // reset to 0 on weapon switch
232 // may be useful to all weapons
233 .float bulletcounter;
236 float g_nexball_meter_period;
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)
241 //vector debug_shotorg; // if non-zero, overrides the shot origin of all weapons
245 float servertime, serverprevtime, serverframetime;
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;
260 bool radar_showennemies;
262 .int minelayer_mines;
263 .float vortex_charge;
264 .float vortex_charge_rottime;
265 .float vortex_chargepool_ammo;
267 .float oknex_charge_rottime;
268 .float oknex_chargepool_ammo;
271 .int grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab
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
277 .int spectatee_status;
288 .float cvar_cl_weaponimpulsemode;
289 .int selectweapon; // last selected weapon of the player
291 .float ballistics_density;
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;
299 .void (entity this, int act_state) setactive;
304 .bool player_blocked;
306 .float revival_time; // time at which player was last revived
307 .float revive_speed; // NOTE: multiplier (anything above 1 is instaheal)
310 .entity frozen_by; // for ice fields
312 .float misc_bulletcounter; // replaces uzi & hlac bullet counter.
314 void PlayerUseKey(entity this);
316 USING(spawn_evalfunc_t, vector(entity this, entity player, entity spot, vector current));
317 .spawn_evalfunc_t spawn_evalfunc;
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;
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)
340 .string cvar_cl_physics;
342 .void(entity this, entity player) init_for_player;
344 .WepSet dual_weapons;
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;
368 g_monsters = IL_NEW();
369 g_waypoints = IL_NEW();
370 g_vehicles = IL_NEW();
371 g_turrets = IL_NEW();
373 g_projectiles = IL_NEW();
375 g_initforplayer = 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();