From 2d5a2e4c873e46f7ba52d6b1b7794efd5e423289 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Wed, 9 Dec 2020 16:54:53 +0100 Subject: [PATCH] Display hazels in the StatsDisplay --- squirrelbattle/display/statsdisplay.py | 5 ++++- squirrelbattle/display/texturepack.py | 3 +++ squirrelbattle/entities/player.py | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/squirrelbattle/display/statsdisplay.py b/squirrelbattle/display/statsdisplay.py index ac1a89c..ec0c90a 100644 --- a/squirrelbattle/display/statsdisplay.py +++ b/squirrelbattle/display/statsdisplay.py @@ -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)) diff --git a/squirrelbattle/display/texturepack.py b/squirrelbattle/display/texturepack.py index 880f9c4..93b6047 100644 --- a/squirrelbattle/display/texturepack.py +++ b/squirrelbattle/display/texturepack.py @@ -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='🐿️ ️', diff --git a/squirrelbattle/entities/player.py b/squirrelbattle/entities/player.py index ce27c37..2a2a986 100644 --- a/squirrelbattle/entities/player.py +++ b/squirrelbattle/entities/player.py @@ -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