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