2020-12-01 16:12:22 +00:00
|
|
|
from ..interfaces import FriendlyEntity
|
|
|
|
from ..translations import gettext as _
|
2020-11-27 17:35:52 +00:00
|
|
|
from .player import Player
|
2020-11-27 15:56:22 +00:00
|
|
|
|
2020-12-01 16:12:22 +00:00
|
|
|
|
2020-11-27 15:56:22 +00:00
|
|
|
class Merchant(FriendlyEntity) :
|
|
|
|
"""
|
|
|
|
The class for merchants in the dungeon
|
|
|
|
"""
|
2020-11-27 17:35:52 +00:00
|
|
|
name = "Merchant"
|
2020-11-27 15:56:22 +00:00
|
|
|
inventory = list
|
2020-11-27 17:35:52 +00:00
|
|
|
hazel = int
|
2020-12-03 23:27:25 +00:00
|
|
|
|
2020-12-05 20:43:13 +00:00
|
|
|
def keys(self) -> list:
|
2020-12-03 23:27:25 +00:00
|
|
|
"""
|
|
|
|
Returns a friendly entitie's specific attributes
|
|
|
|
"""
|
|
|
|
return ["maxhealth", "health", "inventory", "hazel"]
|
2020-11-27 15:56:22 +00:00
|
|
|
|
2020-11-27 17:35:52 +00:00
|
|
|
def __init__(self, inventory : list, hazel : int = 75):
|
2020-11-27 15:56:22 +00:00
|
|
|
super().__init__()
|
|
|
|
self.inventory = inventory
|
2020-11-27 17:35:52 +00:00
|
|
|
self.hazel = hazel
|
2020-11-27 15:56:22 +00:00
|
|
|
|
2020-12-05 20:43:13 +00:00
|
|
|
def talk_to(self, player : Player) -> str:
|
2020-11-27 15:56:22 +00:00
|
|
|
"""
|
|
|
|
This function is used to open the merchant's inventory in a menu,
|
|
|
|
and allow the player to buy/sell objects
|
|
|
|
"""
|
2020-12-01 16:12:22 +00:00
|
|
|
# TODO
|
2020-12-03 23:27:25 +00:00
|
|
|
|
2020-11-27 17:35:52 +00:00
|
|
|
class Sunflower(FriendlyEntity) :
|
|
|
|
"""
|
|
|
|
A friendly sunflower
|
|
|
|
"""
|
2020-12-01 16:12:22 +00:00
|
|
|
dialogue_option = [_("Flower power!!"), _("The sun is warm today")]
|
2020-11-27 17:35:52 +00:00
|
|
|
|
|
|
|
def __init__(self, maxhealth: int = 15,
|
|
|
|
*args, **kwargs) -> None:
|
|
|
|
super().__init__(name="sunflower",
|
|
|
|
maxhealth=maxhealth, *args, **kwargs)
|