even more bugfixing

This commit is contained in:
Cheri Dawn 2024-05-21 23:35:44 +03:00
parent 42d76bce29
commit 0705441b8a

View file

@ -123,20 +123,34 @@ class SetageShell(Cmd):
print(manifest["items"][arg]["examine"])
else:
print("It doesn't seem to be all that interesting...")
elif "items" in cur_room:
elif arg:
if "items" not in cur_room and "interactables" not in cur_room:
print("> I don't see anything to examine here...")
return
no_items = False
if "items" in cur_room:
if len(cur_room["items"]) == 0:
no_items = True
no_interactables = False
if "interactables" in cur_room:
if len(cur_room["interactables"]) == 0:
no_interactables = True
if no_items and no_interactables:
print("> I don't see anything to examine here...")
if arg in cur_room["items"].keys():
manifest["items"][arg]["hidden"] = False
if "examine" in manifest["items"][arg]:
print(manifest["items"][arg]["examine"])
else:
print("It doesn't seem to be all that interesting...")
elif "interactables" in cur_room:
if arg in cur_room["interactables"].keys():
elif arg in cur_room["interactables"].keys():
cur_room["interactables"][arg]["hidden"] = False
if "examine" in cur_room["interactables"][arg]:
print(cur_room["interactables"][arg]["examine"])
else:
print("It doesn't seem to be all that interesting...")
else:
print("> I don't see anything like that...")
else:
print("> I don't see anything like that...")
@ -358,9 +372,18 @@ class SetageShell(Cmd):
if arg == "":
print("> What should I take?")
return
elif arg in cur_room["items"].keys():
inventory.append((arg, cur_room["items"].pop(arg)))
print(f"{arg} added to inventory.")
elif arg:
if "items" not in cur_room:
print("> I don't see anything that I could take...")
return
if len(cur_room["items"]) == 0:
print("> I don't see anything that I could take...")
return
if arg in cur_room["items"].keys():
inventory.append((arg, cur_room["items"].pop(arg)))
print(f"{arg} added to inventory.")
else:
print("> I don't see anything like that...")
else:
print("> I don't see anything like that...")
return self.check_win()