Critical hit chance is now displayed along with the other stats.

This commit is contained in:
eichhornchen 2021-01-05 19:23:25 +01:00
parent 4bddf076ea
commit 3ace133037
1 changed files with 8 additions and 7 deletions

View File

@ -25,10 +25,11 @@ class StatsDisplay(Display):
self.player.max_xp, self.player.health, self.player.max_xp, self.player.health,
self.player.maxhealth) self.player.maxhealth)
self.addstr(self.pad, 0, 0, string2) self.addstr(self.pad, 0, 0, string2)
string3 = "STR {}\nINT {}\nCHR {}\nDEX {}\nCON {}"\ string3 = "STR {}\nINT {}\nCHR {}\nDEX {}\nCON {}\nCRI {}%"\
.format(self.player.strength, .format(self.player.strength,
self.player.intelligence, self.player.charisma, self.player.intelligence, self.player.charisma,
self.player.dexterity, self.player.constitution) self.player.dexterity, self.player.constitution,\
self.player.critical)
self.addstr(self.pad, 3, 0, string3) self.addstr(self.pad, 3, 0, string3)
inventory_str = _("Inventory:") + " " inventory_str = _("Inventory:") + " "
@ -44,22 +45,22 @@ class StatsDisplay(Display):
if count > 1: if count > 1:
inventory_str += f"x{count} " inventory_str += f"x{count} "
printed_items.append(item) printed_items.append(item)
self.addstr(self.pad, 8, 0, inventory_str) self.addstr(self.pad, 9, 0, inventory_str)
if self.player.equipped_item: if self.player.equipped_item:
self.addstr(self.pad, 9, 0, self.addstr(self.pad, 10, 0,
_("Equipped item:") + " " _("Equipped item:") + " "
f"{self.pack[self.player.equipped_item.name.upper()]}") f"{self.pack[self.player.equipped_item.name.upper()]}")
if self.player.equipped_armor: if self.player.equipped_armor:
self.addstr(self.pad, 10, 0, self.addstr(self.pad, 11, 0,
_("Equipped armor:") + " " _("Equipped armor:") + " "
f"{self.pack[self.player.equipped_armor.name.upper()]}") f"{self.pack[self.player.equipped_armor.name.upper()]}")
self.addstr(self.pad, 11, 0, f"{self.pack.HAZELNUT} " self.addstr(self.pad, 12, 0, f"{self.pack.HAZELNUT} "
f"x{self.player.hazel}") f"x{self.player.hazel}")
if self.player.dead: if self.player.dead:
self.addstr(self.pad, 13, 0, _("YOU ARE DEAD"), curses.COLOR_RED, self.addstr(self.pad, 14, 0, _("YOU ARE DEAD"), curses.COLOR_RED,
bold=True, blink=True, standout=True) bold=True, blink=True, standout=True)
def display(self) -> None: def display(self) -> None: