]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/server/defs.qh
Nifreks lockonrestart feature. Used in team-based game modes. Once all players are...
[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
283 .float winning;
284 .float deaths;
285 .float jointime;
286
287 .float spawnshieldtime;
288
289 .float lms_nextcheck;
290 .float lms_traveled_distance;
291
292 .entity flagcarried;
293
294 .entity lastrocket;
295
296 .float playerid;
297 float playerid_last;
298 .float noalign;         // if set to 1, the item or spawnpoint won't be dropped to the floor
299
300 .vector spawnorigin;
301
302 .vector death_origin;
303 .vector killer_origin;
304
305 .float isdecor;
306
307 float default_player_alpha;
308 float default_weapon_alpha;
309
310 .float has_zoomed;
311
312 .float() customizeentityforclient;
313 .float cvar_cl_handicap;
314 .float cvar_cl_zoomfactor;
315 .float cvar_cl_zoomspeed;
316 .float cvar_cl_playerdetailreduction;
317 .float cvar_cl_nogibs;
318 .float cvar_scr_centertime;
319 .float cvar_cl_shownames;
320 .float cvar_cl_hidewaypoints;
321 .string cvar_g_nexuizversion;
322
323 .float version_nagtime;
324
325 #ifdef ALLOW_VARIABLE_LOD
326 .float modelindex_lod0;
327 .float modelindex_lod1;
328 .float modelindex_lod2;
329 #endif
330
331 #define NUM_JUMPPADSUSED 3
332 .float jumppadcount;
333 .entity jumppadsused[NUM_JUMPPADSUSED];
334
335 string gamemode_name;
336 float teams_matter;
337
338 float startitem_failed;
339
340 void DropFlag(entity flag);
341 void DropAllRunes(entity pl);
342
343
344 typedef .float floatfield;
345 floatfield Item_CounterField(float it);
346 float Item_WeaponCode(float it);
347 void Item_SpawnByItemCode(float it);
348
349 float W_AmmoItemCode(float wpn);
350 float W_ItemCode(float wpn);
351 string W_Name(float weaponid);
352
353 void UpdateSelectedPlayer();
354 void ClearSelectedPlayer();
355 .entity selected_player;
356 .entity last_selected_player;
357 .float selected_player_time; // when this player has been selected
358 .float selected_player_count; // how long this player has been directly pointed to
359 .float selected_player_display_needs_update; // are regular updates necessary? (health)
360 .float selected_player_display_timeout; // when the selection will time out
361
362 void FixIntermissionClient(entity e);
363 void FixClientCvars(entity e);
364
365 float itemsInMap;
366
367 void centerprint_atprio(entity e, float prio, string s);
368 void centerprint_expire(entity e, float prio);
369 void centerprint(entity e, string s);
370
371 .float respawn_countdown; // next number to count
372
373 float bot_waypoints_for_items;
374
375 .float  attack_finished_for[WEP_LAST + 1];
376 .float attack_finished_single;
377 #define ATTACK_FINISHED(ent) ((ent).(attack_finished_for[(ent).weapon]))
378
379 // assault game mode: Which team is attacking in this round?
380 float assault_attacker_team;
381
382 // speedrun: when 1, player auto teleports back when capture timeout happens
383 .float speedrunning;
384
385 // Q3 support
386 .float notteam;
387 .float notsingle;
388 .float notfree;
389 .float notq3a;
390 float q3acompat_machineshotgunswap;
391
392 // database
393 float ServerProgsDB;
394
395 .float team_saved;
396
397 float some_spawn_has_been_used;
398 float have_team_spawns;
399
400 // set when showing a kill countdown
401 .entity killindicator;
402 .float killindicator_teamchange;
403
404 void Damage (entity targ, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
405
406 float lockteams;