Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Hacksaar
Haxotel
Commits
a3564202
Commit
a3564202
authored
Aug 01, 2014
by
Ralf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
people can actually look around!
parent
590f6419
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
labyrinth.py
labyrinth.py
+2
-2
player.py
player.py
+5
-0
No files found.
labyrinth.py
View file @
a3564202
...
...
@@ -109,13 +109,13 @@ class Labyrinth:
descr
=
""
local
=
list
(
filter
(
lambda
thing
:
thing
!=
player
,
player
.
field
.
things
))
if
local
:
descr
+=
"Next to you, "
+
describeThings
(
local
)
+
"
\n
"
descr
+=
"Next to you, "
+
describeThings
(
local
)
+
"
.
\n
"
for
direction
,
(
dy
,
dx
)
in
directions
.
items
():
field
=
player
.
field
.
neighbor
(
dx
=
dx
,
dy
=
dy
)
if
field
is
None
:
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
def
moveThing
(
self
,
thing
,
newField
,
beforeFinish
=
None
):
...
...
player.py
View file @
a3564202
...
...
@@ -7,6 +7,7 @@ goVerbs = ['go', 'walk', 'run']
sayVerbs
=
[
'say'
,
'talk'
,
'scream'
,
'whisper'
]
announceVerbs
=
[
'announce'
]
leaveVerbs
=
[
'leave'
,
'quit'
,
'exit'
,
'suicide'
]
lookVerbs
=
[
'look'
]
playerUID
=
0
...
...
@@ -124,6 +125,10 @@ class Player(Thing):
elif
verb
in
leaveVerbs
:
self
.
send
(
"Good Bye!"
)
self
.
game
.
removePlayer
(
self
)
elif
verb
in
lookVerbs
:
desc
=
self
.
game
.
labyrinth
.
getDescription
(
self
)
self
.
send
(
desc
,
end
=
""
)
elif
verb
==
self
.
game
.
adminPW
:
self
.
send
(
"Welcome to the vault, my son"
)
self
.
game
.
makeAdmin
(
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