adventure-game #3

Open
Kenwood wants to merge 80 commits from adventure-game into master
3 changed files with 14 additions and 2 deletions
Showing only changes of commit 773d48b732 - Show all commits

View File

@ -43,7 +43,15 @@ class Handler(npyscreen.ButtonPress):
# Localize the player # Localize the player
player = self.parent.parentApp.player player = self.parent.parentApp.player
roomlocation = player.playerData['player']['location'] + '.yaml' roomlocation = player.playerData['player']['location'] + '.yaml'
try:
room = parse(self.parent.parentApp.mainPath / 'gamedata/world' / roomlocation) room = parse(self.parent.parentApp.mainPath / 'gamedata/world' / roomlocation)
# If the file could not be found
except FileNotFoundError:
# Log a critical error!
self.parent.parentApp.log.critical('Handler could not load the current room! Is the player file corrupt or was there a typo? Path was {0}'.format(self.parent.parentApp.mainPath / 'gamedata/world' / roomlocation))
# Put the player in a blank room i forgot to finish
room = parse(self.parent.parentApp.mainPath / 'gamedata/world/blank_room.yaml')
self.parent.update_log('You are in {0}.'.format(room)) self.parent.update_log('You are in {0}.'.format(room))
# Log the command that we parsed # Log the command that we parsed

View File

@ -0,0 +1,4 @@
blank_room:
grid: [-1, -1]
upon_enter: "You're in a blank room. It looks unfinished, like joe forgot to put something here"
look_around: "There is nothing to look at, you should tell joe you're here."

View File

@ -1,4 +1,4 @@
player: player:
name: 'Default' name: 'Default'
location: 'office' location: 'officee'
inventory: ['test', 'test2'] inventory: ['test', 'test2']