Health hud adjust (#7702)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
freeman2651
2022-05-03 05:53:05 -04:00
committed by GitHub
parent 983b004607
commit 6aeae14fe1

View File

@@ -26,11 +26,11 @@ namespace Content.Server.MobState.States
short modifier = 0;
if (stateComponent.TryGetEarliestIncapacitatedState(threshold, out _, out var earliestThreshold))
if (stateComponent.TryGetEarliestIncapacitatedState(threshold, out _, out var earliestThreshold) && damageable.TotalDamage > 0)
{
modifier = (short) (damageable.TotalDamage / (earliestThreshold / 7f));
modifier = (short) MathF.Max((float) (damageable.TotalDamage / (earliestThreshold / 6f)),1);
//if hurt at all we skip to the first hurt state with Max(), anything else will end up falling to 5 at maximum before crit
}
EntitySystem.Get<AlertsSystem>().ShowAlert(entity, AlertType.HumanHealth, modifier);
}
}