Dec-14-2019, 02:22 PM
Sound like protection value was higher then damage. You simple have to make sure damage is less or greater than zero. Depends how you apply damage to health.
hit = protection - damage if hit < 0: health += hitelse
hit = damage - protection if hit > 0: health -= hitYou might find this helpful.
class Pool: def __init__(self, value): self.value = value self.max_value = value def damage(self, value): if value > 0: self.value -= value def fill(self): self.value = self.max_value def heal(self, value): self.value += value if self.value > self.max_value: self.value = self.max_value
99 percent of computer problems exists between chair and keyboard.