add a nice patch from esteel to fix the rapid weapon switching "NexMG"
[divverent/nexuiz.git] / data / qcsrc / server / defs.qh
1
2 // Globals
3
4 entity  activator;
5 string  string_null;
6
7 float player_count;
8 float lms_dead_count;
9 float lms_lowest_lives;
10 float lms_next_place;
11
12 float team1_score, team2_score, team3_score, team4_score;
13
14 float maxclients;
15
16 string 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";
17
18 // Fields
19
20 .void(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) event_damage;
21
22 //.string       wad;
23 //.string       map;
24
25 // is this client a remote administrator?
26 .float adminstatus;
27
28 //.float        worldtype;
29 .float  delay;
30 .float  wait;
31 .float  lip;
32 //.float        light_lev;
33 .float  speed;
34 //.float        style;
35 //.float        skill;
36 .float  sounds;
37
38 .string killtarget;
39
40 .vector pos1, pos2;
41 .vector mangle;
42
43 .float  attack_finished;
44 .float  attack_finished_old;
45 .float  pain_finished;                  //Added by Supajoe
46 .float  pain_frame;                     //"
47 .float  statdraintime;                  // record the one-second intervals between draining health and armour when they're over 100
48 .float  crouch; // Crouching or not?
49
50 .float  strength_finished;
51 //.float        speed_finished;
52 .float  invincible_finished;
53 //.float        slowmo_finished;
54
55 .vector         finaldest, finalangle;          //plat.qc stuff
56 .void()         think1;
57 .float state;
58 .float          t_length, t_width;
59
60 .vector destvec;                // for rain
61 .float cnt;             // for rain
62 .float count;
63 //.float cnt2;
64
65 .float death_time;
66 .float dead_time;
67 .float dead_frame;
68 .float die_frame;
69 .float fade_time;
70 .float fade_rate;
71
72 .string mdl;
73
74 .string playermodel;
75 .string playerskin;
76
77 .float  respawntime;
78 //.float        chasecam;
79
80 .float  damageforcescale;
81
82 //.float          gravity;
83
84 .float          dmg;
85
86 // for railgun damage (hitting multiple enemies)
87 .float railgunhit;
88 .float railgunhitsolidbackup;
89 .vector railgunhitloc;
90
91 .float          air_finished;
92 .float          dmgtime;
93
94 .float          killcount;
95
96 .float watersound_finished;
97 .float iscreature;
98 .vector oldvelocity;
99
100 .float pauseregen_finished;
101 .float pauserothealth_finished;
102 .float pauserotarmor_finished;
103 .string item_pickupsound;
104
105 // definitions for weaponsystem
106
107 .entity weaponentity;
108 .entity exteriorweaponentity;
109 .float switchweapon;
110 .float autoswitch;
111 float(float wpn, float wrequest) weapon_action;
112 float(entity cl, float wpn, float andammo, float complain) client_hasweapon;
113 void() w_clear;
114 void() w_ready;
115 // VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies)
116 .float weapon_nextthink;
117 .void() weapon_think;
118 .float weapon_nextthink_lastframe;
119
120 //float PLAYER_WEAPONSELECTION_DELAY = );
121 float   PLAYER_WEAPONSELECTION_SPEED = 18;
122 vector  PLAYER_WEAPONSELECTION_RANGE = '0 20 -40';
123
124 // weapon states (self.weaponentity.state)
125 float WS_CLEAR                  = 0; // no weapon selected
126 float WS_RAISE                  = 1; // raise frame
127 float WS_DROP                   = 2; // deselecting frame
128 float WS_INUSE                  = 3; // fire state
129 float WS_READY                  = 4; // idle frame
130
131 // weapon requests
132 float WR_SETUP            = 1; // setup weapon data
133 float WR_THINK            = 2; // logic to run every frame
134 float WR_CHECKAMMO1       = 3; // checks ammo for weapon
135 float WR_CHECKAMMO2       = 4; // checks ammo for weapon
136 float WR_AIM              = 5; // runs bot aiming code for this weapon
137
138 // Weapon indexes
139 float WEP_LASER                         = 1; // float   IT_LASER                                = 4096;
140 float WEP_SHOTGUN                       = 2; // float   IT_SHOTGUN                              = 1;
141 float WEP_UZI                           = 3; // float   IT_UZI                                  = 2;
142 float WEP_GRENADE_LAUNCHER      = 4; // float   IT_GRENADE_LAUNCHER             = 4;
143 float WEP_ELECTRO                       = 5; // float   IT_ELECTRO                              = 8;
144 float WEP_CRYLINK                       = 6; // float   IT_CRYLINK                              = 16;
145 float WEP_NEX                           = 7; // float   IT_NEX                                  = 32;
146 float WEP_HAGAR                         = 8; // float   IT_HAGAR                                = 64;
147 float WEP_ROCKET_LAUNCHER       = 9; // float   IT_ROCKET_LAUNCHER              = 128;
148
149 // For weapon cycling commands
150 float WEP_FIRST                         = 1;
151 float WEP_LAST                          = 9;
152
153 void(entity e, float chan, string samp, float vol, float atten) sound = #8;
154 void(entity client, string s)   stuffcmd = #21;
155 void(entity client, string s)   sprint = #24;
156 vector(entity e, float sped)    aim = #44;
157 void(entity client, string s)   centerprint = #73;
158 void(entity e)                  setspawnparms = #78;
159 void(float to, float f)         WriteByte = #52;
160 void(float to, float f)         WriteChar = #53;
161 void(float to, float f)         WriteShort = #54;
162 void(float to, float f)         WriteLong = #55;
163 void(float to, float f)         WriteCoord = #56;
164 void(float to, float f)         WriteAngle = #57;
165 void(float to, string s)        WriteString     = #58;
166 void(float to, entity s)        WriteEntity     = #59;
167 .vector dest1, dest2;
168 void(entity clent) dropclient = #453;
169
170 float gameover;
171 float intermission_running;
172 float intermission_exittime;
173 float alreadychangedlevel;
174
175
176 .float runes;
177
178
179 .float welcomemessage_time;
180 .float welcomemessage_time2;
181 .float version;
182
183 // stahl's voting
184 float votecalled;
185 string votecalledvote;
186 float votecalledmaster;
187 entity votecaller;
188 float votefinished;
189 .float vote_master;
190 .float vote_next;
191 .float vote_vote;
192 void VoteThink();
193 string VoteParse();
194 float VoteAllowed(string vote);
195 void VoteReset();
196 void VoteAccept();
197 void VoteReject();
198 void VoteTimeout();
199 void VoteStop(entity stopper);
200 void VoteCount();
201
202 // Wazat's grappling hook
203 .entity         hook;
204 void GrapplingHookFrame();
205 void RemoveGrapplingHook(entity pl);
206 void SetGrappleHookBindings();
207 // hook impulses
208 float GRAPHOOK_FIRE             = 20;
209 float GRAPHOOK_RELEASE          = 21;
210 // (note: you can change the hook impulse #'s to whatever you please)
211 .float hook_time;
212
213 // Laser target for laser-guided weapons
214 .entity lasertarget;
215 .float laser_on;
216
217 // minstagib vars
218 .float jump_interval;    // laser refire
219
220 //swamp
221 .float in_swamp;              // bool
222 .entity swampslug;            // Uses this to release from swamp ("untouch" fix)
223
224 // footstep interval
225 .float nextstep;
226
227 .float ready;
228
229 .float winning;
230 .float deaths;
231 .float jointime;
232
233 .float spawnshieldtime;
234
235 .float lms_nextcheck;
236 .float lms_traveled_distance;
237
238 .entity flagcarried;
239
240 .entity lastrocket;
241
242 .float playerid;
243 float playerid_last;
244 .float noalign;         // if set to 1, the item or spawnpoint won't be dropped to the floor
245
246 .vector spawnorigin;
247
248 .vector death_origin;
249 .vector killer_origin;
250
251 .float isdecor;
252
253 float default_player_alpha;
254 float default_weapon_alpha;
255
256 .float() customizeentityforclient;
257 .float cvar_cl_playerdetailreduction;
258 .float cvar_cl_nogibs;
259 .float cvar_scr_centertime;
260 .float cvar_cl_shownames;
261
262 #ifdef ALLOW_VARIABLE_LOD
263 .float modelindex_lod0;
264 .float modelindex_lod1;
265 .float modelindex_lod2;
266 #endif
267
268 #define NUM_JUMPPADSUSED 3
269 .float jumppadcount;
270 .entity jumppadsused[NUM_JUMPPADSUSED];
271
272 string gamemode_name;
273 float teams_matter;
274
275 float startitem_failed;
276
277
278
279 typedef .float floatfield;
280 typedef void(void) spawnfunc;
281 floatfield Item_CounterField(float it);
282 float Item_WeaponCode(float it);
283 spawnfunc Item_SpawnFunc(float it);
284
285 float W_AmmoItemCode(float wpn);
286 float W_ItemCode(float wpn);
287 string W_Name(float weaponid);
288
289 void UpdateSelectedPlayer();
290 void ClearSelectedPlayer();
291 .entity selected_player;
292 .float selected_player_time; // when this player has been selected
293 .float selected_player_count; // how long this player has been directly pointed to
294 .float selected_player_display_needs_update; // are regular updates necessary? (health)
295 .float selected_player_display_timeout; // when the selection will time out