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