3 #include <common/weapons/_all.qh>
4 #include <common/stats.qh>
6 #define INDEPENDENT_ATTACK_FINISHED 1
10 float g_footsteps, g_grappling_hook;
11 float g_warmup_allguns;
12 float g_warmup_allow_timeout;
16 bool sv_ready_restart;
17 bool sv_ready_restart_after_countdown;
18 bool sv_ready_restart_repeatable;
25 float bots_would_leave;
27 void UpdateFrags(entity player, int f);
30 // flag set on worldspawn so that the code knows if it is dedicated or not
31 float server_is_dedicated;
35 .void(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) event_damage;
37 .bool(entity targ, entity inflictor, float amount, float limit) event_heal;
43 // Needed for dynamic clientwalls
44 .bool inactive; // Clientwall disappears when inactive
45 .float alpha_max, alpha_min;
46 .float fade_start, fade_end, fade_vertical_offset;
47 .float default_solid; // Variable to store default .solid for clientwalls
49 .float pain_finished; //Added by Supajoe
50 .float pain_frame; //"
51 .float crouch; // Crouching or not?
53 .float superweapons_finished = _STAT(SUPERWEAPONS_FINISHED);
55 .float cnt; // used in too many places
61 .float respawn_time_max;
66 void player_setupanimsformodel(entity this);
75 .float scheduledrespawntime;
77 .float respawntimejitter;
78 .float respawntimestart;
81 .float damageforcescale;
82 const float MIN_DAMAGEEXTRARADIUS = 2;
83 const float MAX_DAMAGEEXTRARADIUS = 16;
84 .float damageextraradius;
90 // for railgun damage (hitting multiple enemies)
92 .float railgunhitsolidbackup;
93 .vector railgunhitloc;
99 .float damage_dealt, typehitsound, killsound;
101 .float watersound_finished;
103 .float damagedbycontents;
104 .float damagedbytriggers;
108 .float pauseregen_finished;
109 .float pauserothealth_finished;
110 .float pauserotarmor_finished;
111 .float pauserotfuel_finished;
112 // string overrides entity
113 .string item_pickupsound;
114 .entity item_pickupsound_ent;
115 .entity item_model_ent;
119 bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andammo, bool complain);
120 void w_clear(Weapon thiswep, entity actor, .entity weaponentity, int fire);
121 void w_ready(Weapon thiswep, entity actor, .entity weaponentity, int fire);
122 // VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies)
123 .float weapon_nextthink;
124 .void(Weapon thiswep, entity actor, .entity weaponentity, int fire) weapon_think;
127 // there is 2 weapon tics that can run in one server frame
128 const int W_TICSPERFRAME = 2;
130 void weapon_defaultspawnfunc(entity this, Weapon e);
132 float intermission_running;
133 float intermission_exittime;
134 float alreadychangedlevel;
139 float blockSpectators; //if set, new or existing spectators or observers will be removed unless they become a player within g_maxplayers_spectator_blocktime seconds
140 .float spectatortime; //point in time since the client is spectating or observing
141 void checkSpectatorBlock(entity this);
143 float game_completion_ratio; // 0 at start, 1 near end
145 .float jointime; // time of connecting
146 .float startplaytime; // time of switching from spectator to player
147 .float alivetime; // time of being alive
148 .float motd_actived_time; // used for both motd and campaign_message
150 bool nJoinAllowed(entity this, entity ignore);
152 .float spawnshieldtime;
153 .float item_spawnshieldtime;
158 .float noalign; // if set to 1, the item or spawnpoint won't be dropped to the floor
160 .vector death_origin;
162 float default_player_alpha;
163 float default_weapon_alpha;
165 .float cvar_cl_handicap;
166 .float cvar_cl_clippedspectating;
167 .float cvar_cl_autoscreenshot;
168 .float cvar_cl_jetpack_jump;
169 .float cvar_cl_movement_track_canjump;
170 .float cvar_cl_newusekeysupported;
171 .float cvar_cl_cts_noautoswitch;
173 .string cvar_g_xonoticversion;
174 .string cvar_cl_weaponpriority;
175 .string cvar_cl_weaponpriorities[10];
176 .float cvar_cl_noantilag;
178 .string weaponorder_byimpulse;
180 .float cvar_cl_allow_uid2name;
181 .float cvar_cl_allow_uidtracking;
182 .string stored_netname;
184 string gamemode_name;
186 string W_Apply_Weaponreplace(string in);
188 void FixIntermissionClient(entity e);
189 void FixClientCvars(entity e);
191 // WEAPONTODO: remove this
192 //WepSet weaponsInMap;
194 .float respawn_countdown; // next number to count
196 float bot_waypoints_for_items;
198 .float attack_finished_for[Weapons_MAX * MAX_WEAPONSLOTS];
199 .float attack_finished_single[MAX_WEAPONSLOTS];
200 #if INDEPENDENT_ATTACK_FINISHED
201 #define ATTACK_FINISHED_FOR(ent, w, slot) ((ent).(attack_finished_for[((w) - WEP_FIRST) * MAX_WEAPONSLOTS + (slot)]))
203 #define ATTACK_FINISHED_FOR(ent, w, slot) ((ent).attack_finished_single[slot])
205 #define ATTACK_FINISHED(ent, slot) ATTACK_FINISHED_FOR(ent, ent.(weaponentity).m_weapon.m_id, slot)
207 // assault game mode: Which team is attacking in this round?
208 float assault_attacker_team;
210 // speedrun: when 1, player auto teleports back when capture timeout happens
219 bool some_spawn_has_been_used;
220 int have_team_spawns; // 0 = no team spawns requested, -1 = team spawns requested but none found, 1 = team spawns requested and found
221 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"
225 void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force);
228 #define DMG_NOWEP (weaponentities[0])
231 float sv_maxidle_spectatorsareidle;
232 int sv_maxidle_slots;
233 bool sv_maxidle_slots_countbots;
235 float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end);
240 .float cvar_cl_autotaunt;
241 .float cvar_cl_voice_directional;
242 .float cvar_cl_voice_directional_taunt_attenuation;
244 int autocvar__independent_players;
245 bool independent_players;
246 #define INDEPENDENT_PLAYERS (autocvar__independent_players ? (autocvar__independent_players > 0) : independent_players)
247 #define IS_INDEPENDENT_PLAYER(e) ((e).solid == SOLID_TRIGGER)
248 #define MAKE_INDEPENDENT_PLAYER(e) (((e).solid = SOLID_TRIGGER), ((e).frags = FRAGS_PLAYER_NONSOLID))
257 string cvar_purechanges;
258 float cvar_purechanges_count;
260 //float game_starttime; //point in time when the countdown to game start is over
261 //float round_starttime; //point in time when the countdown to round start is over
263 void W_Porto_Remove (entity p);
265 .int projectiledeathtype;
269 // reset to 0 on weapon switch
270 // may be useful to all weapons
271 .float bulletcounter;
274 float g_nexball_meter_period;
276 .void(entity this) reset; // if set, an entity is reset using this
277 .void(entity this) reset2; // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
279 void ClientData_Touch(entity e);
281 //vector debug_shotorg; // if non-zero, overrides the shot origin of all weapons
285 float servertime, serverprevtime, serverframetime;
290 .float nickspamtime; // time of last nick change
291 .float nickspamcount;
292 .float floodcontrol_chat;
293 .float floodcontrol_chatteam;
294 .float floodcontrol_chattell;
295 .float floodcontrol_voice;
296 .float floodcontrol_voiceteam;
300 bool radar_showennemies;
303 float client_cefc_accumulator;
304 float client_cefc_accumulatortime;
307 .float weapon_load[Weapons_MAX];
308 .int ammo_none; // used by the reloading system, must always be 0
313 .int minelayer_mines;
314 .float vortex_charge;
315 .float vortex_charge_rottime;
316 .float vortex_chargepool_ammo;
318 .float oknex_charge_rottime;
319 .float oknex_chargepool_ammo;
322 .int grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab
324 #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
325 // when doing this, hagar can go through clones
326 // #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_BBOX
328 .int spectatee_status;
339 .float cvar_cl_weaponimpulsemode;
340 .int selectweapon; // last selected weapon of the player
342 .float ballistics_density; // wall piercing factor, larger = bullet can pass through more
344 //const int FROZEN_NOT = 0;
345 const int FROZEN_NORMAL = 1;
346 const int FROZEN_TEMP_REVIVING = 2;
347 const int FROZEN_TEMP_DYING = 3;
349 const int ACTIVE_NOT = 0;
350 const int ACTIVE_ACTIVE = 1;
351 const int ACTIVE_IDLE = 2;
352 const int ACTIVE_BUSY = 2;
353 const int ACTIVE_TOGGLE = 3;
355 .void (entity this, int act_state) setactive;
360 .bool player_blocked;
362 .float revival_time; // time at which player was last revived
363 .float revive_speed; // NOTE: multiplier (anything above 1 is instaheal)
366 .entity frozen_by; // for ice fields
368 .entity muzzle_flash;
369 .float misc_bulletcounter; // replaces uzi & hlac bullet counter.
371 void PlayerUseKey(entity this);
373 USING(spawn_evalfunc_t, vector(entity this, entity player, entity spot, vector current));
374 .spawn_evalfunc_t spawn_evalfunc;
379 const int MIF_SPLASH = BIT(1);
380 const int MIF_ARC = BIT(2);
381 const int MIF_PROXY = BIT(3);
382 const int MIF_GUIDED_MANUAL = BIT(4);
383 const int MIF_GUIDED_HEAT = BIT(5);
384 const int MIF_GUIDED_LASER = BIT(6);
385 const int MIF_GUIDED_AI = BIT(7);
386 const int MIF_GUIDED_TAG = BIT(7);
387 const int MIF_GUIDED_ALL = MIF_GUIDED_MANUAL | MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG;
388 const int MIF_GUIDED_TRACKING = MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG;
389 const int MIF_GUIDED_CONFUSABLE = MIF_GUIDED_HEAT | MIF_GUIDED_AI;
391 #define MISSILE_IS_CONFUSABLE(m) ((m.missile_flags & MIF_GUIDED_CONFUSABLE) ? true : false)
392 #define MISSILE_IS_GUIDED(m) ((m.missile_flags & MIF_GUIDED_ALL) ? true : false)
393 #define MISSILE_IS_TRACKING(m) ((m.missile_flags & MIF_GUIDED_TRACKING) ? true : false)
397 .string cvar_cl_physics;
399 .void(entity this, entity player) init_for_player;
401 .WepSet dual_weapons;
403 IntrusiveList g_monsters;
404 IntrusiveList g_waypoints;
405 IntrusiveList g_vehicles;
406 IntrusiveList g_turrets;
407 IntrusiveList g_mines;
408 IntrusiveList g_projectiles;
409 IntrusiveList g_items;
410 IntrusiveList g_initforplayer;
411 IntrusiveList g_clones;
412 IntrusiveList g_spawnpoints;
413 IntrusiveList g_bot_targets;
414 IntrusiveList g_bot_dodge;
415 IntrusiveList g_damagedbycontents;
416 IntrusiveList g_railgunhit;
417 IntrusiveList g_ladders;
418 IntrusiveList g_locations;
419 IntrusiveList g_saved_team;
420 IntrusiveList g_monster_targets;
421 IntrusiveList g_pathlib_nodes;
424 g_monsters = IL_NEW();
425 g_waypoints = IL_NEW();
426 g_vehicles = IL_NEW();
427 g_turrets = IL_NEW();
429 g_projectiles = IL_NEW();
431 g_initforplayer = IL_NEW();
433 g_spawnpoints = IL_NEW();
434 g_bot_targets = IL_NEW();
435 g_bot_dodge = IL_NEW();
436 g_damagedbycontents = IL_NEW();
437 g_railgunhit = IL_NEW();
438 g_ladders = IL_NEW();
439 g_locations = IL_NEW();
440 g_saved_team = IL_NEW();
441 g_monster_targets = IL_NEW();
442 g_pathlib_nodes = IL_NEW();