adventure-game #3

Open
Kenwood wants to merge 80 commits from adventure-game into master
1 changed files with 35 additions and 27 deletions
Showing only changes of commit 301d3d75db - Show all commits

View File

@ -63,6 +63,7 @@ class Handler(npyscreen.ButtonPress):
# TODO: Should upgrade these to use fuzzy words library! and not direct comparisons!
if command == 'LOOK':
try:
if arguments[0] == 'AROUND':
try:
self.parent.update_log(room['look_around'])
@ -73,9 +74,13 @@ class Handler(npyscreen.ButtonPress):
# 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.")
self.parent.update_log("Im not sure what you're trying to look at.")
except IndexError:
self.parent.parentApp.log.error('Could not handle {0}, {1}'.format(command, arguments))
self.parent.update_log("You must specify something to look at.")
elif command == 'PICK':
try:
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
@ -92,6 +97,9 @@ class Handler(npyscreen.ButtonPress):
self.parent.update_log(room[long_arg.lower()]['pick_up'])
except KeyError:
self.parent.update_log("You cant pick that up.")
except IndexError:
self.parent.parentApp.log.error('Could not handle {0}, {1}'.format(command, arguments))
self.parent.update_log("You must specify something to pick up.")
elif command == 'OPEN':
try: