Work in progress on printing a store menu. Its buggy though

This commit is contained in:
eichhornchen
2020-12-07 20:54:53 +01:00
parent d39427f978
commit 8540a8f354
7 changed files with 68 additions and 34 deletions

View File

@ -1,13 +1,14 @@
from ..interfaces import FriendlyEntity
from ..translations import gettext as _
from .player import Player
from .items import Item
from random import choice
class Merchant(FriendlyEntity) :
"""
The class for merchants in the dungeon
"""
name = "Merchant"
inventory = list
hazel = int
@ -17,10 +18,13 @@ class Merchant(FriendlyEntity) :
"""
return ["maxhealth", "health", "inventory", "hazel"]
def __init__(self, inventory : list, hazel : int = 75):
super().__init__()
self.inventory = inventory
def __init__(self, name : str = "merchant", hazel : int = 75):
super().__init__(name = name)
self.hazel = hazel
self.name = name
self.inventory = []
for i in range(5) :
self.inventory.append(choice(Item.get_all_items())())
def talk_to(self, player : Player) -> str:
"""