int redflag, blueflag, yellowflag, pinkflag, neutralflag; // current status
float redflag_statuschange_elapsedtime, blueflag_statuschange_elapsedtime, yellowflag_statuschange_elapsedtime, pinkflag_statuschange_elapsedtime, neutralflag_statuschange_elapsedtime; // time since the status changed
bool ctf_oneflag; // one-flag CTF mode enabled/disabled
- int stat_items = getstati(STAT_CTF_FLAGSTATUS, 0, 24);
+ int stat_items = STAT(CTF_FLAGSTATUS);
float fs, fs2, fs3, size1, size2;
vector e1, e2;
addPowerupItem("Superweapons", "superweapons", autocvar_hud_progressbar_superweapons_color, superTime, 30);
FOREACH(Buffs, it.m_itemid & allBuffs, LAMBDA(
- addPowerupItem(it.m_prettyName, strcat("buff_", it.m_name), it.m_color, bound(0, getstatf(STAT_BUFF_TIME) - time, 99), 60);
+ addPowerupItem(it.m_prettyName, strcat("buff_", it.m_name), it.m_color, bound(0, STAT(BUFF_TIME) - time, 99), 60);
));
if(!powerupItemsCount)
void HUD_Draw()
{
if(STAT(FROZEN))
- drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, ((getstatf(STAT_REVIVE_PROGRESS)) ? ('0.25 0.90 1' + ('1 0 0' * getstatf(STAT_REVIVE_PROGRESS)) + ('0 1 1' * getstatf(STAT_REVIVE_PROGRESS) * -1)) : '0.25 0.90 1'), autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+ drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, ((STAT(REVIVE_PROGRESS)) ? ('0.25 0.90 1' + ('1 0 0' * STAT(REVIVE_PROGRESS)) + ('0 1 1' * STAT(REVIVE_PROGRESS) * -1)) : '0.25 0.90 1'), autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
else if (STAT(HEALING_ORB)>time)
drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, NADE_TYPE_HEAL.m_color, autocvar_hud_colorflash_alpha*STAT(HEALING_ORB_ALPHA), DRAWFLAG_ADDITIVE);
if(!intermission)
DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(NADE_TIMER), '0.25 0.90 1' + ('1 0 0' * STAT(NADE_TIMER)) - ('0 1 1' * STAT(NADE_TIMER)), autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
drawstring_aspect(eY * 0.64 * vid_conheight, ((autocvar_cl_nade_timer == 2) ? _("Nade timer") : ""), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
}
- else if(getstatf(STAT_REVIVE_PROGRESS))
+ else if(STAT(REVIVE_PROGRESS))
{
- DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", getstatf(STAT_REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+ DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
drawstring_aspect(eY * 0.64 * vid_conheight, _("Revival progress"), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
}
if(autocvar_chase_active <= 0) // greater than 0 means it's enabled manually, and this code is skipped
{
float vehicle_chase = (hud != HUD_NORMAL && (autocvar_cl_eventchase_vehicle || spectatee_status > 0));
- float ons_roundlost = (gametype == MAPINFO_TYPE_ONSLAUGHT && getstati(STAT_ROUNDLOST));
+ float ons_roundlost = (gametype == MAPINFO_TYPE_ONSLAUGHT && STAT(ROUNDLOST));
entity gen = world;
if(ons_roundlost)
.float teleport_antispam;
-.bool ons_roundlost;
+.bool ons_roundlost = _STAT(ROUNDLOST);
// waypoint sprites
.entity bot_basewaypoint; // generator waypointsprite
g_onslaught = true;
ons_captureshield_force = autocvar_g_onslaught_shield_force;
- addstat(STAT_ROUNDLOST, AS_INT, ons_roundlost);
-
InitializeEntity(world, ons_DelayedInit, INITPRIO_GAMETYPE);
}
float autocvar_cl_gameplayfix_fixedcheckwatertransition = 1;
#ifdef SVQC
-.int stat_gameplayfix_upvelocityclearsonground;
+.int stat_gameplayfix_upvelocityclearsonground = _STAT(GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND);
#define GRAVITY_UNAFFECTED_BY_TICRATE autocvar_sv_gameplayfix_gravityunaffectedbyticrate
#define UPWARD_VELOCITY_CLEARS_ONGROUND autocvar_sv_gameplayfix_upwardvelocityclearsongroundflag
#define TICRATE sys_frametime
#elif defined(CSQC)
#define GRAVITY_UNAFFECTED_BY_TICRATE (STAT(MOVEFLAGS) & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE)
-#define UPWARD_VELOCITY_CLEARS_ONGROUND getstati(STAT_GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND)
+#define UPWARD_VELOCITY_CLEARS_ONGROUND STAT(GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND)
#define TICRATE ticrate
#endif
#include "../../../gamemodes/all.qh"
#include "../../../buffs/all.qh"
-.float buff_time;
+.float buff_time = _STAT(BUFF_TIME);
void buffs_DelayedInit();
REGISTER_MUTATOR(buffs, cvar("g_buffs"))
{
MUTATOR_ONADD
{
- addstat(STAT_BUFF_TIME, AS_FLOAT, buff_time);
-
InitializeEntity(world, buffs_DelayedInit, INITPRIO_FINDTARGET);
}
}
#define PHYS_MULTIJUMP getstati(STAT_MULTIJUMP)
#define PHYS_MULTIJUMP_SPEED getstatf(STAT_MULTIJUMP_SPEED)
#define PHYS_MULTIJUMP_ADD getstati(STAT_MULTIJUMP_ADD)
-#define PHYS_MULTIJUMP_MAXSPEED getstatf(STAT_MULTIJUMP_MAXSPEED)
-#define PHYS_MULTIJUMP_DODGING getstati(STAT_MULTIJUMP_DODGING)
+#define PHYS_MULTIJUMP_MAXSPEED STAT(MULTIJUMP_MAXSPEED)
+#define PHYS_MULTIJUMP_DODGING STAT(MULTIJUMP_DODGING)
#elif defined(SVQC)
.float stat_multijump;
.float stat_multijump_speed;
.float stat_multijump_add;
-.float stat_multijump_maxspeed;
-.float stat_multijump_dodging;
+.float stat_multijump_maxspeed = _STAT(MULTIJUMP_MAXSPEED);
+.float stat_multijump_dodging = _STAT(MULTIJUMP_DODGING);
void multijump_UpdateStats()
{SELFPARAM();
addstat(STAT_MULTIJUMP, AS_INT, stat_multijump);
addstat(STAT_MULTIJUMP_SPEED, AS_FLOAT, stat_multijump_speed);
addstat(STAT_MULTIJUMP_ADD, AS_INT, stat_multijump_add);
- addstat(STAT_MULTIJUMP_MAXSPEED, AS_FLOAT, stat_multijump_maxspeed);
- addstat(STAT_MULTIJUMP_DODGING, AS_INT, stat_multijump_dodging);
}
#endif
addstat(STAT_MOVEVARS_STOPSPEED, AS_FLOAT, stat_sv_stopspeed);
addstat(STAT_MOVEVARS_AIRACCELERATE, AS_FLOAT, stat_sv_airaccelerate);
addstat(STAT_MOVEVARS_AIRSTOPACCELERATE, AS_FLOAT, stat_sv_airstopaccelerate);
-
- addstat(STAT_GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND, AS_INT, stat_gameplayfix_upvelocityclearsonground);
}
void Physics_UpdateStats(float maxspd_mod)
#define PHYS_DOUBLEJUMP getstati(STAT_DOUBLEJUMP)
- #define PHYS_BUGRIGS getstati(STAT_BUGRIGS)
- #define PHYS_BUGRIGS_ANGLE_SMOOTHING getstati(STAT_BUGRIGS_ANGLE_SMOOTHING)
- #define PHYS_BUGRIGS_PLANAR_MOVEMENT getstati(STAT_BUGRIGS_PLANAR_MOVEMENT)
- #define PHYS_BUGRIGS_REVERSE_SPEEDING getstati(STAT_BUGRIGS_REVERSE_SPEEDING)
- #define PHYS_BUGRIGS_FRICTION_FLOOR getstatf(STAT_BUGRIGS_FRICTION_FLOOR)
- #define PHYS_BUGRIGS_AIR_STEERING getstati(STAT_BUGRIGS_AIR_STEERING)
- #define PHYS_BUGRIGS_FRICTION_BRAKE getstatf(STAT_BUGRIGS_FRICTION_BRAKE)
- #define PHYS_BUGRIGS_ACCEL getstatf(STAT_BUGRIGS_ACCEL)
- #define PHYS_BUGRIGS_SPEED_REF getstatf(STAT_BUGRIGS_SPEED_REF)
- #define PHYS_BUGRIGS_SPEED_POW getstatf(STAT_BUGRIGS_SPEED_POW)
- #define PHYS_BUGRIGS_STEER getstatf(STAT_BUGRIGS_STEER)
- #define PHYS_BUGRIGS_FRICTION_AIR getstatf(STAT_BUGRIGS_FRICTION_AIR)
- #define PHYS_BUGRIGS_CAR_JUMPING getstatf(STAT_BUGRIGS_CAR_JUMPING)
- #define PHYS_BUGRIGS_REVERSE_SPINNING getstatf(STAT_BUGRIGS_REVERSE_SPINNING)
- #define PHYS_BUGRIGS_REVERSE_STOPPING getstatf(STAT_BUGRIGS_REVERSE_STOPPING)
+ #define PHYS_BUGRIGS STAT(BUGRIGS)
+ #define PHYS_BUGRIGS_ANGLE_SMOOTHING STAT(BUGRIGS_ANGLE_SMOOTHING)
+ #define PHYS_BUGRIGS_PLANAR_MOVEMENT STAT(BUGRIGS_PLANAR_MOVEMENT)
+ #define PHYS_BUGRIGS_REVERSE_SPEEDING STAT(BUGRIGS_REVERSE_SPEEDING)
+ #define PHYS_BUGRIGS_FRICTION_FLOOR STAT(BUGRIGS_FRICTION_FLOOR)
+ #define PHYS_BUGRIGS_AIR_STEERING STAT(BUGRIGS_AIR_STEERING)
+ #define PHYS_BUGRIGS_FRICTION_BRAKE STAT(BUGRIGS_FRICTION_BRAKE)
+ #define PHYS_BUGRIGS_ACCEL STAT(BUGRIGS_ACCEL)
+ #define PHYS_BUGRIGS_SPEED_REF STAT(BUGRIGS_SPEED_REF)
+ #define PHYS_BUGRIGS_SPEED_POW STAT(BUGRIGS_SPEED_POW)
+ #define PHYS_BUGRIGS_STEER STAT(BUGRIGS_STEER)
+ #define PHYS_BUGRIGS_FRICTION_AIR STAT(BUGRIGS_FRICTION_AIR)
+ #define PHYS_BUGRIGS_CAR_JUMPING STAT(BUGRIGS_CAR_JUMPING)
+ #define PHYS_BUGRIGS_REVERSE_SPINNING STAT(BUGRIGS_REVERSE_SPINNING)
+ #define PHYS_BUGRIGS_REVERSE_STOPPING STAT(BUGRIGS_REVERSE_STOPPING)
#define PHYS_JUMPSPEEDCAP_MIN cvar_string("cl_jumpspeedcap_min")
#define PHYS_JUMPSPEEDCAP_MAX cvar_string("cl_jumpspeedcap_max")
.float stat_gameplayfix_unstickplayers;
.float stat_gameplayfix_stepdown;
- .float stat_bugrigs;
- .float stat_bugrigs_angle_smoothing;
- .float stat_bugrigs_planar_movement;
- .float stat_bugrigs_reverse_speeding;
- .float stat_bugrigs_friction_floor;
- .float stat_bugrigs_air_steering;
- .float stat_bugrigs_friction_brake;
- .float stat_bugrigs_accel;
- .float stat_bugrigs_speed_ref;
- .float stat_bugrigs_speed_pow;
- .float stat_bugrigs_steer;
- .float stat_bugrigs_friction_air;
- .float stat_bugrigs_car_jumping;
- .float stat_bugrigs_reverse_spinning;
- .float stat_bugrigs_reverse_stopping;
+ .float stat_bugrigs = _STAT(BUGRIGS);
+ .float stat_bugrigs_angle_smoothing = _STAT(BUGRIGS_ANGLE_SMOOTHING);
+ .float stat_bugrigs_planar_movement = _STAT(BUGRIGS_PLANAR_MOVEMENT);
+ .float stat_bugrigs_reverse_speeding = _STAT(BUGRIGS_REVERSE_SPEEDING);
+ .float stat_bugrigs_friction_floor = _STAT(BUGRIGS_FRICTION_FLOOR);
+ .float stat_bugrigs_air_steering = _STAT(BUGRIGS_AIR_STEERING);
+ .float stat_bugrigs_friction_brake = _STAT(BUGRIGS_FRICTION_BRAKE);
+ .float stat_bugrigs_accel = _STAT(BUGRIGS_ACCEL);
+ .float stat_bugrigs_speed_ref = _STAT(BUGRIGS_SPEED_REF);
+ .float stat_bugrigs_speed_pow = _STAT(BUGRIGS_SPEED_POW);
+ .float stat_bugrigs_steer = _STAT(BUGRIGS_STEER);
+ .float stat_bugrigs_friction_air = _STAT(BUGRIGS_FRICTION_AIR);
+ .float stat_bugrigs_car_jumping = _STAT(BUGRIGS_CAR_JUMPING);
+ .float stat_bugrigs_reverse_spinning = _STAT(BUGRIGS_REVERSE_SPINNING);
+ .float stat_bugrigs_reverse_stopping = _STAT(BUGRIGS_REVERSE_STOPPING);
// new properties
.float stat_sv_jumpvelocity;
STAT_LAST_VECTOR
};
-const int REGISTERED_STATS = 64;
+const int REGISTERED_STATS = 86;
REGISTER_STAT(KH_KEYS, int)
/** weapon requested to switch to; next WANTED weapon (for HUD) */
REGISTER_STAT(OK_AMMO_CHARGE, float)
REGISTER_STAT(OK_AMMO_CHARGEPOOL, float)
REGISTER_STAT(FROZEN, int)
+REGISTER_STAT(REVIVE_PROGRESS, float)
+REGISTER_STAT(ROUNDLOST, int)
+REGISTER_STAT(BUFF_TIME, float)
+REGISTER_STAT(CTF_FLAGSTATUS, int)
+REGISTER_STAT(MULTIJUMP_DODGING, int)
+REGISTER_STAT(MULTIJUMP_MAXSPEED, float)
+REGISTER_STAT(GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND, int)
+REGISTER_STAT(BUGRIGS_REVERSE_STOPPING, int)
+REGISTER_STAT(BUGRIGS_REVERSE_SPINNING, int)
+REGISTER_STAT(BUGRIGS_CAR_JUMPING, int)
+REGISTER_STAT(BUGRIGS_FRICTION_AIR, float)
+REGISTER_STAT(BUGRIGS_STEER, float)
+REGISTER_STAT(BUGRIGS_SPEED_POW, float)
+REGISTER_STAT(BUGRIGS_SPEED_REF, float)
+REGISTER_STAT(BUGRIGS_ACCEL, float)
+REGISTER_STAT(BUGRIGS_FRICTION_BRAKE, float)
+REGISTER_STAT(BUGRIGS_AIR_STEERING, int)
+REGISTER_STAT(BUGRIGS_FRICTION_FLOOR, float)
+REGISTER_STAT(BUGRIGS_REVERSE_SPEEDING, int)
+REGISTER_STAT(BUGRIGS_PLANAR_MOVEMENT, int)
+REGISTER_STAT(BUGRIGS_ANGLE_SMOOTHING, int)
+REGISTER_STAT(BUGRIGS, int)
enum {
STAT_FIRST_MAIN = (STAT_LAST_VECTOR - 1) + REGISTERED_STATS,
- STAT_REVIVE_PROGRESS,
- STAT_ROUNDLOST,
- STAT_BUFF_TIME,
- STAT_CTF_FLAGSTATUS,
- STAT_MULTIJUMP_DODGING,
- STAT_MULTIJUMP_MAXSPEED,
- STAT_GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND,
- STAT_BUGRIGS_REVERSE_STOPPING,
- STAT_BUGRIGS_REVERSE_SPINNING,
- STAT_BUGRIGS_CAR_JUMPING,
- STAT_BUGRIGS_FRICTION_AIR,
- STAT_BUGRIGS_STEER,
- STAT_BUGRIGS_SPEED_POW,
- STAT_BUGRIGS_SPEED_REF,
- STAT_BUGRIGS_ACCEL,
- STAT_BUGRIGS_FRICTION_BRAKE,
- STAT_BUGRIGS_AIR_STEERING,
- STAT_BUGRIGS_FRICTION_FLOOR,
- STAT_BUGRIGS_REVERSE_SPEEDING,
- STAT_BUGRIGS_PLANAR_MOVEMENT,
- STAT_BUGRIGS_ANGLE_SMOOTHING,
- STAT_BUGRIGS,
STAT_GAMEPLAYFIX_STEPDOWN,
STAT_MOVEVARS_JUMPSTEP,
STAT_NOSTEP,
.float weapon_blocked; // weapon use disabled
.float frozen = _STAT(FROZEN); // for freeze attacks
-.float revive_progress;
+.float revive_progress = _STAT(REVIVE_PROGRESS);
.float revival_time; // time at which player was last revived
.float revive_speed; // NOTE: multiplier (anything above 1 is instaheal)
.entity iceblock;
WepSet_AddStat_InMap();
Nagger_Init();
- // freeze attacks
- addstat(STAT_REVIVE_PROGRESS, AS_FLOAT, revive_progress);
-
// physics
Physics_AddStats();
#define CTF_DIFFTEAM(a,b) ((autocvar_g_ctf_reverse || (ctf_oneflag && autocvar_g_ctf_oneflag_reverse)) ? SAME_TEAM(a,b) : DIFF_TEAM(a,b))
// networked flag statuses
-.int ctf_flagstatus;
+.int ctf_flagstatus = _STAT(CTF_FLAGSTATUS);
#endif
const int CTF_RED_FLAG_TAKEN = 1;
ctf_captureshield_max_ratio = autocvar_g_ctf_shield_max_ratio;
ctf_captureshield_force = autocvar_g_ctf_shield_force;
- addstat(STAT_CTF_FLAGSTATUS, AS_INT, ctf_flagstatus);
-
InitializeEntity(world, ctf_DelayedInit, INITPRIO_GAMETYPE);
}