Talk:Damage Values and Enemy Health (Hollow Knight)/@comment-30295195-20180814212218

I probably believed the reason why the game rounds the damage upwards (instead of normally downwards on other games) is because of this formula of damage the game might've used:

HP := trunc(HP - Damage)

(:= means to set a value, in this case, sets the HP value.)

(trunc(x) is a function to remove the fraction part (trunc(1.1) and trunc(1.9) will output 1))

Instead of:

HP := HP - trunc(Damage)

Thus (a made-up example), an enemy with 100 HP takes 5.1 damage, it would take 6 damage (will now have 94HP):

94 := trunc(100 - 5.1)

trunc(100 - 5.1) results a value 94.9HP, this gets rounded down to 94.

If it was a rounded down damage, this happens:

HP := HP - trunc(5.1)

trunc(5.1) outputs 5, which will do 100 - 5 = 95HP.