4 #include "../common/weapons/all.qh"
6 #define INDEPENDENT_ATTACK_FINISHED
8 noref float require_spawnfunc_prefix; // if this float exists, only functions with spawnfunc_ name prefix qualify as spawn functions
10 #define BUTTON_ATCK button0
11 #define BUTTON_JUMP button2
12 #define BUTTON_ATCK2 button3
13 #define BUTTON_ZOOM button4
14 #define BUTTON_CROUCH button5
15 #define BUTTON_HOOK button6
16 #define BUTTON_INFO button7
17 #define BUTTON_CHAT buttonchat
18 #define BUTTON_USE buttonuse
19 #define BUTTON_DRAG button8
20 #define BUTTON_ZOOMSCRIPT button9
21 #define BUTTON_JETPACK button10
25 float g_cloaked, g_footsteps, g_grappling_hook, g_instagib;
27 float g_warmup_allguns;
28 float g_warmup_allow_timeout;
30 float g_pickup_respawntime_weapon;
31 float g_pickup_respawntime_superweapon;
32 float g_pickup_respawntime_ammo;
33 float g_pickup_respawntime_short;
34 float g_pickup_respawntime_medium;
35 float g_pickup_respawntime_long;
36 float g_pickup_respawntime_powerup;
37 float g_pickup_respawntimejitter_weapon;
38 float g_pickup_respawntimejitter_superweapon;
39 float g_pickup_respawntimejitter_ammo;
40 float g_pickup_respawntimejitter_short;
41 float g_pickup_respawntimejitter_medium;
42 float g_pickup_respawntimejitter_long;
43 float g_pickup_respawntimejitter_powerup;
51 float bots_would_leave;
53 void UpdateFrags(entity player, float f);
56 float team1_score, team2_score, team3_score, team4_score;
60 // flag set on worldspawn so that the code knows if it is dedicated or not
61 float server_is_dedicated;
65 .void(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) event_damage;
71 // Needed for dynamic clientwalls
72 .float inactive; // Clientwall disappears when inactive
73 .float alpha_max, alpha_min;
74 .float fade_start, fade_end, fade_vertical_offset;
75 .float default_solid; // Variable to store default self.solid for clientwalls
77 .float pain_finished; //Added by Supajoe
78 .float pain_frame; //"
79 .float crouch; // Crouching or not?
81 .float strength_finished;
82 .float invincible_finished;
83 .float superweapons_finished;
85 .float cnt; // used in too many places
92 .float respawn_time_max;
97 // weapon animation vectors:
103 void() player_setupanimsformodel;
104 void setanim(entity e, vector anim, float looping, float override, float restart);
113 .float scheduledrespawntime;
115 .float respawntimejitter;
118 .float damageforcescale;
119 const float MIN_DAMAGEEXTRARADIUS = 2;
120 const float MAX_DAMAGEEXTRARADIUS = 16;
121 .float damageextraradius;
127 // for railgun damage (hitting multiple enemies)
129 .float railgunhitsolidbackup;
130 .vector railgunhitloc;
136 .float damage_dealt, typehitsound;
138 .float watersound_finished;
140 .float damagedbycontents;
141 .float damagedbytriggers;
146 .float pauseregen_finished;
147 .float pauserothealth_finished;
148 .float pauserotarmor_finished;
149 .float pauserotfuel_finished;
150 // string overrides entity
151 .string item_pickupsound;
152 .entity item_pickupsound_ent;
154 // definitions for weaponsystem
155 // more WEAPONTODO: move these to their proper files
156 .entity weaponentity;
157 .entity exteriorweaponentity;
158 .vector weaponentity_glowmod;
160 //.int weapon; // current weapon
161 .int switchweapon; // weapon requested to switch to
162 .int switchingweapon; // weapon currently being switched to (is copied from switchweapon once switch is possible)
163 .string weaponname; // name of .weapon
167 //float WEP_ACTION(float wpn, float wrequest);
168 float client_hasweapon(entity cl, float wpn, float andammo, float complain);
171 // VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies)
172 .float weapon_nextthink;
173 .void() weapon_think;
176 // weapon states (self.weaponentity.state)
177 const int WS_CLEAR = 0; // no weapon selected
178 const int WS_RAISE = 1; // raise frame
179 const int WS_DROP = 2; // deselecting frame
180 const int WS_INUSE = 3; // fire state
181 const int WS_READY = 4; // idle frame
183 // there is 2 weapon tics that can run in one server frame
184 const int W_TICSPERFRAME = 2;
186 void weapon_defaultspawnfunc(float wpn);
189 float intermission_running;
190 float intermission_exittime;
191 float alreadychangedlevel;
198 float blockSpectators; //if set, new or existing spectators or observers will be removed unless they become a player within g_maxplayers_spectator_blocktime seconds
199 .float spectatortime; //point in time since the client is spectating or observing
200 void checkSpectatorBlock();
202 float game_completion_ratio; // 0 at start, 1 near end
204 .float jointime; // time of joining
205 .float alivetime; // time of being alive
206 .float motd_actived_time; // used for both motd and campaign_message
208 float nJoinAllowed(entity ignore);
210 .float spawnshieldtime;
211 .float item_spawnshieldtime;
217 .float noalign; // if set to 1, the item or spawnpoint won't be dropped to the floor
221 .vector death_origin;
222 .vector killer_origin;
224 float default_player_alpha;
225 float default_weapon_alpha;
227 .float() customizeentityforclient;
228 .float cvar_cl_handicap;
229 .float cvar_cl_clippedspectating;
230 .float cvar_cl_autoscreenshot;
231 .float cvar_cl_jetpack_jump;
232 .float cvar_cl_movement_track_canjump;
233 .float cvar_cl_newusekeysupported;
235 .string cvar_g_xonoticversion;
236 .string cvar_cl_weaponpriority;
237 .string cvar_cl_weaponpriorities[10];
238 .float cvar_cl_gunalign;
239 .float cvar_cl_noantilag;
241 .string weaponorder_byimpulse;
243 .float cvar_cl_allow_uid2name;
244 .float cvar_cl_allow_uidtracking;
245 .string stored_netname;
247 .float version_nagtime;
249 string gamemode_name;
251 float startitem_failed;
253 string W_Apply_Weaponreplace(string in);
255 void FixIntermissionClient(entity e);
256 void FixClientCvars(entity e);
258 // WEAPONTODO: remove this
261 .WepSet weaponsinmap;
263 .float respawn_countdown; // next number to count
265 float bot_waypoints_for_items;
267 .float attack_finished_for[WEP_MAXCOUNT];
268 .float attack_finished_single;
269 #ifdef INDEPENDENT_ATTACK_FINISHED
270 #define ATTACK_FINISHED_FOR(ent,w) ((ent).(attack_finished_for[(w) - WEP_FIRST]))
272 #define ATTACK_FINISHED_FOR(ent,w) ((ent).attack_finished_single)
274 #define ATTACK_FINISHED(ent) ATTACK_FINISHED_FOR(ent,(ent).weapon)
276 // assault game mode: Which team is attacking in this round?
277 float assault_attacker_team;
279 // speedrun: when 1, player auto teleports back when capture timeout happens
288 float some_spawn_has_been_used;
289 float have_team_spawns; // 0 = no team spawns requested, -1 = team spawns requested but none found, 1 = team spawns requested and found
290 float have_team_spawns_forteam[17]; // 0 = this team has no spawns, 1 = this team has spawns; team 0 is the "no-team"
292 // set when showing a kill countdown
293 .entity killindicator;
294 .float killindicator_teamchange;
296 void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
300 .float parm_idlesince;
302 float sv_maxidle_spectatorsareidle;
304 float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end);
310 .bool(entity to, int sendflags) SendEntity;
312 // player sounds, voice messages
313 // TODO implemented fall and falling
314 #define ALLPLAYERSOUNDS \
326 #define ALLVOICEMSGS \
328 _VOICEMSG(attackinfive) \
331 _VOICEMSG(freelance) \
332 _VOICEMSG(incoming) \
334 _VOICEMSG(needhelp) \
335 _VOICEMSG(seenflag) \
339 #define _VOICEMSG(m) .string playersound_##m;
344 // reserved sound names for the future (some models lack sounds for them):
345 // _VOICEMSG(flagcarriertakingdamage) \
346 // _VOICEMSG(getflag) \
347 // reserved sound names for the future (ALL models lack sounds for them):
348 // _VOICEMSG(affirmative) \
349 // _VOICEMSG(attacking) \
350 // _VOICEMSG(defending) \
351 // _VOICEMSG(roaming) \
352 // _VOICEMSG(onmyway) \
353 // _VOICEMSG(droppedflag) \
354 // _VOICEMSG(negative) \
355 // _VOICEMSG(seenenemy) \
357 string globalsound_fall;
358 string globalsound_metalfall;
359 string globalsound_step;
360 string globalsound_metalstep;
362 const float VOICETYPE_PLAYERSOUND = 10;
363 const float VOICETYPE_TEAMRADIO = 11;
364 const float VOICETYPE_LASTATTACKER = 12;
365 const float VOICETYPE_LASTATTACKER_ONLY = 13;
366 const float VOICETYPE_AUTOTAUNT = 14;
367 const float VOICETYPE_TAUNT = 15;
369 void PrecachePlayerSounds(string f);
370 void PrecacheGlobalSound(string samplestring);
371 void UpdatePlayerSounds();
372 void ClearPlayerSounds();
373 void PlayerSound(.string samplefield, float channel, float voicetype);
374 void GlobalSound(string samplestring, float channel, float voicetype);
375 void FakeGlobalSound(string samplestring, float channel, float voicetype);
376 void VoiceMessage(string type, string message);
377 float GetPlayerSoundSampleField_notFound;
378 .string GetVoiceMessageSampleField(string type);
381 .float cvar_cl_autotaunt;
382 .float cvar_cl_voice_directional;
383 .float cvar_cl_voice_directional_taunt_attenuation;
385 .float version_mismatch;
387 float independent_players;
388 #define INDEPENDENT_PLAYERS (autocvar__independent_players ? (autocvar__independent_players > 0) : independent_players)
389 #define IS_INDEPENDENT_PLAYER(e) ((e).solid == SOLID_TRIGGER)
390 #define MAKE_INDEPENDENT_PLAYER(e) (((e).solid = SOLID_TRIGGER) + ((e).frags = FRAGS_PLAYER_NONSOLID))
391 // we're using + here instead of , because fteqcc sucks
397 .float porto_forbidden;
402 string cvar_purechanges;
403 float cvar_purechanges_count;
405 float game_starttime; //point in time when the countdown to game start is over
406 float round_starttime; //point in time when the countdown to round start is over
407 .float stat_game_starttime;
408 .float stat_round_starttime;
410 void W_Porto_Remove (entity p);
412 .int projectiledeathtype;
416 .float stat_allow_oldvortexbeam;
418 // reset to 0 on weapon switch
419 // may be useful to all weapons
420 .float bulletcounter;
423 .entity ballcarried; // Also used for keepaway
425 float g_nexball_meter_period;
427 void SUB_DontUseTargets();
428 void SUB_UseTargets();
430 .void() reset; // if set, an entity is reset using this
431 .void() reset2; // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
433 void ClientData_Touch(entity e);
435 //vector debug_shotorg; // if non-zero, overrides the shot origin of all weapons
439 float servertime, serverprevtime, serverframetime;
446 .float nickspamtime; // time of last nick change
447 .float nickspamcount;
448 .float floodcontrol_chat;
449 .float floodcontrol_chatteam;
450 .float floodcontrol_chattell;
451 .float floodcontrol_voice;
452 .float floodcontrol_voiceteam;
454 .float stat_shotorg; // networked stat for trueaim HUD
463 .float damage_dealt_total;
465 .float stat_leadlimit;
467 bool radar_showennemies;
470 float client_cefc_accumulator;
471 float client_cefc_accumulatortime;
474 .float weapon_load[WEP_MAXCOUNT];
475 .int ammo_none; // used by the reloading system, must always be 0
477 .float old_clip_load;
481 .float minelayer_mines;
482 .float vortex_charge;
483 .float vortex_charge_rottime;
484 .float vortex_chargepool_ammo;
487 .int grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab
489 #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
490 // when doing this, hagar can go through clones
491 // #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_BBOX
493 .float spectatee_status;
504 .float cvar_cl_weaponimpulsemode;
505 .float selectweapon; // last selected weapon of the player
507 .float ballistics_density; // wall piercing factor, larger = bullet can pass through more
509 const float ACTIVE_NOT = 0;
510 const float ACTIVE_ACTIVE = 1;
511 const float ACTIVE_IDLE = 2;
512 const float ACTIVE_BUSY = 2;
513 const float ACTIVE_TOGGLE = 3;
515 .void (float act_state) setactive;
520 .float team_forced; // can be a team number to force a team, or 0 for default action, or -1 for forced spectator
522 .float player_blocked;
523 .float weapon_blocked; // weapon use disabled
525 .float frozen; // for freeze attacks
526 .float revive_progress;
527 .float revival_time; // time at which player was last revived
528 .float revive_speed; // NOTE: multiplier (anything above 1 is instaheal)
530 .entity frozen_by; // for ice fields
532 .entity muzzle_flash;
533 .float misc_bulletcounter; // replaces uzi & hlac bullet counter.
535 .float stat_respawn_time; // shows respawn time, and is negative when awaiting respawn
539 typedef vector(entity player, entity spot, vector current) spawn_evalfunc_t;
540 .spawn_evalfunc_t spawn_evalfunc;
544 .float missile_flags;
545 const int MIF_SPLASH = 2;
546 const int MIF_ARC = 4;
547 const int MIF_PROXY = 8;
548 const int MIF_GUIDED_MANUAL = 16;
549 const int MIF_GUIDED_HEAT = 32;
550 const int MIF_GUIDED_LASER = 64;
551 const int MIF_GUIDED_AI = 128;
552 const int MIF_GUIDED_TAG = 128;
553 #define MIF_GUIDED_ALL (MIF_GUIDED_MANUAL | MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG)
554 #define MIF_GUIDED_TRACKING (MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG)
555 #define MIF_GUIDED_CONFUSABLE (MIF_GUIDED_HEAT | MIF_GUIDED_AI)
557 #define MISSILE_IS_CONFUSABLE(m) ((m.missile_flags & MIF_GUIDED_CONFUSABLE) ? true : false)
558 #define MISSILE_IS_GUIDED(m) ((m.missile_flags & MIF_GUIDED_ALL) ? true : false)
559 #define MISSILE_IS_TRACKING(m) ((m.missile_flags & MIF_GUIDED_TRACKING) ? true : false)
564 .entity player_stats;
570 .string cvar_cl_physics;
572 .float init_for_player_needed;
573 .void(entity) init_for_player;