diff options
| author | Kleopatra Angelidi <akleop@gmail.com> | 2013-04-23 21:34:29 +0300 |
|---|---|---|
| committer | Kleopatra Angelidi <akleop@gmail.com> | 2013-04-29 03:21:17 +0300 |
| commit | b4d052c783b870989832af782e8086304651b157 (patch) | |
| tree | bd2856c21041496fa5268375bf20158137683d69 /weatbag | |
| parent | 6a3e8459abf4e87488c5187ce704186ab2c04ae6 (diff) | |
added description/leave/boolean/
Diffstat (limited to 'weatbag')
| -rw-r--r-- | weatbag/tiles/n3w2.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/weatbag/tiles/n3w2.py b/weatbag/tiles/n3w2.py new file mode 100644 index 0000000..3627713 --- /dev/null +++ b/weatbag/tiles/n3w2.py @@ -0,0 +1,39 @@ +from weatbag import words +from weatbag.utils import transfer + +class Tile: + def __init__(self): + self.give_catfood = False + + def describe(self): + if not self.give_catfood: + print("You are at the beach and there is an old man with an enormous " + "beard that is geting his little boat ready to go across to the " + "mainland.\nNaturally you are asking him to take you in his " + "boat.\nThe old man replies:\nOf course I can take you with me my " + "dear adventurer but first I need some catfood so I can feed the " + "kitties across in the mainland!") + else: + 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': + if player.has('catfood'): + player.take('catfood') + print("Great! Now we can sail!") + self.give_catfood = True + else: + print("No boat for you if you don't give me tha catfood!") + self.give_catfood = False + else: + print("Sorry, I don't understand.") + + def leave(self, player, direction): + if direction=='e': + print("You can't swim, remember the electric eels? You need a " + "transport to go across.") + return False + return True + +test_items = ['catfood'] |
