]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/client/defs.qh
Optimize vehicle impact code by only calling vlen() if damage would be taken
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / defs.qh
1 #pragma once
2
3 // Additional OPTIONAL Fields and Globals
4 //float         intermission;
5 float           scoreboard_showscores;
6 .string         message;
7 .float          renderflags;
8 // float                coop;
9 // float                deathmatch;
10
11 float           dmg_take;
12 // float                dmg_save;
13 // vector               dmg_origin;
14
15 // Darkplaces Render Modifications
16 #if 0
17 .float alpha;
18 .vector colormod;
19 .float scale;
20 #endif
21
22 // Basic variables
23 .int enttype; // entity type sent from server
24 .int sv_entnum; // entity number sent from server
25 .int team;
26 .int team_size;
27
28 float vid_conheight;
29 int binddb;
30
31 // QUALIFYING
32 float race_checkpoint;
33 float race_time;
34 float race_laptime;
35 float race_checkpointtime;
36 float race_previousbesttime;
37 float race_mypreviousbesttime;
38 string race_previousbestname;
39 float race_nextcheckpoint;
40 float race_nextbesttime;
41 float race_mybesttime;
42 string race_nextbestname;
43 float race_penaltyaccumulator; // qualifying: total penalty time in tenths
44 float race_penaltyeventtime; // time when the player got the penalty
45 float race_penaltytime; // duration of penalty time, in tenths
46 string race_penaltyreason; // reason for penalty
47 float race_server_record; // server record
48 float race_speedaward;
49 string race_speedaward_holder;
50 string race_speedaward_unit;
51 float race_speedaward_alltimebest;
52 string race_speedaward_alltimebest_holder;
53 string race_speedaward_alltimebest_unit;
54
55 // RACE
56 float race_mycheckpoint;
57 float race_mycheckpointtime;
58 float race_mycheckpointdelta;
59 float race_mycheckpointlapsdelta;
60 string race_mycheckpointenemy;
61 float race_othercheckpoint;
62 float race_othercheckpointtime;
63 float race_othercheckpointdelta;
64 float race_othercheckpointlapsdelta;
65 string race_othercheckpointenemy;
66 float scoreboard_showscores_force;
67 float race_status;
68 string race_status_name;
69 float race_myrank;
70
71 // Nexball
72 float nb_pb_period;
73
74 // Spectating
75 // -1 - observing
76 // 0 - playing
77 // >0 - id of spectated player
78 float spectatee_status;
79 float spectatee_status_changed_time;
80
81 // short mapname
82 string shortmapname;
83
84 // database for misc stuff
85 int tempdb;
86 int ClientProgsDB;
87 vector hook_shotorigin[4];
88 vector lightning_shotorigin[4];
89
90
91 #ifdef BLURTEST
92 float blurtest_time0, blurtest_time1, blurtest_radius, blurtest_power;
93 #endif
94
95 float serverprevtime, serverdeltatime;
96
97 float ticrate;
98
99 .float damageforcescale;
100 const float MIN_DAMAGEEXTRARADIUS = 2;
101 const float MAX_DAMAGEEXTRARADIUS = 16;
102 .float damageextraradius;
103 .void(entity this, float thisdmg, int hittype, vector org, vector thisforce) event_damage;
104
105 // weapons
106 .bool silent;
107
108 int w_deathtype;
109 float w_issilent, w_random;
110 vector w_org, w_backoff;
111
112 float autoswitch;
113 bool cvar_cl_allow_uid2name;
114 bool cvar_cl_allow_uidranking;
115 float cvar_cl_autoscreenshot;
116 float cvar_cl_autotaunt;
117 float cvar_cl_clippedspectating;
118 float cvar_cl_handicap;
119 float cvar_cl_jetpack_jump;
120 float cvar_cl_movement_track_canjump;
121 float cvar_cl_noantilag;
122 string cvar_cl_physics;
123 float cvar_cl_voice_directional;
124 float cvar_cl_voice_directional_taunt_attenuation;
125 float cvar_cl_weaponimpulsemode;
126 string cvar_g_xonoticversion;
127 float cvar_cl_cts_noautoswitch;
128 bool cvar_cl_weapon_switch_reload;
129 bool cvar_cl_weapon_switch_fallback_to_impulse;
130
131 REPLICATE(autoswitch, bool, "cl_autoswitch");
132 REPLICATE(cvar_cl_allow_uid2name, bool, "cl_allow_uid2name");
133 REPLICATE(cvar_cl_allow_uidranking, bool, "cl_allow_uidranking");
134 REPLICATE(cvar_cl_autoscreenshot, int, "cl_autoscreenshot");
135 REPLICATE(cvar_cl_autotaunt, float, "cl_autotaunt");
136 REPLICATE(cvar_cl_clippedspectating, bool, "cl_clippedspectating");
137 REPLICATE(cvar_cl_handicap, float, "cl_handicap");
138 REPLICATE(cvar_cl_jetpack_jump, bool, "cl_jetpack_jump");
139 REPLICATE(cvar_cl_movement_track_canjump, bool, "cl_movement_track_canjump");
140 REPLICATE(cvar_cl_noantilag, bool, "cl_noantilag");
141 REPLICATE(cvar_cl_physics, string, "cl_physics");
142 REPLICATE(cvar_cl_voice_directional, int, "cl_voice_directional");
143 REPLICATE(cvar_cl_voice_directional_taunt_attenuation, float, "cl_voice_directional_taunt_attenuation");
144 REPLICATE(cvar_cl_weaponimpulsemode, int, "cl_weaponimpulsemode");
145 REPLICATE(cvar_g_xonoticversion, string, "g_xonoticversion");
146 REPLICATE(cvar_cl_cts_noautoswitch, bool, "cl_cts_noautoswitch");
147 REPLICATE(cvar_cl_weapon_switch_reload, bool, "cl_weapon_switch_reload");
148 REPLICATE(cvar_cl_weapon_switch_fallback_to_impulse, bool, "cl_weapon_switch_fallback_to_impulse");
149 /*
150 // this is also a STAT
151 // pointless sending this cvars since server can't change gun alignment during the match
152 int cvar_cl_gunalign;
153 REPLICATE(cvar_cl_gunalign, int, "cl_gunalign");
154
155 // cvar cl_newusekeysupported doesn't exist
156 float cvar_cl_newusekeysupported;
157 REPLICATE(cvar_cl_newusekeysupported, bool, "cl_newusekeysupported");
158 */
159 string cvar_cl_allow_uidtracking;
160 REPLICATE(cvar_cl_allow_uidtracking, string, "cl_allow_uidtracking");
161
162 string cvar_cl_weaponpriority;
163 REPLICATE(cvar_cl_weaponpriority, string, "cl_weaponpriority");
164
165 string cvar_cl_weaponpriorities[10];
166 REPLICATE(cvar_cl_weaponpriorities[0], string, "cl_weaponpriority0");
167 REPLICATE(cvar_cl_weaponpriorities[1], string, "cl_weaponpriority1");
168 REPLICATE(cvar_cl_weaponpriorities[2], string, "cl_weaponpriority2");
169 REPLICATE(cvar_cl_weaponpriorities[3], string, "cl_weaponpriority3");
170 REPLICATE(cvar_cl_weaponpriorities[4], string, "cl_weaponpriority4");
171 REPLICATE(cvar_cl_weaponpriorities[5], string, "cl_weaponpriority5");
172 REPLICATE(cvar_cl_weaponpriorities[6], string, "cl_weaponpriority6");
173 REPLICATE(cvar_cl_weaponpriorities[7], string, "cl_weaponpriority7");
174 REPLICATE(cvar_cl_weaponpriorities[8], string, "cl_weaponpriority8");
175 REPLICATE(cvar_cl_weaponpriorities[9], string, "cl_weaponpriority9");
176
177 float bgmtime;
178
179 string weaponorder_byimpulse;
180 string weaponorder_bypriority;
181
182 float vortex_charge_movingavg;
183
184 int serverflags;
185
186 float uid2name_dialog;
187
188 float intermission_time;
189
190 .bool csqcmodel_isdead; // used by shownames and miscfunctions (entcs_IsDead) to know when a player is dead
191
192 #define player_currententnum (spectatee_status > 0 ? spectatee_status : player_localnum + 1)