Added a merchant class and a talk_to method to interact with friendly entities
This commit is contained in:
parent
6b72f4b284
commit
76bbee7e6d
|
@ -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
|
||||||
|
|
|
@ -436,3 +436,6 @@ class FriendlyEntity(Entity):
|
||||||
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue