diff options
| author | Kleopatra Angelidi <akleop@gmail.com> | 2013-04-20 23:46:14 +0300 |
|---|---|---|
| committer | Kleopatra Angelidi <akleop@gmail.com> | 2013-04-29 03:21:16 +0300 |
| commit | c4f5bfe7d00652632e38db23251aa33ede84f009 (patch) | |
| tree | 151d4ffb9246a96b67e2ef799bb36782d1c08fca /weatbag | |
| parent | 2cc3d7ac306ad7ae935acad7d4d338b6e00914c3 (diff) | |
Added tile n2w1.
Diffstat (limited to 'weatbag')
| -rw-r--r-- | weatbag/tiles/n2w1.py | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/weatbag/tiles/n2w1.py b/weatbag/tiles/n2w1.py new file mode 100644 index 0000000..a4347f8 --- /dev/null +++ b/weatbag/tiles/n2w1.py @@ -0,0 +1,75 @@ +from weatbag import words + +class Tile: + def __init__(self): + self.contents = {'island ticket': 1} + self.minutes = "40" + + def describe(self): + if self.contents['island ticket']: + self.challenge() + else: + print("The brother and sister have vanished. You see a line of " + "trees across the sand.") + + def challenge(self): + print("You aproach the children who you see now are a boy and a girl.\n" + "They are playing and running around a raft.\n" + "You ask them to give it to you.") + print("The little boy laughs and replies: \nSo you think you " + "are brave enough to go to that island? Very well, but we cannot" + " give you our raft. " + "What we can do is transfer you there ourselves. But first you " + "must answer this:\n\n") + print("Ignore weight and weather variables and listen carefully.\nIt " + "takes for me to transfer a person on the island exactly one hour.\n" + "It takes double the time for my sister.\nIf we combine our powers " + "in how many minutes will we transfer you on the island?\n") + print("To make a guess, type a number followed by 'minutes'") + + def action(self, player, do): + if ( self.contents["island ticket"] > 0 ): + try: + if do[1] == "minutes": + if do[0] == self.minutes: + print("Your guess have pleased me and my sister! " + "Let's go!") + print("The brother and sister will take you to the " + "island.") + self.contents['island ticket'] -= 1 + player.give('island ticket') + else: + print("We're afraid this is not the correct answer. " + "Try another one.") + elif (do[0] in words.take) and (do[1] == "sister" or + do[1] == "girl"): + print("You little bastard, leave my sister down!\n" + "What kind of an asshole are you? Taking advantage of " + "little children?\nWe will transfer you for free.") + print("The brother and sister take you to the island!") + self.contents['island ticket'] -= 1 + player.give('island ticket') + + elif (do[0] in words.take) and (do[1] == "brother" or + do[1] == "boy"): + print("You bastard, take me down!\n" + "We will transfer you for free!") + print("The brother and sister take you to the island!") + self.contents['island ticket'] -= 1 + player.give('island ticket') + + elif (do[0] in words.take) and (self.contents['island ticket'] == 1): + print("I told you we won't give you our raft, " + "you have to guess the correct amount of time!") + except: + print("Please try guessing a number, like '42 minutes'.") + def leave(self, player, direction): + if direction == "w": + print ("You can't go there by swimming, that part is full of " + "electric eels.") + return False + else: + return True + + + |
