Merging master into village, conflicts were solved

This commit is contained in:
eichhornchen
2020-12-06 11:43:48 +01:00
parent 38842cee68
commit 866af98fe4
20 changed files with 574 additions and 168 deletions

View File

@ -31,8 +31,19 @@ class StatsDisplay(Display):
self.player.dexterity, self.player.constitution)
self.addstr(self.pad, 3, 0, string3)
inventory_str = _("Inventory:") + " " + "".join(
self.pack[item.name.upper()] for item in self.player.inventory)
inventory_str = _("Inventory:") + " "
# Stack items by type instead of displaying each item
item_types = [item.name for item in self.player.inventory]
item_types.sort(key=item_types.count, reverse=True)
printed_items = []
for item in item_types:
if item in printed_items:
continue
count = item_types.count(item)
inventory_str += self.pack[item.upper()]
if count > 1:
inventory_str += f"x{count} "
printed_items.append(item)
self.addstr(self.pad, 8, 0, inventory_str)
if self.player.dead: