summaryrefslogtreecommitdiffstats
path: root/weatbag/tiles/n2w5.py
diff options
context:
space:
mode:
authorThomas Kluyver <takowl@gmail.com>2013-04-30 10:15:21 -0700
committerThomas Kluyver <takowl@gmail.com>2013-04-30 10:15:21 -0700
commite8676fe2073467b093af0abc8ccb19443ed4ecb7 (patch)
treec25d9794e1b8c77d70c2862f07f197fc0c69f067 /weatbag/tiles/n2w5.py
parente3612c7544341abf9e84234d4bda5f65ce8ee47a (diff)
parent3d626b5229add94f08acc3ae3731566507fc2f7e (diff)
Merge pull request #22 from ratmonkey/island_rebased
Island area
Diffstat (limited to 'weatbag/tiles/n2w5.py')
-rw-r--r--weatbag/tiles/n2w5.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/weatbag/tiles/n2w5.py b/weatbag/tiles/n2w5.py
new file mode 100644
index 0000000..12ae7d2
--- /dev/null
+++ b/weatbag/tiles/n2w5.py
@@ -0,0 +1,33 @@
+from weatbag import words
+from weatbag.utils import transfer
+
+class Tile:
+ def __init__(self):
+ self.contents = {'catfood': 2}
+
+ def describe(self):
+ if self.contents['catfood']>0:
+ print("You look around and you see a shelf with catfood cans.\n"
+ "I don't know about you, but a catfood can is always handy!\n"
+ "Never know when you'll need to feed a kitty!\n")
+ else:
+ print("You see an empty self.")
+
+ def action(self, player, do):
+ if (do[0] in words.take) and ('catfood' in do):
+ self.take_catfood(player)
+ else:
+ print("Sorry, I don't understand.\n")
+
+ def take_catfood(self, player):
+ if transfer('catfood', self.contents, player.inventory, n=2):
+ print("You did wise. You took the catfood!\n")
+ else:
+ print("There is nothing here.\n")
+
+ def leave(self, player, direction):
+ if direction == 'w'or direction == 's' or direction == 'n':
+ print("Area 51. No trespassing beyond this point.\n")
+ return False
+ else:
+ return True