summaryrefslogtreecommitdiffstats
path: root/weatbag/tiles/n2w1.py
blob: 6ce8301c495e743c77711c2639b04a5208a0fee3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from weatbag import words

class Tile:
    def __init__(self):
        self.challenge_not_completed = True
        self.minutes = "40"

    def describe(self):
        print("\nYou see two children who you notice now are a boy and a girl. "
              "\nThey are playing and running around a raft.")
        if self.challenge_not_completed:
            self.challenge()
        else:
            print("\nThe children take you to the western island!")

    def challenge(self):
        print("You ask them to give it to you."
              "The little boy laughs  and replies: \n"
              "So 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"
              "Ignore weight and weather variables and listen carefully.\n"
              "It takes for me to transfer a person on the island exactly one "
              "hour.\n"
              "It takes double the time for my sister.\n"
              "If we combine our powers, "
              "how many minutes will it take to transfer you on the island?\n"
              "To make a guess, type a number followed by 'minutes'.\n")

    def action(self, player, do):
        if self.challenge_not_completed:
            try:
                if do[1] == "minutes": 
                    if do[0] == self.minutes:
                        print("Your guess have pleased me and my sister! "
                              "\nLet's go!")
                        print("The brother and sister will take you to the "
                              "island.\n")
                        self.challenge_not_completed = False
                    else:
                        print("We're afraid this is not the correct answer. "
                              "Try another one.\n")
                elif (do[0] in words.take) and (do[1] == "sister" or 
                                                do[1] == "girl"):
                    print("You bastard! Leave my sister down!\n"
                         "What kind of an asshole are you? Taking advantage of "
                         "little children?\nWe will transfer you for free.\n")
                    print("The brother and sister take you to the island!\n")
                    self.challenge_not_completed = False
                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!\n")
                    print("The brother and sister take you to the island!\n")
                    self.challenge_not_completed = False
                elif (do[0] in words.take) and self.challenge_not_completed:
                    print("I told you we won't give you our raft, "
                        "you have to guess the correct amount of time!\n")
            except:
                print("Please try guessing a number, like '42 minutes'\n.")
    def leave(self, player, direction):
        if direction == "w" and self.challenge_not_completed:
            print ("You can't go there by swimming, that part is full of "
                 "electric eels.\n")
            return False
        else:
            return True