X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fstats.qh;h=82398aa56b1c7d40513bdfb5e735115a0e4087ee;hb=df6524e32dea9e91c2c4ba6ff383eef5d20ffcdb;hp=6825ff76b6a89548570ff92e3d0df7287d83d40e;hpb=ac0ab7e8b52ac931e7275bcbffe1aebe4259317f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 6825ff76b..82398aa56 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -1,20 +1,44 @@ -#ifndef STATS_H -#define STATS_H +#pragma once + +#ifdef SVQC +#include +#endif // Full list of all stat constants, included in a single location for easy reference // 255 is the current limit (MAX_CL_STATS - 1), engine will need to be modified if you wish to add more stats const int MAX_CL_STATS = 256; -#ifndef CSQC -const int STAT_HEALTH = 0; // .health -const int STAT_ARMOR = 4; // .armorvalue -const int STAT_SHELLS = 6; // .ammo_shells -const int STAT_NAILS = 7; // .ammo_nails -const int STAT_ROCKETS = 8; // .ammo_rockets -const int STAT_CELLS = 9; // .ammo_cells -const int STAT_ACTIVEWEAPON = 10; // .weapon -const int STAT_ITEMS = 15; // .items | .items2 << 23 | serverflags << 28 -const int STAT_VIEWHEIGHT = 16; // .view_ofs_z + +// const int STAT_HEALTH = 0; +// const int STAT_ARMOR = 4; +// const int STAT_SHELLS = 6; +// const int STAT_NAILS = 7; +// const int STAT_ROCKETS = 8; +// const int STAT_CELLS = 9; +// const int STAT_ACTIVEWEAPON = 10; +// const int STAT_ITEMS = 15; // .items | .items2 << 23 | serverflags << 28 +// const int STAT_VIEWHEIGHT = 16; + +#if defined(CSQC) + #define g_stat_HEALTH getstati(STAT_HEALTH) + #define g_stat_ARMOR getstat_int(STAT_ARMOR) + #define g_stat_SHELLS getstat_int(STAT_SHELLS) + #define g_stat_NAILS getstat_int(STAT_NAILS) + #define g_stat_ROCKETS getstat_int(STAT_ROCKETS) + #define g_stat_CELLS getstat_int(STAT_CELLS) + #define g_stat_ACTIVEWEAPON getstat_int(STAT_ACTIVEWEAPON) + #define g_stat_ITEMS getstat_int(STAT_ITEMS) + #define g_stat_VIEWHEIGHT getstati(STAT_VIEWHEIGHT) +#elif defined(SVQC) + #define stat_HEALTH health + #define stat_ARMOR armorvalue + #define stat_SHELLS ammo_shells + #define stat_NAILS ammo_nails + #define stat_ROCKETS ammo_rockets + #define stat_CELLS ammo_cells + #define stat_ACTIVEWEAPON weapon + #define stat_ITEMS items + #define stat_VIEWHEIGHT view_ofs_z #endif REGISTER_STAT(WEAPONS, vectori) @@ -30,8 +54,18 @@ REGISTER_STAT(PL_MAX, vector, autocvar_sv_player_maxs) REGISTER_STAT(PL_CROUCH_MAX, vector, autocvar_sv_player_crouch_maxs) REGISTER_STAT(KH_KEYS, int) + /** weapon requested to switch to; next WANTED weapon (for HUD) */ REGISTER_STAT(SWITCHWEAPON, int) +/** weapon currently being switched to (is copied from switchweapon once switch is possible) */ +REGISTER_STAT(SWITCHINGWEAPON, int) +REGISTER_STAT(WEAPON_NEXTTHINK, float) +#ifdef SVQC +SPECTATE_COPYFIELD(_STAT(WEAPON_NEXTTHINK)) +float W_WeaponRateFactor(entity this); +#endif +REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor(this)) + REGISTER_STAT(GAMESTARTTIME, float) REGISTER_STAT(STRENGTH_FINISHED, float) REGISTER_STAT(INVINCIBLE_FINISHED, float) @@ -57,7 +91,6 @@ REGISTER_STAT(DAMAGE_DEALT_TOTAL, int) REGISTER_STAT(TYPEHIT_TIME, float) REGISTER_STAT(LAYED_MINES, int) REGISTER_STAT(HAGAR_LOAD, int) -REGISTER_STAT(SWITCHINGWEAPON, int) REGISTER_STAT(SUPERWEAPONS_FINISHED, float) REGISTER_STAT(VEHICLESTAT_HEALTH, int) REGISTER_STAT(VEHICLESTAT_SHIELD, int) @@ -88,6 +121,10 @@ REGISTER_STAT(REVIVE_PROGRESS, float) REGISTER_STAT(ROUNDLOST, int) REGISTER_STAT(BUFF_TIME, float) REGISTER_STAT(CTF_FLAGSTATUS, int) +REGISTER_STAT(CAPTURE_PROGRESS, float) +REGISTER_STAT(ENTRAP_ORB, float) +REGISTER_STAT(ENTRAP_ORB_ALPHA, float) +REGISTER_STAT(ITEMSTIME, int, autocvar_sv_itemstime) #ifdef SVQC int autocvar_g_multijump; @@ -138,12 +175,21 @@ REGISTER_STAT(BUGRIGS_SPEED_POW, float, g_bugrigs_speed_pow) REGISTER_STAT(BUGRIGS_SPEED_REF, float, g_bugrigs_speed_ref) REGISTER_STAT(BUGRIGS_STEER, float, g_bugrigs_steer) -REGISTER_STAT(GAMEPLAYFIX_DOWNTRACEONGROUND, int, cvar("sv_gameplayfix_downtracesupportsongroundflag")) -REGISTER_STAT(GAMEPLAYFIX_EASIERWATERJUMP, int, cvar("sv_gameplayfix_easierwaterjump")) -REGISTER_STAT(GAMEPLAYFIX_STEPDOWN, int, cvar("sv_gameplayfix_stepdown")) -REGISTER_STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, int, cvar("sv_gameplayfix_stepmultipletimes")) -REGISTER_STAT(GAMEPLAYFIX_UNSTICKPLAYERS, int, cvar("sv_gameplayfix_unstickplayers")) +#ifdef SVQC +int autocvar_sv_gameplayfix_downtracesupportsongroundflag; +int autocvar_sv_gameplayfix_easierwaterjump; +int autocvar_sv_gameplayfix_stepdown; +int autocvar_sv_gameplayfix_stepmultipletimes; +int autocvar_sv_gameplayfix_unstickplayers; +int autocvar_sv_gameplayfix_fixedcheckwatertransition; +#endif +REGISTER_STAT(GAMEPLAYFIX_DOWNTRACEONGROUND, int, autocvar_sv_gameplayfix_downtracesupportsongroundflag) +REGISTER_STAT(GAMEPLAYFIX_EASIERWATERJUMP, int, autocvar_sv_gameplayfix_easierwaterjump) +REGISTER_STAT(GAMEPLAYFIX_STEPDOWN, int, autocvar_sv_gameplayfix_stepdown) +REGISTER_STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, int, autocvar_sv_gameplayfix_stepmultipletimes) +REGISTER_STAT(GAMEPLAYFIX_UNSTICKPLAYERS, int, autocvar_sv_gameplayfix_unstickplayers) REGISTER_STAT(GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND, int, autocvar_sv_gameplayfix_upwardvelocityclearsongroundflag) +REGISTER_STAT(GAMEPLAYFIX_WATERTRANSITION, int, autocvar_sv_gameplayfix_fixedcheckwatertransition) REGISTER_STAT(MOVEVARS_JUMPSTEP, int, cvar("sv_jumpstep")) REGISTER_STAT(NOSTEP, int, cvar("sv_nostep")) @@ -169,6 +215,7 @@ float autocvar_sv_dodging_horiz_speed_frozen; float autocvar_sv_dodging_ramp_time; float autocvar_sv_dodging_up_speed; bool autocvar_sv_dodging_wall_dodging; +bool autocvar_sv_dodging_air_dodging; #endif REGISTER_STAT(DODGING, int, g_dodging) @@ -183,7 +230,8 @@ REGISTER_STAT(DODGING_RAMP_TIME, float, autocvar_sv_dodging_ramp_time) /** cvar loopback */ REGISTER_STAT(DODGING_TIMEOUT, float) REGISTER_STAT(DODGING_UP_SPEED, float, autocvar_sv_dodging_up_speed) -REGISTER_STAT(DODGING_WALL, int, autocvar_sv_dodging_wall_dodging) +REGISTER_STAT(DODGING_WALL, bool, autocvar_sv_dodging_wall_dodging) +REGISTER_STAT(DODGING_AIR, bool, autocvar_sv_dodging_air_dodging) REGISTER_STAT(JETPACK_ACCEL_SIDE, float, autocvar_g_jetpack_acceleration_side) REGISTER_STAT(JETPACK_ACCEL_UP, float, autocvar_g_jetpack_acceleration_up) @@ -191,9 +239,24 @@ REGISTER_STAT(JETPACK_ANTIGRAVITY, float, autocvar_g_jetpack_antigravity) REGISTER_STAT(JETPACK_FUEL, float, autocvar_g_jetpack_fuel) REGISTER_STAT(JETPACK_MAXSPEED_SIDE, float, autocvar_g_jetpack_maxspeed_side) REGISTER_STAT(JETPACK_MAXSPEED_UP, float, autocvar_g_jetpack_maxspeed_up) +REGISTER_STAT(JETPACK_REVERSE_THRUST, float, autocvar_g_jetpack_reverse_thrust) REGISTER_STAT(MOVEVARS_HIGHSPEED, float, autocvar_g_movement_highspeed) +#ifdef SVQC +AUTOCVAR(g_walljump, bool, false, "Enable wall jumping mutator"); +AUTOCVAR(g_walljump_delay, float, 1, "Minimum delay between wall jumps"); +AUTOCVAR(g_walljump_force, float, 300, "How far to bounce/jump off the wall"); +AUTOCVAR(g_walljump_velocity_xy_factor, float, 1.15, "How much to slow down along horizontal axis, higher value = higher deceleration, if factor is < 1, you accelerate by wall jumping"); +AUTOCVAR(g_walljump_velocity_z_factor, float, 0.5, "Upwards velocity factor, multiplied by normal jump velocity"); +#endif +REGISTER_STAT(WALLJUMP, int, autocvar_g_walljump) +REGISTER_STAT(WALLJUMP_VELOCITY_Z_FACTOR, float, autocvar_g_walljump_velocity_z_factor) +REGISTER_STAT(WALLJUMP_VELOCITY_XY_FACTOR, float, autocvar_g_walljump_velocity_xy_factor) +REGISTER_STAT(WALLJUMP_DELAY, float, autocvar_g_walljump_delay) +REGISTER_STAT(WALLJUMP_FORCE, float, autocvar_g_walljump_force) +REGISTER_STAT(LASTWJ, float) + // freeze tag, clan arena REGISTER_STAT(REDALIVE, int) REGISTER_STAT(BLUEALIVE, int) @@ -210,8 +273,17 @@ REGISTER_STAT(DOM_PPS_PINK, float) REGISTER_STAT(TELEPORT_MAXSPEED, float, autocvar_g_teleport_maxspeed) REGISTER_STAT(TELEPORT_TELEFRAG_AVOID, int, autocvar_g_telefrags_avoid) +REGISTER_STAT(CAMERA_SPECTATOR, int) + +REGISTER_STAT(SPECTATORSPEED, float) + +#ifdef SVQC +bool autocvar_sv_slick_applygravity; +#endif +REGISTER_STAT(SLICK_APPLYGRAVITY, bool, autocvar_sv_slick_applygravity) + #ifdef SVQC -#include "movetypes/movetypes.qh" +#include "physics/movetypes/movetypes.qh" #endif REGISTER_STAT(MOVEVARS_AIRACCEL_QW_STRETCHFACTOR, float) @@ -219,6 +291,7 @@ REGISTER_STAT(MOVEVARS_AIRCONTROL_PENALTY, float) REGISTER_STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW, float) REGISTER_STAT(MOVEVARS_AIRSTRAFEACCEL_QW, float) REGISTER_STAT(MOVEVARS_AIRCONTROL_POWER, float) +REGISTER_STAT(MOVEVARS_AIRCONTROL_BACKWARDS, bool) noref bool autocvar_sv_gameplayfix_nogravityonground; REGISTER_STAT(MOVEFLAGS, int, MOVEFLAG_VALID | (autocvar_sv_gameplayfix_q2airaccelerate ? MOVEFLAG_Q2AIRACCELERATE : 0) @@ -237,6 +310,7 @@ REGISTER_STAT(MOVEVARS_MAXAIRSTRAFESPEED, float) REGISTER_STAT(MOVEVARS_AIRCONTROL, float) REGISTER_STAT(FRAGLIMIT, float, autocvar_fraglimit) REGISTER_STAT(TIMELIMIT, float, autocvar_timelimit) +REGISTER_STAT(WARMUP_TIMELIMIT, float, warmup_limit) #ifdef SVQC float autocvar_sv_wallfriction; #endif @@ -256,4 +330,16 @@ REGISTER_STAT(MOVEVARS_MAXAIRSPEED, float) REGISTER_STAT(MOVEVARS_STEPHEIGHT, float, autocvar_sv_stepheight) REGISTER_STAT(MOVEVARS_AIRACCEL_QW, float) REGISTER_STAT(MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION, float) + + +#ifdef CSQC +noref int autocvar_cl_gunalign; +#endif +#ifdef SVQC +.int cvar_cl_gunalign; +REPLICATE(cvar_cl_gunalign, int, "cl_gunalign"); +#endif +REGISTER_STAT(GUNALIGN, int, this.cvar_cl_gunalign) +#ifdef SVQC +SPECTATE_COPYFIELD(_STAT(GUNALIGN)) #endif