7aee6bd6 by Barry

Added outside monsters file.

Fixed bug in go command.
1 parent bd246800
def go(id, params, players, mud, tokens, command):
# store the exit name
if params == '':
params = command
params = command.strip()
else:
params = params.strip()
room_data = utils.load_object_from_file('rooms/' + players[id]["room"] + '.txt')
exits = room_data['exits']
......@@ -25,8 +27,13 @@ def go(id, params, players, mud, tokens, command):
mud.send_message(id, "An invisible force prevents you from going in that direction.")
return None
else:
players[id]["room"] = exits[params]
room = params
new_room = utils.load_object_from_file('rooms/' + exits[params] + '.txt')
if not new_room:
mud.send_message(id, "An invisible force prevents you from going in that direction.")
return None
else:
players[id]["room"] = exits[params]
mud.send_message(id, "You arrive at '{}'".format(new_room['title']))
# go through all the players in the game
for pid, pl in players.items():
......@@ -41,8 +48,6 @@ def go(id, params, players, mud, tokens, command):
players[id]["name"], params))
# send the player a message telling them where they are now
title = utils.load_object_from_file('rooms/' + players[id]["room"] + '.txt')['title']
mud.send_message(id, "You arrive at '{}'".format(title))
tokens = []
return 'look'
# the specified exit wasn't found in the current room
......
{}
\ No newline at end of file
{"cricket": {"max": 1, "active": [{"hp": 100, "mp": 2.75, "sta": 1.7500000000000182, "maxhp": 100, "maxmp": 10, "maxsta": 10, "action": "attack", "target": "test"}]}}
\ No newline at end of file
{"cricket": {"max": 1, "active": [{"hp": 100, "mp": 1.0, "sta": 3.950000000000027, "maxhp": 100, "maxmp": 10, "maxsta": 10, "action": "attack", "target": "test"}]}}
\ No newline at end of file
......