diff options
| author | Thomas Kluyver <takowl@gmail.com> | 2013-05-26 14:43:55 -0700 |
|---|---|---|
| committer | Thomas Kluyver <takowl@gmail.com> | 2013-05-26 14:43:55 -0700 |
| commit | 0f8ea0492007d5a330558665e00012b0b7b92fef (patch) | |
| tree | 7845c107d6bfe9def38fbbc4af13fa36d68d1c74 /weatbag/tiles/n5w5.py | |
| parent | 8cdd5546c6993898e6d319853ab6c7e639ab7bf0 (diff) | |
| parent | 74288b83d9e99f790ef4a96fe7bfc96814bcb3d6 (diff) | |
Merge pull request #24 from ratmonkey/kittens
Kittens
Diffstat (limited to 'weatbag/tiles/n5w5.py')
| -rw-r--r-- | weatbag/tiles/n5w5.py | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/weatbag/tiles/n5w5.py b/weatbag/tiles/n5w5.py new file mode 100644 index 0000000..75aff81 --- /dev/null +++ b/weatbag/tiles/n5w5.py @@ -0,0 +1,52 @@ +from weatbag import words +from weatbag.utils import transfer + +class Tile: + map_word = "Kiosk" + + def __init__(self): + self.contents = {"cream": 1} + self.challenge_completed = False + + def describe(self): + print("You are on the beach. You see a small kiosk selling " + "ice cream!\n") + if not self.challenge_completed: + self.challenge() + + def challenge(self): + print("You go and see an old lady inside stir a pot. A fat ginger cat " + "outside the kiosk is digging holes in the sand.\n" + "You say hi, and the old lady replies:\n" + "Hello to you traveler, I'm Grace Hopper and this is my cat " + "Sandy Claws. I could offer you some cream but first you must " + "answer me this:\n" + "Tom's mother has three children. One is named April, one is " + "named May. What is the third one named?\n") + + def action(self, player, do): + if do[0]=="tom" and self.contents["cream"]: + print("That's correct. Now you can have some cream! " + "There... already in your bag!\nHave a mice day!\n") + self.contents["cream"] -= 1 + player.give("cream") + self.challenge = True + elif do[0] in words.take and "cream" in do and self.contents["cream"]: + print("No, it doesn't work this way. First you gotta answer my " + "question!") + elif do[0] in words.take and "cream" in do: + print("Don't be greedy, you have all the cream you're gonna " + "need.\n") + else: + print("I don't understand.") + + def leave(self, player, direction): + if direction in ("n", "e"): + print("It's the open sea. You can't go anywhere near by " + "swimming.") + return False + elif direction == "s": + print("A bunch of pine trees...") + return True + else: + return True |
