mirror of
https://github.com/nzp-team/quakec.git
synced 2025-02-20 18:52:36 +00:00
FTE/CLIENT: Tweak HUD health display to account for Juggernog
This commit is contained in:
parent
b4f8a15cc3
commit
b691428e3c
3 changed files with 8 additions and 3 deletions
|
@ -49,14 +49,17 @@ string(string img) getImage = {
|
|||
|
||||
void(float width, float height) HUD_Health =
|
||||
{
|
||||
local float health;
|
||||
float health;
|
||||
float max_health;
|
||||
float alpha;
|
||||
|
||||
health = getstatf(STAT_HEALTH);
|
||||
max_health = getstatf(STAT_MAXHEALTH);
|
||||
|
||||
if (health < 100)
|
||||
if (health < max_health)
|
||||
{
|
||||
alpha = (100.0 - ((1.25 * health) - 25))/100*255;
|
||||
alpha = 255 - ((health/max_health))*255;
|
||||
|
||||
if (alpha <= 0.0)
|
||||
return;
|
||||
float modifier = (sin(time * 10) * 20) - 20;//always negative
|
||||
|
|
|
@ -320,6 +320,7 @@ void() worldspawn =
|
|||
clientstat(STAT_PLAYERSTANCE, EV_FLOAT, stance);
|
||||
clientstat(STAT_FACINGENEMY, EV_FLOAT, facingenemy);
|
||||
clientstat(STAT_VIEWZOOM, EV_FLOAT, viewzoom);
|
||||
clientstat(STAT_MAXHEALTH, EV_FLOAT, max_health);
|
||||
|
||||
#endif // FTE
|
||||
|
||||
|
|
|
@ -220,6 +220,7 @@ const float EVENT_SONGPLAY = 41;
|
|||
#define STAT_PLAYERNUM 64
|
||||
#define STAT_PLAYERSTANCE 65
|
||||
#define STAT_FACINGENEMY 66
|
||||
#define STAT_MAXHEALTH 67
|
||||
|
||||
//
|
||||
// invert float takes in float value between 0 and 1, inverts position
|
||||
|
|
Loading…
Reference in a new issue