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