Compare commits
3 Commits
2f8dd761ba
...
493b663b4e
Author | SHA1 | Date |
---|---|---|
|
493b663b4e | |
|
21bd3c39bb | |
|
a1f215cc93 |
|
@ -34,7 +34,7 @@ class GameNavigator(npyscreen.FormBaseNew):
|
|||
This may not be needed in the future, dynamic
|
||||
handling of location is something the navigator should do and should inherit from player.
|
||||
"""
|
||||
pass
|
||||
self.artBox.footer = location
|
||||
|
||||
def create(self):
|
||||
top_division_height = 20
|
||||
|
@ -58,7 +58,7 @@ class GameNavigator(npyscreen.FormBaseNew):
|
|||
editable=False)
|
||||
self.artBox.footer = 'Unknown Location'
|
||||
|
||||
self.artBox = self.add(npyscreen.BoxBasic,
|
||||
self.inventoryBox = self.add(npyscreen.BoxBasic,
|
||||
name='Inventory',
|
||||
max_width=inventory_width,
|
||||
max_height=top_division_height,
|
||||
|
@ -114,4 +114,5 @@ class GameNavigator(npyscreen.FormBaseNew):
|
|||
# TODO: Expand this by loding the text from the game
|
||||
# WARN: THIS MAY REQUIRE REWRITING HANDLER.PY TO INTALIZE THE ROOM OBJECT OUTSIDE OF HANDLER.PY
|
||||
self.update_log('Welcome back! Try "LOOK AROUND" to get started.')
|
||||
self.update_log('>>Note from joe: Welcome! you\'re playing the demo! Please dont mind text issues like |this| and *this*\ni have yet to implement color!')
|
||||
self.update_log(
|
||||
'>>Note from joe: Welcome! you\'re playing the demo! Please dont mind text issues like |this| and *this*\ni have yet to implement color!')
|
||||
|
|
|
@ -101,16 +101,16 @@ class Handler(npyscreen.ButtonPress):
|
|||
self.parent.update_log("You must specify something to pick up.")
|
||||
|
||||
elif command == 'OPEN':
|
||||
#try:
|
||||
try:
|
||||
self.parent.parentApp.log.info('Player tried to open door: {0}'.format(arguments[0]))
|
||||
new_room = room[arguments[0].lower()]['leads_to']
|
||||
self.parent.parentApp.log.debug('New room is: {0}'.format(new_room))
|
||||
upon_enter = player.change_room(new_room) # Change the player to that new room.
|
||||
self.parent.update_log(upon_enter) # Print the new room upon enter text.
|
||||
#except KeyError:
|
||||
# self.parent.update_log("You cant open that.")
|
||||
#except IndexError:
|
||||
# self.parent.update_log("you must specify something to open")
|
||||
except KeyError:
|
||||
self.parent.update_log("You cant open that.")
|
||||
except IndexError:
|
||||
self.parent.update_log("you must specify something to open")
|
||||
|
||||
else:
|
||||
self.parent.parentApp.log.info('Player\'s command was not understood: {0}'.format(command))
|
||||
|
@ -123,6 +123,15 @@ class Handler(npyscreen.ButtonPress):
|
|||
# Log the command that we parsed
|
||||
self.parent.parentApp.log.info('Parsed command "{0}" with arguments "{1}"'.format(command, arguments))
|
||||
|
||||
"""
|
||||
Do a little bit of final setup, change the art if we
|
||||
need to, change the text at the bottom and update the inventory.
|
||||
"""
|
||||
try:
|
||||
self.parent.update_location(room['name'])
|
||||
except KeyError:
|
||||
self.parent.update_location('Unknown Location')
|
||||
|
||||
# Make sure to re-draw the art box when we're all done (in case we updated it in logic above)
|
||||
self.parent.artContent.display()
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
room:
|
||||
name: "Your Office"
|
||||
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|"
|
||||
|
|
Loading…
Reference in New Issue