summaryrefslogtreecommitdiffstats
path: root/weatbag/tiles/n3w2.py
diff options
context:
space:
mode:
authorKleopatra Angelidi <akleop@gmail.com>2013-04-23 23:57:44 +0300
committerKleopatra Angelidi <akleop@gmail.com>2013-04-29 03:21:17 +0300
commita0b3849ab9e7ac2c36c7dc27b30cf486f619db30 (patch)
tree939cd721bb98c0fd057df134e6f66d4086f1ae15 /weatbag/tiles/n3w2.py
parente39daf19cc243ad5a64ef93d914a5142161fcaee (diff)
corrected if cases / added catfood
Diffstat (limited to 'weatbag/tiles/n3w2.py')
-rw-r--r--weatbag/tiles/n3w2.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/weatbag/tiles/n3w2.py b/weatbag/tiles/n3w2.py
index 61775f6..d1266f2 100644
--- a/weatbag/tiles/n3w2.py
+++ b/weatbag/tiles/n3w2.py
@@ -18,19 +18,26 @@ class Tile:
print("There's the old fisherman with his boat, he can take you "
"across if you like!")
- def action(self, player, do):
- if (do[0] in words.use or do[0] in words.give) and do[1]=='catfood':
-
# I only added words.use because player might
# use the word "use" insteed of "give".
+ def action(self, player, do):
- if player.has('catfood'):
- player.take('catfood')
- print("Great! Now we can sail!")
- self.give_catfood = True
+ if do[0] in words.use or do[0] in words.give:
+ if 'catfood' in do:
+ if player.has('catfood'):
+ if self.give_catfood == False:
+ player.take('catfood')
+ self.give_catfood = True
+ print("Great! Now we can sail!")
+ else:
+ player.take('catfood')
+ print("Oh how nice of you. You are the best!")
+ elif len(do) > 1:
+ print("I have no use for that.")
else:
print("Sorry, I don't understand.")
+
def leave(self, player, direction):
if direction=='e'and not self.give_catfood:
print("You can't swim, remember the electric eels? You need a "
@@ -38,4 +45,5 @@ class Tile:
return False
return True
-test_items = ['catfood']
+#two catfoods!
+test_items = ['catfood','catfood']