diff --git a/BossHP/scripting/BossHP.sp b/BossHP/scripting/BossHP.sp index 1b0c9e1..5f12a67 100644 --- a/BossHP/scripting/BossHP.sp +++ b/BossHP/scripting/BossHP.sp @@ -241,7 +241,6 @@ public void OnMapStart() bool bMultiTrigger = view_as(KvConfig.GetNum("multitrigger", 0)); bool bNameFixup = view_as(KvConfig.GetNum("namefixup", 0)); int iTimeout = KvConfig.GetNum("timeout", -1); - int iOffset = KvConfig.GetNum("offset", 0); CConfig Config = view_as(INVALID_HANDLE); @@ -317,7 +316,6 @@ public void OnMapStart() Config.bMultiTrigger = bMultiTrigger; Config.bNameFixup = bNameFixup; Config.iTimeout = iTimeout; - Config.iOffset = iOffset; Config.SetTrigger(sTrigger); Config.SetOutput(sTrigger[iTriggerDelim + 1]); @@ -931,33 +929,45 @@ public void OnGameFrame() } } - if(!IsVoteInProgress()) - { - if(g_sHUDText[0]) - { - for(int client = 1; client <= MaxClients; client++) - { - if(IsClientInGame(client)) - { - PrintHintText(client, g_sHUDText); - StopSound(client, SNDCHAN_STATIC, "UI/hint.wav"); - } - } - s_bLastHudPrinted = true; - } - else if(s_bLastHudPrinted) - { - for(int client = 1; client <= MaxClients; client++) - { - if(IsClientInGame(client)) - { - PrintHintText(client, ""); - StopSound(client, SNDCHAN_STATIC, "UI/hint.wav"); - } - } - s_bLastHudPrinted = false; - } - } + bool voteInProgress = IsVoteInProgress(); + if(g_sHUDText[0]) + { + for(int client = 1; client <= MaxClients; client++) + { + if(IsClientInGame(client)) + { + if (voteInProgress) + { + PrintCenterText(client, g_sHUDText); + } + else + { + PrintHintText(client, g_sHUDText); + } + StopSound(client, SNDCHAN_STATIC, "UI/hint.wav"); + } + } + s_bLastHudPrinted = true; + } + else if(s_bLastHudPrinted) + { + for(int client = 1; client <= MaxClients; client++) + { + if(IsClientInGame(client)) + { + if (voteInProgress) + { + PrintCenterText(client, g_sHUDText); + } + else + { + PrintHintText(client, g_sHUDText); + } + StopSound(client, SNDCHAN_STATIC, "UI/hint.wav"); + } + } + s_bLastHudPrinted = false; + } } bool BossInit(CBoss _Boss) @@ -1316,7 +1326,6 @@ bool BossProcess(CBoss _Boss) bool bInvalid = false; int iHealth = 0; int iLastHealth = _Boss.iHealth; - int iMaxHealth = _Boss.iMaxHealth; int iLastChange = _Boss.iLastChange; if(_Boss.IsBreakable) @@ -1396,26 +1405,16 @@ bool BossProcess(CBoss _Boss) bInvalid = true; } - int iOffset = _Config.iOffset; - if(iOffset != 0) - iHealth += iOffset; - if(iHealth < 0) iHealth = 0; - if(iMaxHealth < iHealth) - { - iMaxHealth = iHealth; - _Boss.iMaxHealth = iHealth; - } - if(iHealth != iLastHealth) { iLastChange = GetTime(); _Boss.iLastChange = iLastChange; } - // Boss hasn't initialized HP yet. + // Boss hasnt initialized HP yet. if(iHealth == 0 && iLastHealth == 0) { // Boss invalid: Delete boss @@ -1453,15 +1452,6 @@ bool BossProcess(CBoss _Boss) sFormat[FormatLen++] = ' '; FormatLen += IntToString(iHealth, sFormat[FormatLen], sizeof(sFormat) - FormatLen); - - sFormat[FormatLen++] = ' '; - sFormat[FormatLen++] = '['; - - FormatLen += IntToString(RoundToNearest(float(iHealth) / float(iMaxHealth) * 100), sFormat[FormatLen], sizeof(sFormat) - FormatLen); - - FormatLen += StrCat(sFormat[FormatLen], sizeof(sFormat) - FormatLen, "%%%%"); // No idea why this needs 4 percents, but it works. - - sFormat[FormatLen++] = ']'; sFormat[FormatLen] = 0; StrCat(g_sHUDText, sizeof(g_sHUDText), sFormat);