1 #define INDEPENDENT_ATTACK_FINISHED
\r
3 float require_spawnfunc_prefix; // if this float exists, only functions with spawnfunc_ name prefix qualify as spawn functions
\r
5 #define BUTTON_ATCK button0
\r
6 #define BUTTON_JUMP button2
\r
7 #define BUTTON_ATCK2 button3
\r
8 #define BUTTON_ZOOM button4
\r
9 #define BUTTON_CROUCH button5
\r
10 #define BUTTON_JETPACK button6
\r
11 #define BUTTON_INFO button7
\r
12 #define BUTTON_CHAT buttonchat
\r
13 #define BUTTON_USE buttonuse
\r
14 #define BUTTON_DRAG button8
\r
15 #define BUTTON_REGURGITATE button9
\r
16 #define BUTTON_DIGEST button10
\r
20 float ctf_score_value(string parameter);
\r
22 float g_dm, g_domination, g_ctf, g_tdm, g_keyhunt, g_onslaught, g_assault, g_arena, g_ca, g_lms, g_race, g_cts, g_rpg;
\r
23 float g_cloaked, g_footsteps, g_jump_grunt, g_midair, g_norecoil, g_vampire, g_bloodloss;
\r
24 float g_warmup_limit;
\r
25 float g_warmup_allguns;
\r
26 float g_warmup_allow_timeout;
\r
27 float g_ctf_win_mode;
\r
28 float g_ctf_ignore_frags;
\r
29 float g_ctf_reverse;
\r
30 float g_race_qualifying;
\r
31 float inWarmupStage;
\r
32 float g_pickup_respawntime_weapon;
\r
33 float g_pickup_respawntime_ammo;
\r
34 float g_pickup_respawntime_short;
\r
35 float g_pickup_respawntime_medium;
\r
36 float g_pickup_respawntime_long;
\r
37 float g_pickup_respawntime_powerup;
\r
38 float g_pickup_respawntimejitter_weapon;
\r
39 float g_pickup_respawntimejitter_ammo;
\r
40 float g_pickup_respawntimejitter_short;
\r
41 float g_pickup_respawntimejitter_medium;
\r
42 float g_pickup_respawntimejitter_long;
\r
43 float g_pickup_respawntimejitter_powerup;
\r
48 float sv_foginterval;
\r
54 float bots_would_leave;
\r
55 float lms_lowest_lives;
\r
56 float lms_next_place;
\r
57 float LMS_NewPlayerLives();
\r
59 void UpdateFrags(entity player, float f);
\r
62 float team1_score, team2_score, team3_score, team4_score;
\r
69 .entity fakepredator;
\r
70 .float swallow_progress_prey, swallow_progress_pred;
\r
72 .float stomach_load, stomach_maxload;
\r
73 .float weapon_delay;
\r
75 .float stat_eaten, stat_stomachload, stat_stomachmaxload, stat_digesting, stat_canleave, stat_canswallow;
\r
76 .float dropweapon_check;
\r
80 .void(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) event_damage;
\r
100 .float cvar_cl_hitsound;
\r
102 .float pain_finished; //Added by Supajoe
\r
103 .float pain_frame; //"
\r
104 .float statdraintime; // record the one-second intervals between draining health and armour when they're over 100
\r
105 .float crouch; // Crouching or not?
\r
107 .float strength_finished;
\r
108 //.float speed_finished;
\r
109 .float invincible_finished;
\r
110 //.float slowmo_finished;
\r
112 .vector finaldest, finalangle; //plat.qc stuff
\r
115 .float t_length, t_width;
\r
117 .vector destvec; // for rain
\r
118 .float cnt; // for rain
\r
128 // player animation state
\r
129 .float animstate_startframe;
\r
130 .float animstate_numframes;
\r
131 .float animstate_framerate;
\r
132 .float animstate_starttime;
\r
133 .float animstate_endtime;
\r
134 .float animstate_override;
\r
135 .float animstate_looping;
\r
137 // player animation data for this model
\r
138 // each vector is as follows:
\r
142 .vector anim_die1; // player dies
\r
143 .vector anim_die2; // player dies differently
\r
144 .vector anim_draw; // player pulls out a weapon
\r
145 .vector anim_duck; // player crouches (from idle to duckidle)
\r
146 .vector anim_duckwalk; // player walking while crouching
\r
147 .vector anim_duckjump; // player jumping from a crouch
\r
148 .vector anim_duckidle; // player idling while crouching
\r
149 .vector anim_idle; // player standing
\r
150 .vector anim_jump; // player jump
\r
151 .vector anim_pain1; // player flinches from pain
\r
152 .vector anim_pain2; // player flinches from pain, differently
\r
153 .vector anim_shoot; // player shoots
\r
154 .vector anim_taunt; // player taunts others (FIXME: no code references this)
\r
155 .vector anim_run; // player running forward
\r
156 .vector anim_runbackwards; // player running backward
\r
157 .vector anim_strafeleft; // player shuffling left quickly
\r
158 .vector anim_straferight; // player shuffling right quickly
\r
159 .vector anim_dead1; // player dead (must be identical to last frame of die1)
\r
160 .vector anim_dead2; // player dead (must be identical to last frame of die2)
\r
161 .vector anim_forwardright; // player running forward and right
\r
162 .vector anim_forwardleft; // player running forward and left
\r
163 .vector anim_backright; // player running backward and right
\r
164 .vector anim_backleft; // player running back and left
\r
166 // weapon animation vectors:
\r
167 .vector anim_fire1;
\r
168 .vector anim_fire2;
\r
170 .vector anim_reload;
\r
172 void() player_setupanimsformodel;
\r
173 void setanim(entity e, vector anim, float looping, float override, float restart);
\r
177 .string playermodel;
\r
178 .string playerskin;
\r
182 .float respawntime;
\r
183 .float respawntimejitter;
\r
186 .float damageforcescale;
\r
192 // for railgun damage (hitting multiple enemies)
\r
194 .float railgunhitsolidbackup;
\r
195 .vector railgunhitloc;
\r
197 .float air_finished;
\r
201 .float hitsound, typehitsound;
\r
203 .float watersound_finished, digestsound_finished, gurglesound_finished;
\r
205 .vector oldvelocity;
\r
207 .float pauseregenhealth_finished;
\r
208 .float pauserothealth_finished;
\r
209 .float pauseregenarmor_finished;
\r
210 .float pauserotarmor_finished;
\r
211 .float pauserotfuel_finished;
\r
212 .string item_pickupsound;
\r
214 // definitions for weaponsystem
\r
216 .entity weaponentity;
\r
217 .entity exteriorweaponentity;
\r
218 .vector weaponentity_glowmod;
\r
219 .float switchweapon;
\r
221 float weapon_action(float wpn, float wrequest);
\r
222 float client_hasweapon(entity cl, float wpn, float andammo, float complain);
\r
225 // VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies)
\r
226 .float weapon_nextthink;
\r
227 .void() weapon_think;
\r
229 //float PLAYER_WEAPONSELECTION_DELAY = );
\r
230 float PLAYER_WEAPONSELECTION_SPEED = 18;
\r
231 vector PLAYER_WEAPONSELECTION_RANGE = '0 20 -40';
\r
233 // weapon states (self.weaponentity.state)
\r
234 float WS_CLEAR = 0; // no weapon selected
\r
235 float WS_RAISE = 1; // raise frame
\r
236 float WS_DROP = 2; // deselecting frame
\r
237 float WS_INUSE = 3; // fire state
\r
238 float WS_READY = 4; // idle frame
\r
241 float WR_SETUP = 1; // setup weapon data
\r
242 float WR_THINK = 2; // logic to run every frame
\r
243 float WR_CHECKAMMO1 = 3; // checks ammo for weapon
\r
244 float WR_CHECKAMMO2 = 4; // checks ammo for weapon
\r
245 float WR_AIM = 5; // runs bot aiming code for this weapon
\r
246 float WR_PRECACHE = 6; // precaches models/sounds used by this weapon
\r
247 float WR_SUICIDEMESSAGE = 7; // sets w_deathtypestring or leaves it alone (and may inspect w_deathtype for details)
\r
248 float WR_KILLMESSAGE = 8; // sets w_deathtypestring or leaves it alone
\r
249 float WR_RESETPLAYER = 9; // does not need to do anything
\r
250 float WR_RELOAD = 10; // used for reloading
\r
252 void weapon_defaultspawnfunc(float wpn);
\r
254 string w_deathtypestring;
\r
257 void(entity client, string s) centerprint_builtin = #73;
\r
258 .vector dest1, dest2;
\r
261 float intermission_running;
\r
262 float intermission_exittime;
\r
263 float alreadychangedlevel;
\r
265 .float welcomemessage_time;
\r
269 .float in_swamp; // bool
\r
270 .entity swampslug; // Uses this to release from swamp ("untouch" fix)
\r
272 // footstep interval
\r
276 #define RESTART_COUNTDOWN 10
\r
277 float restart_mapalreadyrestarted; //bool, indicates whether reset_map() was already executed
\r
278 entity restartTimer;
\r
279 void restartTimer_Think();
\r
280 float blockSpectators; //if set, new or existing spectators or observers will be removed unless they become a player within g_maxplayers_spectator_blocktime seconds
\r
281 .float spectatortime; //point in time since the client is spectating or observing
\r
282 void checkSpectatorBlock();
\r
287 float isJoinAllowed();
\r
288 #define PREVENT_JOIN_TEXT "^1You may not join the game at this time.\n\nThe player limit reached maximum capacity."
\r
290 //sv_timeout: pauses the game by setting the gamespeed to a really low value (see TIMEOUT_SLOWMO_VALUE)
\r
291 #define TIMEOUT_SLOWMO_VALUE 0.0001
\r
292 float sys_frametime; // gets initialised in worlspawn, saves the value from cvar("sys_ticrate")
\r
293 float remainingTimeoutTime; // contains the time in seconds that the active timeout has left
\r
294 float remainingLeadTime; // contains the number of seconds left of the leadtime (before the timeout starts)
\r
295 float timeoutStatus; // (values: 0, 1, 2) contains whether a timeout is not active (0), was called but still at leadtime (1) or is active (2)
\r
296 .float allowedTimeouts; // contains the number of allowed timeouts for each player
\r
297 entity timeoutInitiator; // contains the entity of the player who started the last timeout
\r
298 float orig_slowmo; // contains the value of cvar("slowmo") so that, after timeout finished, it isn't set to slowmo 1 necessarily
\r
299 .vector lastV_angle; //used when pausing the game in order to force the player to keep his old view angle fixed
\r
300 .vector leanangle_damage_loc, leanangle_damage_force; // used for leaning the player model
\r
301 entity timeoutHandler; //responsible for centerprinting the timeout countdowns and playing sounds
\r
302 void timeoutHandler_Think();
\r
303 void evaluateTimeout();
\r
304 void evaluateTimein();
\r
305 string getTimeoutText(float addOneSecond);
\r
307 .float spawnshieldtime;
\r
309 .float lms_nextcheck;
\r
310 .float lms_traveled_distance;
\r
312 .entity flagcarried;
\r
315 float playerid_last;
\r
316 .float noalign; // if set to 1, the item or spawnpoint won't be dropped to the floor
\r
318 .vector spawnorigin;
\r
320 .vector death_origin;
\r
321 .vector killer_origin;
\r
323 float default_player_alpha;
\r
324 float default_weapon_alpha;
\r
326 .float() customizeentityforclient;
\r
327 .float cvar_cl_handicap;
\r
328 .float cvar_cl_clippedspectating;
\r
329 .float cvar_scr_centertime;
\r
330 .float cvar_cl_shownames;
\r
331 .string cvar_g_voretournamentversion;
\r
332 .string cvar_cl_weaponpriority;
\r
333 .string cvar_cl_weaponpriorities[10];
\r
334 #ifdef ALLOW_FORCEMODELS
\r
335 .float cvar_cl_forceplayermodels;
\r
336 .float cvar_cl_forceplayermodelsfromvoretournament;
\r
337 float sv_clforceplayermodels;
\r
339 .float cvar_cl_gunalign;
\r
340 .float cvar_cl_noantilag;
\r
341 .float cvar_cl_vore_stomachmodel;
\r
342 .float cvar_cl_vore_swallowmodel;
\r
343 .float cvar_cl_vore_autodigest;
\r
344 .float cvar_chase_active;
\r
346 void Announce(string snd);
\r
347 void AnnounceTo(entity e, string snd);
\r
349 .float version_nagtime;
\r
353 #define NUM_JUMPPADSUSED 3
\r
354 .float jumppadcount;
\r
355 .entity jumppadsused[NUM_JUMPPADSUSED];
\r
357 string gamemode_name;
\r
358 float teams_matter;
\r
360 float startitem_failed;
\r
362 void DropFlag(entity flag, entity penalty_receiver, entity attacker);
\r
365 typedef .float floatfield;
\r
366 floatfield Item_CounterField(float it);
\r
368 float W_AmmoItemCode(float wpn);
\r
369 float W_WeaponBit(float wpn);
\r
370 string W_Name(float weaponid);
\r
372 void UpdateSelectedPlayer();
\r
373 void ClearSelectedPlayer();
\r
374 .entity selected_player;
\r
375 .entity last_selected_player;
\r
376 .float selected_player_time; // when this player has been selected
\r
377 .float selected_player_count; // how long this player has been directly pointed to
\r
378 .float selected_player_display_needs_update; // are regular updates necessary? (health)
\r
379 .float selected_player_display_timeout; // when the selection will time out
\r
381 void FixIntermissionClient(entity e);
\r
382 void FixClientCvars(entity e);
\r
384 float weaponsInMap;
\r
386 void centerprint_atprio(entity e, float prio, string s);
\r
387 void centerprint_expire(entity e, float prio);
\r
388 void centerprint(entity e, string s);
\r
390 .float respawn_countdown; // next number to count
\r
392 float bot_waypoints_for_items;
\r
394 .float attack_finished_for[WEP_MAXCOUNT];
\r
395 .float attack_finished_single;
\r
396 #ifdef INDEPENDENT_ATTACK_FINISHED
\r
397 #define ATTACK_FINISHED_FOR(ent,w) ((ent).(attack_finished_for[(w) - WEP_FIRST]))
\r
399 #define ATTACK_FINISHED_FOR(ent,w) ((ent).attack_finished_single)
\r
401 #define ATTACK_FINISHED(ent) ATTACK_FINISHED_FOR(ent,(ent).weapon)
\r
403 // assault game mode: Which team is attacking in this round?
\r
404 float assault_attacker_team;
\r
406 // speedrun: when 1, player auto teleports back when capture timeout happens
\r
407 .float speedrunning;
\r
414 float q3acompat_machineshotgunswap;
\r
417 float ServerProgsDB;
\r
422 float some_spawn_has_been_used;
\r
423 float have_team_spawns; // 0 = no team spawns requested, -1 = team spawns requested but none found, 1 = team spawns requested and found
\r
425 // set when showing a kill countdown
\r
426 .entity killindicator;
\r
427 .float killindicator_teamchange;
\r
429 void Damage (entity targ, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
\r
433 .float parm_idlesince;
\r
435 float sv_maxidle_spectatorsareidle;
\r
437 float sv_pogostick;
\r
438 float sv_doublejump;
\r
439 float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end);
\r
441 float next_pingtime;
\r
445 .float(entity to, float sendflags) SendEntity;
\r
447 // player sounds, voice messages
\r
448 // TODO implemented fall and falling
\r
449 #define ALLPLAYERSOUNDS \
\r
455 _VOICEMSG(swallow) \
\r
456 _VOICEMSG(digest) \
\r
457 _VOICEMSG(regurgitate) \
\r
458 _VOICEMSG(regurgitate_prepare) \
\r
459 _VOICEMSG(gurgle) \
\r
461 _VOICEMSG(pain25) \
\r
462 _VOICEMSG(pain50) \
\r
463 _VOICEMSG(pain75) \
\r
465 #define ALLVOICEMSGS \
\r
466 _VOICEMSG(attack) \
\r
467 _VOICEMSG(attackinfive) \
\r
469 _VOICEMSG(seenflag) \
\r
473 _VOICEMSG(teamshoot)
\r
475 #define _VOICEMSG(m) .string playersound_##m;
\r
480 // reserved sound names for the future (models lack sounds for them):
\r
481 // _VOICEMSG(affirmative) \
\r
482 // _VOICEMSG(attacking) \
\r
483 // _VOICEMSG(defending) \
\r
484 // _VOICEMSG(roaming) \
\r
485 // _VOICEMSG(onmyway) \
\r
486 // _VOICEMSG(droppedflag) \
\r
487 // _VOICEMSG(flagcarriertakingdamage) \
\r
488 // _VOICEMSG(negative) \
\r
489 // _VOICEMSG(seenenemy) \
\r
490 // _VOICEMSG(fall) \
\r
491 // _VOICEMSG(getflag) \
\r
492 // _VOICEMSG(incoming) \
\r
493 // _VOICEMSG(coverme) \
\r
494 // _VOICEMSG(needhelp) \
\r
495 // _VOICEMSG(defend) \
\r
496 // _VOICEMSG(freelance) \
\r
497 // _VOICEMSG(falling) \
\r
499 string globalsound_fall;
\r
500 string globalsound_metalfall;
\r
501 string globalsound_step;
\r
502 string globalsound_metalstep;
\r
504 #define VOICETYPE_PLAYERSOUND 10
\r
505 #define VOICETYPE_TEAMRADIO 11
\r
506 #define VOICETYPE_LASTATTACKER 12
\r
507 #define VOICETYPE_LASTATTACKER_ONLY 13
\r
508 #define VOICETYPE_AUTOTAUNT 14
\r
509 #define VOICETYPE_TAUNT 15
\r
510 #define VOICETYPE_GURGLE 16
\r
512 #define TAUNTTYPE_DEATH 1
\r
513 #define TAUNTTYPE_VOREPRED 2
\r
514 #define TAUNTTYPE_VOREPREY 3
\r
516 void PrecachePlayerSounds(string f);
\r
517 void PrecacheGlobalSound(string samplestring);
\r
518 void UpdatePlayerSounds();
\r
519 void ClearPlayerSounds();
\r
520 void PlayerSound(entity player, .string samplefield, float channel, float voicetype);
\r
521 void GlobalSound(string samplestring, float channel, float voicetype, float vol);
\r
522 void VoiceMessage(string type, string message);
\r
524 // autotaunt system
\r
525 .float cvar_cl_autotaunt;
\r
526 .float cvar_cl_voice_directional;
\r
527 .float cvar_cl_voice_directional_taunt_attenuation;
\r
529 .float version_mismatch;
\r
531 float independent_players;
\r
532 #define IS_INDEPENDENT_PLAYER(e) ((e).solid == SOLID_TRIGGER)
\r
533 #define MAKE_INDEPENDENT_PLAYER(e) (((e).solid = SOLID_TRIGGER) + ((e).frags = FRAGS_PLAYER_NONSOLID))
\r
534 // we're using + here instead of , because fteqcc sucks
\r
536 string clientstuff;
\r
539 .float pressedkeys;
\r
541 .float porto_forbidden;
\r
545 string cvar_changes;
\r
547 float game_starttime; //point in time when the countdown is over
\r
548 .float stat_game_starttime;
\r
550 .float projectiledeathtype;
\r
554 vector railgun_start, railgun_end; // filled by FireRailgunBullet, used by damage code for head shot
\r
555 .float stat_allow_oldnexbeam;
\r
557 void target_voicescript_next(entity pl);
\r
558 void target_voicescript_clear(entity pl);
\r
563 .float trigger_reverse;
\r
565 void SUB_DontUseTargets();
\r
566 void SUB_UseTargets();
\r
568 .void() reset; // if set, an entity is reset using this
\r
569 .void() reset2; // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
\r
571 void ClientData_Touch(entity e);
\r
573 vector debug_shotorg; // if non-zero, overrides the shot origin of all weapons
\r
576 #define BITXOR(v,b) ((v) + (b) - 2 * ((v) & (b)))
\r
577 #define BITXOR_ASSIGN(v,b) ((v) += ((b) - 2 * ((v) & (b))))
\r
581 float servertime, serverprevtime, serverframetime;
\r
583 .entity soundentity;
\r
587 .vector prevorigin;
\r
590 .float nickspamtime; // time of last nick change
\r
591 .float nickspamcount;
\r
592 .float floodcontrol_chat;
\r
593 .float floodcontrol_chatteam;
\r
594 .float floodcontrol_chattell;
\r
595 .float floodcontrol_voice;
\r
596 .float floodcontrol_voiceteam;
\r
598 .float stat_shotorg; // networked stat for trueaim HUD
\r
604 .float last_pickup;
\r
610 .float stats_hit[WEP_MAXCOUNT]; // for hitscan bullets hit
\r
611 .float stats_fired[WEP_MAXCOUNT]; // for hitscan bullets fired
\r
613 .float stat_sbring1_type, stat_sbring1_clip, stat_sbring2_type, stat_sbring2_clip;
\r
614 .float stat_crosshair_style;
\r
616 .float stat_leadlimit;
\r
619 float client_cefc_accumulator;
\r
620 float client_cefc_accumulatortime;
\r
623 ..float current_ammo;
\r
625 .float weapon_load[WEP_MAXCOUNT];
\r
627 .float old_clip_load;
\r
630 .float grabber_stunned;
\r
632 #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
\r
633 // #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_BBOX
\r
635 .float spectatee_status;
\r
637 .float bloodloss_timer;
\r
638 .float restriction;
\r
640 .entity clientdata;
\r
643 string deathmessage;
\r
645 .float just_joined;
\r
647 .float cvar_cl_accuracy_data_share;
\r
648 .float cvar_cl_accuracy_data_receive;
\r