Display hazels in the StatsDisplay

This commit is contained in:
Yohann D'ANELLO 2020-12-09 16:54:53 +01:00
parent 56627f3e84
commit 2d5a2e4c87
3 changed files with 8 additions and 1 deletions

View File

@ -46,8 +46,11 @@ class StatsDisplay(Display):
printed_items.append(item)
self.addstr(self.pad, 8, 0, inventory_str)
self.addstr(self.pad, 9, 0, f"{self.pack.HAZELNUT} "
f"x{self.player.hazel}")
if self.player.dead:
self.addstr(self.pad, 10, 0, _("YOU ARE DEAD"),
self.addstr(self.pad, 11, 0, _("YOU ARE DEAD"),
curses.A_BOLD | curses.A_BLINK | curses.A_STANDOUT
| self.color_pair(3))

View File

@ -21,6 +21,7 @@ class TexturePack:
HEDGEHOG: str
EMPTY: str
FLOOR: str
HAZELNUT: str
MERCHANT: str
PLAYER: str
RABBIT: str
@ -62,6 +63,7 @@ TexturePack.ASCII_PACK = TexturePack(
BOMB='o',
EMPTY=' ',
FLOOR='.',
HAZELNUT='',
HEART='',
HEDGEHOG='*',
MERCHANT='M',
@ -86,6 +88,7 @@ TexturePack.SQUIRREL_PACK = TexturePack(
BOMB='💣',
EMPTY=' ',
FLOOR='██',
HAZELNUT='🌰',
HEART='💜',
HEDGEHOG='🦔',
PLAYER='🐿️ ',

View File

@ -133,4 +133,5 @@ class Player(FightingEntity):
d["current_xp"] = self.current_xp
d["max_xp"] = self.max_xp
d["inventory"] = [item.save_state() for item in self.inventory]
d["hazel"] = self.hazel
return d