Fixed looking at things

This commit is contained in:
Joe S 2021-02-24 00:28:47 -05:00
parent 45b3252838
commit 6f10d6420b
2 changed files with 17 additions and 2 deletions

View File

@ -68,6 +68,12 @@ class Handler(npyscreen.ButtonPress):
self.parent.update_log(room['look_around'])
except KeyError:
self.parent.update_log('There is nothing to look at?.. This might be a bug.')
if arguments[0] == 'AT':
try:
# Argument[1] is the "thing" you want to look at, yaml is lowercase so we lowercase it.
self.parent.update_log(room[arguments[1].lower()]['look_at'])
except KeyError:
self.parent.update_log("Not sure what you're trying to look at.")
if command == 'WHERE':
# TODO: this should take the human readable room name, not the code-name

View File

@ -1,5 +1,14 @@
INFO:root:Logging started!
DEBUG:root:Gamelib at adventure_game\gamedata\gamelib.yaml
DEBUG:root:Send button pressed!
WARNING:root:Command "" could not be split, was it malformed or incomplete?
INFO:root:Parsed command "" with arguments "[]"
DEBUG:root:{'grid': [0, 0], 'upon_enter': 'You are standing behind your desk, you see a |NAMEPLATE|, a |TAPE RECORDER| and your trusty |LOG VIEWER|', 'look_around': 'You look around the room, you see a |DESK|, a |BOOKSHELF| and the |DOOR|', 'pick_up_logviewer': 'You pick the *LOG VIEWER* up.', 'desk': {'look_at': 'You move to stand behind your desk. You see a |NAMEPLATE|, a |TAPE RECORDER| and your trusty |LOG VIEWER|', 'inspect': 'Desk, ornate, stuff'}, 'log_viewer': {'look_at': 'logviewer looks like garbo', 'inspect': 'beep boop', 'pick_up': 'You pick up the *LOG VIEWER*.'}}
INFO:root:Parsed command "LOOK" with arguments "['AROUND']"
DEBUG:root:Send button pressed!
DEBUG:root:{'grid': [0, 0], 'upon_enter': 'You are standing behind your desk, you see a |NAMEPLATE|, a |TAPE RECORDER| and your trusty |LOG VIEWER|', 'look_around': 'You look around the room, you see a |DESK|, a |BOOKSHELF| and the |DOOR|', 'pick_up_logviewer': 'You pick the *LOG VIEWER* up.', 'desk': {'look_at': 'You move to stand behind your desk. You see a |NAMEPLATE|, a |TAPE RECORDER| and your trusty |LOG VIEWER|', 'inspect': 'Desk, ornate, stuff'}, 'log_viewer': {'look_at': 'logviewer looks like garbo', 'inspect': 'beep boop', 'pick_up': 'You pick up the *LOG VIEWER*.'}}
INFO:root:Parsed command "LOOK" with arguments "['AT', 'DESK']"
DEBUG:root:Send button pressed!
DEBUG:root:{'grid': [0, 0], 'upon_enter': 'You are standing behind your desk, you see a |NAMEPLATE|, a |TAPE RECORDER| and your trusty |LOG VIEWER|', 'look_around': 'You look around the room, you see a |DESK|, a |BOOKSHELF| and the |DOOR|', 'pick_up_logviewer': 'You pick the *LOG VIEWER* up.', 'desk': {'look_at': 'You move to stand behind your desk. You see a |NAMEPLATE|, a |TAPE RECORDER| and your trusty |LOG VIEWER|', 'inspect': 'Desk, ornate, stuff'}, 'log_viewer': {'look_at': 'logviewer looks like garbo', 'inspect': 'beep boop', 'pick_up': 'You pick up the *LOG VIEWER*.'}}
INFO:root:Parsed command "LOOK" with arguments "['AT', 'DOOR']"
DEBUG:root:Send button pressed!
DEBUG:root:{'grid': [0, 0], 'upon_enter': 'You are standing behind your desk, you see a |NAMEPLATE|, a |TAPE RECORDER| and your trusty |LOG VIEWER|', 'look_around': 'You look around the room, you see a |DESK|, a |BOOKSHELF| and the |DOOR|', 'pick_up_logviewer': 'You pick the *LOG VIEWER* up.', 'desk': {'look_at': 'You move to stand behind your desk. You see a |NAMEPLATE|, a |TAPE RECORDER| and your trusty |LOG VIEWER|', 'inspect': 'Desk, ornate, stuff'}, 'log_viewer': {'look_at': 'logviewer looks like garbo', 'inspect': 'beep boop', 'pick_up': 'You pick up the *LOG VIEWER*.'}}
INFO:root:Parsed command "LOOK" with arguments "['AT', 'BOOKSHELF']"