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