diff --git a/README.md b/README.md index b7a3ce6..cbbb258 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ Aura Client ====================== -[![CI](https://github.com/phoenixprojectsoftware/Aura-CL/actions/workflows/CI.yml/badge.svg?branch=master&event=push)](https://github.com/phoenixprojectsoftware/Aura-CL/actions/workflows/CI.yml) -[![Build Status](https://travis-ci.com/phoenixprojectsoftware/Aura-CL.svg?branch=master)](https://travis-ci.com/phoenixprojectsoftware/Aura-CL) **Aura** is the all new multiplayer game engine from The Phoenix Project Software, and a modification of Adrenaline Gamer, built specifically for *Half-Life: Zombies Ate My Neighbours.* diff --git a/cl_dll/battery.cpp b/cl_dll/battery.cpp index c3c0850..fd7e691 100644 --- a/cl_dll/battery.cpp +++ b/cl_dll/battery.cpp @@ -84,7 +84,7 @@ int CHudBattery:: MsgFunc_Battery(const char *pszName, int iSize, void *pbuf ) int CHudBattery::Draw(float flTime) { - if ( gHUD.m_iHideHUDDisplay & HIDEHUD_HEALTH ) + if (gHUD.m_iHideHUDDisplay & HIDEHUD_HEALTH) return 1; int r, g, b, x, y, a; @@ -94,40 +94,58 @@ int CHudBattery::Draw(float flTime) #if defined( _TFC ) float fScale = 0.0; - - if ( m_iBatMax > 0 ) + + if (m_iBatMax > 0) fScale = 1.0 / (float)m_iBatMax; - rc.top += m_iHeight * ((float)(m_iBatMax-(min(m_iBatMax,m_iBat))) * fScale); // battery can go from 0 to m_iBatMax so * fScale goes from 0 to 1 + rc.top += m_iHeight * ((float)(m_iBatMax - (min(m_iBatMax, m_iBat))) * fScale); // battery can go from 0 to m_iBatMax so * fScale goes from 0 to 1 #else - rc.top += m_iHeight * ((float)(100-(min(100,m_iBat))) * 0.01); // battery can go from 0 to 100 so * 0.01 goes from 0 to 1 + rc.top += m_iHeight * ((float)(100 - (min(100, m_iBat))) * 0.01); // battery can go from 0 to 100 so * 0.01 goes from 0 to 1 #endif - UnpackRGB(r,g,b, gHUD.m_iDefaultHUDColor); + cvar_t* sv_aura_regeneration = gEngfuncs.pfnGetCvarPointer("sv_aura_regeneration"); - if (!(gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT)) )) - return 1; - // Has health changed? Flash the health # - if (m_fFade) + // DeanAMX: Flash the armour HUD on zero. + + UnpackRGB(r, g, b, RGB_DEFAULT); + if (sv_aura_regeneration->value == 1) { - if (m_fFade > FADE_TIME) - m_fFade = FADE_TIME; - m_fFade -= (gHUD.m_flTimeDelta * 20); - if (m_fFade <= 0) + if (m_iBat <= 0) + { + if (!Blinking) { - a = 128; - m_fFade = 0; + PlaySound("player/shield_empty.wav", 1); + Blinking = true; } - // Fade the health number back to dim + a = (int)(fabs(sin(flTime * 10)) * 256.0); + } + else + { + Blinking = false; + + if (0 != m_fFade) // Has health changed? Flash the health # + { + if (m_fFade > FADE_TIME) + m_fFade = FADE_TIME; + + m_fFade -= (gHUD.m_flTimeDelta * 20); + if (m_fFade <= 0) + { + a = 128; + m_fFade = 0; + } - a = MIN_ALPHA + (m_fFade/FADE_TIME) * 128; + // Fade the health number back to dim + a = MIN_ALPHA + (m_fFade / FADE_TIME) * 128; + } + else + a = MIN_ALPHA; + } } - else - a = MIN_ALPHA; ScaleColors(r, g, b, a ); diff --git a/cl_dll/hud.h b/cl_dll/hud.h index 1211082..84a9662 100644 --- a/cl_dll/hud.h +++ b/cl_dll/hud.h @@ -353,6 +353,7 @@ class CHudBattery: public CHudBase int VidInit( void ); int Draw(float flTime); int MsgFunc_Battery(const char *pszName, int iSize, void *pbuf ); + bool Blinking; private: HSPRITE m_hSprite1;