summaryrefslogtreecommitdiffstats
path: root/weatbag/tiles
diff options
context:
space:
mode:
authorKleopatra Angelidi <akleop@gmail.com>2013-05-07 21:59:31 +0300
committerKleopatra Angelidi <akleop@gmail.com>2013-05-07 21:59:31 +0300
commit1431ba0785d17d87bbed158c6fd3b2806d696e45 (patch)
tree4cc32017bcbe56d3ada3280812b9ef9a98a866ff /weatbag/tiles
parent4a73bd4bff8544a3b9c73c25e6b22fe2ddf20788 (diff)
added describe/action/leave (n1w5)
Diffstat (limited to 'weatbag/tiles')
-rw-r--r--weatbag/tiles/n1w5.py29
1 files changed, 26 insertions, 3 deletions
diff --git a/weatbag/tiles/n1w5.py b/weatbag/tiles/n1w5.py
index 078de7f..c6ef8dd 100644
--- a/weatbag/tiles/n1w5.py
+++ b/weatbag/tiles/n1w5.py
@@ -1,10 +1,33 @@
-class Tile:
+from weatbag import words
+from weatbag.utils import transfer
+class Tile:
+ def __init__(self):
+ self.contents = {'rats': 2}
+
def describe(self):
- print("blah blah describe\n")
+ if self.contents['rats']:
+ print("As you walk the path at the edge of the cliff you hear a "
+ "squeaking sound and you notice two rat traps on the ground. "
+ "Each are having one rat inside them trapped.\n"
+ "You could take the nasty rodents but really... what the "
+ "hell are you gonna do with them?\n")
+ else:
+ print("You walk the path at the edge of the cliff. Nothing "
+ "to do here.\n")
def action(self, player, do):
- print("Sorry, I don't understand.\n")
+ if (do[0] in words.take) and ('rats' in do):
+ self.take_rats(player)
+ else:
+ print("Sorry, I don't understand.\n")
+
+ def take_rats(self, player):
+ if transfer('rats', self.contents, player.inventory, n=2):
+ print("You take the rats.\n")
+ else:
+ print("No more rats for now. Got to leave the traps do their "
+ "job.\n")
def leave(self, player, direction):
if direction == "s":