From d15f1f16d4c5ae50c5e0743777b14f0d6da973cc Mon Sep 17 00:00:00 2001 From: Kleopatra Angelidi Date: Wed, 15 May 2013 02:37:38 +0300 Subject: set action (n5w5) --- weatbag/tiles/n5w5.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'weatbag') diff --git a/weatbag/tiles/n5w5.py b/weatbag/tiles/n5w5.py index dac6249..98f720c 100644 --- a/weatbag/tiles/n5w5.py +++ b/weatbag/tiles/n5w5.py @@ -3,6 +3,7 @@ from weatbag.utils import transfer class Tile: def __init__(self): + self.contents = {"cream": 1} self.challenge_completed = False def describe(self): @@ -12,9 +13,9 @@ class Tile: self.challenge() def challenge(self): - print("You go there and see that there's an old lady inside who stir a " - "pot. A fat ginger cat outside the kiosk is digging holes in the " - "sand.\nYou say hi, and the old lady replies:\n" + 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 a cream but first you must " "answer me this:\n" @@ -22,7 +23,14 @@ class Tile: "named May. What is the third one named?\n") def action(self, player, do): - print("I don't understand.\n") + if do[0]=="tom" and self.contents["cream"]: + print("That's correct. Now you can have some cream!\n") + self.contents["cream"] -= 1 + player.give("cream") + self.challenge = True + else: + print("I don't understand.\n") + #sandy claws -- cgit v1.3