Chest can be destroyed by bombs.

This commit is contained in:
eichhornchen 2021-01-10 16:31:16 +01:00
parent e56fc502cb
commit 841c7b9f90
1 changed files with 6 additions and 3 deletions

View File

@ -3,7 +3,7 @@
from random import choice, shuffle from random import choice, shuffle
from .items import Item from .items import Item, Bomb
from .monsters import Monster from .monsters import Monster
from .player import Player from .player import Player
from ..interfaces import Entity, FightingEntity, FriendlyEntity, \ from ..interfaces import Entity, FightingEntity, FriendlyEntity, \
@ -68,6 +68,9 @@ class Chest(InventoryHolder, FriendlyEntity):
""" """
A chest is not living, it can not take damage A chest is not living, it can not take damage
""" """
if isinstance(attacker, Bomb) :
self.die()
return _("The chest exploded")
return _("It's not really effective") return _("It's not really effective")
@property @property
@ -82,7 +85,7 @@ class Sunflower(FriendlyEntity):
""" """
A friendly sunflower. A friendly sunflower.
""" """
def __init__(self, maxhealth: int = 15, def __init__(self, maxhealth: int = 20,
*args, **kwargs) -> None: *args, **kwargs) -> None:
super().__init__(name="sunflower", maxhealth=maxhealth, *args, **kwargs) super().__init__(name="sunflower", maxhealth=maxhealth, *args, **kwargs)
@ -162,6 +165,6 @@ class Trumpet(Familiar):
A class of familiars. A class of familiars.
""" """
def __init__(self, name: str = "trumpet", strength: int = 3, def __init__(self, name: str = "trumpet", strength: int = 3,
maxhealth: int = 20, *args, **kwargs) -> None: maxhealth: int = 30, *args, **kwargs) -> None:
super().__init__(name=name, strength=strength, super().__init__(name=name, strength=strength,
maxhealth=maxhealth, *args, **kwargs) maxhealth=maxhealth, *args, **kwargs)