コード例 #1
0
    def modifyPlayer(self, player):
        """Method to modify player"""
        if self.openChestFlag:  # if the chest is being opened
            if self.openFlag:  # if the key hasn't been taken
                print(
                    form.border("""
                You opened the chest and see nothing
                """))
                self.openFlag = False  # reset open flag
            else:  # if the chest hasn't been opened
                # if the playaer has a chest key
                if "chest key" in player.inventory:
                    print(
                        form.border("""
                    You opened the chest and found a key!

                    You picked up the key.
                    """))
                    # appends a key to player inventory
                    player.inventory.append("key")
                    # removes chest key from player inventory
                    player.inventory.remove("chest key")
                    self.openChestFlag = False  # reset open chest flag
                    self.openFlag = True  # the key has been taken
                else:
                    print(
                        form.border("""
                    You need to find the chest key to open this chest
                    """))
                    self.openChestFlag = False  # resets open chest flag
コード例 #2
0
 def searchClothes(self):
     """Method for searching the clothes"""
     print(
         form.border("""
     You searched through the clothes and noticed some Balenciaga,
     Supreme, Gucci, Louis Voutton, but didn't find any keys at all.
     """))
コード例 #3
0
 def modifyPlayer(self, player):
     """Function to modify player"""
     if self.open:  # if door has been opened
         # player must have three keys
         if player.inventory.count("key") == 3:
             player.win = True  # player wins the game
             print(f"Turn {player.turnCounter}")  # prints turn counter
             print(
                 form.border("""
             Congratulation on finding three keys
             You win!
             """))
         else:  # if the player doesn't have 3 keys
             print(
                 form.border("""
             You need to collect 3 keys to unlock this door
             """))
             self.open = False  # resets open flag
コード例 #4
0
 def modifyPlayer(self, player):
     """Class to modify player"""
     if self.sitFlag:  # if the player is sitting
         if self.keyFlag:  # if the key has been taken
             print(
                 form.border("""
             The chair made squeeked a little when you sat on it
             """))
             self.sitFlag = False  # resets sit flag
         else:  # if the tkey has not been taken
             player.inventory.append(self.item)  # append key to player inv
             print(
                 form.border("""
             Upon sitting on the chair you notice that it wobbles a little
             and found a key for a chest underneath the legs
             """))
             self.keyFlag = True  # key has been taken
             self.sitFlag = False  # reset sit flag
コード例 #5
0
 def modifyPlayer(self, player):
     """Method to modify the player"""
     if self.open:  # if the door has been opened
         player.giveUp = True  # let the game know player gave up
         print(f"Turn {player.turnCounter}")  # print turns
         print(form.border("""
         You lose
         """))
         self.open = False  # resets open flag
コード例 #6
0
    def modifyPlayer(self, player):
        """Method to modify the player"""
        if self.openDrawerFlag:  # if the drawer is open
            if self.keyFlag:  # if the key has been collected
                print(
                    form.border("""
                you opened the drawer and see nothing
                """))
                self.openDrawerFlag = False  # resets open drawer
            else:  # if the key hasn't been collected
                print(
                    form.border("""
                You opened the drawer and found a key!

                You picked up the key.
                """))
                player.inventory.append("key")  # add key to player inv
                self.keyFlag = True  # key has been collected
                self.openDrawerFlag = False  # resets open drawer flag
コード例 #7
0
    def readBook7(self):
        """Method for reading book 7"""
        # summary from https://www.amazon.ca/39-Clues-Book-One-Bones/dp/
        # 0545060397/ref=sr_1_7?keywords=the+39+clues&qid=1579321295&sr=8-7
        print(
            form.border("""
The 39 Clues Book One: The Maze of Bones by Rick Riordan
    Minutes before she died Grace Cahill changed her will, leaving her
    decendants an impossible decision:

    "You have a choice - one million dollars or a clue."
            """))
コード例 #8
0
    def readBook1(self):
        """Method for reading book 1"""
        # summary from https://www.chapters.indigo.ca/en-ca/books/minecraft-
        # combat-handbook-ultimate-collectors/9781537037868-item.html
        print(
            form.border("""
Minecraft: Combat Handbook: Ultimate Collector's Edition by Erik Aronsen
    The Masterpiece from Amazon #1 Bestselling Minecraft Authors Creative
    Community.This time we're delighted to present A Stunning Master Work
    Minecraft Combat Handbook: Collector's Edition Our goal is to show you
    the most Incredible Possibilities and unlockyour Creative Abilities to
    Master Minecraft World together with us!
            """))
コード例 #9
0
 def modifyPlayer(self, player):
     """Method to modify player"""
     if self.openBookFlag:  # if the book is being read
         if self.keyFlag:  # if the key has been taken
             self.openBookFlag = False  # resets open book flag
         else:  # if the key has not been taken
             print(
                 form.border("""
             As you opened the book a key fell out!
             """))
             player.inventory.append("key")  # add key to player inventory
             self.openBookFlag = False  # reset open book flag
             self.keyFlag = True  # key has been taken
コード例 #10
0
    def readBook4(self):
        """Method for reading book 4"""
        # summary from https://www.amazon.ca/Goosebumps-Welcome-Camp-Nightmare
        # -Stine/dp/0545158893/ref=sr_1_7?keywords=goosebumps&qid=1579321183&
        # sr=8-7
        print(
            form.border("""
Goosebumps: Welcome to Camp Nightmare by R L Stine
    The food isn't great. The counselors are strange. And the camp director
    seems demented. Okay, so Billy can handle all that. But then his fellow
    campers start to disappear. What's going on? Why won't his parents answer
    his letters? What's lurking out there after dark? Camp Nightmoon is
    turning into Camp Nightmare! And Billy might be next...
                """))
コード例 #11
0
    def readBook5(self):
        """Method for reading book 5"""
        # summary from https://www.amazon.ca/Little-Riding-Hood-Gaby-Goldsack
        # /dp/1680524488/ref=sr_1_1?keywords=little+red+riding+hood+book&qid=
        # 1579321224&sr=8-1
        self.openBookFlag = True  # book 5 is being read
        print(
            form.border("""
Little Red Riding Hood by Gaby Goldsack
    he classic tale of Little Red Riding Hood comes to life in this vibrant
    retelling perfect for beginning readers.  Designed to encourage vocabulary
    development and help children read aloud, this story uses larger font
    types and vivid, contemporary illustrations to help early learning skills.
    It's a perfect addition to any children's library
            """))
コード例 #12
0
    def readBook3(self):
        """Method for reading book 3"""
        # summary from https://www.amazon.ca/DIARY-WIMPY-Kinney-Author-
        # Hardcover/dp/B0051XV5Y6/ref=sr_1_13?crid=2YHZ0XW6OKNET&keywords=
        # diary+of+a+wimpy&qid=1579321142&sprefix=dairy+of+a+wimpy%2Caps
        # %2C184&sr=8-13
        print(
            form.border("""
Diary of a Wimpy Kid Book 1 by Jeff Kinney
    It’s a new school year, and Greg Heffley finds himself thrust into middle
    school, where undersized weaklings share the hallways with kids who are
    taller, meaner, and already shaving. The hazards of growing up before
    you’re ready are uniquely revealed through words and drawings as Greg
    records them in his diary.
            """))
コード例 #13
0
    def readBook2(self):
        """Method for reading book 2"""
        # summary from https://www.amazon.ca/Essential-Calvin-Hobbes-Bill-
        # Watterson/dp/0836218051/ref=sr_1_1?crid=1YAN87VEA3JWD&keywords=the+
        # essential+calvin+and+hobbes&qid=1579321108&sprefix=the+essential+cal
        # %2Caps%2C181&sr=8-1
        print(
            form.border("""
THE ESSENTIAL CALVIN AND HOBBES by Bill Watterson
    Beginning with the day Hobbes sprang into Calvin's tuna fish trap, the
    first two Calvin and Hobbes collections, Calvin and Hobbes and Something
    Under The Bed Is Drooling, are brought together in this treasury.
    Including black-and-white dailies and color Sundays, The Essential Calvin
    and Hobbes also features an original full-color 16-page story.
            """))
コード例 #14
0
    def readBook6(self):
        """Method for reading book 6"""
        # summary from https://www.amazon.ca/Captain-Underpants-Tyrannical-
        # Retaliation-Toilet/dp/0545504902/ref=sr_1_2?crid=28U0PXHDGQBN7&
        # keywords=captain+underpants+and+the+terrifying+return+of+tippy+
        # tinkletrousers&qid=1579321256&sprefix=captain+underpants+and+the+
        # %2Caps%2C180&sr=8-2
        print(
            form.border("""
Captain Underpants and the Tyrannical Retaliation of the Turbo Toilet 2000
by Dav Pilkey
    Just when you thought it was safe to flush . . .

    The Turbo Toilet 2000 strikes back! The carnivorous commode known for
    devouring everything in its path has built up a real appetite . . . for
    REVENGE! Join Captain Underpants for another epic showdown of Wedgie Power
    vs. Potty Power as our tighty-whitey-wearing superhero GOES TO ELEVEN!
            """))
コード例 #15
0
 def search(self):
     """Method to search a tile"""
     self.searchFlag = True  # tell program it has been searched
     print(form.border(self.event))  # prins the search event of tile
コード例 #16
0
 def lookMirror(self):
     """Method for looking at the mirror"""
     print(
         form.border("""
     You look in the mirror and notice a reflection that resembles yourself
     """))