Exemplo n.º 1
0
    def open(self, room):
        if room.clues_found >= 4:
            print("If you know the combination, try it now:")
            ant = str(input("> ")).lower()
            if ant == self.combination:
                speech_manipulation(
                    "** You manage to open the door with your combination!\n",
                    0.06)
                time.sleep(2)
                print(
                    "In the next room you find all your equipment and a note from your capturer:"
                )
                print(
                    "'Not bad. You are not as dumb as I thought... Maybe you are useful after all. We will be in touch.'"
                )
                i = """          ▄▀▄
        ▄▀───▀▄
      ▄▀──▄▄▄──▀▄
    ▄▀──▄▀─▄─▀▄──▀▄
  ▄▀─────▀▄▄▄▀─────▀▄
▄▀───────────────────▀▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀"""
                print(i)
                room.solved = True
            else:
                print(
                    "That was not the right combination. Try again and review your clues."
                )
        else:
            print("Are you sure you've found enough to know the combination?")
Exemplo n.º 2
0
def setup_game():
    clear()
    question1 = "Hello what's your name?\n"
    speech_manipulation(question1, 0.05)
    print("")
    myPlayer.name = input("> ").lower()

    clear()

    classes = ["warrior", "mage", "rogue"]
    question2 = "What Class do you want to play? (Warrior, Mage, Rogue)\n"
    speech_manipulation(question2, 0.01)
    print("")
    player_class = input("> ").lower()
    print("")
    if player_class.lower() in classes:
        myPlayer.play_class = player_class
        print("You are now a " + player_class)
        time.sleep(1.5)
    else:
        while player_class.lower() not in classes:
            print("No valid class.\n")
            player_class = input("> ").lower()
        if player_class.lower() in classes:
            myPlayer.play_class = player_class
            print("You are now " + player_class)
            time.sleep(1.5)

    if myPlayer.play_class == "warrior":
        myPlayer.health_max = 120
        myPlayer.health_cur = 120
        myPlayer.mp_cur_max.append(20)
        myPlayer.mp_cur_max.append(20)
    elif myPlayer.play_class == "mage":
        myPlayer.health_max = 80
        myPlayer.health_cur = 80
        myPlayer.mp_cur_max.append(80)
        myPlayer.mp_cur_max.append(80)
    elif myPlayer.play_class == "rogue":
        myPlayer.health_max = 100
        myPlayer.health_cur = 100
        myPlayer.mp_cur_max.append(40)
        myPlayer.mp_cur_max.append(40)

    # intro()

    clear()
    print("#" * screen_width + "\n")
    print("#" + (" " * int((screen_width - 2 - len("Let's start now")) / 2)) + "Let's start now" + (
            " " * int((screen_width - 2 - len("Let's start now")) / 2)) + "#\n")
    print("#" * screen_width + "\n")

    game_loop()

    end_screen()
Exemplo n.º 3
0
def end_screen():
    speech_manipulation(
        "Congratulations, you have solved the complete game. I never thought you would be able to do this.", 0.05)
    print("")
    speech_manipulation(
        "I will get in touch with you soon. Wait for a sign from me. I think I have a good job for some strong "
        "adventurer like you.",
        0.04)
    time.sleep(5)
    clear()
    # print("Made by laeberkaes")
    # print("Hit me "UP" at: https://github.com/laeberkaes/ or @laeberkaes:uraltemorla.xyz")
    #
    # time.sleep(5)
    sys.exit()
Exemplo n.º 4
0
    def riddles(self, player):
        riddles = [("""
        This thing all things devours:
        Birds, beasts, trees, flowers;
        Gnaws iron, bites steel;
        Grinds hard stones to meal;
        Slays king, ruins town,
        And beats high mountain down.
        \n""", "time"),
                   ("""
        Alive without breath,
        As cold as death;
        Never thirsty, ever drinking,
        All in mail never clinking.
        \n""", "fish"),
                   ("""
        A box without hinges, key, or lid,
        yet golden treasure inside is hid.
        \n""", "egg"),
                   ("""
        It cannot be seen, cannot be felt,
        Cannot be heard, cannot be smelt.
        It lies behind stars and under hills,
        And empty holes it fills.
        It comes first and follows after,
        Ends life, kills laughter.
        \n""", "dark"),
                   ("""
        Voiceless it cries,
        Wingless flutters,
        toothless bites,
        Mouthless mutters.
        \n""", "wind"),
                   ("""
        Thirty white horses on a red hill,
        First they champ,
        Then they stamp,
        Then they stand still.
        \n""", "teeth"),
                   ("""
        What has roots as nobody sees,
        Is taller than trees,
        Up, up it goes,
        And yet never grows?
        \n""", "mountain")]

        speech_manipulation("What is this: \n", 0.05)
        riddle = random.choice(riddles)
        speech_manipulation(riddle[0], 0.04)

        answ = input("> ")
        if answ.lower() != riddle[1]:
            speech_manipulation("Maybe you're better with your sword than with your mind.", 0.05)
            time.sleep(.5)
            fight_setup(player, [1, 0, 0])
        else:
            speech_manipulation("I knew you are clever. So have a good day on your journey.", 0.05)
Exemplo n.º 5
0
    def level_up(self):
        """
        Used to level up. More health, more mana.
        :return:
        """
        self.level += 1
        self.health_max += 20
        self.mp_cur_max[1] += 20
        self.ep -= 100
        self.pos = (self.pos[0] - (self.level * 0.05),
                    self.pos[1] + (self.level * 0.1),
                    self.pos[2] + (self.level * 0.05))
        speech_manipulation(
            "Congratulations, you leveled up. You are now a level " +
            str(self.level) + " " + self.play_class + ".\n", 0.03)
        speech_manipulation(
            "You have " + str(self.health_max) + " max HP and " +
            str(self.mp_cur_max[1]) + " max MP.\n", 0.03)
        if self.level % 2 == 0:
            print("You can distribute 2 points on your character traits.")
            print(
                "Which traits do you want to upgrade? ('strength', 'dexterity', 'constitution', 'intelligence', "
                "'wisdom', 'charisma')")
            traits = [
                'strength', 'dexterity', 'constitution', 'intelligence',
                'wisdom', 'charisma'
            ]
            first = input("1: ")
            while first not in traits:
                print("This trait was not recognised.")
                first = input("1: ")
            second = input("2: ")
            while second not in traits:
                print("This trait was not recognised.")
                second = input("2: ")
            self.upgrade_trait(first.lower())
            self.upgrade_trait(second.lower())

        time.sleep(2)
        while self.ep > 100:
            self.level_up()
Exemplo n.º 6
0
 def level_up(self):
     """
     Used to level up. More health, more mana.
     :return:
     """
     self.level += 1
     self.health_max += 20
     self.mp_cur_max[1] += 20
     self.ep -= 100
     self.pos = (self.pos[0] - (self.level * 0.05),
                 self.pos[1] + (self.level * 0.1),
                 self.pos[2] + (self.level * 0.05))
     speech_manipulation(
         "Congratulations, you leveled up. You are now a level " +
         str(self.level) + " " + self.play_class + ".\n", 0.03)
     speech_manipulation(
         "You have " + str(self.health_max) + " max HP and " +
         str(self.mp_cur_max[1]) + " max MP.", 0.03)
     time.sleep(2)
     while self.ep > 100:
         self.level_up()
Exemplo n.º 7
0
 def intro(self, player):
     print("Hey!", end=" ")
     time.sleep(1)
     print(" " + player.name)
     time.sleep(1)
     speech_manipulation(
         "Come over here for a second, I have an offer for you.", 0.08)
     time.sleep(1)
     clear()
     print(
         "You look like a trustworthy adventure. I have a problem, you see, and I need help. My farm was raided by some bandits and I have nothing left to eat."
     )
     time.sleep(3)
     print(
         "They left a note with a message. I have it in my house. Would you come take a look and help me?"
     )
     ant = str(input("> ")).lower()
     if ant not in ["yes", "y"]:
         print("Oh. I thought you were the one to save me...")
         time.sleep(2)
     else:
         speech_manipulation("Thank you!!", 0.08)
         time.sleep(1)
         print(" ")
         speech_manipulation(
             "** You follow the man through a narrow street. After you turn a corner everything is black!",
             0.065)
         time.sleep(1)
         clear()
         time.sleep(2)
Exemplo n.º 8
0
 def story_setup(self):
     #player.location = "room_1"
     speech_manipulation("** You wake up. Your head hurts like hell.\n", 0.075)
     time.sleep(1)
     speech_manipulation("** You feel your pockets. Empty.\n", 0.075)
     time.sleep(1)
     speech_manipulation("** Looks like you need to get out of here.", 0.06)
     time.sleep(1)
Exemplo n.º 9
0
def game_over():
    clear()
    speech_manipulation("Ouh there you are again.\n", 0.05)
    speech_manipulation(
        "Don't get me wrong. This is no surprise for me. Maybe you have more luck in your next reincarnation.\n",
        0.05)
    speech_manipulation("Have a good day. :)", 0.07)
    myPlayer.game_over = True
    time.sleep(2)
    sys.exit()
Exemplo n.º 10
0
def setup_game():
    clear()
    question1 = "Hello what's your name?\n"
    speech_manipulation(question1, 0.05)
    print("")
    myPlayer.name = input("> ").lower()

    clear()

    classes = ["warrior", "mage", "rogue", "debug"]
    question2 = "What Class do you want to play? ('Warrior', 'Mage', 'Rogue')\n"
    speech_manipulation(question2, 0.01)
    print("")
    player_class = input("> ").lower()
    print("")
    if player_class.lower() in classes:
        myPlayer.play_class = player_class
        print("You are now a:")
    else:
        while player_class.lower() not in classes:
            print("No valid class.\n")
            player_class = input("> ").lower()
        if player_class.lower() in classes:
            myPlayer.play_class = player_class
            print("You are now " + player_class)

    if myPlayer.play_class == "warrior":
        print_warrior()
        time.sleep(2)
        myPlayer.health_max = 120
        myPlayer.health_cur = 120
        myPlayer.mp_cur_max.append(20)
        myPlayer.mp_cur_max.append(20)

        myPlayer.karma = 1.0
        myPlayer.strength = 0.3
        myPlayer.dexterity = -0.1
        myPlayer.constitution = 0.2
        myPlayer.intelligence = 0.0
        myPlayer.wisdom = 0.1
        myPlayer.charisma = 0.2
    elif myPlayer.play_class == "mage":
        print_mage()
        time.sleep(2)
        myPlayer.health_max = 80
        myPlayer.health_cur = 80
        myPlayer.mp_cur_max.append(80)
        myPlayer.mp_cur_max.append(80)

        myPlayer.karma = 1.0
        myPlayer.strength = 0.0
        myPlayer.dexterity = 0.2
        myPlayer.constitution = 0.2
        myPlayer.intelligence = 0.3
        myPlayer.wisdom = 0.1
        myPlayer.charisma = -0.1
    elif myPlayer.play_class == "rogue":
        print_rogue()
        time.sleep(2)
        myPlayer.health_max = 100
        myPlayer.health_cur = 100
        myPlayer.mp_cur_max.append(40)
        myPlayer.mp_cur_max.append(40)

        myPlayer.karma = 1.0
        myPlayer.strength = -0.1
        myPlayer.dexterity = 0.3
        myPlayer.constitution = 0.1
        myPlayer.intelligence = 0.1
        myPlayer.wisdom = 0.0
        myPlayer.charisma = 0.3
    elif myPlayer.play_class == "debug":
        myPlayer.health_max = 1000
        myPlayer.health_cur = 1000
        myPlayer.mp_cur_max.append(400)
        myPlayer.mp_cur_max.append(400)
        myPlayer.level = 10
        myPlayer.gold = 10000

        myPlayer.karma = 1.0
        myPlayer.strength = -0.1
        myPlayer.dexterity = 0.3
        myPlayer.constitution = 0.1
        myPlayer.intelligence = 0.1
        myPlayer.wisdom = 0.0
        myPlayer.charisma = 0.3

        for i in range(3):
            myPlayer.spells.append(Spell(myPlayer))
        myPlayer.weapon = game_object.Weapon(10)
        print("Where to start? (a1, a2, etc.")
        myPlayer.location = input("> ")
    # intro()

    clear()
    print("#" * screen_width + "\n")
    print("#" + (" " * int((screen_width - 2 - len("Let's start now")) / 2)) + "Let's start now" + (
            " " * int((screen_width - 2 - len("Let's start now")) / 2)) + "#\n")
    print("#" * screen_width + "\n")

    game_loop()

    end_screen()
Exemplo n.º 11
0
def intro():
    clear()
    question3 = "Welcome, " + myPlayer.name + " the " + myPlayer.play_class + ".\n"
    speech_manipulation(question3, 0.05)
    speech_manipulation("Welcome to this fantasy world I created for you. ;)\n", 0.05)
    speech_manipulation("I hope you will have some fun\n ... \n ... \n ...\n", 0.15)
    speech_manipulation(
        "Well, you are not the first adventurer here. There have been many before you. And to be honest, there will "
        "be many after you ... when you have ... ",
        0.05)
    speech_manipulation("passed away ... \n", 0.25)
    speech_manipulation("Now have some fun exploring the world. We will see each other when it's time to.\n", 0.05)
    time.sleep(2)
Exemplo n.º 12
0
 def setup(self, player):
     print("Hello there. Do you want to make some money?")
     time.sleep(0.5)
     speech_manipulation("How about a round of rock, paper, scissors?\n",
                         0.05)
     a = str(input("> ")).lower()
     while a not in ["yes", "no"]:
         print("What did you say?")
         a = str(input("> ")).lower()
     if a == "yes":
         clear()
         speech_manipulation("Alright! Place your bet.\n", 0.05)
         time.sleep(0.3)
         speech_manipulation(
             "How much do you want to play for? If you win, I'll double it.\n",
             0.05)
         amount = input("> ")
         while not all([c in "0123456789" for c in amount]):
             speech_manipulation(
                 "You should give me an amount of gold you want to bet?\n",
                 0.05)
             amount = input("> ")
         amount = int(amount)
         if amount > 0:
             if amount > player.gold:
                 print("Sorry mate, you don't have the bank for that.")
             else:
                 speech_manipulation("Alright.", 0.05)
                 win = self.play_rps()
                 if win == 1:
                     speech_manipulation("You won! Not bad.\n", 0.05)
                     time.sleep(0.5)
                     print("Here is your reward!")
                     speech_manipulation(
                         "You earn " + str(amount) + " Gold.", 0.05)
                     player.gold += amount
                     time.sleep(2)
                 elif win == 2:
                     speech_manipulation("Oh. A tie.\n", 0.05)
                     print("Well, no luck for both of us.")
                     time.sleep(2)
                 else:
                     speech_manipulation(
                         "You lose... Better luck next time!\n", 0.05)
                     time.sleep(0.5)
                     print("Pay your bet!")
                     player.gold -= amount
                     time.sleep(2)
         else:
             print("Try again...")
Exemplo n.º 13
0
 def setup_game(self, player):
     speech_manipulation(
         "Hello stranger. Care for a round of the shell game?\n", 0.05)
     time.sleep(0.3)
     speech_manipulation(
         "The rules are simple. One ball, three cups. You tell me where the ball is and I pay you money.\n",
         0.05)
     time.sleep(0.3)
     speech_manipulation("If you lose, you pay me.\n", 0.05)
     time.sleep(0.3)
     speech_manipulation("Do you want to play?\n", 0.05)
     a = str(input("> ")).lower()
     if a in ["yes", "y"]:
         speech_manipulation("Alright! Place your bet.\n", 0.05)
         time.sleep(0.3)
         speech_manipulation(
             "How much do you want to play for? If you win, I'll double it.\n",
             0.05)
         amount = input("> ")
         while not all([c in "0123456789" for c in amount]):
             speech_manipulation(
                 "You should give me an amount of gold you want to bet?\n",
                 0.05)
             amount = input("> ")
         # try:
         #     amount = int(input("> "))
         # except ValueError:
         #     print("Tell me, how much money do you want to bet?")
         amount = int(amount)
         if amount > 0:
             if amount > player.gold:
                 speech_manipulation(
                     "Sorry, your coin purse seems a little light for such a bet.\n",
                     0.05)
                 time.sleep(1)
             else:
                 speech_manipulation("Okay, here we go.\n", 0.05)
                 win = self.play_game(player)
                 if win > 0:
                     player.gold += amount
                     speech_manipulation(
                         "You get " + str(amount) +
                         " gold from me. Be sure to play again.\n", 0.05)
                     time.sleep(2)
                 else:
                     player.gold -= amount
                     speech_manipulation("Thanks for the money, sucker!\n",
                                         0.05)
                     time.sleep(2)
         else:
             speech_manipulation("Not funny.\n", 0.05)
     else:
         speech_manipulation("Really? Well then... See you around.\n", 0.05)
Exemplo n.º 14
0
    def __init__(self, player):
        speech_manipulation("Hey! YOU! Don't think about crossing this bridge without paying the price.\n", 0.05)
        print(" " * 6 + "1. Pay 10 Gold.")
        print(" " * 6 + "2. Persuade the Guard.")
        print(" " * 6 + "3. Intimidate the Guard.")
        print(" " * 6 + "4. Go and mind your own business.")
        answ = input("> ")

        while answ not in ["1", "2", "3", "4"]:
            print("Invalid option.")
            answ = input("> ")

        if answ == "1" and player.gold > 9:
            player.gold -= 10
            speech_manipulation("I knew you are a good person. Have a nice day Sir.\n", 0.04)
        elif answ == "1" and player.gold < 10:
            speech_manipulation("I see you have not enough money with you.\n", 0.05)
            fight_setup(player, [1, 0, 0])
        elif answ == "2" and (random.random() > (0.5 + (0.1 * player.level) - player.friendly)):
            speech_manipulation("Am I looking like a joke to you?\n", 0.04)
            fight_setup(player, [1, 0, 0])
            player.friendly += 0.1
        elif answ == "2":
            speech_manipulation("Okay I see you have some serious trouble yourself. I will give you a riddle and you "
                                "can solve this instead of paying the price.\n", 0.05)
            self.riddles(player)
        elif answ == "3" and (random.random() > (0.2 + (0.1 * player.level) - player.friendly)):
            speech_manipulation("Well. It doesn't seem you know whom you are talking to?\n", 0.05)
            fight_setup(player, [1, 0, 0])
            player.friendly += 0.1
        elif answ == "3":
            speech_manipulation(
                "Okay, okay. You don't have to get mad. Go over there .. but don't come back quickly.\n", 0.04)
        elif answ == "4":
            speech_manipulation("Yeah better go now!\n", 0.04)