4 #include "../common/weapons/all.qh"
6 #define INDEPENDENT_ATTACK_FINISHED 1
8 #define BUTTON_ATCK button0
9 #define BUTTON_JUMP button2
10 #define BUTTON_ATCK2 button3
11 #define BUTTON_ZOOM button4
12 #define BUTTON_CROUCH button5
13 #define BUTTON_HOOK button6
14 #define BUTTON_INFO button7
15 #define BUTTON_CHAT buttonchat
16 #define BUTTON_USE buttonuse
17 #define BUTTON_DRAG button8
18 #define BUTTON_ZOOMSCRIPT button9
19 #define BUTTON_JETPACK button10
23 float g_footsteps, g_grappling_hook, g_instagib;
25 float g_warmup_allguns;
26 float g_warmup_allow_timeout;
28 PROPERTY(float, g_pickup_respawntime_weapon)
29 PROPERTY(float, g_pickup_respawntime_superweapon)
30 PROPERTY(float, g_pickup_respawntime_ammo)
31 PROPERTY(float, g_pickup_respawntime_short)
32 PROPERTY(float, g_pickup_respawntime_medium)
33 PROPERTY(float, g_pickup_respawntime_long)
34 PROPERTY(float, g_pickup_respawntime_powerup)
35 PROPERTY(float, g_pickup_respawntimejitter_weapon)
36 PROPERTY(float, g_pickup_respawntimejitter_superweapon)
37 PROPERTY(float, g_pickup_respawntimejitter_ammo)
38 PROPERTY(float, g_pickup_respawntimejitter_short)
39 PROPERTY(float, g_pickup_respawntimejitter_medium)
40 PROPERTY(float, g_pickup_respawntimejitter_long)
41 PROPERTY(float, g_pickup_respawntimejitter_powerup)
49 float bots_would_leave;
51 void UpdateFrags(entity player, float f);
54 float team1_score, team2_score, team3_score, team4_score;
58 // flag set on worldspawn so that the code knows if it is dedicated or not
59 float server_is_dedicated;
63 .void(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) event_damage;
69 // Needed for dynamic clientwalls
70 .float inactive; // Clientwall disappears when inactive
71 .float alpha_max, alpha_min;
72 .float fade_start, fade_end, fade_vertical_offset;
73 .float default_solid; // Variable to store default self.solid for clientwalls
75 .float pain_finished; //Added by Supajoe
76 .float pain_frame; //"
77 .float crouch; // Crouching or not?
79 .float strength_finished;
80 .float invincible_finished;
81 .float superweapons_finished;
83 .float cnt; // used in too many places
90 .float respawn_time_max;
95 // weapon animation vectors:
101 void() player_setupanimsformodel;
102 void setanim(entity e, vector anim, float looping, float override, float restart);
111 .float scheduledrespawntime;
113 .float respawntimejitter;
116 .float damageforcescale;
117 const float MIN_DAMAGEEXTRARADIUS = 2;
118 const float MAX_DAMAGEEXTRARADIUS = 16;
119 .float damageextraradius;
125 // for railgun damage (hitting multiple enemies)
127 .float railgunhitsolidbackup;
128 .vector railgunhitloc;
134 .float damage_dealt, typehitsound;
136 .float watersound_finished;
138 .float damagedbycontents;
139 .float damagedbytriggers;
144 .float pauseregen_finished;
145 .float pauserothealth_finished;
146 .float pauserotarmor_finished;
147 .float pauserotfuel_finished;
148 // string overrides entity
149 .string item_pickupsound;
150 .entity item_pickupsound_ent;
151 .entity item_model_ent;
153 // definitions for weaponsystem
154 // more WEAPONTODO: move these to their proper files
155 .entity exteriorweaponentity;
156 .vector weaponentity_glowmod;
158 //.int weapon; // current weapon
159 .int switchweapon; // weapon requested to switch to
160 .int switchingweapon; // weapon currently being switched to (is copied from switchweapon once switch is possible)
161 .string weaponname; // name of .weapon
165 float client_hasweapon(entity cl, float wpn, float andammo, float complain);
166 void w_clear(Weapon thiswep, entity actor, .entity weaponentity, int fire);
167 void w_ready(Weapon thiswep, entity actor, .entity weaponentity, int fire);
168 // VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies)
169 .float weapon_nextthink;
170 .void(Weapon thiswep, entity actor, .entity weaponentity, int fire) weapon_think;
173 // weapon states (self.weaponentity.state)
174 const int WS_CLEAR = 0; // no weapon selected
175 const int WS_RAISE = 1; // raise frame
176 const int WS_DROP = 2; // deselecting frame
177 const int WS_INUSE = 3; // fire state
178 const int WS_READY = 4; // idle frame
180 // there is 2 weapon tics that can run in one server frame
181 const int W_TICSPERFRAME = 2;
183 void weapon_defaultspawnfunc(entity this, Weapon e);
186 float intermission_running;
187 float intermission_exittime;
188 float alreadychangedlevel;
195 float blockSpectators; //if set, new or existing spectators or observers will be removed unless they become a player within g_maxplayers_spectator_blocktime seconds
196 .float spectatortime; //point in time since the client is spectating or observing
197 void checkSpectatorBlock();
199 float game_completion_ratio; // 0 at start, 1 near end
201 .float jointime; // time of joining
202 .float alivetime; // time of being alive
203 .float motd_actived_time; // used for both motd and campaign_message
205 float nJoinAllowed(entity ignore);
207 .float spawnshieldtime;
208 .float item_spawnshieldtime;
214 .float noalign; // if set to 1, the item or spawnpoint won't be dropped to the floor
218 .vector death_origin;
219 .vector killer_origin;
221 float default_player_alpha;
222 float default_weapon_alpha;
224 .float() customizeentityforclient;
225 .float cvar_cl_handicap;
226 .float cvar_cl_clippedspectating;
227 .float cvar_cl_autoscreenshot;
228 .float cvar_cl_jetpack_jump;
229 .float cvar_cl_movement_track_canjump;
230 .float cvar_cl_newusekeysupported;
232 .string cvar_g_xonoticversion;
233 .string cvar_cl_weaponpriority;
234 .string cvar_cl_weaponpriorities[10];
235 .float cvar_cl_gunalign;
236 .float cvar_cl_noantilag;
238 .string weaponorder_byimpulse;
240 .float cvar_cl_allow_uid2name;
241 .float cvar_cl_allow_uidtracking;
242 .string stored_netname;
244 .float version_nagtime;
246 string gamemode_name;
248 float startitem_failed;
250 string W_Apply_Weaponreplace(string in);
252 void FixIntermissionClient(entity e);
253 void FixClientCvars(entity e);
255 // WEAPONTODO: remove this
258 .WepSet weaponsinmap;
260 .float respawn_countdown; // next number to count
262 float bot_waypoints_for_items;
264 .float attack_finished_for[Weapons_MAX * MAX_WEAPONSLOTS];
265 .float attack_finished_single[MAX_WEAPONSLOTS];
266 #if INDEPENDENT_ATTACK_FINISHED
267 #define ATTACK_FINISHED_FOR(ent, w, slot) ((ent).(attack_finished_for[((w) - WEP_FIRST) * MAX_WEAPONSLOTS + (slot)]))
269 #define ATTACK_FINISHED_FOR(ent, w, slot) ((ent).attack_finished_single[slot])
271 #define ATTACK_FINISHED(ent, slot) ATTACK_FINISHED_FOR(ent, (ent).weapon, slot)
273 // assault game mode: Which team is attacking in this round?
274 float assault_attacker_team;
276 // speedrun: when 1, player auto teleports back when capture timeout happens
285 float some_spawn_has_been_used;
286 float have_team_spawns; // 0 = no team spawns requested, -1 = team spawns requested but none found, 1 = team spawns requested and found
287 float have_team_spawns_forteam[17]; // 0 = this team has no spawns, 1 = this team has spawns; team 0 is the "no-team"
289 // set when showing a kill countdown
290 .entity killindicator;
291 .float killindicator_teamchange;
293 void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
297 .float parm_idlesince;
299 float sv_maxidle_spectatorsareidle;
301 float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end);
305 // player sounds, voice messages
306 // TODO implemented fall and falling
307 #define ALLPLAYERSOUNDS \
319 #define ALLVOICEMSGS \
321 _VOICEMSG(attackinfive) \
324 _VOICEMSG(freelance) \
325 _VOICEMSG(incoming) \
327 _VOICEMSG(needhelp) \
328 _VOICEMSG(seenflag) \
332 #define _VOICEMSG(m) .string playersound_##m;
337 // reserved sound names for the future (some models lack sounds for them):
338 // _VOICEMSG(flagcarriertakingdamage) \
339 // _VOICEMSG(getflag) \
340 // reserved sound names for the future (ALL models lack sounds for them):
341 // _VOICEMSG(affirmative) \
342 // _VOICEMSG(attacking) \
343 // _VOICEMSG(defending) \
344 // _VOICEMSG(roaming) \
345 // _VOICEMSG(onmyway) \
346 // _VOICEMSG(droppedflag) \
347 // _VOICEMSG(negative) \
348 // _VOICEMSG(seenenemy) \
351 string globalsound_fall;
352 string globalsound_metalfall;
353 string globalsound_step;
354 string globalsound_metalstep;
356 const float VOICETYPE_PLAYERSOUND = 10;
357 const float VOICETYPE_TEAMRADIO = 11;
358 const float VOICETYPE_LASTATTACKER = 12;
359 const float VOICETYPE_LASTATTACKER_ONLY = 13;
360 const float VOICETYPE_AUTOTAUNT = 14;
361 const float VOICETYPE_TAUNT = 15;
363 void PrecachePlayerSounds(string f);
364 void PrecacheGlobalSound(string samplestring);
365 void UpdatePlayerSounds();
366 void ClearPlayerSounds();
367 void PlayerSound(.string samplefield, float channel, float voicetype);
368 void GlobalSound(string samplestring, float channel, float voicetype);
369 void FakeGlobalSound(string samplestring, float channel, float voicetype);
370 void VoiceMessage(string type, string message);
371 float GetPlayerSoundSampleField_notFound;
372 .string GetVoiceMessageSampleField(string type);
375 .float cvar_cl_autotaunt;
376 .float cvar_cl_voice_directional;
377 .float cvar_cl_voice_directional_taunt_attenuation;
379 .float version_mismatch;
381 int autocvar__independent_players;
382 bool independent_players;
383 #define INDEPENDENT_PLAYERS (autocvar__independent_players ? (autocvar__independent_players > 0) : independent_players)
384 #define IS_INDEPENDENT_PLAYER(e) ((e).solid == SOLID_TRIGGER)
385 #define MAKE_INDEPENDENT_PLAYER(e) (((e).solid = SOLID_TRIGGER), ((e).frags = FRAGS_PLAYER_NONSOLID))
394 string cvar_purechanges;
395 float cvar_purechanges_count;
397 float game_starttime; //point in time when the countdown to game start is over
398 float round_starttime; //point in time when the countdown to round start is over
399 .float stat_game_starttime;
400 .float stat_round_starttime;
402 void W_Porto_Remove (entity p);
404 .int projectiledeathtype;
408 .float stat_allow_oldvortexbeam;
410 // reset to 0 on weapon switch
411 // may be useful to all weapons
412 .float bulletcounter;
415 .entity ballcarried; // Also used for keepaway
416 float g_nexball_meter_period;
418 void SUB_DontUseTargets();
419 void SUB_UseTargets();
421 .void() reset; // if set, an entity is reset using this
422 .void() reset2; // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
424 void ClientData_Touch(entity e);
426 //vector debug_shotorg; // if non-zero, overrides the shot origin of all weapons
430 float servertime, serverprevtime, serverframetime;
437 .float nickspamtime; // time of last nick change
438 .float nickspamcount;
439 .float floodcontrol_chat;
440 .float floodcontrol_chatteam;
441 .float floodcontrol_chattell;
442 .float floodcontrol_voice;
443 .float floodcontrol_voiceteam;
445 .float stat_shotorg; // networked stat for trueaim HUD
454 .float damage_dealt_total;
456 .float stat_leadlimit;
458 bool radar_showennemies;
461 float client_cefc_accumulator;
462 float client_cefc_accumulatortime;
465 .float weapon_load[Weapons_MAX];
466 .int ammo_none; // used by the reloading system, must always be 0
468 .float old_clip_load;
471 .float minelayer_mines;
472 .float vortex_charge;
473 .float vortex_charge_rottime;
474 .float vortex_chargepool_ammo;
477 .int grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab
479 #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
480 // when doing this, hagar can go through clones
481 // #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_BBOX
483 .float spectatee_status;
494 .float cvar_cl_weaponimpulsemode;
495 .float selectweapon; // last selected weapon of the player
497 .float ballistics_density; // wall piercing factor, larger = bullet can pass through more
499 const float ACTIVE_NOT = 0;
500 const float ACTIVE_ACTIVE = 1;
501 const float ACTIVE_IDLE = 2;
502 const float ACTIVE_BUSY = 2;
503 const float ACTIVE_TOGGLE = 3;
505 .void (float act_state) setactive;
510 .float team_forced; // can be a team number to force a team, or 0 for default action, or -1 for forced spectator
512 .float player_blocked;
513 .float weapon_blocked; // weapon use disabled
515 .float frozen; // for freeze attacks
516 .float revive_progress;
517 .float revival_time; // time at which player was last revived
518 .float revive_speed; // NOTE: multiplier (anything above 1 is instaheal)
520 .entity frozen_by; // for ice fields
522 .entity muzzle_flash;
523 .float misc_bulletcounter; // replaces uzi & hlac bullet counter.
525 .float stat_respawn_time; // shows respawn time, and is negative when awaiting respawn
529 typedef vector(entity player, entity spot, vector current) spawn_evalfunc_t;
530 .spawn_evalfunc_t spawn_evalfunc;
534 .float missile_flags;
535 const int MIF_SPLASH = BIT(1);
536 const int MIF_ARC = BIT(2);
537 const int MIF_PROXY = BIT(3);
538 const int MIF_GUIDED_MANUAL = BIT(4);
539 const int MIF_GUIDED_HEAT = BIT(5);
540 const int MIF_GUIDED_LASER = BIT(6);
541 const int MIF_GUIDED_AI = BIT(7);
542 const int MIF_GUIDED_TAG = BIT(7);
543 const int MIF_GUIDED_ALL = MIF_GUIDED_MANUAL | MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG;
544 const int MIF_GUIDED_TRACKING = MIF_GUIDED_HEAT | MIF_GUIDED_LASER | MIF_GUIDED_AI | MIF_GUIDED_TAG;
545 const int MIF_GUIDED_CONFUSABLE = MIF_GUIDED_HEAT | MIF_GUIDED_AI;
547 #define MISSILE_IS_CONFUSABLE(m) ((m.missile_flags & MIF_GUIDED_CONFUSABLE) ? true : false)
548 #define MISSILE_IS_GUIDED(m) ((m.missile_flags & MIF_GUIDED_ALL) ? true : false)
549 #define MISSILE_IS_TRACKING(m) ((m.missile_flags & MIF_GUIDED_TRACKING) ? true : false)
554 .entity player_stats;
560 .string cvar_cl_physics;
562 .float init_for_player_needed;
563 .void(entity) init_for_player;