]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/defs.qh
Some more cleanup of defs.qh, use a flag to indicate crouch state instead of a separa...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / defs.qh
1 #pragma once
2
3 #include <common/weapons/_all.qh>
4 #include <common/stats.qh>
5
6 // Globals
7
8 float g_footsteps, g_grappling_hook;
9 float g_warmup_allguns;
10 float g_warmup_allow_timeout;
11 float warmup_stage;
12 float g_jetpack;
13
14 bool sv_ready_restart;
15 bool sv_ready_restart_after_countdown;
16 bool sv_ready_restart_repeatable;
17
18 float sv_clones;
19 float sv_foginterval;
20
21 // Fields
22
23 .void(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) event_damage;
24
25 .bool(entity targ, entity inflictor, float amount, float limit) event_heal;
26
27 //.string       wad;
28 //.string       map;
29
30 //.float        worldtype;
31
32 .float  pain_finished;                  //Added by Supajoe
33 .float  pain_frame;                     //"
34
35 .float superweapons_finished; // NOTE: this field is used only by map entities, it does not directly apply the superweapons stat
36 const .float air_finished = _STAT(AIR_FINISHED);
37
38 .float cnt; // used in too many places
39 .float count;
40 //.float cnt2;
41
42 .float death_time;
43 .float fade_time;
44 .float fade_rate;
45
46 .string mdl;
47
48 .string playermodel;
49 .string playerskin;
50
51 .float species;
52
53 .float  scheduledrespawntime;
54 .float  respawntime;
55 .float  respawntimejitter;
56 .float  respawntimestart;
57 //.float        chasecam;
58
59 //.float          gravity;
60
61 .float          dmg;
62
63 // for railgun damage (hitting multiple enemies)
64 .bool railgunhit;
65 .float railgunhitsolidbackup;
66 .vector railgunhitloc;
67
68 .float          dmgtime;
69
70 .float          killcount;
71 .float damage_dealt, typehitsound, killsound;
72
73 .float watersound_finished;
74 .float iscreature;
75 .float damagedbycontents;
76 .float damagedbytriggers;
77 .float teleportable;
78 .vector oldvelocity;
79
80 .float pauseregen_finished;
81 .float pauserothealth_finished;
82 .float pauserotarmor_finished;
83 .float pauserotfuel_finished;
84 // string overrides entity
85 .string item_pickupsound;
86 .entity item_pickupsound_ent;
87 .entity item_model_ent;
88
89 // WEAPONTODO
90 .float autoswitch;
91
92 float intermission_running;
93 float intermission_exittime;
94 float alreadychangedlevel;
95
96 // footstep interval
97 .float nextstep;
98
99 float blockSpectators; //if set, new or existing spectators or observers will be removed unless they become a player within g_maxplayers_spectator_blocktime seconds
100 .float spectatortime; //point in time since the client is spectating or observing
101
102 .float winning;
103 .float jointime; // time of connecting
104 .float startplaytime; // time of switching from spectator to player
105 .float alivetime; // time of being alive
106 .float motd_actived_time; // used for both motd and campaign_message
107
108 .float spawnshieldtime;
109
110 .int playerid;
111 .float noalign;         // if set to 1, the item or spawnpoint won't be dropped to the floor
112
113 .vector death_origin;
114
115 float default_player_alpha;
116 float default_weapon_alpha;
117
118 .float cvar_cl_handicap;
119 .int cvar_cl_gunalign;
120 .float cvar_cl_clippedspectating;
121 .float cvar_cl_autoscreenshot;
122 .float cvar_cl_jetpack_jump;
123 .float cvar_cl_movement_track_canjump;
124 .float cvar_cl_newusekeysupported;
125 .float cvar_cl_cts_noautoswitch;
126 .bool cvar_cl_weapon_switch_reload;
127 .bool cvar_cl_weapon_switch_fallback_to_impulse;
128
129 .string cvar_g_xonoticversion;
130 .string cvar_cl_weaponpriority;
131 .string cvar_cl_weaponpriorities[10];
132 .float cvar_cl_noantilag;
133
134 .string weaponorder_byimpulse;
135
136 .float cvar_cl_allow_uid2name;
137 .float cvar_cl_allow_uidtracking;
138 .bool cvar_cl_allow_uidranking;
139 .string stored_netname;
140
141 string gamemode_name;
142
143 float bot_waypoints_for_items;
144
145 // speedrun: when 1, player auto teleports back when capture timeout happens
146 .float speedrunning;
147
148 // database
149 float ServerProgsDB;
150 float TemporaryDB;
151
152 .int team_saved;
153
154 bool some_spawn_has_been_used;
155 int have_team_spawns; // 0 = no team spawns requested, -1 = team spawns requested but none found, 1 = team spawns requested and found
156 int have_team_spawns_forteams; // if Xth bit is 1 then team X has spawns else it has no spawns; team 0 is the "no-team"
157
158 .bool canteamdamage;
159
160 // WEAPONTODO
161 #define DMG_NOWEP (weaponentities[0])
162
163 float sv_maxidle;
164 float sv_maxidle_spectatorsareidle;
165 int sv_maxidle_slots;
166 bool sv_maxidle_slots_countbots;
167
168 // autotaunt system
169 .float cvar_cl_autotaunt;
170 .float cvar_cl_voice_directional;
171 .float cvar_cl_voice_directional_taunt_attenuation;
172
173 int autocvar__independent_players;
174 bool independent_players;
175 #define INDEPENDENT_PLAYERS (autocvar__independent_players ? (autocvar__independent_players > 0) : independent_players)
176 #define IS_INDEPENDENT_PLAYER(e) ((e).solid == SOLID_TRIGGER)
177 #define MAKE_INDEPENDENT_PLAYER(e) (((e).solid = SOLID_TRIGGER), ((e).frags = FRAGS_PLAYER_OUT_OF_GAME))
178
179 string clientstuff;
180 .float phase;
181 .int pressedkeys;
182
183 .string fog;
184
185 string cvar_changes;
186 string cvar_purechanges;
187 float cvar_purechanges_count;
188
189 //float game_starttime; //point in time when the countdown to game start is over
190 //float round_starttime; //point in time when the countdown to round start is over
191
192 .int projectiledeathtype;
193
194 .string message2;
195
196 // reset to 0 on weapon switch
197 // may be useful to all weapons
198 .float bulletcounter;
199
200 // Nexball
201 float g_nexball_meter_period;
202
203 .void(entity this) reset; // if set, an entity is reset using this
204 .void(entity this) reset2; // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
205
206 .bool wasplayer;
207
208 string matchid;
209
210 bool radar_showenemies;
211
212 .int minelayer_mines;
213 .float vortex_charge;
214 .float vortex_charge_rottime;
215 .float vortex_chargepool_ammo;
216 .float oknex_charge;
217 .float oknex_charge_rottime;
218 .float oknex_chargepool_ammo;
219 .int hagar_load;
220
221 .int grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab
222
223 #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
224 // when doing this, hagar can go through clones
225 // #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_BBOX
226
227 .int spectatee_status;
228 .bool zoomstate;
229 .int restriction;
230
231 .entity clientdata;
232 .entity personal;
233
234 string deathmessage;
235
236 .bool just_joined;
237
238 .float cvar_cl_weaponimpulsemode;
239 .int selectweapon; // last selected weapon of the player
240
241 .float ballistics_density;
242
243 //const int FROZEN_NOT                          = 0;
244 const int FROZEN_NORMAL                         = 1;
245 const int FROZEN_TEMP_REVIVING          = 2;
246 const int FROZEN_TEMP_DYING                     = 3;
247
248 .entity realowner;
249
250 //float serverflags;
251
252 .bool player_blocked;
253
254 .float revival_time; // time at which player was last revived
255 .float revive_speed; // NOTE: multiplier (anything above 1 is instaheal)
256 .float freeze_time;
257 .entity iceblock;
258 .entity frozen_by; // for ice fields
259
260 .float misc_bulletcounter;      // replaces uzi & hlac bullet counter.
261
262 string modname;
263
264 ////
265
266 .string cvar_cl_physics;
267
268 .WepSet dual_weapons;
269
270 IntrusiveList g_monsters;
271 IntrusiveList g_waypoints;
272 IntrusiveList g_vehicles;
273 IntrusiveList g_turrets;
274 IntrusiveList g_mines;
275 IntrusiveList g_projectiles;
276 IntrusiveList g_items;
277 IntrusiveList g_initforplayer;
278 IntrusiveList g_clones;
279 IntrusiveList g_spawnpoints;
280 IntrusiveList g_bot_targets;
281 IntrusiveList g_bot_dodge;
282 IntrusiveList g_damagedbycontents;
283 IntrusiveList g_railgunhit;
284 IntrusiveList g_ladders;
285 IntrusiveList g_locations;
286 IntrusiveList g_saved_team;
287 IntrusiveList g_monster_targets;
288 IntrusiveList g_pathlib_nodes;
289 IntrusiveList g_moveables;
290 STATIC_INIT(defs)
291 {
292         g_monsters = IL_NEW();
293         g_waypoints = IL_NEW();
294         g_vehicles = IL_NEW();
295         g_turrets = IL_NEW();
296         g_mines = IL_NEW();
297         g_projectiles = IL_NEW();
298         g_items = IL_NEW();
299         g_initforplayer = IL_NEW();
300         g_clones = IL_NEW();
301         g_spawnpoints = IL_NEW();
302         g_bot_targets = IL_NEW();
303         g_bot_dodge = IL_NEW();
304         g_damagedbycontents = IL_NEW();
305         g_railgunhit = IL_NEW();
306         g_ladders = IL_NEW();
307         g_locations = IL_NEW();
308         g_saved_team = IL_NEW();
309         g_monster_targets = IL_NEW();
310         g_pathlib_nodes = IL_NEW();
311         g_moveables = IL_NEW();
312 }