Fix broken tests

This commit is contained in:
Yohann D'ANELLO
2020-11-19 01:11:11 +01:00
parent a80a604212
commit 0d5812bfaa
6 changed files with 78 additions and 47 deletions

View File

@ -63,6 +63,14 @@ class Heart(Item):
player.health = min(player.maxhealth, player.health + self.healing)
self.map.remove_entity(self)
def save_state(self) -> dict:
"""
Saves the state of the header into a dictionary
"""
d = super().save_state()
d["healing"] = self.healing
return d
class Bomb(Item):
"""
@ -90,3 +98,12 @@ class Bomb(Item):
if abs(e.x - self.x) + abs(e.y - self.y) <= 1 and \
isinstance(e, FightingEntity):
e.take_damage(self, self.damage)
def save_state(self) -> dict:
"""
Saves the state of the bomb into a dictionary
"""
d = super().save_state()
d["exploding"] = self.exploding
d["damage"] = self.damage
return d