v0.9.4: fixed damage warn triggering when hero gains HP from being hit
This commit is contained in:
parent
d261b73272
commit
0d0f33d845
|
@ -1215,6 +1215,8 @@ public class Hero extends Char {
|
||||||
int postHP = HP + shielding();
|
int postHP = HP + shielding();
|
||||||
int effectiveDamage = preHP - postHP;
|
int effectiveDamage = preHP - postHP;
|
||||||
|
|
||||||
|
if (effectiveDamage <= 0) return;
|
||||||
|
|
||||||
//flash red when hit for serious damage.
|
//flash red when hit for serious damage.
|
||||||
float percentDMG = effectiveDamage / (float)preHP; //percent of current HP that was taken
|
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
|
float percentHP = 1 - ((HT - postHP) / (float)HT); //percent health after damage was taken
|
||||||
|
|
Loading…
Reference in New Issue
Block a user