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