seta hud_progressbar_health_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_armor_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_fuel_color "" "R G B vector of the progress bar background color"
+seta hud_progressbar_oxygen_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_nexball_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_speed_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_acceleration_color "" "R G B vector of the progress bar background color"
seta hud_progressbar_health_color "0.83 0.12 0"
seta hud_progressbar_armor_color "0.28 0.8 0"
seta hud_progressbar_fuel_color "0.77 0.67 0"
+seta hud_progressbar_oxygen_color "0.1 1 1"
seta hud_progressbar_nexball_color "0.2 0.65 0.93"
seta hud_progressbar_speed_color "0.77 0.67 0"
seta hud_progressbar_acceleration_color "0.2 0.65 0.93"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_oxygen_color "0 1 1"
seta hud_progressbar_nexball_color "0.7 0.1 0"
seta hud_progressbar_speed_color "1 0.75 0"
seta hud_progressbar_acceleration_color "0.5 0.75 1"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_oxygen_color "0 1 1"
seta hud_progressbar_nexball_color "0.7 0.1 0"
seta hud_progressbar_speed_color "1 0.75 0"
seta hud_progressbar_acceleration_color "0.5 0.75 1"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_oxygen_color "0 1 1"
seta hud_progressbar_nexball_color "0.7 0.1 0"
seta hud_progressbar_speed_color "1 0.75 0"
seta hud_progressbar_acceleration_color "0.5 0.75 1"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_oxygen_color "0 1 1"
seta hud_progressbar_nexball_color "0.7 0.1 0"
seta hud_progressbar_speed_color "1 0.75 0"
seta hud_progressbar_acceleration_color "0.5 0.75 1"
seta hud_progressbar_health_color "0.6 0 0"
seta hud_progressbar_armor_color "0 0.6 0"
seta hud_progressbar_fuel_color "0.6 0.6 0"
+seta hud_progressbar_oxygen_color "0 1 1"
seta hud_progressbar_nexball_color "0.7 0.1 0"
seta hud_progressbar_speed_color "1 0.75 0"
seta hud_progressbar_acceleration_color "0.5 0.75 1"
float autocvar_hud_progressbar_alpha;
vector autocvar_hud_progressbar_armor_color;
vector autocvar_hud_progressbar_fuel_color;
+vector autocvar_hud_progressbar_oxygen_color = '0.1 1 1';
vector autocvar_hud_progressbar_health_color;
vector autocvar_hud_progressbar_nexball_color;
vector autocvar_hud_progressbar_shield_color;
HUD_Write_Cvar("hud_progressbar_health_color");
HUD_Write_Cvar("hud_progressbar_armor_color");
HUD_Write_Cvar("hud_progressbar_fuel_color");
+ HUD_Write_Cvar("hud_progressbar_oxygen_color");
HUD_Write_Cvar("hud_progressbar_nexball_color");
HUD_Write_Cvar("hud_progressbar_speed_color");
HUD_Write_Cvar("hud_progressbar_acceleration_color");
void HUD_HealthArmor()
{
- int armor, health, fuel;
+ int armor, health, fuel, air_time;
if(!autocvar__hud_configure)
{
if((!autocvar_hud_panel_healtharmor) || (spectatee_status == -1))
prev_armor = 0;
}
fuel = STAT(FUEL);
+ air_time = bound(0, STAT(AIR_FINISHED) - time, 10);
}
else
{
health = 150;
armor = 75;
fuel = 20;
+ air_time = 6;
}
HUD_Panel_LoadCvars();
if(fuel)
HUD_Panel_DrawProgressBar(pos, vec2(mySize.x, 0.2 * mySize.y), "progressbar", fuel/100, 0, (baralign == 1 || baralign == 3), autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ if(air_time)
+ HUD_Panel_DrawProgressBar(pos + eY * 0.8 * mySize.y, vec2(mySize.x, 0.2 * mySize.y), "progressbar", air_time / 10, 0, (baralign == 1 || baralign == 3), autocvar_hud_progressbar_oxygen_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
}
else
{
armor_offset.y = mySize.y;
}
- bool health_baralign, armor_baralign, fuel_baralign;
+ bool health_baralign, armor_baralign, fuel_baralign, air_align;
bool health_iconalign, armor_iconalign;
if (autocvar_hud_panel_healtharmor_flip)
{
armor_baralign = (autocvar_hud_panel_healtharmor_baralign == 2 || autocvar_hud_panel_healtharmor_baralign == 1);
health_baralign = (autocvar_hud_panel_healtharmor_baralign == 3 || autocvar_hud_panel_healtharmor_baralign == 1);
- fuel_baralign = health_baralign;
+ air_align = fuel_baralign = health_baralign;
armor_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 2 || autocvar_hud_panel_healtharmor_iconalign == 1);
health_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 3 || autocvar_hud_panel_healtharmor_iconalign == 1);
}
{
health_baralign = (autocvar_hud_panel_healtharmor_baralign == 2 || autocvar_hud_panel_healtharmor_baralign == 1);
armor_baralign = (autocvar_hud_panel_healtharmor_baralign == 3 || autocvar_hud_panel_healtharmor_baralign == 1);
- fuel_baralign = armor_baralign;
+ air_align = fuel_baralign = armor_baralign;
health_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 2 || autocvar_hud_panel_healtharmor_iconalign == 1);
armor_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 3 || autocvar_hud_panel_healtharmor_iconalign == 1);
}
DrawNumIcon(pos + armor_offset, mySize, armor, "armor", is_vertical, armor_iconalign, HUD_Get_Num_Color(armor, maxarmor), 1);
}
- if(fuel)
+ vector cell_size = mySize;
+ if (fuel || air_time)
{
if (is_vertical)
mySize.x *= 0.2 / 2; //if vertical always halve x to not cover too much numbers with 3 digits
mySize.x *= 2; //restore full panel size
else if (panel_ar < 1/4)
mySize.y *= 2; //restore full panel size
- HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", fuel/100, is_vertical, fuel_baralign, autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ if (fuel)
+ HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", fuel/100, is_vertical, fuel_baralign, autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ if (air_time)
+ {
+ if (panel_ar > 1 && panel_ar < 4)
+ pos.y += cell_size.y;
+ else if (panel_ar > 1/4 && panel_ar <= 1)
+ pos.x += cell_size.x;
+ if (is_vertical)
+ pos.x += cell_size.x - mySize.x;
+ else
+ pos.y += cell_size.y - mySize.y;
+ HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", air_time / 10, is_vertical, air_align, autocvar_hud_progressbar_oxygen_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ }
}
}
REGISTER_STAT(DAMAGE_DEALT_TOTAL, int)
REGISTER_STAT(TYPEHIT_TIME, float)
REGISTER_STAT(SUPERWEAPONS_FINISHED, float)
+REGISTER_STAT(AIR_FINISHED, float)
REGISTER_STAT(VEHICLESTAT_HEALTH, int)
REGISTER_STAT(VEHICLESTAT_SHIELD, int)
REGISTER_STAT(VEHICLESTAT_ENERGY, int)
if(this.air_finished < time)
PlayerSound(this, playersound_gasp, CH_PLAYER, VOL_BASE, VOICETYPE_PLAYERSOUND);
this.air_finished = time + autocvar_g_balance_contents_drowndelay;
+ this.air_finished_stat = 0;
}
else if (this.air_finished < time)
{ // drown!
Damage (this, NULL, NULL, autocvar_g_balance_contents_playerdamage_drowning * autocvar_g_balance_contents_damagerate, DEATH_DROWN.m_id, DMG_NOWEP, this.origin, '0 0 0');
this.pain_finished = time + 0.5;
}
+ this.air_finished_stat = this.air_finished;
}
+ else
+ this.air_finished_stat = this.air_finished;
}
.bool move_qcphysics;
.float crouch; // Crouching or not?
const .float superweapons_finished = _STAT(SUPERWEAPONS_FINISHED);
+const .float air_finished_stat = _STAT(AIR_FINISHED);
.float cnt; // used in too many places
.float count;