Compare commits
2 Commits
45b3252838
...
3928084098
Author | SHA1 | Date |
---|---|---|
|
3928084098 | |
|
6f10d6420b |
|
@ -68,6 +68,29 @@ 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 == 'PICK':
|
||||
if arguments[0] == 'UP':
|
||||
if len(arguments) <= 2: # If there are only 2 args ex:up, item then we dont need to merge that last arg
|
||||
try:
|
||||
# Argument[1] is the "thing" you want to pick up, yaml is lowercase so we lowercase it.
|
||||
self.parent.parentApp.log.info('Player tried to pick up {0}'.format(arguments[1]))
|
||||
self.parent.update_log(room[arguments[1].lower()]['pick_up'])
|
||||
except KeyError:
|
||||
self.parent.update_log("You cant pick that up.")
|
||||
else: # if its a longer list of args, the player prolly wants to pick up an item with multiple words, like hand_axe, or log_viewer
|
||||
try:
|
||||
long_arg = '_'.join(arguments[1:]) # Joins whatever comes after 1 in our args with '_' between
|
||||
self.parent.parentApp.log.info('Player tried to pick up long object {0}'.format(long_arg))
|
||||
self.parent.update_log(room[long_arg.lower()]['pick_up'])
|
||||
except KeyError:
|
||||
self.parent.update_log("You cant pick that up.")
|
||||
|
||||
if command == 'WHERE':
|
||||
# TODO: this should take the human readable room name, not the code-name
|
||||
|
|
|
@ -7,6 +7,6 @@ office:
|
|||
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"
|
||||
look_at: "log viewer looks like garbo"
|
||||
inspect: "beep boop"
|
||||
pick_up: "You pick up the *LOG VIEWER*."
|
|
@ -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']"
|
||||
|
|
Loading…
Reference in New Issue