]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/stats.qh
Merge branch 'master' into TimePath/stats
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / stats.qh
1 #ifndef STATS_H
2 #define STATS_H
3
4 // Full list of all stat constants, included in a single location for easy reference
5 // 255 is the current limit (MAX_CL_STATS - 1), engine will need to be modified if you wish to add more stats
6
7 const int MAX_CL_STATS = 256;
8 #ifndef CSQC
9 const int STAT_HEALTH = 0; // .health
10 const int STAT_ARMOR = 4; // .armorvalue
11 const int STAT_SHELLS = 6; // .ammo_shells
12 const int STAT_NAILS = 7; // .ammo_nails
13 const int STAT_ROCKETS = 8; // .ammo_rockets
14 const int STAT_CELLS = 9; // .ammo_cells
15 const int STAT_ACTIVEWEAPON = 10; // .weapon
16 const int STAT_ITEMS = 15; // .items | .items2 << 23 | serverflags << 28
17 const int STAT_VIEWHEIGHT = 16; // .view_ofs_z
18 #endif
19
20 REGISTER_STAT(WEAPONS, vectori)
21 REGISTER_STAT(WEAPONSINMAP, vectori)
22
23 REGISTER_STAT(PL_VIEW_OFS, vector, autocvar_sv_player_viewoffset)
24 REGISTER_STAT(PL_CROUCH_VIEW_OFS, vector, autocvar_sv_player_crouch_viewoffset)
25
26 REGISTER_STAT(PL_MIN, vector, autocvar_sv_player_mins)
27 REGISTER_STAT(PL_CROUCH_MIN, vector, autocvar_sv_player_crouch_mins)
28
29 REGISTER_STAT(PL_MAX, vector, autocvar_sv_player_maxs)
30 REGISTER_STAT(PL_CROUCH_MAX, vector, autocvar_sv_player_crouch_maxs)
31
32 REGISTER_STAT(KH_KEYS, int)
33 /** weapon requested to switch to; next WANTED weapon (for HUD) */
34 REGISTER_STAT(SWITCHWEAPON, int)
35 REGISTER_STAT(GAMESTARTTIME, float)
36 REGISTER_STAT(STRENGTH_FINISHED, float)
37 REGISTER_STAT(INVINCIBLE_FINISHED, float)
38 /** arc heat in [0,1] */
39 REGISTER_STAT(ARC_HEAT, float)
40 REGISTER_STAT(PRESSED_KEYS, int)
41 /** this stat could later contain some other bits of info, like, more server-side particle config */
42 REGISTER_STAT(ALLOW_OLDVORTEXBEAM, bool)
43 REGISTER_STAT(FUEL, int)
44 REGISTER_STAT(NB_METERSTART, float)
45 /** compressShotOrigin */
46 REGISTER_STAT(SHOTORG, int)
47 REGISTER_STAT(LEADLIMIT, float)
48 REGISTER_STAT(WEAPON_CLIPLOAD, int)
49 REGISTER_STAT(WEAPON_CLIPSIZE, int)
50
51 REGISTER_STAT(VORTEX_CHARGE, float)
52 REGISTER_STAT(LAST_PICKUP, float)
53 REGISTER_STAT(HUD, int)
54 REGISTER_STAT(VORTEX_CHARGEPOOL, float)
55 REGISTER_STAT(HIT_TIME, float)
56 REGISTER_STAT(DAMAGE_DEALT_TOTAL, int)
57 REGISTER_STAT(TYPEHIT_TIME, float)
58 REGISTER_STAT(LAYED_MINES, int)
59 REGISTER_STAT(HAGAR_LOAD, int)
60 REGISTER_STAT(SWITCHINGWEAPON, int)
61 REGISTER_STAT(SUPERWEAPONS_FINISHED, float)
62 REGISTER_STAT(VEHICLESTAT_HEALTH, int)
63 REGISTER_STAT(VEHICLESTAT_SHIELD, int)
64 REGISTER_STAT(VEHICLESTAT_ENERGY, int)
65 REGISTER_STAT(VEHICLESTAT_AMMO1, int)
66 REGISTER_STAT(VEHICLESTAT_RELOAD1, int)
67 REGISTER_STAT(VEHICLESTAT_AMMO2, int)
68 REGISTER_STAT(VEHICLESTAT_RELOAD2, int)
69 REGISTER_STAT(VEHICLESTAT_W2MODE, int)
70 REGISTER_STAT(NADE_TIMER, float)
71 REGISTER_STAT(SECRETS_TOTAL, float)
72 REGISTER_STAT(SECRETS_FOUND, float)
73 REGISTER_STAT(RESPAWN_TIME, float)
74 REGISTER_STAT(ROUNDSTARTTIME, float)
75 REGISTER_STAT(MONSTERS_TOTAL, int)
76 REGISTER_STAT(MONSTERS_KILLED, int)
77 REGISTER_STAT(BUFFS, int)
78 REGISTER_STAT(NADE_BONUS, float)
79 REGISTER_STAT(NADE_BONUS_TYPE, int)
80 REGISTER_STAT(NADE_BONUS_SCORE, float)
81 REGISTER_STAT(HEALING_ORB, float)
82 REGISTER_STAT(HEALING_ORB_ALPHA, float)
83 REGISTER_STAT(PLASMA, int)
84 REGISTER_STAT(OK_AMMO_CHARGE, float)
85 REGISTER_STAT(OK_AMMO_CHARGEPOOL, float)
86 REGISTER_STAT(FROZEN, int)
87 REGISTER_STAT(REVIVE_PROGRESS, float)
88 REGISTER_STAT(ROUNDLOST, int)
89 REGISTER_STAT(BUFF_TIME, float)
90 REGISTER_STAT(CTF_FLAGSTATUS, int)
91
92 #ifdef SVQC
93 int autocvar_g_multijump;
94 float autocvar_g_multijump_add;
95 float autocvar_g_multijump_speed;
96 float autocvar_g_multijump_maxspeed;
97 float autocvar_g_multijump_dodging = 1;
98 #endif
99 REGISTER_STAT(MULTIJUMP_DODGING, int, autocvar_g_multijump_dodging)
100 REGISTER_STAT(MULTIJUMP_MAXSPEED, float, autocvar_g_multijump_maxspeed)
101 REGISTER_STAT(MULTIJUMP_ADD, int, autocvar_g_multijump_add)
102 REGISTER_STAT(MULTIJUMP_SPEED, float, autocvar_g_multijump_speed)
103 REGISTER_STAT(MULTIJUMP, int, autocvar_g_multijump)
104 REGISTER_STAT(DOUBLEJUMP, int, autocvar_sv_doublejump)
105
106 #ifdef SVQC
107 float g_bugrigs;
108 float g_bugrigs_planar_movement;
109 float g_bugrigs_planar_movement_car_jumping;
110 float g_bugrigs_reverse_spinning;
111 float g_bugrigs_reverse_speeding;
112 float g_bugrigs_reverse_stopping;
113 float g_bugrigs_air_steering;
114 float g_bugrigs_angle_smoothing;
115 float g_bugrigs_friction_floor;
116 float g_bugrigs_friction_brake;
117 float g_bugrigs_friction_air;
118 float g_bugrigs_accel;
119 float g_bugrigs_speed_ref;
120 float g_bugrigs_speed_pow;
121 float g_bugrigs_steer;
122 #endif
123 REGISTER_STAT(BUGRIGS, int, g_bugrigs)
124 REGISTER_STAT(BUGRIGS_ACCEL, float, g_bugrigs_accel)
125 REGISTER_STAT(BUGRIGS_AIR_STEERING, int, g_bugrigs_air_steering)
126 REGISTER_STAT(BUGRIGS_ANGLE_SMOOTHING, int, g_bugrigs_angle_smoothing)
127 REGISTER_STAT(BUGRIGS_CAR_JUMPING, int, g_bugrigs_planar_movement_car_jumping)
128 REGISTER_STAT(BUGRIGS_FRICTION_AIR, float, g_bugrigs_friction_air)
129 REGISTER_STAT(BUGRIGS_FRICTION_BRAKE, float, g_bugrigs_friction_brake)
130 REGISTER_STAT(BUGRIGS_FRICTION_FLOOR, float, g_bugrigs_friction_floor)
131 REGISTER_STAT(BUGRIGS_PLANAR_MOVEMENT, int, g_bugrigs_planar_movement)
132 REGISTER_STAT(BUGRIGS_REVERSE_SPEEDING, int, g_bugrigs_reverse_speeding)
133 REGISTER_STAT(BUGRIGS_REVERSE_SPINNING, int, g_bugrigs_reverse_spinning)
134 REGISTER_STAT(BUGRIGS_REVERSE_STOPPING, int, g_bugrigs_reverse_stopping)
135 REGISTER_STAT(BUGRIGS_SPEED_POW, float, g_bugrigs_speed_pow)
136 REGISTER_STAT(BUGRIGS_SPEED_REF, float, g_bugrigs_speed_ref)
137 REGISTER_STAT(BUGRIGS_STEER, float, g_bugrigs_steer)
138
139 REGISTER_STAT(GAMEPLAYFIX_DOWNTRACEONGROUND, int, cvar("sv_gameplayfix_downtracesupportsongroundflag"))
140 REGISTER_STAT(GAMEPLAYFIX_EASIERWATERJUMP, int, cvar("sv_gameplayfix_easierwaterjump"))
141 REGISTER_STAT(GAMEPLAYFIX_STEPDOWN, int, cvar("sv_gameplayfix_stepdown"))
142 REGISTER_STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, int, cvar("sv_gameplayfix_stepmultipletimes"))
143 REGISTER_STAT(GAMEPLAYFIX_UNSTICKPLAYERS, int, cvar("sv_gameplayfix_unstickplayers"))
144 REGISTER_STAT(GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND, int, autocvar_sv_gameplayfix_upwardvelocityclearsongroundflag)
145
146 REGISTER_STAT(MOVEVARS_JUMPSTEP, int, cvar("sv_jumpstep"))
147 REGISTER_STAT(NOSTEP, int, cvar("sv_nostep"))
148
149 REGISTER_STAT(MOVEVARS_FRICTION, float)
150 REGISTER_STAT(MOVEVARS_FRICTION_SLICK, float, autocvar_sv_friction_slick)
151 REGISTER_STAT(MOVEVARS_FRICTION_ONLAND, float, autocvar_sv_friction_on_land)
152
153 REGISTER_STAT(MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS, int, autocvar_sv_jumpspeedcap_max_disable_on_ramps)
154 REGISTER_STAT(MOVEVARS_TRACK_CANJUMP, int)
155 /** cvar loopback */
156 REGISTER_STAT(MOVEVARS_CL_TRACK_CANJUMP, int)
157
158 #ifdef SVQC
159 int g_dodging;
160 float autocvar_sv_dodging_delay;
161 float autocvar_sv_dodging_wall_distance_threshold;
162 bool autocvar_sv_dodging_frozen;
163 bool autocvar_sv_dodging_frozen_doubletap;
164 float autocvar_sv_dodging_height_threshold;
165 float autocvar_sv_dodging_horiz_speed;
166 float autocvar_sv_dodging_horiz_speed_frozen;
167 float autocvar_sv_dodging_ramp_time;
168 float autocvar_sv_dodging_up_speed;
169 bool autocvar_sv_dodging_wall_dodging;
170 #endif
171
172 REGISTER_STAT(DODGING, int, g_dodging)
173 REGISTER_STAT(DODGING_DELAY, float, autocvar_sv_dodging_delay)
174 REGISTER_STAT(DODGING_DISTANCE_THRESHOLD, float, autocvar_sv_dodging_wall_distance_threshold)
175 REGISTER_STAT(DODGING_FROZEN, int, autocvar_sv_dodging_frozen)
176 REGISTER_STAT(DODGING_FROZEN_NO_DOUBLETAP, int, autocvar_sv_dodging_frozen_doubletap)
177 REGISTER_STAT(DODGING_HEIGHT_THRESHOLD, float, autocvar_sv_dodging_height_threshold)
178 REGISTER_STAT(DODGING_HORIZ_SPEED, float, autocvar_sv_dodging_horiz_speed)
179 REGISTER_STAT(DODGING_HORIZ_SPEED_FROZEN, float, autocvar_sv_dodging_horiz_speed_frozen)
180 REGISTER_STAT(DODGING_RAMP_TIME, float, autocvar_sv_dodging_ramp_time)
181 /** cvar loopback */
182 REGISTER_STAT(DODGING_TIMEOUT, float)
183 REGISTER_STAT(DODGING_UP_SPEED, float, autocvar_sv_dodging_up_speed)
184 REGISTER_STAT(DODGING_WALL, int, autocvar_sv_dodging_wall_dodging)
185
186 REGISTER_STAT(JETPACK_ACCEL_SIDE, float, autocvar_g_jetpack_acceleration_side)
187 REGISTER_STAT(JETPACK_ACCEL_UP, float, autocvar_g_jetpack_acceleration_up)
188 REGISTER_STAT(JETPACK_ANTIGRAVITY, float, autocvar_g_jetpack_antigravity)
189 REGISTER_STAT(JETPACK_FUEL, float, autocvar_g_jetpack_fuel)
190 REGISTER_STAT(JETPACK_MAXSPEED_SIDE, float, autocvar_g_jetpack_maxspeed_side)
191 REGISTER_STAT(JETPACK_MAXSPEED_UP, float, autocvar_g_jetpack_maxspeed_up)
192
193 REGISTER_STAT(MOVEVARS_HIGHSPEED, float, autocvar_g_movement_highspeed)
194
195 // freeze tag, clan arena
196 REGISTER_STAT(REDALIVE, int)
197 REGISTER_STAT(BLUEALIVE, int)
198 REGISTER_STAT(YELLOWALIVE, int)
199 REGISTER_STAT(PINKALIVE, int)
200
201 // domination
202 REGISTER_STAT(DOM_TOTAL_PPS, float)
203 REGISTER_STAT(DOM_PPS_RED, float)
204 REGISTER_STAT(DOM_PPS_BLUE, float)
205 REGISTER_STAT(DOM_PPS_YELLOW, float)
206 REGISTER_STAT(DOM_PPS_PINK, float)
207
208 #ifdef SVQC
209 #include "movetypes/movetypes.qh"
210 #endif
211
212 REGISTER_STAT(MOVEVARS_AIRACCEL_QW_STRETCHFACTOR, float)
213 REGISTER_STAT(MOVEVARS_AIRCONTROL_PENALTY, float)
214 REGISTER_STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW, float)
215 REGISTER_STAT(MOVEVARS_AIRSTRAFEACCEL_QW, float)
216 REGISTER_STAT(MOVEVARS_AIRCONTROL_POWER, float)
217 noref bool autocvar_sv_gameplayfix_nogravityonground;
218 REGISTER_STAT(MOVEFLAGS, int, MOVEFLAG_VALID
219                               | (autocvar_sv_gameplayfix_q2airaccelerate ? MOVEFLAG_Q2AIRACCELERATE : 0)
220                               | (autocvar_sv_gameplayfix_nogravityonground ? MOVEFLAG_NOGRAVITYONGROUND : 0)
221                               | (autocvar_sv_gameplayfix_gravityunaffectedbyticrate ? MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE : 0))
222
223 REGISTER_STAT(MOVEVARS_WARSOWBUNNY_AIRFORWARDACCEL, float)
224 REGISTER_STAT(MOVEVARS_WARSOWBUNNY_ACCEL, float)
225 REGISTER_STAT(MOVEVARS_WARSOWBUNNY_TOPSPEED, float)
226 REGISTER_STAT(MOVEVARS_WARSOWBUNNY_TURNACCEL, float)
227 REGISTER_STAT(MOVEVARS_WARSOWBUNNY_BACKTOSIDERATIO, float)
228
229 REGISTER_STAT(MOVEVARS_AIRSTOPACCELERATE, float)
230 REGISTER_STAT(MOVEVARS_AIRSTRAFEACCELERATE, float)
231 REGISTER_STAT(MOVEVARS_MAXAIRSTRAFESPEED, float)
232 REGISTER_STAT(MOVEVARS_AIRCONTROL, float)
233 REGISTER_STAT(FRAGLIMIT, float, autocvar_fraglimit)
234 REGISTER_STAT(TIMELIMIT, float, autocvar_timelimit)
235 #ifdef SVQC
236 float autocvar_sv_wallfriction;
237 #endif
238 REGISTER_STAT(MOVEVARS_WALLFRICTION, int, autocvar_sv_wallfriction)
239 REGISTER_STAT(MOVEVARS_TICRATE, float, autocvar_sys_ticrate)
240 REGISTER_STAT(MOVEVARS_TIMESCALE, float, autocvar_slowmo)
241 REGISTER_STAT(MOVEVARS_GRAVITY, float, autocvar_sv_gravity)
242 REGISTER_STAT(MOVEVARS_STOPSPEED, float)
243 REGISTER_STAT(MOVEVARS_MAXSPEED, float)
244 REGISTER_STAT(MOVEVARS_ACCELERATE, float)
245 REGISTER_STAT(MOVEVARS_AIRACCELERATE, float)
246 .float gravity;
247 // FIXME: Was 0 on server, 1 on client. Still want that?
248 REGISTER_STAT(MOVEVARS_ENTGRAVITY, float, (this.gravity) ? this.gravity : 1)
249 REGISTER_STAT(MOVEVARS_JUMPVELOCITY, float)
250 REGISTER_STAT(MOVEVARS_MAXAIRSPEED, float)
251 REGISTER_STAT(MOVEVARS_STEPHEIGHT, float, autocvar_sv_stepheight)
252 REGISTER_STAT(MOVEVARS_AIRACCEL_QW, float)
253 REGISTER_STAT(MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION, float)
254 #endif