def heal(self, heal_by=2, full_healing=True): """Heal the unit replenishing all the hit points""" if self.health_meter == self.max_hp: return if full_healing: self.health_meter = self.max_hp else: self.health_meter += heal_by if self.health_meter > self.max_hp: raise HealthMeterException("health_meter > max_hp!") print_bold("You are HEALED", end=' ') self.show_health(bold=True)
def heal(self, heal_by=2, full_healing=True): """ metoda za ozravljanje lika """ if self.health_meter == self.max_hp: return if full_healing: self.health_meter = self.max_hp else: self.health_meter += heal_by # nasa iznimka if self.health_meter > self.max_hp: raise HealthMeterException() print_bold("Izliječen si!", end=' ') self.show_health(bold=True)