v0.9.4: fixed damage warn triggering when hero gains HP from being hit

This commit is contained in:
Evan Debenham 2021-06-29 21:33:19 -04:00
parent d261b73272
commit 0d0f33d845

View File

@ -1215,6 +1215,8 @@ public class Hero extends Char {
int postHP = HP + shielding();
int effectiveDamage = preHP - postHP;
if (effectiveDamage <= 0) return;
//flash red when hit for serious damage.
float percentDMG = effectiveDamage / (float)preHP; //percent of current HP that was taken
float percentHP = 1 - ((HT - postHP) / (float)HT); //percent health after damage was taken