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
83e4eec5
authored
2018-04-28 18:23:04 -0700
by
Barry
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bug fixes for exits
1 parent
eded01f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
commandhandler.py
rooms/tavern.txt
commandhandler.py
View file @
83e4eec
...
...
@@ -85,8 +85,9 @@ class CommandHandler(object):
# store the exit name
ex
=
self
.
params
.
lower
()
.
strip
()
exits
=
roomloader
.
get_exits
(
self
.
players
[
self
.
id
][
"room"
])
# if the specified exit is found in the room's exits list
if
ex
in
roomloader
.
get_exits
(
self
.
players
[
self
.
id
][
"room"
])
:
if
ex
in
exits
:
# go through all the players in the game
for
pid
,
pl
in
self
.
players
.
items
():
# if player is in the same room and isn't the player
...
...
@@ -100,11 +101,11 @@ class CommandHandler(object):
# update the player's current room to the one the exit leads to
if
roomloader
.
get_title
(
ex
)
==
None
:
if
roomloader
.
get_title
(
ex
its
[
ex
]
)
==
None
:
self
.
mud
.
send_message
(
self
.
id
,
"An invisible force prevents you from going in that direction."
)
return
True
else
:
self
.
players
[
self
.
id
][
"room"
]
=
roomloader
.
get_exits
(
self
.
players
[
self
.
id
][
"room"
])
[
ex
]
self
.
players
[
self
.
id
][
"room"
]
=
exits
[
ex
]
self
.
room
=
ex
# go through all the players in the game
...
...
rooms/tavern.txt
View file @
83e4eec
{
"title": "Tavern",
"description": "You're in a cozy tavern warmed by an open fire.",
"exits": {"outside": "Outside", "behind
bar
": "Room001", "dark": "Dark"},
"exits": {"outside": "Outside", "behind": "Room001", "dark": "Dark"},
"look_items": {
"bar": "The bar is a long wooden plank thrown over roughly hewn barrels.",
"barrel,barrels": "The old barrels bands are thick with oxidation and stained with the purple of spilled wine.",
...
...
Please
register
or
sign in
to post a comment