adventure-game #3
|
@ -63,6 +63,7 @@ class Handler(npyscreen.ButtonPress):
|
||||||
|
|
||||||
# TODO: Should upgrade these to use fuzzy words library! and not direct comparisons!
|
# TODO: Should upgrade these to use fuzzy words library! and not direct comparisons!
|
||||||
if command == 'LOOK':
|
if command == 'LOOK':
|
||||||
|
try:
|
||||||
if arguments[0] == 'AROUND':
|
if arguments[0] == 'AROUND':
|
||||||
try:
|
try:
|
||||||
self.parent.update_log(room['look_around'])
|
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.
|
# 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'])
|
self.parent.update_log(room[arguments[1].lower()]['look_at'])
|
||||||
except KeyError:
|
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':
|
elif command == 'PICK':
|
||||||
|
try:
|
||||||
if arguments[0] == 'UP':
|
if arguments[0] == 'UP':
|
||||||
if len(
|
if len(
|
||||||
arguments) <= 2: # If there are only 2 args ex:up, item then we dont need to merge that last arg
|
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'])
|
self.parent.update_log(room[long_arg.lower()]['pick_up'])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
self.parent.update_log("You cant pick that up.")
|
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':
|
elif command == 'OPEN':
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue