Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Hacksaar
Haxotel
Commits
590f6419
Commit
590f6419
authored
Aug 01, 2014
by
Ralf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tell people they're alone when they are
parent
b483dfcd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
labyrinth.py
labyrinth.py
+3
-2
player.py
player.py
+8
-2
No files found.
labyrinth.py
View file @
590f6419
...
@@ -112,8 +112,9 @@ class Labyrinth:
...
@@ -112,8 +112,9 @@ class Labyrinth:
descr
+=
"Next to you, "
+
describeThings
(
local
)
+
"
\n
"
descr
+=
"Next to you, "
+
describeThings
(
local
)
+
"
\n
"
for
direction
,
(
dy
,
dx
)
in
directions
.
items
():
for
direction
,
(
dy
,
dx
)
in
directions
.
items
():
field
=
player
.
field
.
neighbor
(
dx
=
dx
,
dy
=
dy
)
field
=
player
.
field
.
neighbor
(
dx
=
dx
,
dy
=
dy
)
if
field
is
None
:
continue
if
field
is
None
:
if
field
.
things
:
descr
+=
"In the "
+
direction
+
", you see a weird kind of void. What could that be? Only time will tell...
\n
"
elif
field
.
things
:
descr
+=
"In the "
+
direction
+
", "
+
describeThings
(
field
.
things
)
+
"
\n
"
descr
+=
"In the "
+
direction
+
", "
+
describeThings
(
field
.
things
)
+
"
\n
"
return
descr
return
descr
...
...
player.py
View file @
590f6419
...
@@ -108,13 +108,19 @@ class Player(Thing):
...
@@ -108,13 +108,19 @@ class Player(Thing):
elif
verb
in
sayVerbs
:
elif
verb
in
sayVerbs
:
msg
=
" "
.
join
(
words
[
1
:])
msg
=
" "
.
join
(
words
[
1
:])
someoneClose
=
False
for
dx
,
dy
in
directionOffsets
.
values
():
for
dx
,
dy
in
directionOffsets
.
values
():
for
thing
in
self
.
field
.
neighbor
(
dx
=
dx
,
dy
=
dy
).
things
:
for
thing
in
self
.
field
.
neighbor
(
dx
=
dx
,
dy
=
dy
).
things
:
if
isinstance
(
thing
,
Player
)
and
thing
!=
self
:
assert
thing
!=
self
if
isinstance
(
thing
,
Player
):
someoneClose
=
True
thing
.
send
(
"You hear someone saying: "
+
msg
)
thing
.
send
(
"You hear someone saying: "
+
msg
)
for
admin
in
self
.
game
.
admins
:
for
admin
in
self
.
game
.
admins
:
admin
.
send
(
"{0} says: {1}"
.
format
(
self
.
uid
,
msg
))
admin
.
send
(
"{0} says: {1}"
.
format
(
self
.
uid
,
msg
))
self
.
send
(
"You say: "
+
msg
)
if
someoneClose
:
self
.
send
(
"You say: "
+
msg
)
else
:
self
.
send
(
"You want to say something, but then you realize nobody's caring anyway. Get over it!"
)
elif
verb
in
leaveVerbs
:
elif
verb
in
leaveVerbs
:
self
.
send
(
"Good Bye!"
)
self
.
send
(
"Good Bye!"
)
self
.
game
.
removePlayer
(
self
)
self
.
game
.
removePlayer
(
self
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment