strengthTime = bound(0, STAT(STRENGTH_FINISHED) - time, 99);
shieldTime = bound(0, STAT(INVINCIBLE_FINISHED) - time, 99);
- superTime = bound(0, getstatf(STAT_SUPERWEAPONS_FINISHED) - time, 99);
+ superTime = bound(0, STAT(SUPERWEAPONS_FINISHED) - time, 99);
if(allItems & IT_UNLIMITED_SUPERWEAPONS)
superTime = 99;
else if (getstatf(STAT_HEALING_ORB)>time)
drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, NADE_TYPE_HEAL.m_color, autocvar_hud_colorflash_alpha*getstatf(STAT_HEALING_ORB_ALPHA), DRAWFLAG_ADDITIVE);
if(!intermission)
- if(getstatf(STAT_NADE_TIMER) && autocvar_cl_nade_timer) // give nade top priority, as it's a matter of life and death
+ if(STAT(NADE_TIMER) && autocvar_cl_nade_timer) // give nade top priority, as it's a matter of life and death
{
- DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", getstatf(STAT_NADE_TIMER), '0.25 0.90 1' + ('1 0 0' * getstatf(STAT_NADE_TIMER)) - ('0 1 1' * getstatf(STAT_NADE_TIMER)), 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(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))
.entity nade;
.entity fake_nade;
-.float nade_timer;
+.float nade_timer = _STAT(NADE_TIMER);
.float nade_refire;
.float bonus_nades;
.float nade_special_time;
{
MUTATOR_ONADD
{
- addstat(STAT_NADE_TIMER, AS_FLOAT, nade_timer);
addstat(STAT_NADE_BONUS, AS_FLOAT, bonus_nades);
addstat(STAT_NADE_BONUS_TYPE, AS_INT, nade_type);
addstat(STAT_NADE_BONUS_SCORE, AS_FLOAT, bonus_nade_score);
STAT_LAST_VECTOR
};
-const int REGISTERED_STATS = 24;
+const int REGISTERED_STATS = 33;
REGISTER_STAT(KH_KEYS, int)
/** weapon requested to switch to; next WANTED weapon (for HUD) */
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)
+REGISTER_STAT(VEHICLESTAT_ENERGY, int)
+REGISTER_STAT(VEHICLESTAT_AMMO1, int)
+REGISTER_STAT(VEHICLESTAT_RELOAD1, int)
+REGISTER_STAT(VEHICLESTAT_AMMO2, int)
+REGISTER_STAT(VEHICLESTAT_RELOAD2, int)
+REGISTER_STAT(VEHICLESTAT_W2MODE, int)
+REGISTER_STAT(NADE_TIMER, float)
enum {
STAT_FIRST_MAIN = (STAT_LAST_VECTOR - 1) + REGISTERED_STATS,
- STAT_SUPERWEAPONS_FINISHED,
- STAT_VEHICLESTAT_HEALTH,
- STAT_VEHICLESTAT_SHIELD,
- STAT_VEHICLESTAT_ENERGY,
- STAT_VEHICLESTAT_AMMO1,
- STAT_VEHICLESTAT_RELOAD1,
- STAT_VEHICLESTAT_AMMO2,
- STAT_VEHICLESTAT_RELOAD2,
- STAT_VEHICLESTAT_W2MODE,
- STAT_NADE_TIMER,
STAT_SECRETS_TOTAL,
STAT_SECRETS_FOUND,
STAT_RESPAWN_TIME,
#include "all.qh"
-#ifndef MENUQC
-STATIC_INIT(vehicles_common_initialize)
-{
-#ifdef SVQC
- addstat(STAT_VEHICLESTAT_HEALTH, AS_INT, vehicle_health);
- addstat(STAT_VEHICLESTAT_SHIELD, AS_INT, vehicle_shield);
- addstat(STAT_VEHICLESTAT_ENERGY, AS_INT, vehicle_energy);
-
- addstat(STAT_VEHICLESTAT_W2MODE, AS_INT, vehicle_weapon2mode);
-
- addstat(STAT_VEHICLESTAT_AMMO1, AS_INT, vehicle_ammo1);
- addstat(STAT_VEHICLESTAT_RELOAD1, AS_INT, vehicle_reload1);
-
- addstat(STAT_VEHICLESTAT_AMMO2, AS_INT, vehicle_ammo2);
- addstat(STAT_VEHICLESTAT_RELOAD2, AS_INT, vehicle_reload2);
-#endif // SVQC
-}
-#endif
-
REGISTER_NET_LINKED(ENT_CLIENT_AUXILIARYXHAIR)
#if defined(SVQC)
float barAlpha = autocvar_hud_progressbar_alpha * hudAlpha;
float blinkValue = 0.55 + sin(time * 7) * 0.45;
- float health = getstati(STAT_VEHICLESTAT_HEALTH) * 0.01;
- float shield = getstati(STAT_VEHICLESTAT_SHIELD) * 0.01;
- float energy = getstati(STAT_VEHICLESTAT_ENERGY) * 0.01;
- float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1) * 0.01;
- float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1) * 0.01;
- float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2) * 0.01;
- float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2) * 0.01;
+ float health = STAT(VEHICLESTAT_HEALTH) * 0.01;
+ float shield = STAT(VEHICLESTAT_SHIELD) * 0.01;
+ float energy = STAT(VEHICLESTAT_ENERGY) * 0.01;
+ float ammo1 = STAT(VEHICLESTAT_AMMO1) * 0.01;
+ float reload1 = STAT(VEHICLESTAT_RELOAD1) * 0.01;
+ float ammo2 = STAT(VEHICLESTAT_AMMO2) * 0.01;
+ float reload2 = STAT(VEHICLESTAT_RELOAD2) * 0.01;
// HACK to deal with the inconsistent use of the vehicle stats
ammo1 = (ammo1) ? ammo1 : energy;
void RaptorCBShellfragDraw(entity this);
void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang);
-#define weapon2mode getstati(STAT_VEHICLESTAT_W2MODE)
+#define weapon2mode STAT(VEHICLESTAT_W2MODE)
#endif
.entity gunner1;
.entity gunner2;
-.float vehicle_health; /// If self is player this is 0..100 indicating precentage of health left on vehicle. If self is vehile, this is the real health value.
-.float vehicle_energy; /// If self is player this is 0..100 indicating precentage of energy left on vehicle. If self is vehile, this is the real energy value.
-.float vehicle_shield; /// If self is player this is 0..100 indicating precentage of shield left on vehicle. If self is vehile, this is the real shield value.
+.float vehicle_health = _STAT(VEHICLESTAT_HEALTH); /// If self is player this is 0..100 indicating precentage of health left on vehicle. If self is vehile, this is the real health value.
+.float vehicle_energy = _STAT(VEHICLESTAT_ENERGY); /// If self is player this is 0..100 indicating precentage of energy left on vehicle. If self is vehile, this is the real energy value.
+.float vehicle_shield = _STAT(VEHICLESTAT_SHIELD); /// If self is player this is 0..100 indicating precentage of shield left on vehicle. If self is vehile, this is the real shield value.
-.float vehicle_ammo1; /// If self is player this is 0..100 indicating percentage of primary ammo left UNLESS value is already stored in vehicle_energy. If self is vehile, this is the real ammo1 value.
-.float vehicle_reload1; /// If self is player this is 0..100 indicating percentage of primary reload status. If self is vehile, this is the real reload1 value.
-.float vehicle_ammo2; /// If self is player this is 0..100 indicating percentage of secondary ammo left. If self is vehile, this is the real ammo2 value.
-.float vehicle_reload2; /// If self is player this is 0..100 indicating percentage of secondary reload status. If self is vehile, this is the real reload2 value.
+.float vehicle_ammo1 = _STAT(VEHICLESTAT_AMMO1); /// If self is player this is 0..100 indicating percentage of primary ammo left UNLESS value is already stored in vehicle_energy. If self is vehile, this is the real ammo1 value.
+.float vehicle_reload1 = _STAT(VEHICLESTAT_RELOAD1); /// If self is player this is 0..100 indicating percentage of primary reload status. If self is vehile, this is the real reload1 value.
+.float vehicle_ammo2 = _STAT(VEHICLESTAT_AMMO2); /// If self is player this is 0..100 indicating percentage of secondary ammo left. If self is vehile, this is the real ammo2 value.
+.float vehicle_reload2 = _STAT(VEHICLESTAT_RELOAD2); /// If self is player this is 0..100 indicating percentage of secondary reload status. If self is vehile, this is the real reload2 value.
.float sound_nexttime;
const float VOL_VEHICLEENGINE = 1;
// vehicle functions
.void(int _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
.bool(int _imp) vehicles_impulse;
-.int vehicle_weapon2mode;
+.int vehicle_weapon2mode = _STAT(VEHICLESTAT_W2MODE);
.void(int exit_flags) vehicle_exit;
.bool() vehicle_enter;
const int VHEF_NORMAL = 0; /// User pressed exit key
dropmark.gravity = 1;
}
- float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2) * 0.01;
+ float reload2 = STAT(VEHICLESTAT_RELOAD2) * 0.01;
if(reload2 == 1)
{
setorigin(dropmark, pmove_org);
.float strength_finished = _STAT(STRENGTH_FINISHED);
.float invincible_finished = _STAT(INVINCIBLE_FINISHED);
-.float superweapons_finished;
+.float superweapons_finished = _STAT(SUPERWEAPONS_FINISHED);
.float cnt; // used in too many places
.float count;
addstat(STAT_ROUNDSTARTTIME, AS_FLOAT, stat_round_starttime);
Nagger_Init();
- addstat(STAT_SUPERWEAPONS_FINISHED, AS_FLOAT, superweapons_finished);
addstat(STAT_PLASMA, AS_INT, ammo_plasma);
// freeze attacks