diff --git a/src/player.py b/src/player.py index fb4b055..7104d7c 100644 --- a/src/player.py +++ b/src/player.py @@ -189,10 +189,12 @@ class Player: def set_health(self, value): """Set health and handle death if needed.""" - if self.isInvincible: - return # No damage while invincible - old_health = self._health + + # Oops, allow healing while invincible. + if self.isInvincible and value < old_health: + return + self._health = max(0, value) # Health can't go below 0 if self._health == 0 and old_health > 0: diff --git a/src/powerup.py b/src/powerup.py index 9574d63..e58abd2 100644 --- a/src/powerup.py +++ b/src/powerup.py @@ -70,6 +70,11 @@ class PowerUp(Object): elif self.item_type == 'shin_bone': # Add shin bone handling player.shinBoneCount += 1 player._coins += 5 + if player.get_health() < player.get_max_health(): + player.set_health(min( + player.get_health() + 1, + player.get_max_health() + )) self.check_for_nunchucks(player) elif self.item_type == 'witch_broom': broomWeapon = Weapon.create_witch_broom()