diff --git a/doom_matrix/entities/items.py b/doom_matrix/entities/items.py index e12085f..5a60df5 100644 --- a/doom_matrix/entities/items.py +++ b/doom_matrix/entities/items.py @@ -78,7 +78,8 @@ class Inventory: def add(self, item, count=1): if item.kind == "key": - self.keycards.add(item.item_id) + color = item.item_id.removeprefix("keycard_") + self.keycards.add(color) return if item.kind == "fragment": self.crucible_fragments += count diff --git a/doom_matrix/world/rooms.py b/doom_matrix/world/rooms.py index 2dd3938..2af0249 100644 --- a/doom_matrix/world/rooms.py +++ b/doom_matrix/world/rooms.py @@ -5,6 +5,8 @@ from doom_matrix.engine.ui import Colors, slow_print, menu, section_title from doom_matrix.engine import cheats +KEYCARD_COLOR_DE = {"red": "rote", "blue": "blaue", "yellow": "gelbe"} + class Room: def __init__(self, room_id, name, description, exits=None, item_ids=None, @@ -98,7 +100,8 @@ class Hub: _, target_id = exit_keys[idx] target = self.rooms.get(target_id) if target and target.locked_by and not player.inventory.has_keycard(target.locked_by): - slow_print(f"\n{Colors.RED}Diese Tuer benoetigt eine {target.locked_by}e Keycard.{Colors.END}") + color_de = KEYCARD_COLOR_DE.get(target.locked_by, target.locked_by) + slow_print(f"\n{Colors.RED}Diese Tuer benoetigt eine {color_de} Keycard.{Colors.END}") return None self.current_id = target_id return None