Fix keycard mismatch and typo in locked-door message

Inventory stored keycards under their full item_id (keycard_red) while
Room.locked_by/has_keycard checked against the plain color (red), so
the Waffentresor always reported itself as locked even with the
keycard in hand. Also fixes "rede Keycard" -> "rote Keycard".
This commit is contained in:
fedora_openclaw committed 2026-07-05 20:22:00 +02:00
1 parent 46116f7f4b
commit d4fd5561c2
2 files changed
+6 -2

No files matched your search

+4 -1
View File
@@ -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