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