summaryrefslogtreecommitdiffstats
path: root/weatbag/tiles/s2e1.py
diff options
context:
space:
mode:
authorThomas Kluyver <takowl@gmail.com>2013-04-24 14:31:55 -0700
committerThomas Kluyver <takowl@gmail.com>2013-04-24 14:31:55 -0700
commit0436b931c9941f5ac49198cffe4c88fd555ed67b (patch)
tree19d5bff7af4d5f3ca080a60774eb374f959b806c /weatbag/tiles/s2e1.py
parent32db2f567c844ece509a5001233606465474d18f (diff)
parent871d2649c85c56c6b092cffa91a42e2a3210706d (diff)
Merge pull request #18 from lathan/bug_quest
Bug quest
Diffstat (limited to 'weatbag/tiles/s2e1.py')
-rw-r--r--weatbag/tiles/s2e1.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/weatbag/tiles/s2e1.py b/weatbag/tiles/s2e1.py
new file mode 100644
index 0000000..f09581f
--- /dev/null
+++ b/weatbag/tiles/s2e1.py
@@ -0,0 +1,42 @@
+# Second and final bug quest tile.
+#
+# To future hackers:
+# This is part of a short quest which beggins by
+# going South from e1. Plase consider this when coding neighbouring tiles.
+# thnx :)
+from weatbag import words
+
+class Tile:
+ def __init__(self):
+ self.first_time = True
+
+ def describe(self):
+ print("You have reached upstream."
+ "You see the bug.")
+
+ def action(self, player, do):
+ if ('bug' in do) and ( do[0] in words.attack or
+ do[0] in words.look or
+ do[0] == 'crush' or
+ do[0] == 'fix' ):
+ print("Traceback (most recent call last):\n"
+ " File \"matrix.py\", line 97397, in <module>\n"
+ " main()\n"
+ " File \"slacking_off.py\", line 23934, in main\n"
+ " print(excuse[723])\n"
+ "IndexError: list index out of range")
+ input()
+ if self.first_time == True:
+ print("Suddenly, you realize!")
+ self.first_time = False
+ input()
+ print("It's not a bug, it's a feature!")
+
+ def leave(self, player, direction):
+ restricted_directions = { 'w', 'e', 's' }
+ if direction in restricted_directions:
+ print("The undergrowth in that direction "
+ "is impassable. You turn back.")
+ return False
+ else:
+ return True