]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/server/defs.qh
make sv_gentle a global variable, read in the same fashion as sv_cheats. It thus...
[divverent/nexuiz.git] / data / qcsrc / server / defs.qh
1 #define MAPINFO
2 float require_spawnfunc_prefix; // if this float exists, only functions with spawnfunc_ name prefix qualify as spawn functions
3
4 // Globals
5
6 float g_domination, g_ctf, g_tdm, g_keyhunt, g_onslaught, g_assault, g_arena, g_lms, g_runematch;
7 float g_cloaked, g_footsteps, g_grappling_hook, g_instagib, g_laserguided_missile, g_midair, g_minstagib, g_nixnex, g_nixnex_with_laser, g_norecoil, g_rocketarena, g_vampire, g_minstagib_invis_alpha;
8 float g_tourney;
9 float tourneyInMatchStage;
10
11 float sv_cheats;
12 float sv_gentle;
13 float sv_foginterval;
14
15 entity  activator;
16 string  string_null;
17
18 float player_count;
19 float currentbots;
20 float bots_would_leave;
21 float lms_lowest_lives;
22 float lms_next_place;
23 float() LMS_NewPlayerLives;
24
25 void(entity player, float f) UpdateFrags;
26 .float totalfrags;
27
28 float team1_score, team2_score, team3_score, team4_score;
29
30 float maxclients;
31
32 #define NEWLINES "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
33
34 // Fields
35
36 .void(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) event_damage;
37
38 //.string       wad;
39 //.string       map;
40
41 //.float        worldtype;
42 .float  delay;
43 .float  wait;
44 .float  lip;
45 //.float        light_lev;
46 .float  speed;
47 //.float        style;
48 //.float        skill;
49 .float  sounds;
50
51 .string killtarget;
52
53 .vector pos1, pos2;
54 .vector mangle;
55
56 .float  pain_finished;                  //Added by Supajoe
57 .float  pain_frame;                     //"
58 .float  statdraintime;                  // record the one-second intervals between draining health and armour when they're over 100
59 .float  crouch; // Crouching or not?
60
61 .float  strength_finished;
62 //.float        speed_finished;
63 .float  invincible_finished;
64 //.float        slowmo_finished;
65
66 .vector         finaldest, finalangle;          //plat.qc stuff
67 .void()         think1;
68 .float state;
69 .float          t_length, t_width;
70
71 .vector destvec;                // for rain
72 .float cnt;             // for rain
73 .float count;
74 //.float cnt2;
75
76 .float play_time;
77 .float death_time;
78 .float dead_frame;
79 .float fade_time;
80 .float fade_rate;
81
82 // player animation state
83 .float animstate_startframe;
84 .float animstate_numframes;
85 .float animstate_framerate;
86 .float animstate_starttime;
87 .float animstate_endtime;
88 .float animstate_override;
89 .float animstate_looping;
90
91 // player animation data for this model
92 // each vector is as follows:
93 // _x = startframe
94 // _y = numframes
95 // _z = framerate
96 .vector anim_die1; // player dies
97 .vector anim_die2; // player dies differently
98 .vector anim_draw; // player pulls out a weapon
99 .vector anim_duck; // player crouches (from idle to duckidle)
100 .vector anim_duckwalk; // player walking while crouching
101 .vector anim_duckjump; // player jumping from a crouch
102 .vector anim_duckidle; // player idling while crouching
103 .vector anim_idle; // player standing
104 .vector anim_jump; // player jump
105 .vector anim_pain1; // player flinches from pain
106 .vector anim_pain2; // player flinches from pain, differently
107 .vector anim_shoot; // player shoots
108 .vector anim_taunt; // player taunts others (FIXME: no code references this)
109 .vector anim_run; // player running forward
110 .vector anim_runbackwards; // player running backward
111 .vector anim_strafeleft; // player shuffling left quickly
112 .vector anim_straferight; // player shuffling right quickly
113 .vector anim_dead1; // player dead (must be identical to last frame of die1)
114 .vector anim_dead2; // player dead (must be identical to last frame of die2)
115 .vector anim_forwardright; // player running forward and right
116 .vector anim_forwardleft; // player running forward and left
117 .vector anim_backright; // player running backward and right
118 .vector anim_backleft; // player running back and left
119
120 void() player_setupanimsformodel;
121 void(vector anim, float looping, float override, float restart) player_setanim;
122
123 .string mdl;
124
125 .string playermodel;
126 .string playerskin;
127
128 .float  respawntime;
129 //.float        chasecam;
130
131 .float  damageforcescale;
132
133 //.float          gravity;
134
135 .float          dmg;
136
137 // for railgun damage (hitting multiple enemies)
138 .float railgunhit;
139 .float railgunhitsolidbackup;
140 .vector railgunhitloc;
141
142 .float          air_finished;
143 .float          dmgtime;
144
145 .float          killcount;
146 .float hitsound;
147
148 .float watersound_finished;
149 .float iscreature;
150 .vector oldvelocity;
151
152 .float pauseregen_finished;
153 .float pauserothealth_finished;
154 .float pauserotarmor_finished;
155 .string item_pickupsound;
156
157 // definitions for weaponsystem
158
159 .entity weaponentity;
160 .entity exteriorweaponentity;
161 .float switchweapon;
162 .float autoswitch;
163 float(float wpn, float wrequest) weapon_action;
164 float(entity cl, float wpn, float andammo, float complain) client_hasweapon;
165 void() w_clear;
166 void() w_ready;
167 // VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies)
168 .float weapon_nextthink;
169 .void() weapon_think;
170
171 //float PLAYER_WEAPONSELECTION_DELAY = );
172 float   PLAYER_WEAPONSELECTION_SPEED = 18;
173 vector  PLAYER_WEAPONSELECTION_RANGE = '0 20 -40';
174
175 // weapon states (self.weaponentity.state)
176 float WS_CLEAR                  = 0; // no weapon selected
177 float WS_RAISE                  = 1; // raise frame
178 float WS_DROP                   = 2; // deselecting frame
179 float WS_INUSE                  = 3; // fire state
180 float WS_READY                  = 4; // idle frame
181
182 // weapon requests
183 float WR_SETUP            = 1; // setup weapon data
184 float WR_THINK            = 2; // logic to run every frame
185 float WR_CHECKAMMO1       = 3; // checks ammo for weapon
186 float WR_CHECKAMMO2       = 4; // checks ammo for weapon
187 float WR_AIM              = 5; // runs bot aiming code for this weapon
188 float WR_PRECACHE         = 6; // precaches models/sounds used by this weapon
189 float WR_REGISTER         = 7; // send data about the weapon to the client self (for ClientConnect)
190
191 // Weapon indexes
192 float WEP_LASER                         = 1; // float   IT_LASER                                = 4096;
193 float WEP_SHOTGUN                       = 2; // float   IT_SHOTGUN                              = 1;
194 float WEP_UZI                           = 3; // float   IT_UZI                                  = 2;
195 float WEP_GRENADE_LAUNCHER      = 4; // float   IT_GRENADE_LAUNCHER             = 4;
196 float WEP_ELECTRO                       = 5; // float   IT_ELECTRO                              = 8;
197 float WEP_CRYLINK                       = 6; // float   IT_CRYLINK                              = 16;
198 float WEP_NEX                           = 7; // float   IT_NEX                                  = 32;
199 float WEP_HAGAR                         = 8; // float   IT_HAGAR                                = 64;
200 float WEP_ROCKET_LAUNCHER       = 9; // float   IT_ROCKET_LAUNCHER              = 128;
201
202 // For weapon cycling commands
203 float WEP_FIRST                         = 1;
204 float WEP_LAST                          = 9;
205
206 void(entity client, string s)   stuffcmd = #21;
207 void(entity client, string s)   sprint = #24;
208 vector(entity e, float sped)    aim = #44;
209 void(entity client, string s)   centerprint_builtin = #73;
210 void(entity e)                  setspawnparms = #78;
211 void(float to, float f)         WriteByte = #52;
212 void(float to, float f)         WriteChar = #53;
213 void(float to, float f)         WriteShort = #54;
214 void(float to, float f)         WriteLong = #55;
215 void(float to, float f)         WriteCoord = #56;
216 void(float to, float f)         WriteAngle = #57;
217 void(float to, string s)        WriteString     = #58;
218 void(float to, entity s)        WriteEntity     = #59;
219 .vector dest1, dest2;
220
221 float gameover;
222 float intermission_running;
223 float intermission_exittime;
224 float alreadychangedlevel;
225
226
227 .float runes;
228
229
230 .float welcomemessage_time;
231 .float version;
232
233 // esteel's voting
234 float votecalled;
235 string votecalledvote;
236 string votecalledvote_display;
237 float votecalledmaster;
238 entity votecaller;
239 float votefinished;
240 .float vote_master;
241 .float vote_next;
242 .float vote_vote;
243 void VoteThink();
244 string VoteParse();
245 float VoteAllowed(string vote);
246 void VoteReset();
247 void VoteAccept();
248 void VoteReject();
249 void VoteTimeout();
250 void VoteStop(entity stopper);
251 void VoteCount();
252
253 // Wazat's grappling hook
254 .entity         hook;
255 void GrapplingHookFrame();
256 void RemoveGrapplingHook(entity pl);
257 void SetGrappleHookBindings();
258 // hook impulses
259 float GRAPHOOK_FIRE             = 20;
260 float GRAPHOOK_RELEASE          = 21;
261 // (note: you can change the hook impulse #'s to whatever you please)
262 .float hook_time;
263
264 // Laser target for laser-guided weapons
265 .entity lasertarget;
266 .float laser_on;
267
268 // minstagib vars
269 .float jump_interval;    // laser refire
270
271 //swamp
272 .float in_swamp;              // bool
273 .entity swampslug;            // Uses this to release from swamp ("untouch" fix)
274
275 // footstep interval
276 .float nextstep;
277
278 .float ready;
279 #define RESTART_COUNTDOWN 10
280 float restart_countdown; //point in time when the countdown is over
281 float restart_mapalreadyrestarted; //bool, indicates whether reset_map() was already executed
282 entity restartAnnouncer; //a temporary entity which will play the countdown sounds 3, 2, 1 for all clients, will also reset the map after the countdown
283 void restartAnnouncer_Think();
284 entity readyNagger; //manages printing the ready-nag to active players who are not ready yet
285 void readyNagger_Think();
286 float readyNagActive; //if set to 1, the readyNagger entity was already spawned (boolean)
287 float blockSpectators; //if set, new or existing spectators or observers will be removed unless they become a player within g_maxplayers_spectator_blocktime seconds
288 .float spectatortime; //point in time since the client is spectating or observing
289 void checkSpectatorBlock();
290 float timelimit_orig;
291
292 .float winning;
293 .float deaths;
294 .float jointime;
295
296 float isJoinAllowed();
297 #define PREVENT_JOIN_TEXT "^1You may not join the game at this time.\n\nThe player limit reached maximum capacity."
298
299 //sv_timeout: pauses the game by setting the gamespeed to a really low value (see TIMEOUT_SLOWMO_VALUE)
300 #define TIMEOUT_SLOWMO_VALUE 0.0001
301 float sys_ticrate; // gets initialised in worlspawn, saves the value from cvar("sys_ticrate")
302 float remainingTimeoutTime; // contains the time in seconds that the active timeout has left
303 float remainingLeadTime; // contains the number of seconds left of the leadtime (before the timeout starts)
304 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)
305 .float allowedTimeouts; // contains the number of allowed timeouts for each player
306 entity timeoutInitiator; // contains the entity of the player who started the last timeout
307 float orig_slowmo; // contains the value of cvar("slowmo") so that, after timeout finished, it isn't set to slowmo 1 necessarily
308 .vector lastV_angle; //used when pausing the game in order to force the player to keep his old view angle fixed
309 entity timeoutHandler; //responsible for centerprinting the timeout countdowns and playing sounds
310 void timeoutHandler_Think();
311 void evaluateTimeoutCall();
312 void evaluateResumeGame();
313 string getTimeoutText(float addOneSecond);
314
315 .float spawnshieldtime;
316
317 .float lms_nextcheck;
318 .float lms_traveled_distance;
319
320 .entity flagcarried;
321
322 .entity lastrocket;
323
324 .float playerid;
325 float playerid_last;
326 .float noalign;         // if set to 1, the item or spawnpoint won't be dropped to the floor
327
328 .vector spawnorigin;
329
330 .vector death_origin;
331 .vector killer_origin;
332
333 .float isdecor;
334
335 float default_player_alpha;
336 float default_weapon_alpha;
337
338 .float has_zoomed;
339
340 .float() customizeentityforclient;
341 .float cvar_cl_handicap;
342 .float cvar_cl_zoomfactor;
343 .float cvar_cl_zoomspeed;
344 .float cvar_cl_playerdetailreduction;
345 .float cvar_cl_nogibs;
346 .float cvar_scr_centertime;
347 .float cvar_cl_shownames;
348 .float cvar_cl_hidewaypoints;
349 .string cvar_g_nexuizversion;
350
351 .float version_nagtime;
352
353 #ifdef ALLOW_VARIABLE_LOD
354 .float modelindex_lod0;
355 .float modelindex_lod1;
356 .float modelindex_lod2;
357 #endif
358
359 #define NUM_JUMPPADSUSED 3
360 .float jumppadcount;
361 .entity jumppadsused[NUM_JUMPPADSUSED];
362
363 string gamemode_name;
364 float teams_matter;
365
366 float startitem_failed;
367
368 void DropFlag(entity flag);
369 void DropAllRunes(entity pl);
370
371
372 typedef .float floatfield;
373 floatfield Item_CounterField(float it);
374 float Item_WeaponCode(float it);
375 void Item_SpawnByItemCode(float it);
376
377 float W_AmmoItemCode(float wpn);
378 float W_ItemCode(float wpn);
379 string W_Name(float weaponid);
380
381 void UpdateSelectedPlayer();
382 void ClearSelectedPlayer();
383 .entity selected_player;
384 .entity last_selected_player;
385 .float selected_player_time; // when this player has been selected
386 .float selected_player_count; // how long this player has been directly pointed to
387 .float selected_player_display_needs_update; // are regular updates necessary? (health)
388 .float selected_player_display_timeout; // when the selection will time out
389
390 void FixIntermissionClient(entity e);
391 void FixClientCvars(entity e);
392
393 float itemsInMap;
394
395 void centerprint_atprio(entity e, float prio, string s);
396 void centerprint_expire(entity e, float prio);
397 void centerprint(entity e, string s);
398
399 .float respawn_countdown; // next number to count
400
401 float bot_waypoints_for_items;
402
403 .float  attack_finished_for[WEP_LAST + 1];
404 .float attack_finished_single;
405 #define ATTACK_FINISHED(ent) ((ent).(attack_finished_for[(ent).weapon]))
406
407 // assault game mode: Which team is attacking in this round?
408 float assault_attacker_team;
409
410 // speedrun: when 1, player auto teleports back when capture timeout happens
411 .float speedrunning;
412
413 // Q3 support
414 .float notteam;
415 .float notsingle;
416 .float notfree;
417 .float notq3a;
418 float q3acompat_machineshotgunswap;
419
420 // database
421 float ServerProgsDB;
422
423 .float team_saved;
424
425 float some_spawn_has_been_used;
426 float have_team_spawns;
427
428 // set when showing a kill countdown
429 .entity killindicator;
430 .float killindicator_teamchange;
431
432 void Damage (entity targ, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
433
434 float lockteams;