Added a merchant class and a talk_to method to interact with friendly entities

This commit is contained in:
eichhornchen 2020-11-27 16:56:22 +01:00
parent 6b72f4b284
commit 76bbee7e6d
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,20 @@
from ..interfaces import FriendlyEntity, Map
class Merchant(FriendlyEntity) :
"""
The class for merchants in the dungeon
"""
inventory = list
def __init__(self, inventory : list):
super().__init__()
self.inventory = inventory
def talk_to(self, player : Player) -> None:
"""
This function is used to open the merchant's inventory in a menu,
and allow the player to buy/sell objects
"""
#TODO

View File

@ -435,4 +435,7 @@ class FriendlyEntity(Entity):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.maxhealth = maxhealth self.maxhealth = maxhealth
self.health = maxhealth if health is None else health self.health = maxhealth if health is None else health
def talk_to(self, player : Player) -> None:
#TODO