Merge branch 'equipment' into doc

This commit is contained in:
Eichhornchen
2021-01-06 14:49:09 +01:00
8 changed files with 341 additions and 40 deletions

View File

@ -23,15 +23,16 @@ class StatsDisplay(Display):
self.player = game.player
def update_pad(self) -> None:
string2 = "Player -- LVL {}\nEXP {}/{}\nHP {}/{}"\
string2 = _("player").capitalize() + " -- LVL {}\nEXP {}/{}\nHP {}/{}"\
.format(self.player.level, self.player.current_xp,
self.player.max_xp, self.player.health,
self.player.maxhealth)
self.addstr(self.pad, 0, 0, string2)
string3 = "STR {}\nINT {}\nCHR {}\nDEX {}\nCON {}"\
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.dexterity, self.player.constitution,\
self.player.critical)
self.addstr(self.pad, 3, 0, string3)
inventory_str = _("Inventory:") + " "
@ -47,13 +48,30 @@ class StatsDisplay(Display):
if count > 1:
inventory_str += f"x{count} "
printed_items.append(item)
self.addstr(self.pad, 8, 0, inventory_str)
self.addstr(self.pad, 9, 0, inventory_str)
self.addstr(self.pad, 9, 0, f"{self.pack.HAZELNUT} "
f"x{self.player.hazel}")
if self.player.equipped_main:
self.addstr(self.pad, 10, 0,
_("Equipped main:") + " "
f"{self.pack[self.player.equipped_main.name.upper()]}")
if self.player.equipped_secondary:
self.addstr(self.pad, 11, 0,
_("Equipped secondary:") + " "
f"{self.pack[self.player.equipped_secondary.name.upper()]}")
if self.player.equipped_armor:
self.addstr(self.pad, 12, 0,
_("Equipped chestplate:") + " "
f"{self.pack[self.player.equipped_armor.name.upper()]}")
if self.player.equipped_helmet:
self.addstr(self.pad, 13, 0,
_("Equipped helmet:") + " "
f"{self.pack[self.player.equipped_helmet.name.upper()]}")
self.addstr(self.pad, 14, 0, f"{self.pack.HAZELNUT} "
f"x{self.player.hazel}")
if self.player.dead:
self.addstr(self.pad, 11, 0, _("YOU ARE DEAD"), curses.COLOR_RED,
self.addstr(self.pad, 15, 0, _("YOU ARE DEAD"), curses.COLOR_RED,
bold=True, blink=True, standout=True)
def display(self) -> None:

View File

@ -34,6 +34,12 @@ class TexturePack:
TIGER: str
TRUMPET: str
WALL: str
EAGLE: str
SHIELD: str
CHESTPLATE: str
HELMET: str
RING_OF_MORE_EXPERIENCE: str
RING_OF_CRITICAL_DAMAGE: str
ASCII_PACK: "TexturePack"
SQUIRREL_PACK: "TexturePack"
@ -64,7 +70,7 @@ TexturePack.ASCII_PACK = TexturePack(
entity_bg_color=curses.COLOR_BLACK,
BODY_SNATCH_POTION='S',
BOMB='o',
BOMB='ç',
EMPTY=' ',
EXPLOSION='%',
FLOOR='.',
@ -74,12 +80,18 @@ TexturePack.ASCII_PACK = TexturePack(
MERCHANT='M',
PLAYER='@',
RABBIT='Y',
SHIELD='D',
SUNFLOWER='I',
SWORD='\u2020',
TEDDY_BEAR='8',
TIGER='n',
TRUMPET='/',
WALL='#',
EAGLE='µ',
CHESTPLATE='(',
HELMET='0',
RING_OF_MORE_EXPERIENCE='o',
RING_OF_CRITICAL_DAMAGE='o',
)
TexturePack.SQUIRREL_PACK = TexturePack(
@ -101,10 +113,16 @@ TexturePack.SQUIRREL_PACK = TexturePack(
PLAYER='🐿️ ',
MERCHANT='🦜',
RABBIT='🐇',
SHIELD='🛡️ ',
SUNFLOWER='🌻',
SWORD='🗡️ ',
TEDDY_BEAR='🧸',
TIGER='🐅',
TRUMPET='🎺',
WALL='🧱',
EAGLE='🦅',
CHESTPLATE='🦺',
HELMET='⛑️',
RING_OF_MORE_EXPERIENCE='💍',
RING_OF_CRITICAL_DAMAGE='💍',
)