Entity name is a parameter since it can be changed through body snatch potion

This commit is contained in:
Yohann D'ANELLO
2020-12-05 14:25:22 +01:00
parent ea672272f5
commit f887a1f0aa
3 changed files with 25 additions and 24 deletions

View File

@@ -67,8 +67,8 @@ class Heart(Item):
"""
healing: int
def __init__(self, healing: int = 5, *args, **kwargs):
super().__init__(name="heart", *args, **kwargs)
def __init__(self, name: str = "heart", healing: int = 5, *args, **kwargs):
super().__init__(name=name, *args, **kwargs)
self.healing = healing
def hold(self, player: "Player") -> None:
@@ -96,9 +96,9 @@ class Bomb(Item):
owner: Optional["Player"]
tick: int
def __init__(self, damage: int = 5, exploding: bool = False,
*args, **kwargs):
super().__init__(name="bomb", *args, **kwargs)
def __init__(self, name: str = "bomb", damage: int = 5,
exploding: bool = False, *args, **kwargs):
super().__init__(name=name, *args, **kwargs)
self.damage = damage
self.exploding = exploding
self.tick = 4
@@ -151,8 +151,8 @@ class BodySnatchPotion(Item):
other entity.
"""
def __init__(self, *args, **kwargs):
super().__init__(name="body_snatch_potion", *args, **kwargs)
def __init__(self, name: str = "body_snatch_potion", *args, **kwargs):
super().__init__(name=name, *args, **kwargs)
def use(self) -> None:
"""