Merge branch 'master' into 'equipment'

# Conflicts:
#   squirrelbattle/display/statsdisplay.py
#   squirrelbattle/entities/items.py
#   squirrelbattle/entities/player.py
#   squirrelbattle/interfaces.py
#   squirrelbattle/locale/de/LC_MESSAGES/squirrelbattle.po
#   squirrelbattle/locale/es/LC_MESSAGES/squirrelbattle.po
#   squirrelbattle/locale/fr/LC_MESSAGES/squirrelbattle.po
#   squirrelbattle/tests/game_test.py
This commit is contained in:
2021-01-08 02:11:40 +01:00
34 changed files with 1167 additions and 333 deletions

View File

@@ -10,6 +10,9 @@ from .display import Display
class StatsDisplay(Display):
"""
A class to handle the display of the stats of the player.
"""
player: Player
def __init__(self, *args, **kwargs):
@@ -20,16 +23,18 @@ class StatsDisplay(Display):
self.player = game.player
def update_pad(self) -> None:
string2 = _("player").capitalize() + " -- LVL {}\nEXP {}/{}\nHP {}/{}"\
.format(self.player.level, self.player.current_xp,
self.player.max_xp, self.player.health,
self.player.maxhealth)
string2 = f"{_(self.player.name).capitalize()} " \
f"-- LVL {self.player.level} -- " \
f"FLOOR {-self.player.map.floor}\n" \
f"EXP {self.player.current_xp}/{self.player.max_xp}\n" \
f"HP {self.player.health}/{self.player.maxhealth}"
self.addstr(self.pad, 0, 0, string2)
string3 = "STR {}\nINT {}\nCHR {}\nDEX {}\nCON {}\nCRI {}%"\
.format(self.player.strength,
self.player.intelligence, self.player.charisma,
self.player.dexterity, self.player.constitution,
self.player.critical)
string3 = f"STR {self.player.strength}\n" \
f"INT {self.player.intelligence}\n" \
f"CHR {self.player.charisma}\n" \
f"DEX {self.player.dexterity}\n" \
f"CON {self.player.constitution}\n" \
f"CRI {self.player.critical}%"
self.addstr(self.pad, 3, 0, string3)
inventory_str = _("Inventory:") + " "