Added a merchant class and a talk_to method to interact with friendly entities
This commit is contained in:
parent
6b72f4b284
commit
76bbee7e6d
20
squirrelbattle/entities/friendly.py
Normal file
20
squirrelbattle/entities/friendly.py
Normal 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
|
||||
|
@ -435,4 +435,7 @@ class FriendlyEntity(Entity):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.maxhealth = maxhealth
|
||||
self.health = maxhealth if health is None else health
|
||||
|
||||
def talk_to(self, player : Player) -> None:
|
||||
#TODO
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user