summaryrefslogtreecommitdiffstats
path: root/weatbag
diff options
context:
space:
mode:
authorKleopatra Angelidi <akleop@gmail.com>2013-04-21 17:57:34 +0300
committerKleopatra Angelidi <akleop@gmail.com>2013-04-29 03:21:17 +0300
commit7a4413f5d8963cb276580526213e69789182e5a3 (patch)
treee4a24285d5426a3dd2c878b81f26ea92467a575b /weatbag
parent5449d4c2bc6631c3951327b9c57f01b643e4101e (diff)
new tile n2w2
Diffstat (limited to 'weatbag')
-rw-r--r--weatbag/tiles/n2w2.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/weatbag/tiles/n2w2.py b/weatbag/tiles/n2w2.py
new file mode 100644
index 0000000..e16f4b8
--- /dev/null
+++ b/weatbag/tiles/n2w2.py
@@ -0,0 +1,31 @@
+from weatbag import words
+from weatbag.utils import transfer
+
+class Tile:
+ def __init__(self):
+ self.contents = {'key': 1}
+
+ def describe(self):
+ print("You are now on the island.")
+ if self.contents['key']:
+ print("As you walk around you find something shiny on the ground. Looks like a key.")
+
+ def action(self, player, do):
+ if (do[0] in words.take) and ('key' in do):
+ self.take_key(player)
+ else:
+ print("Sorry, I don't understand.")
+
+ def take_key(self, player):
+ if transfer('key', self.contents, player.inventory):
+ print("You pick up the key.")
+ else:
+ print("There is nothing here.")
+
+ def leave(self, player, direction):
+ if direction == "e":
+ print ("You can't go back by swimming, that part is full of "
+ "electric eels.")
+ return False
+ else:
+ return True