]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/server/defs.qh
make the minstagib Nex a separate weapon
[divverent/nexuiz.git] / data / qcsrc / server / defs.qh
1 #define INDEPENDENT_ATTACK_FINISHED
2
3 float require_spawnfunc_prefix; // if this float exists, only functions with spawnfunc_ name prefix qualify as spawn functions
4
5 #define BUTTON_ATCK   button0
6 #define BUTTON_JUMP   button2
7 #define BUTTON_ATCK2  button3
8 #define BUTTON_ZOOM   button4
9 #define BUTTON_CROUCH button5
10 #define BUTTON_HOOK   button6
11 #define BUTTON_INFO   button7
12 #define BUTTON_CHAT   buttonchat
13 #define BUTTON_USE    buttonuse
14
15 #define VOL_BASE 0.7
16
17 // Globals
18
19 float g_dm, g_domination, g_ctf, g_tdm, g_keyhunt, g_onslaught, g_assault, g_arena, g_lms, g_runematch, g_race;
20 float g_cloaked, g_footsteps, g_jump_grunt, g_grappling_hook, g_laserguided_missile, g_midair, g_minstagib, g_nixnex, g_nixnex_with_laser, g_norecoil, g_rocketarena, g_vampire, g_minstagib_invis_alpha;
21 float g_tourney;
22 float g_ctf_win_mode;
23 float g_race_qualifying;
24 float tourneyInMatchStage;
25
26 float sv_cheats;
27 float sv_gentle;
28 float sv_foginterval;
29
30 entity  activator;
31 string  string_null;
32 const var void(void)    func_null;
33
34 float player_count;
35 float currentbots;
36 float bots_would_leave;
37 float lms_lowest_lives;
38 float lms_next_place;
39 float LMS_NewPlayerLives();
40
41 void UpdateFrags(entity player, float f);
42 .float totalfrags;
43
44 float team1_score, team2_score, team3_score, team4_score;
45
46 float maxclients;
47
48 #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"
49
50 // Fields
51
52 .void(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) event_damage;
53
54 //.string       wad;
55 //.string       map;
56
57 //.float        worldtype;
58 .float  delay;
59 .float  wait;
60 .float  lip;
61 //.float        light_lev;
62 .float  speed;
63 //.float        style;
64 //.float        skill;
65 .float  sounds;
66
67 .string killtarget;
68
69 .vector pos1, pos2;
70 .vector mangle;
71
72 .float  pain_finished;                  //Added by Supajoe
73 .float  pain_frame;                     //"
74 .float  statdraintime;                  // record the one-second intervals between draining health and armour when they're over 100
75 .float  crouch; // Crouching or not?
76
77 .float  strength_finished;
78 //.float        speed_finished;
79 .float  invincible_finished;
80 //.float        slowmo_finished;
81
82 .vector         finaldest, finalangle;          //plat.qc stuff
83 .void()         think1;
84 .float state;
85 .float          t_length, t_width;
86
87 .vector destvec;                // for rain
88 .float cnt;             // for rain
89 .float count;
90 //.float cnt2;
91
92 .float play_time;
93 .float death_time;
94 .float dead_frame;
95 .float fade_time;
96 .float fade_rate;
97
98 // player animation state
99 .float animstate_startframe;
100 .float animstate_numframes;
101 .float animstate_framerate;
102 .float animstate_starttime;
103 .float animstate_endtime;
104 .float animstate_override;
105 .float animstate_looping;
106
107 // player animation data for this model
108 // each vector is as follows:
109 // _x = startframe
110 // _y = numframes
111 // _z = framerate
112 .vector anim_die1; // player dies
113 .vector anim_die2; // player dies differently
114 .vector anim_draw; // player pulls out a weapon
115 .vector anim_duck; // player crouches (from idle to duckidle)
116 .vector anim_duckwalk; // player walking while crouching
117 .vector anim_duckjump; // player jumping from a crouch
118 .vector anim_duckidle; // player idling while crouching
119 .vector anim_idle; // player standing
120 .vector anim_jump; // player jump
121 .vector anim_pain1; // player flinches from pain
122 .vector anim_pain2; // player flinches from pain, differently
123 .vector anim_shoot; // player shoots
124 .vector anim_taunt; // player taunts others (FIXME: no code references this)
125 .vector anim_run; // player running forward
126 .vector anim_runbackwards; // player running backward
127 .vector anim_strafeleft; // player shuffling left quickly
128 .vector anim_straferight; // player shuffling right quickly
129 .vector anim_dead1; // player dead (must be identical to last frame of die1)
130 .vector anim_dead2; // player dead (must be identical to last frame of die2)
131 .vector anim_forwardright; // player running forward and right
132 .vector anim_forwardleft; // player running forward and left
133 .vector anim_backright; // player running backward and right
134 .vector anim_backleft; // player running back and left
135
136 void() player_setupanimsformodel;
137 void player_setanim(vector anim, float looping, float override, float restart);
138
139 .string mdl;
140
141 .string playermodel;
142 .string playerskin;
143
144 .float  respawntime;
145 //.float        chasecam;
146
147 .float  damageforcescale;
148
149 //.float          gravity;
150
151 .float          dmg;
152
153 // for railgun damage (hitting multiple enemies)
154 .float railgunhit;
155 .float railgunhitsolidbackup;
156 .vector railgunhitloc;
157
158 .float          air_finished;
159 .float          dmgtime;
160
161 .float          killcount;
162 .float hitsound;
163
164 .float watersound_finished;
165 .float iscreature;
166 .vector oldvelocity;
167
168 .float pauseregen_finished;
169 .float pauserothealth_finished;
170 .float pauserotarmor_finished;
171 .string item_pickupsound;
172
173 // definitions for weaponsystem
174
175 .entity weaponentity;
176 .entity exteriorweaponentity;
177 .float switchweapon;
178 .float autoswitch;
179 float weapon_action(float wpn, float wrequest);
180 float client_hasweapon(entity cl, float wpn, float andammo, float complain);
181 void w_clear();
182 void w_ready();
183 // VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies)
184 .float weapon_nextthink;
185 .void() weapon_think;
186
187 //float PLAYER_WEAPONSELECTION_DELAY = );
188 float   PLAYER_WEAPONSELECTION_SPEED = 18;
189 vector  PLAYER_WEAPONSELECTION_RANGE = '0 20 -40';
190
191 // weapon states (self.weaponentity.state)
192 float WS_CLEAR                  = 0; // no weapon selected
193 float WS_RAISE                  = 1; // raise frame
194 float WS_DROP                   = 2; // deselecting frame
195 float WS_INUSE                  = 3; // fire state
196 float WS_READY                  = 4; // idle frame
197
198 // weapon requests
199 float WR_SETUP              = 1; // setup weapon data
200 float WR_THINK              = 2; // logic to run every frame
201 float WR_CHECKAMMO1         = 3; // checks ammo for weapon
202 float WR_CHECKAMMO2         = 4; // checks ammo for weapon
203 float WR_AIM                = 5; // runs bot aiming code for this weapon
204 float WR_PRECACHE           = 6; // precaches models/sounds used by this weapon
205 float WR_SUICIDEMESSAGE = 7; // sets w_deathtypestring or leaves it alone
206 float WR_KILLMESSAGE    = 8; // sets w_deathtypestring or leaves it alone
207 float WR_SPAWNFUNC      = 9; // calls the spawn function (which just needs to call weapon_defaultspawnfunc)
208
209 void weapon_defaultspawnfunc(float wpn, float weight);
210
211 string w_deathtypestring;
212
213 void(entity client, string s) centerprint_builtin = #73;
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 float timelimit_orig;
286
287 .float winning;
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
293 //sv_timeout: pauses the game by setting the gamespeed to a really low value (see TIMEOUT_SLOWMO_VALUE)
294 #define TIMEOUT_SLOWMO_VALUE 0.0001
295 float sys_ticrate; // gets initialised in worlspawn, saves the value from cvar("sys_ticrate")
296 float remainingTimeoutTime; // contains the time in seconds that the active timeout has left
297 float remainingLeadTime; // contains the number of seconds left of the leadtime (before the timeout starts)
298 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)
299 .float allowedTimeouts; // contains the number of allowed timeouts for each player
300 entity timeoutInitiator; // contains the entity of the player who started the last timeout
301 float orig_slowmo; // contains the value of cvar("slowmo") so that, after timeout finished, it isn't set to slowmo 1 necessarily
302 .vector lastV_angle; //used when pausing the game in order to force the player to keep his old view angle fixed
303 entity timeoutHandler; //responsible for centerprinting the timeout countdowns and playing sounds
304 void timeoutHandler_Think();
305 void evaluateTimeoutCall();
306 void evaluateResumeGame();
307 string getTimeoutText(float addOneSecond);
308
309 .float spawnshieldtime;
310
311 .float lms_nextcheck;
312 .float lms_traveled_distance;
313
314 .entity flagcarried;
315
316 .entity lastrocket;
317
318 .float playerid;
319 float playerid_last;
320 .float noalign;         // if set to 1, the item or spawnpoint won't be dropped to the floor
321
322 .vector spawnorigin;
323
324 .vector death_origin;
325 .vector killer_origin;
326
327 .float isdecor;
328
329 float default_player_alpha;
330 float default_weapon_alpha;
331
332 .float() customizeentityforclient;
333 .float cvar_cl_handicap;
334 .float cvar_cl_playerdetailreduction;
335 .float cvar_cl_nogibs;
336 .float cvar_scr_centertime;
337 .float cvar_cl_shownames;
338 .float cvar_cl_hidewaypoints;
339 .string cvar_g_nexuizversion;
340 .string cvar_cl_weaponpriority;
341 .string cvar_cl_weaponpriorities[10];
342
343 .float version_nagtime;
344
345 #ifdef ALLOW_VARIABLE_LOD
346 .float modelindex_lod0;
347 .float modelindex_lod1;
348 .float modelindex_lod2;
349 #endif
350
351 #define NUM_JUMPPADSUSED 3
352 .float jumppadcount;
353 .entity jumppadsused[NUM_JUMPPADSUSED];
354
355 string gamemode_name;
356 float teams_matter;
357
358 float startitem_failed;
359
360 void DropFlag(entity flag);
361 void DropAllRunes(entity pl);
362
363
364 typedef .float floatfield;
365 floatfield Item_CounterField(float it);
366 void Item_SpawnByWeaponCode(float it);
367
368 float W_AmmoItemCode(float wpn);
369 float W_WeaponBit(float wpn);
370 string W_Name(float weaponid);
371
372 void UpdateSelectedPlayer();
373 void ClearSelectedPlayer();
374 .entity selected_player;
375 .entity last_selected_player;
376 .float selected_player_time; // when this player has been selected
377 .float selected_player_count; // how long this player has been directly pointed to
378 .float selected_player_display_needs_update; // are regular updates necessary? (health)
379 .float selected_player_display_timeout; // when the selection will time out
380
381 void FixIntermissionClient(entity e);
382 void FixClientCvars(entity e);
383
384 float weaponsInMap;
385
386 void centerprint_atprio(entity e, float prio, string s);
387 void centerprint_expire(entity e, float prio);
388 void centerprint(entity e, string s);
389
390 .float respawn_countdown; // next number to count
391
392 float bot_waypoints_for_items;
393
394 .float  attack_finished_for[WEP_COUNT];
395 .float attack_finished_single;
396 #ifdef INDEPENDENT_ATTACK_FINISHED
397 #define ATTACK_FINISHED(ent) ((ent).(attack_finished_for[(ent).weapon]))
398 #else
399 #define ATTACK_FINISHED(ent) ((ent).attack_finished_single)
400 #endif
401
402 // assault game mode: Which team is attacking in this round?
403 float assault_attacker_team;
404
405 // speedrun: when 1, player auto teleports back when capture timeout happens
406 .float speedrunning;
407
408 // Q3 support
409 .float notteam;
410 .float notsingle;
411 .float notfree;
412 .float notq3a;
413 float q3acompat_machineshotgunswap;
414
415 // database
416 float ServerProgsDB;
417
418 .float team_saved;
419
420 float some_spawn_has_been_used;
421 float have_team_spawns;
422
423 // set when showing a kill countdown
424 .entity killindicator;
425 .float killindicator_teamchange;
426
427 void Damage (entity targ, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
428
429 float lockteams;
430
431 .float parm_idlesince;
432 float sv_maxidle;
433 float sv_maxidle_spectatorsareidle;
434
435 float sv_pogostick;
436 float sv_doublejump;
437 float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end);
438
439 float next_pingtime;
440
441 .float Version;
442 .float SendFlags;
443 .float(entity to, float sendflags) SendEntity;
444
445 // player sounds, voice messages
446 .string playersound_attack;
447 .string playersound_attackinfive;
448 .string playersound_coverme;
449 .string playersound_defend;
450 .string playersound_freelance;
451 .string playersound_incoming;
452 .string playersound_meet;
453 .string playersound_needhelp;
454 .string playersound_seenflag;
455 .string playersound_taunt;
456 .string playersound_teamshoot;
457 .string playersound_death;
458 .string playersound_drown;
459 .string playersound_falling; // not yet implemented, FIXME
460 .string playersound_gasp;
461 .string playersound_jump;
462 .string playersound_pain25;
463 .string playersound_pain50;
464 .string playersound_pain75;
465 .string playersound_pain100;
466 string globalsound_fall;
467 string globalsound_metalfall;
468 string globalsound_step;
469 string globalsound_metalstep;
470 void PrecachePlayerSounds(string f);
471 void PrecacheGlobalSound(string samplestring);
472 void UpdatePlayerSounds();
473 void ClearPlayerSounds();
474 void PlayerSound(.string samplefield, float channel, float teamsay); // 0 is normal, 1 is team, 2 is last attacker
475 void GlobalSound(string samplestring, float channel, float teamsay); // 0 is normal, 1 is team, 2 is last attacker
476 void VoiceMessage(string type);
477
478 .float version_mismatch;
479
480 float independent_players;
481 #define IS_INDEPENDENT_PLAYER(e) ((e).solid == SOLID_TRIGGER)
482 #define MAKE_INDEPENDENT_PLAYER(e) ((e).solid = SOLID_TRIGGER)
483
484 string clientstuff;
485 .float stat_sys_ticrate;
486 .float phase;
487 .float weapons;