Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Barry
/
esp8266-Mud
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
7aee6bd6
authored
2018-05-06 18:13:37 -0700
by
Barry
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Added outside monsters file.
Fixed bug in go command.
1 parent
bd246800
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
commands/go.txt
rooms/outside_monsters.json
rooms/tavern_monsters.json
commands/go.txt
View file @
7aee6bd
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
...
...
rooms/outside_monsters.json
0 → 100644
View file @
7aee6bd
{}
\ No newline at end of file
rooms/tavern_monsters.json
View file @
7aee6bd
{
"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
...
...
Please
register
or
sign in
to post a comment