Test merchants

This commit is contained in:
Yohann D'ANELLO
2020-12-09 15:32:37 +01:00
parent 657f4e5209
commit 19b82ff71a
7 changed files with 80 additions and 14 deletions

View File

@ -16,7 +16,7 @@ class Merchant(FriendlyEntity):
"""
Returns a friendly entitie's specific attributes
"""
return ["maxhealth", "health", "inventory", "hazel"]
return super().keys() + ["inventory", "hazel"]
def __init__(self, name: str = "merchant", inventory: list = None,
hazel: int = 75, *args, **kwargs):

View File

@ -50,7 +50,7 @@ class Item(Entity):
self.held = True
self.held_by = player
self.map.remove_entity(self)
player.inventory.append(self)
player.add_to_inventory(self)
def save_state(self) -> dict:
"""