Added a Gamemode for selling interfaces, as well as the base of the player/merchant interaction, related to issue #18

This commit is contained in:
eichhornchen
2020-12-05 21:43:13 +01:00
parent 3886bee1ba
commit ba68e68584
5 changed files with 18 additions and 4 deletions

View File

@ -329,6 +329,12 @@ class Entity:
"""
return isinstance(self, FriendlyEntity)
def is_merchant(self) -> bool:
"""
Is this entity a merchant?
"""
return isinstance(self, Merchant)
@property
def translated_name(self) -> str:
return _(self.name.replace("_", " "))
@ -459,7 +465,7 @@ class FriendlyEntity(FightingEntity):
"""
dialogue_option : list
def talk_to(self, player : Any) -> str:
def talk_to(self, player : Any) -> str :
a = randint(0,len(self.dialogue_option)-1)
return "The "+self.name+" said : "+self.dialogue_option[a]