Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDinko Galetic <dgaletic@everflame.(none)>2010-06-08 23:03:26 (GMT)
committer Dinko Galetic <dgaletic@everflame.(none)>2010-06-08 23:03:26 (GMT)
commitbf2a4d7645d9ff2a32859577873f4dcf85f0b2a6 (patch)
tree9b2824f0da99281c36111e5dd8f8c07c333912d5
parentcda82448da92bb394eecc1d5de2261ff10c837c1 (diff)
Added examine() and go() functions.
examine() returns the description of what you're examining, and go() changes rooms.
-rw-r--r--library/pippy/scholar/scholar.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/library/pippy/scholar/scholar.py b/library/pippy/scholar/scholar.py
index c2c141b..0f50f65 100644
--- a/library/pippy/scholar/scholar.py
+++ b/library/pippy/scholar/scholar.py
@@ -95,3 +95,16 @@ def opposite_exit(side):
else:
return side
+
+def examine(player, obj):
+ # TODO: "If obj in player.inventory" - or something like that
+ if obj in player.position.contains or obj == player.position:
+ print obj.description
+
+# TODO: The option to move without typing "go", just "west", "up"...
+def go(player, side):
+ if player.position.exits.has_key(side):
+ player.position = player.position.exits[side]
+ examine(player, player.position)
+ else:
+ print "No such exit."