コード例 #1
0
 def get_next_node(self, variables):
     """Returns None if self.choices is empty, otherwise the appropriate node. (If a node name is found instead, sets the appropriate value of self.choices to the corresponding node and returns that node instead.)"""
     # Check for empty list (and avoid catching empty strings)
     if self.choices == []:
         return None
     # Check for string (variable name)
     if isinstance(self.choices, str):
         if self.choices in variables:
             var_data = variables[self.choices]
             index = int(var_data[1])
             # Check if choice at that index is a node name
             if isinstance(self.nodes[index], str):
                 # Set value at the index to the corresponding node
                 self.nodes[index] = StoryNode.all_nodes[self.nodes[index]]
             # Return node
             return self.nodes[index]
         raise ValueError("variable \"" + self.choices +
                          "\" not in variables")
     # Get user input
     user_input = validate_input(self.choices, self.err_message,
                                 self.prompt)
     # Find index of first appearance of user_input in self.choices
     index = self.choices.index(user_input)
     # Check if choice at that index is a node name
     if isinstance(self.nodes[index], str):
         # Set value at the index to the corresponding node
         self.nodes[index] = StoryNode.all_nodes[self.nodes[index]]
     # Return node
     return self.nodes[index]
コード例 #2
0
def user_audio_settings() -> None:
  """Gets user input to determine if audio should be enabled.
  """
  # Different groups of choices
  enabled_choices = ("Y", "YES", "ENABLE", "ENABLED", "ON")
  disabled_choices = ("N", "NO", "DISABLE", "DISABLED", "OFF")
  # Get user input
  enable_audio = (inpt.validate_input(enabled_choices+disabled_choices,
                                      "Sorry, I don't understand that"
                                      "input.",
                                      "Do you want to enable audio?")
                  in enabled_choices)
  # Set Audio.enabled
  Audio.enabled = enable_audio
  # Force replit to provide popup
  if Audio.enabled:
    # Plays a sine wave at 440 Hz for 1 second... At 0 volume.
    replit.audio.play_tone(1, 440, 0, volume=0.0)
コード例 #3
0
def welcome():
  global party
  introScreen = pygame.display.set_mode((800, 800))
  introScreen.fill((148, 226, 255))

  welcome = pygame.image.load("files/images/welcome2.PNG")
  welcome = pygame.transform.scale(welcome, (710, 300))
  position = (0, 0)
  introScreen.blit(welcome, position)

  pygame.display.flip()
  clearConsole()

  answer = validate_input([], "", prompt="Press s to skip the intro. Press b just to play the intro battle. Else, press any key to start playing: ", validate=False).lower()

  clearConsole()

  if (answer != "s"):
    if (answer != "b"):
      amaliyahIntro()
      clearConsole()
    option = yes_no(
      False, "Decide quickly...",
      "Do you want instructions on how to fight the battle? (this option will not be provided later): "
    )
    if (option == 'YES' or option == 'Y'):
      battle_tutorial()

    clearConsole()
    loop_battle(party, [NormalKirin.copy(), NormalKirin.copy(), InexperiencedKirin.copy()], "Woods", "And suddenly, they burst through the trees, howling and scrabbling frantically on the wet leaves.", "kirin", "You see a beam of light fade in and out of view and feel an odd sense of displacement...")

  # party = [currentUser.getUserData()["data"]["characters"]["Esteri"]]

  clearConsole()
  delay_print(
    "And as the fire consumed her, there was no pain, not anymore. It was the moment when the ice numbs your hands and the pain fades, down to the shivers of cold, now the tremors of death. And Amaliyah's mind wandered, to the forest, to the city, to the mountains, to her village in the valley and the daughter she left behind."
  )
  clearConsole()
  time.sleep(0.5)
  delay_print("Esteri.", speed=0.01)
  time.sleep(0.5)
  clearConsole()
  pygame.quit()
コード例 #4
0
    def carpenterhouse():
      data = cu.currentUser.getUserData()
      minu_visits = data["data"]["village1"]["minu_visits"]
      stole_something = data["data"]["village1"]["stole_something"]
      minu_mad = data["data"]["village1"]["minu_mad"]

      if stole_something == True:
        delay_print("You can't enter! They might find out that you stole Minu's amulet!")
        time.sleep(1)
        clearConsole()
        village_1()
      else:
        if quest_completion == False:
          clearConsole()
          print(DARK_RED + "CARPENTER'S HOUSE" + DARK_RED)
          time.sleep(0.25)
          delay_print("The door is locked!")
          time.sleep(1)
          clearConsole()
          village_1()
        elif quest_completion == True:
          clearConsole()
          print(DARK_RED + "CARPENTER'S HOUSE" + DARK_RED)
          time.sleep(0.25)
          delay_print(WHITE + "Who would you like to talk to?" + WHITE)
          delay_print(" 1. Carpenter")
          delay_print(" 2. Carpenter's Wife")
          delay_print(" 3. Carpenter's Daughter")
          delay_print(" 4. Exit House")
          carpenter_family = validate_input(["1", "2", "3", "4"], "Invalid input")
          clearConsole()
          if carpenter_family == "1":
            delay_print("The carpenter glances up at you with a bit of confusion. His eyes crinkle kindly when he recognizes you.")
            delay_print("'Hello, hero!' he says, standing frantically and bowing. 'I greatly appreciate your help. Thank you for saving my wife, my daughter, and I!'")
            delay_print("He looks down at his daughter for a second, expression soft and proud. 'I would never forgive myself if I let her be hurt.'")
            time.sleep(0.25)
            delay_print("You're hit by a pang of jealousy.")
            time.sleep(0.25)
            delay_print("He looks back at you, slightly disoriented. 'Where was I? Ah, yes. We're eating breakfast right now. All we have is rice, but it may be able to help you replenish your energy. Would you like to eat some?'")
            carpenter_breakfast = yes_no(False, "Invalid input").lower()
            if carpenter_breakfast == "yes" or carpenter_breakfast == "y":
              delay_print(
                "'Wonderful!' He grins and proffers a bowl of steaming-hot rice.")
              delay_print(
                "You munch on the food you were offered. It's delicious!")
              Esteri.setHP(Esteri.MaxHP)
              time.sleep(1)
              carpenterhouse()
            if carpenter_breakfast == "no" or carpenter_breakfast == "n":
              delay_print(
                "'That's all right,' the carpenter says, slightly disappointed. 'Don't forget to come back another time!'")
              time.sleep(1)
              clearConsole()
              village_1()
          elif carpenter_family == "2":
              delay_print("The carpenter's wife gnaws on rice. She seems distracted.")
              delay_print("'Mmmmm... such good rice...'")
              time.sleep(1)
              carpenterhouse()
          elif carpenter_family == "3":
            if minu_mad == False:
              if minu_visits == 0:
                delay_print("The carpenter's daughter looks downcast. She picks at her rice.")
                delay_print("She glances up at you.")
                delay_print("'Oh, you're the village hero!' she says, recognizing you immediately.")
                delay_print("She kneads her hands. 'What's your name?'")
                delay_print("Will you introduce yourself?")
                carpenter_daughter_response = validate_input(["yes", "y", "no", "n"],"Invalid input").lower()
                if carpenter_daughter_response == "yes" or carpenter_daughter_response == "y":
                  delay_print("'I'm Esteri,' you say, proud.")
                  delay_print("'Nice to meet you, Esteri!'")
                  delay_print("The girl bows slightly. 'My name is Minu.'")
                  delay_print("Her expression becomes one of trepidation. 'Can I trust you with a secret?'")
                  carpenter_daughter_secret = validate_input(["yes", "y", "no", "n"], "Invalid input").lower()
                  if carpenter_daughter_secret == "yes" or carpenter_daughter_response == "y":
                    delay_print("'Sure.' You lean forwards, curious.")
                    delay_print("She furtively flicks her gaze to her father.")
                    delay_print("'I'm afraid that my dad is disappointed that I'm not a carpenter,' she confesses.")
                    delay_print("She looks sheepish. 'I wish I could be a good carpenter, I really do. But I enjoy taking care of animals more.'")
                    delay_print("She looks down at her lap. 'Do you think he's mad at me?'")
                    carpenter_daughter_disappointed = validate_input(["yes", "y", "no", "n"], "Invalid input").lower()
                    if carpenter_daughter_disappointed == "no" or carpenter_daughter_disappointed == "n":
                      delay_print("'I think your dad loves you for who you are,' you say gently.")
                      delay_print("You think of your mother for a second before Minu's voice snaps you out of your thoughts.")
                      delay_print("'Thank you!' Minu's face brightens. 'That makes me feel a lot more confident.'")
                      delay_print("She looks down for a second.")
                      delay_print("'It's hard to find people to talk to here...' she murmurs.")
                      time.sleep(0.5)
                      delay_print("The moment of silence passes, and Minu smiles awkwardly.")
                      time.sleep(0.5)
                      delay_print("She holds out her palm. In it is a small purple stone, pusling with blue light.")
                      delay_print("She grins. 'I'd like you to have this as thanks.'")
                      delay_print("You take the amulet and slip it into your bag. 'Thank you! I'm glad I could help.'")
                      add_item("Minu's Amulet", "An amulet containing a mysterious healing power.")
                      minu_visits += 1
                      data["data"]["village1"]["minu_visits"] = minu_visits
                      cu.currentUser.updateAndPersist(data);
                      time.sleep(1)
                      clearConsole()
                      carpenterhouse()
                    if carpenter_daughter_disappointed == "no" or carpenter_daughter_disappointed == "n":
                      delay_print("'Oh...' Minu looks concerned. 'I suppose you're right. Thank you for your time, Esteri.'")
                      delay_print("She turns away, looking disheartened. You feel momentarily bad.")
                      delay_print("Then you notice a stone next to her plate, bright red and pulsing with fiery orange streaks.")
                      delay_print("Do you take it? You're torn: it could help you on your quest, but stealing is wrong.")
                      take_minus_amulet = validate_input(["yes", "y", "n", "no"], "Invalid input").lower()
                      if take_minus_amulet == "yes" or take_minus_amulet == "y":
                        delay_print("You sneak the stone into your bag. No one notices.")
                        add_item("Minu's Amulet", "An amulet containing the power to harm others.")
                        delay_print("You decide to sneak out of the carpenter's house before anyone can catch you.")
                        stole_something = True
                        minu_visits += 1
                        data["data"]["village1"]["stole_something"] = stole_something
                        data["data"]["village1"]["minu_visits"] = minu_visits
                        cu.currentUser.updateAndPersist(data);

                        time.sleep(1)
                        clearConsole()
                        village_1()
                      if take_minus_amulet == "no" or take_minus_amulet == "n":
                        delay_print("You rescind your hand and smile stiffly.")
                        minu_visits += 1
                        data["data"]["village1"]["minu_visits"] = minu_visits
                        cu.currentUser.updateAndPersist(data);

                        time.sleep(1)
                        clearConsole()
                        carpenterhouse()
                  if carpenter_daughter_secret == "no" or carpenter_daughter_secret == "n":
                    delay_print("Minu smiles softly. 'That's all right. Maybe you can come back another time to hear my secret!'")
                    time.sleep(1)
                    clearConsole()
                    carpenterhouse()
                if carpenter_daughter_response == "2":
                  delay_print("'Oh. Sorry for mistaking you for the wrong person!' She looks uncomfortable.")
                  time.sleep(1)
                  clearConsole()
                  carpenterhouse()
              else:
                delay_print("'This rice is delicious!'")
            elif minu_mad == True: 
              delay_print("You shouldn't go over to her! She's angry!")
              time.sleep(1)
              clearConsole()
              carpenterhouse()
          else:  #carpenter_family == 4
              time.sleep(0.5)
              clearConsole()
              village_1()
コード例 #5
0
def village_1_dark_forest_quest_thing():
  data = cu.currentUser.getUserData()
  delay_print("'C'mon, Esteri, let's go!' Kosu bounds down the forest path, bouncing gleefully.")
  delay_print("His eyes glimmer in the dim light, and for a second you feel a rush of affection for your friend.")
  delay_print("His innocent expression is full of boundless joy.")
  delay_print("He flashes one more grin and then breaks into a sprint. 'You can't even catch me!'")
  delay_print("Will you speed up to catch him?")
  statement_cave_path = validate_input(["y", "n", "yes", "no"], "You'd better decide! He's getting away!").lower()
  if statement_cave_path == "y" or statement_cave_path == "yes":
    delay_print("You bolt down the path after him. 'You know I'm a better runner than you, right?")
    delay_print("He dodges through the trees and swerves out of sight.")
    delay_print("You chase after him, stumbling over tree roots and trampling the packed dirt.")
    delay_print("The path turns into a clearing ahead of you, and you dash towards the gap in the trees, competitiveness fueling your speed.")
    delay_print("As you turn the corner, Kosu comes into view. He hasn't moved.")
    delay_print("'What'd you find?' you demand.")
    delay_print("Kosu holds up his hand. 'Shhhh...' he whispers. 'Look.'")
  elif statement_cave_path == "n" or statement_cave_path == "no":
    delay_print("You amble haughtily down the path, determined to exert your grandeur without ruining your hair.")
    delay_print("As you turn the corner, Kosu comes back into view. He hasn't moved.")
    delay_print("'What'd you find?' you demand.")
    delay_print("Kosu holds up his hand. 'Shhhh...' he whispers. 'Look.'")
  time.sleep(0.5)
  clearConsole()
  delay_print("The clearing is full of glowing mushrooms, shimmering in every color imaginable.")
  delay_print("Pixies flutter about, glimmering faintly and sprinkling light across the leaf-strewn earth.")
  delay_print("Vines creep up the trees, leading into the branches and climbing into darkness.")
  delay_print("'This place is beautiful,' you say wonderingly.")
  delay_print("Kosu turns to face you, unsettled. 'You don't hear it?'")
  delay_print("The two of you fall into a dead silence. Your ears strain.")
  delay_print("A soft buzzing flows out of the quiet, steady and rhythmic as the volume climbs.")
  delay_print("Kosu grabs your arm frantically. 'Something is really wrong with this place!'")
  delay_print("You drag him towards the entrance to the clearing, but you can no longer find it; in fact, the trees seem to be spinning around you, rotating at an immeasurable speed.")
  delay_print("Only one thing in the clearing remains immobile; a small rock, situated in the dead center.")
  delay_print("Do you want to pick up the rock?")
  validate_input(["y", "yes"], "'Come on, Esteri! Pick up that rock!' Kosu complains.")
  clearConsole()
  delay_print("As soon as you lift the rock, an outcropping of stalactites shoots upwards, forming the shape of a lion's muzzle.")
  delay_print("The lion's gaping maw beckons, tunneling down into the pitch-black underground.")
  delay_print("Kosu shoves past you. 'I'll go first,' he yells over the din. Before you can react, he jumps into the hole.")
  delay_print("After one more second of hesitation, you leap after him into the abyss.")
  time.sleep(1)
  clearConsole()
  delay_print("One second passes as you shoot downwards...")
  time.sleep(1)
  delay_print("... then another.")
  time.sleep(1)
  delay_print("You hear the wind whistling through your ears, and ever-so-suddenly, your eyes register the ground rushing up to meet you.")
  delay_print("There is no Kosu- only hard, spiky rock.")
  time.sleep(1)
  delay_print("You inhale and exhale, terror spiking your adrenaline, and then attempt to grab a stalactite.")
  time.sleep(1)
  delay_print("But your hands slip, and you continue to fall.")
  time.sleep(1)
  delay_print("After a brief pause, you start to scream. Agony rings in your ears as you curse your mother, your village, and Kosu for bringing this awful fate upon you.")
  time.sleep(1)
  delay_print("A gust of warm air washes over you, and suddenly you feel your body being carried backwards.")
  time.sleep(1)
  delay_print("Your light-headedness takes over as you try frantically to hold onto consciousness, but the effort is futile...")
  time.sleep(1)
  delay_print("As you shoot over a dark lake, dimly registering the tiny arms that now grip your shirt, you pass out.")
  time.sleep(1)
  clearConsole()
  loading_effect()
  delay_print("You are lying on a cold rock.")
  delay_print("You shove one arm out frantically, then retract it rapidly as you start sliding forward.")
  delay_print("The surface is as smooth and chilly as ice, yet as black as obsidian. It refuses to give you grip.")
  delay_print("Vision swimming, you struggle to stand up, pushing yourself even farther forward.")
  delay_print("At last, you succeed.")
  delay_print("The cave around you sparkles with tens of thousands of tiny pinpricks of light.")
  delay_print("It's a surreal image to behold, but it produces a considerable strain on your eyes.")
  delay_print("You only have a second to register when you see the dark silhouette that stands in front of you, buzzing with the same odd sound.")
  time.sleep(1)
  clearConsole()
  loop_battle([Esteri], [Dronae.copy()], "cave", "Suddenly, it leaps out at you!", "dronae", "You see a beam of light fade in and out of view and feel an odd sense of displacement...")
  time.sleep(1)
  clearConsole()
  delay_print("You stumble away from the monster's carcass, disoriented.")
  delay_print(WHITE_ITALIC + "Esteri..." + WHITE_ITALIC)
  delay_print(WHITE + "A low rumble echoes through the cave." + WHITE)
  delay_print(WHITE_ITALIC + "Esteri... you have not proven your worth..." + WHITE_ITALIC)
  delay_print(WHITE + "You spin around, scrabbling to direct your rotation." + WHITE)
  delay_print(WHITE + "Before you can run, though, the walls reform around you. There are two openings in front of you, but they are guarded by a short, dragon-like figure." + WHITE)
  delay_print(WHITE_ITALIC + "The Dronae... will test you." + WHITE_ITALIC)
  delay_print(WHITE + "The short monster- the Dronae- buzzes." + WHITE)
  delay_print(WHITE_ITALIC + "If you can answer their questions correctly, you shall reach the end of the tunnel with no issue." + WHITE_ITALIC)
  delay_print(WHITE + "You stare down the Dronae." + WHITE)
  delay_print(WHITE_ITALIC + "But if you answer wrong... you will never be able to make it." + WHITE_ITALIC)
  delay_print(WHITE + "The wall lights glow brighter, as if to taunt you." + WHITE)
  delay_print(WHITE_ITALIC + "Good luck..." + WHITE_ITALIC)
  delay_print(WHITE + "A low ringing hums through your ears, then a whistle of air as the voice floats away."+ WHITE)
  time.sleep(1)
  clearConsole()
  delay_print("'Well,' the Dronae buzzes, 'you're the type to bow to your superiors, aren't you?'")
  dronae_question_1 = validate_input(["y", "yes", "n", "no"], "Invalid input").lower()
  if dronae_question_1 == "y" or dronae_question_1 == "yes":
    delay_print("'Yes,' you say begrudgingly, wrapping one hand around your spear.")
    delay_print(WHITE + "'Good,' the Dronae buzzes. 'You may pass... via the left, in recognition of your deference.'" + WHITE)
    delay_print("Will you heed its instruction, or will you choose the other path?")
    delay_print(" 1. Left")
    delay_print(" 2. Right")
    dronae_path_1 = validate_input(["1", "2"], "The Dronae is beginning to look agonized... You'd better heed its instruction...").lower()
    if dronae_path_1 == "1":
      delay_print("'Left,' you mutter angrily.")
      delay_print("The Dronae looks satisfied. You turn and walk down the path to the left.")
    elif dronae_path_1 == "2":
      time.sleep(1)
      clearConsole()
      delay_print("You grab your spear off your back and spin it in your hand, fed up. 'As if I'm going to comply!'")
      loop_battle([Esteri], [Dronae.copy()], "cave", "The Dronae jumps at you in fury!", "dronae", "You see a beam of light fade in and out of view and feel an odd sense of displacement...")
      delay_print("The Dronae lies on the ground, bleeding. 'Continue...' it coughs, suddenly appearing pitiful due to the blood that saturates its muzzle. 'You have proven yourself worthy.'")
      delay_print("It fades, dissolving into the air with transience.")
  elif dronae_question_1 == "n" or dronae_question_1 == "no":
    delay_print("'Of course not.' You grab your spear off your back and lunge forward, incensed.")
    time.sleep(1)
    clearConsole()
    loop_battle([Esteri], [Dronae.copy()], "cave", "'Wrong answer!' The Dronae leaps at you, claws outstretched.", "dronae", "You see a beam of light fade in and out of view and feel an odd sense of displacement...")
    delay_print("The Dronae lies on the ground, bleeding. 'Continue...' it coughs, suddenly appearing pitiful due to the blood that saturates its muzzle. 'You have proven yourself worthy.'")
    delay_print("It fades, dissolving into the air with transience.")
    delay_print("You strap your sword to your back again, letting out a huff of satisfaction.")
    delay_print(WHITE_ITALIC + "Impressive..." + WHITE_ITALIC)
    delay_print(WHITE + "'Where do I go to find Kosu?' you scream at the ceiling, furious." + WHITE)
    delay_print("Your voice echoes back and forth a few times, but nothing else is audible.")
    delay_print("You growl in frustration and stomp forward to the fork.")
    delay_print("Which way will you go?")
    delay_print(" 1. Left")
    delay_print(" 2. Right")
    dronae_path_1 = validate_input(["1", "2"], "You'd better choose quickly... Kosu is in danger...").lower()
  if dronae_path_1 == "1":
    loading_effect()
    clearConsole()
    delay_print("You stumble into another lighted cavern. This one is lined with fluorescent mushrooms like the ones you saw above. The floor is woven with roots.")
    delay_print("'Esteri!' Kosu's voice rings off the walls.")
    delay_print("Your eyes adjust, and you gasp.")
    delay_print("Your friend is ensnared in a tangle of vines, wrapping around him in an intricate pattern and constricting quickly.")
    delay_print("Yet again, a Dronae stands guard in front of the structure.")
    time.sleep(1)
    clearConsole()
    loop_battle([Esteri], [Dronae.copy()], "cave", "This one doesn't even make a noise before it launches itself at you.", "dronae", "You see a beam of light fade in and out of view and feel an odd sense of displacement...")
    delay_print("When the Dronae fades this time, the vines disappear. Kosu drops to the ground with a light thud.")
    delay_print("You rush over to him.")
    delay_print("Will you ask if he's all right?")
    floofffy = validate_input(["yes", "no", "y", "n"], "Kosu looks up at you questioningly.").lower()
    if floofffy == "y" or floofffy == "yes":
      delay_print("'Are you alright?' You peer at him with concern.")
    if floofffy == "n" or floofffy == "no":
      delay_print("'Let's go.' You don't want to dwell on injury.")
    delay_print("Kosu gets up slowly and dusts himself off. 'Yeah,' he says, forcing a smile. 'Let's go!'")
    delay_print("Without waiting for further comment,you grab his wrist and pull him towards the exit to the cavern.")
    delay_print("But you are stopped by another pair of Dronae, which jump in front of you, buzzing with impertinent fury.")
    delay_print("You growl in frustration. 'Te'ke these things.'")
    delay_print("Besides you, Kosu lets out a tired laugh. 'Yeah.'")
    time.sleep(1)
    clearConsole()
    loop_battle([Esteri, Kosu], [Dronae.copy(), Dronae.copy()], "cave", "They swipe a claw at your face in synchrony!", "dronae", "You see a beam of light fade in and out of view and feel an odd sense of displacement...")
    delay_print("When the Dronae fall, a voice echoes through the cavern.")
    time.sleep(1)
    clearConsole()
    delay_print(WHITE_ITALIC + "Esteri..." + WHITE_ITALIC)
    delay_print(WHITE + "You turn pale. Kosu tugs your shoulder. 'What's wrong?'" + WHITE)
    delay_print(WHITE + "You begin to furiously walk towards the exit. Kosu follows you." + WHITE)
    delay_print("The voice fades away with a low whine.")
    delay_print("'Idiot Dronae,' you growl, 'I'm coming for you.'")
    delay_print("You wrap your arm around Kosu's shoulders to help support him, and the two of you slowly stumble through the door.")
    time.sleep(1)
    clearConsole()  
    loading_effect()
    delay_print("Your hand instinctively swings up to shield your eyes as you step into the most bright room you've ever seen in your life.")
    delay_print("Light pours off the ceiling and the walls.")
    delay_print("It washes over you, and you suddenly feel energized.")
    Esteri.setHP(Esteri.MaxHP) #Sets Esteri's health to max if MaxHP is somehow more than 1000
    Kosu.setHP(Kosu.MaxHP)
    delay_print("Kosu wiggles his ankle. 'It feels normal again!'")
    time.sleep(1)
    clearConsole()
    delay_print("Will you ask if he knows anything about the Dronae?")
    kosu_talk_1_yay_woo_puppy_fish = validate_input(["y", "yes", "n", "no"], "Kosu watches you, waiting for a comment.").lower()
    time.sleep(1)
    clearConsole()
    if kosu_talk_1_yay_woo_puppy_fish == "yes" or kosu_talk_1_yay_woo_puppy_fish == "y":
      delay_print("'Have you learned anything about the Dronae?' You peer at him in curiosity.")
      delay_print("He shrugs. 'From what I understand, they're involved in some sort of ceremony.'")
      delay_print("You tilt your head. 'Interesting.'")
      delay_print("'One of my captors said something about being left behind...' He shrugs. 'I wonder why they dissolve when we kill them.'")
      delay_print("You shrug. 'Me too.'")
      time.sleep(1)
      clearConsole()
    if kosu_talk_1_yay_woo_puppy_fish == "no" or kosu_talk_1_yay_woo_puppy_fish == "n":
      delay_print("'Have you learned anything about the Dronae?' Kosu's expression is questioning.")
      delay_print("Will you tell him about the voice?")
      voice_thing_haha = validate_input(["y", "yes", "n", "no"], "You have to say SOMETHING!")
      if voice_thing_haha == "yes" or voice_thing_haha == "y":
        delay_print("'I've been hearing this... voice,' you say cautiously.")
        delay_print("Kosu's brow creases in concern. 'What do you mean?'")
        delay_print("'It said something about how I have to prove myself,' you say with indignance.")
        delay_print("'It said that if we pass the Dronaes' test, we'll be able to escape.'")
        delay_print("Kosu's expression is troubled.'I hope everything's alright.'")
      if voice_thing_haha == "n" or voice_thing_haha == "n":
        delay_print("'No,' you say. 'I haven't learned anything.'")
      time.sleep(1)
      clearConsole()
    delay_print("Suddenly, a low echo runs through the cavern.")
    delay_print(WHITE_ITALIC + "You've made it quite far..." + WHITE_ITALIC)
    delay_print("You stand up, startled. 'We have to go, Kosu!'")
    delay_print(WHITE_ITALIC + "I eagerly await your arrival..." + WHITE_ITALIC)
    delay_print("Kosu nods. 'All right!'")
    delay_print("A glowing turquoise door appears in the center of the room.")
    delay_print("Are you ready to step through it?")
    validate_input(["y", "yes"], "You'd better go...")
    time.sleep(1)
    clearConsole()
  elif dronae_path_1 == "2":
    loading_effect()
    clearConsole()
    delay_print("You stumble through the darkness, trying to feel for a wall.")
    delay_print("Your stomach fills with painful regret as you realize that you should have gone in the other direction.")
    delay_print("You can see nothing around you but endless black, swallowing the air and suffocating you.")
    delay_print("You trudge forward one more step and then trip, heavy with exhaustion.")
    delay_print("A Dronae looms above you. 'I'm not very happy, you know,' it buzzes. 'You dissolved my friends before the Turning Ceremony.'")
    delay_print("'What's going on?' you demand, sitting up and brushing yourself off.")
    delay_print("The Dronae groans. 'Of course I can't tell you that, impertinent child.'")
    delay_print("It looks over you. 'But...' It turns away, looking slightly fearful. 'Maybe I can heal you.'")
    delay_print("It climbs onto your lap, and begins to mutter a few incantations.")
    delay_print("Will you push it off you?")
    push_off_nice_dronae = validate_input(["yes", "y", "no", "n"], "You have to do SOMETHING!")
    if push_off_nice_dronae == "y" or push_off_nice_dronae == "yes":
      delay_print("'Get off me!' You shove it off your lap.")
      delay_print("The Dronae slides backwards, hissing. 'That's not very nice.'")
      delay_print("'I'm not nice to my enemies.' You unstrap your spear and brandish it.")
      loop_battle([Esteri], [Dronae.copy()], "cave", "The Dronae launches itself at your chest!", "dronae", "You see a beam of light fade in and out of view and feel an odd sense of displacement...")
      time.sleep(1)
      clearConsole()
      delay_print("You strap your spear to your back again and march fowards, determined to find Kosu.")
    if push_off_nice_dronae == "n" or push_off_nice_dronae == "no":
      delay_print("The Dronae's paws glow. You suddenly feel replenished.")
      Esteri.setHP(Esteri.MaxHP)
      time.sleep(1)
      clearConsole()
      delay_print("It scampers off your stomach and glares up at you as you sit up slowly, stretching your arms with new vigorousness.") 
      delay_print("'The Sentinel is not very nice,' the Dronae admits with trepidation. 'It keeps us safe, but I resent it for controlling us.'")
      delay_print("It turns to stare you in the eye. 'You seem to be a noble child... so I trust you to defeat the Sentinel and bring long-due revenge upon it.'") 
      delay_print("Now it smiles at you, mouth curling up into an eerie shape. 'But first, I would like you to send me to my family. Please prove that you were worthy of my favor!'")
      time.sleep(1)
      clearConsole()
      loop_battle([Esteri], [Dronae.copy()], "cave", "The Dronae launches itself at your chest!", "dronae", "You see a beam of light fade in and out of view and feel an odd sense of displacement...")
      time.sleep(1)
      clearConsole()
      delay_print("You watch as the Dronae's remains fade in the wind, feeling faintly guilty.")
      delay_print("But your trepidation fades as you remember your mission and fill with resolve.")
    delay_print("Before you, mushrooms begin to sprout furiously in luminescent clumps, forming a path.")
    delay_print("Would you like to continue down the path?")
    validate_input(["y", "yes"], "You'd better go!")
    loading_effect()
    clearConsole()
    delay_print("You stumble into another lighted cavern. This one is lined with fluorescent mushrooms like the ones you saw above. The floor is woven with roots.")
    delay_print("'Esteri!' Kosu's voice rings off the walls.")
    delay_print("Your eyes adjust, and you gasp.")
    delay_print("Your friend is ensnared in a tangle of vines, wrapping around him in an intricate pattern and constricting quickly.")
    delay_print("Yet again, a Dronae stands guard in front of the structure.")
    time.sleep(1)
    clearConsole()
    loop_battle([Esteri], [Dronae.copy()], "cave", "This one doesn't even make a noise before it launches itself at you.", "dronae", "You see a beam of light fade in and out of view and feel an odd sense of displacement...")
    delay_print("When the Dronae fades this time, the vines disappear. Kosu drops to the ground with a light thud.")
    delay_print("You rush over to him.")
    delay_print("What will you say?")
    delay_print(" 1. Are you okay?")
    delay_print(" 2. Let's go!")
    validate_input(["1", "2"], "Kosu looks up at you impatiently.").lower()
    delay_print("Kosu gets up slowly and dusts himself off. 'Yeah,' he says, forcing a smile. 'Let's go!'")
    delay_print("Without waiting for further comment, you grab his wrist and pull him towards the exit to the cavern.")
    delay_print("But you are stopped by another pair of Dronae, which jump in front of you, buzzing with impertinent fury.")
    time.sleep(1)
    clearConsole()
    loop_battle([Esteri, Kosu], [Dronae.copy(), Dronae.copy()], "cave", "They swipe a claw at your face in synchrony!", "dronae", "You see a beam of light fade in and out of view and feel an odd sense of displacement...")
    delay_print("When the Dronae fall, a voice echoes through the cavern.")
    time.sleep(1)
    clearConsole()
    delay_print(WHITE_ITALIC + "Esteri..." + WHITE_ITALIC)
    delay_print(WHITE + "You turn pale. Kosu grabs your arm. 'What's wrong?'" + WHITE)
    delay_print(WHITE_ITALIC + "You have not yet won..." + WHITE_ITALIC)
    delay_print(WHITE + "You begin to furiously walk towards the exit. Kosu follows you." + WHITE)
    delay_print(WHITE_ITALIC + "I look forward to seeing you..." + WHITE_ITALIC)
    delay_print(WHITE + "You freeze." + WHITE)
    delay_print("The voice fades away with a low whine.")
    delay_print("You feel a light breeze rushing over you, and suddenly feel re-energized.")
    Esteri.setHP(Esteri.MaxHP)
    time.sleep(1)
    clearConsole()
    delay_print("Now Kosu grabs your arm and begins to tug you along.")
    delay_print("'I don't know what's wrong, but we don't have time to worry about it,' he whispers, then winces. You notice that he's limping.")
    delay_print("You wrap your arm around Kosu's shoulders to help support him, and the two of you slowly stumble to the door.")
    delay_print("Are you ready to exit?")
    validate_input(["y", "yes"], "You'd better go...")
    time.sleep(1)
    clearConsole()
  loading_effect()
  delay_print("You step into a dark cavern, akin to the first one.")
  delay_print("The ceiling twinkles like the night sky, spangled with stars.")
  delay_print("Kosu gasps in awe. 'It's beautiful!'")
  time.sleep(1)
  delay_print("A thundering footstep rings through the space.")
  delay_print("Beside you, Kosu flinches.")
  delay_print(WHITE_ITALIC + "Now..." + WHITE_ITALIC)
  delay_print(WHITE + "You ready your spear. Beside you, Kosu tenses." + WHITE)
  delay_print(WHITE_ITALIC + "...the ceremony will begin!" + WHITE_ITALIC)
  time.sleep(1)
  clearConsole()
  loop_battle([Esteri, Kosu], [Sentinel.copy()], "cave", "A massive claw swings out at your face!", "sentinel", "You see a beam of light fade in and out of view and feel an odd sense of displacement...")
  time.sleep(1)
  clearConsole()
  delay_print("The Sentinel falls, crashing down onto the ground forcefully and then dissolving with a final groan.")
  delay_print("A door appears in front of you. Will you enter?")
  validate_input(["y", "yes"], "You'd better go in!").lower()
  delay_print("--Missing text section: You and Kosu encounter the people and help them back to the village.--")
  time.sleep(1)

  # Update quest_completion
  data["data"]["village1"]["quest_completion"] = True
  cu.currentUser.updateAndPersist(data);

  # Return to village
  village_1()
コード例 #6
0
def village_1():
  data = currentUser.getUserData()
  square_visits = data["data"]["village1"]["square_visits"]
  balliya_coat = data["data"]["village1"]["balliya_coat"]
  quest_completion = data["data"]["village1"]["quest_completion"]

  clearConsole()
  delay_print("Please select which location you would like to visit.")
  num_options = 9
  delay_print(" 1. Noble House")
  delay_print(" 2. Carpenter's House")
  delay_print(" 3. Cobbler's House")
  delay_print(" 4. Tailor's House")
  delay_print(" 5. Old Lady's House")
  delay_print(" 6. Apothecary")
  delay_print(" 7. Church")
  delay_print(" 8. Town Square")
  delay_print(" 9. Dark Forest")
  if quest_completion == True:
    delay_print(" 10. Bright Forest Path")
    num_options += 1
  snowball = validate_int_input(
    range(1, num_options+1), "Invalid input",
    "Type the number of your destination here: ")  #Limited to 1 through num_options
  if snowball == 1:
    print(DARK_RED + "NOBLE HOUSE" + DARK_RED)
    time.sleep(0.25)
    if quest_completion == False:
      delay_print(WHITE + "The door is locked!" + WHITE)
      time.sleep(1)
      clearConsole()
      village_1()
    if quest_completion == True:
      delay_print(WHITE + "The knocker thumps hollowly against the door." + WHITE)
      delay_print("You hear frantic footsteps scuttling in your direction.")
      delay_print("The door creaks open, revealing a stout old butler in a tuxedo.")
      delay_print(
        "'Stay out of this house!' he whines. 'The master is not expecting visitors!'" +
        WHITE)
      delay_print("You were shoved out of the house!")
      time.sleep(1)
      clearConsole()
      village_1()
  elif snowball == 2:
    def carpenterhouse():
      data = cu.currentUser.getUserData()
      minu_visits = data["data"]["village1"]["minu_visits"]
      stole_something = data["data"]["village1"]["stole_something"]
      minu_mad = data["data"]["village1"]["minu_mad"]

      if stole_something == True:
        delay_print("You can't enter! They might find out that you stole Minu's amulet!")
        time.sleep(1)
        clearConsole()
        village_1()
      else:
        if quest_completion == False:
          clearConsole()
          print(DARK_RED + "CARPENTER'S HOUSE" + DARK_RED)
          time.sleep(0.25)
          delay_print("The door is locked!")
          time.sleep(1)
          clearConsole()
          village_1()
        elif quest_completion == True:
          clearConsole()
          print(DARK_RED + "CARPENTER'S HOUSE" + DARK_RED)
          time.sleep(0.25)
          delay_print(WHITE + "Who would you like to talk to?" + WHITE)
          delay_print(" 1. Carpenter")
          delay_print(" 2. Carpenter's Wife")
          delay_print(" 3. Carpenter's Daughter")
          delay_print(" 4. Exit House")
          carpenter_family = validate_input(["1", "2", "3", "4"], "Invalid input")
          clearConsole()
          if carpenter_family == "1":
            delay_print("The carpenter glances up at you with a bit of confusion. His eyes crinkle kindly when he recognizes you.")
            delay_print("'Hello, hero!' he says, standing frantically and bowing. 'I greatly appreciate your help. Thank you for saving my wife, my daughter, and I!'")
            delay_print("He looks down at his daughter for a second, expression soft and proud. 'I would never forgive myself if I let her be hurt.'")
            time.sleep(0.25)
            delay_print("You're hit by a pang of jealousy.")
            time.sleep(0.25)
            delay_print("He looks back at you, slightly disoriented. 'Where was I? Ah, yes. We're eating breakfast right now. All we have is rice, but it may be able to help you replenish your energy. Would you like to eat some?'")
            carpenter_breakfast = yes_no(False, "Invalid input").lower()
            if carpenter_breakfast == "yes" or carpenter_breakfast == "y":
              delay_print(
                "'Wonderful!' He grins and proffers a bowl of steaming-hot rice.")
              delay_print(
                "You munch on the food you were offered. It's delicious!")
              Esteri.setHP(Esteri.MaxHP)
              time.sleep(1)
              carpenterhouse()
            if carpenter_breakfast == "no" or carpenter_breakfast == "n":
              delay_print(
                "'That's all right,' the carpenter says, slightly disappointed. 'Don't forget to come back another time!'")
              time.sleep(1)
              clearConsole()
              village_1()
          elif carpenter_family == "2":
              delay_print("The carpenter's wife gnaws on rice. She seems distracted.")
              delay_print("'Mmmmm... such good rice...'")
              time.sleep(1)
              carpenterhouse()
          elif carpenter_family == "3":
            if minu_mad == False:
              if minu_visits == 0:
                delay_print("The carpenter's daughter looks downcast. She picks at her rice.")
                delay_print("She glances up at you.")
                delay_print("'Oh, you're the village hero!' she says, recognizing you immediately.")
                delay_print("She kneads her hands. 'What's your name?'")
                delay_print("Will you introduce yourself?")
                carpenter_daughter_response = validate_input(["yes", "y", "no", "n"],"Invalid input").lower()
                if carpenter_daughter_response == "yes" or carpenter_daughter_response == "y":
                  delay_print("'I'm Esteri,' you say, proud.")
                  delay_print("'Nice to meet you, Esteri!'")
                  delay_print("The girl bows slightly. 'My name is Minu.'")
                  delay_print("Her expression becomes one of trepidation. 'Can I trust you with a secret?'")
                  carpenter_daughter_secret = validate_input(["yes", "y", "no", "n"], "Invalid input").lower()
                  if carpenter_daughter_secret == "yes" or carpenter_daughter_response == "y":
                    delay_print("'Sure.' You lean forwards, curious.")
                    delay_print("She furtively flicks her gaze to her father.")
                    delay_print("'I'm afraid that my dad is disappointed that I'm not a carpenter,' she confesses.")
                    delay_print("She looks sheepish. 'I wish I could be a good carpenter, I really do. But I enjoy taking care of animals more.'")
                    delay_print("She looks down at her lap. 'Do you think he's mad at me?'")
                    carpenter_daughter_disappointed = validate_input(["yes", "y", "no", "n"], "Invalid input").lower()
                    if carpenter_daughter_disappointed == "no" or carpenter_daughter_disappointed == "n":
                      delay_print("'I think your dad loves you for who you are,' you say gently.")
                      delay_print("You think of your mother for a second before Minu's voice snaps you out of your thoughts.")
                      delay_print("'Thank you!' Minu's face brightens. 'That makes me feel a lot more confident.'")
                      delay_print("She looks down for a second.")
                      delay_print("'It's hard to find people to talk to here...' she murmurs.")
                      time.sleep(0.5)
                      delay_print("The moment of silence passes, and Minu smiles awkwardly.")
                      time.sleep(0.5)
                      delay_print("She holds out her palm. In it is a small purple stone, pusling with blue light.")
                      delay_print("She grins. 'I'd like you to have this as thanks.'")
                      delay_print("You take the amulet and slip it into your bag. 'Thank you! I'm glad I could help.'")
                      add_item("Minu's Amulet", "An amulet containing a mysterious healing power.")
                      minu_visits += 1
                      data["data"]["village1"]["minu_visits"] = minu_visits
                      cu.currentUser.updateAndPersist(data);
                      time.sleep(1)
                      clearConsole()
                      carpenterhouse()
                    if carpenter_daughter_disappointed == "no" or carpenter_daughter_disappointed == "n":
                      delay_print("'Oh...' Minu looks concerned. 'I suppose you're right. Thank you for your time, Esteri.'")
                      delay_print("She turns away, looking disheartened. You feel momentarily bad.")
                      delay_print("Then you notice a stone next to her plate, bright red and pulsing with fiery orange streaks.")
                      delay_print("Do you take it? You're torn: it could help you on your quest, but stealing is wrong.")
                      take_minus_amulet = validate_input(["yes", "y", "n", "no"], "Invalid input").lower()
                      if take_minus_amulet == "yes" or take_minus_amulet == "y":
                        delay_print("You sneak the stone into your bag. No one notices.")
                        add_item("Minu's Amulet", "An amulet containing the power to harm others.")
                        delay_print("You decide to sneak out of the carpenter's house before anyone can catch you.")
                        stole_something = True
                        minu_visits += 1
                        data["data"]["village1"]["stole_something"] = stole_something
                        data["data"]["village1"]["minu_visits"] = minu_visits
                        cu.currentUser.updateAndPersist(data);

                        time.sleep(1)
                        clearConsole()
                        village_1()
                      if take_minus_amulet == "no" or take_minus_amulet == "n":
                        delay_print("You rescind your hand and smile stiffly.")
                        minu_visits += 1
                        data["data"]["village1"]["minu_visits"] = minu_visits
                        cu.currentUser.updateAndPersist(data);

                        time.sleep(1)
                        clearConsole()
                        carpenterhouse()
                  if carpenter_daughter_secret == "no" or carpenter_daughter_secret == "n":
                    delay_print("Minu smiles softly. 'That's all right. Maybe you can come back another time to hear my secret!'")
                    time.sleep(1)
                    clearConsole()
                    carpenterhouse()
                if carpenter_daughter_response == "2":
                  delay_print("'Oh. Sorry for mistaking you for the wrong person!' She looks uncomfortable.")
                  time.sleep(1)
                  clearConsole()
                  carpenterhouse()
              else:
                delay_print("'This rice is delicious!'")
            elif minu_mad == True: 
              delay_print("You shouldn't go over to her! She's angry!")
              time.sleep(1)
              clearConsole()
              carpenterhouse()
          else:  #carpenter_family == 4
              time.sleep(0.5)
              clearConsole()
              village_1()
    carpenterhouse()
  elif snowball == 3:
    #Cobbler's House
    VillageStore.getItems()
  elif snowball == 4:
    if quest_completion == False:
      clearConsole()
      print(DARK_RED + "TAILOR'S HOUSE" + DARK_RED)
      time.sleep(0.25)
      delay_print("The door is locked!")
      time.sleep(1)
      clearConsole()
      village_1()
    elif quest_completion == True:
      clearConsole()
      otis("TAILOR'S HOUSE")
      time.sleep(0.25)
      delay_print(WHITE + "You fiddle with the doorknob and the door squeaks open, scuffing the dirt floor." + WHITE)
      delay_print("The inside of the house is filthy. Do you still want to go in?")
      enter_tailors_house = validate_input(["yes", "y", "no", "n"], "Invalid input").lower()
      if enter_tailors_house == "yes" or enter_tailors_house == "y":
        delay_print("You glance around. The room is full of raucous, partying men, heavily drunk.")
        delay_print("On second thought, you shouldn't go in. You head back outside.")
      if enter_tailors_house == "no" or enter_tailors_house == "n":
        delay_print("You decide not to enter.")
        time.sleep(1)
        clearConsole()
        village_1()
  elif snowball == 5:
    if quest_completion == False:
      clearConsole()
      print(DARK_RED + "KURIGALU'S HOUSE" + DARK_RED)
      time.sleep(0.25)
      delay_print("The door is locked!")
      time.sleep(1)
      clearConsole()
      village_1()
    elif quest_completion == True:
      clearConsole()
      print(DARK_RED + "KURIGALU'S HOUSE" + DARK_RED)
      time.sleep(0.25)
      delay_print("You nudge the door open to reveal a cozy room.")
      delay_print("The floors, made of wood coated in faded stain, are soft and splintered after decades of wear.")
      delay_print("The room is in a peculiar octagonal shape, contrary to the rectangular design of many of the other cottages.")
      delay_print("In the center, by a smoldering chimney, an old lady sits in a hard wooden chair.")
      time.sleep(1)
      clearConsole()
      delay_print("She looks up at you, eyes crinkling in a smile. 'Hello, ahalan. I am Kurigalu, the matriarch of the village. What brings you here?'")
      delay_print("Will you ask her about the Dronae?")
      esteri_talk_to_kurigalu_1 = validate_input(["y", "yes", "n", "no"], "Kurigalu waits patiently for an answer.").lower()
      time.sleep(1)
      clearConsole()
      if esteri_talk_to_kurigalu_1 == "y" or esteri_talk_to_kurigalu_1 == "y":
        time.sleep(1)
        clearConsole()
        delay_print("'What were those monsters?' you demand.")
        delay_print("Kurigalu tilts her head, and her eyes sparkle with disappointment. She stirs her tea. 'I won't answer such a disrespectful question, ahalan.'")
        delay_print("'Stop calling me-' Kosu pinches you. 'Ouch!'")
        delay_print("He steps up next to you. 'What my friend means to say,' he says, tense, 'is that we were wondering if you knew what the Dronae were, ma'am.")
        delay_print("Kurigalu turns to look at him. 'Ah, child,' she says, 'you are far more respectful. Your friend has quite a lot to learn from you.'")
        delay_print("You struggle to restrain your anger, growling.")
        delay_print("She smiles again. 'As for the Dronae... I believe that their Turning Ceremony is a sort of celebration.'")
        delay_print("She takes a long, slow sip of tea. You glower.")
        delay_print("'As I was saying,' she says, 'the Turning Ceremony is the time of year at which the Dronae lair is transported to a new location.'")
        delay_print("'Why did they kidnap the village people?' Kosu speaks up before you can.")
        delay_print("'I believe that they use human sacrifices to power the rotation of their home,' Kurigalu explains. 'Now they will have to find a new power source.'")
        time.sleep(1)
        clearConsole()
        delay_print("She turns back to you. 'Do you have anything to say, ahalan?'")
        delay_print("Would you like to tell Kurigalu about your search for your mother?")
        tell_kurigalu_about_search = validate_input(["yes", "y", "no", "n"])
        if tell_kurigalu_about_search == "yes" or tell_kurigalu_about_search == "y":
          delay_print("'I'm looking for my mother,' you admit. 'I'm sorry for being bothersome earlier.'")
      if esteri_talk_to_kurigalu_1 == "2":
        delay_print("'Ah, yes,' Kurigalu says, nodding her head in affirmation. 'You're Amaliyah's daughter, correct?'")
        validate_input(["y", "yes"], "Don't lie!").lower()
      delay_print("Kurigalu inclines her head. 'I heard that Amaliyah died years ago.'")
      delay_print("What will you say?")
      delay_print(" 1. We're not sure. I'm hoping to find her.")
      delay_print(" 2. I don't think she died. That's why I'm looking for her.")
      esteri_talk_to_kurigalu_2 = validate_input(["1", "2"], "Kurigalu waits patiently for an answer.").lower()
      delay_print("Kurigalu inclines her head. 'Mmm.'")
      delay_print("Will you give Kurigalu the letter?")
      esteri_talk_to_kurigalu_3 = validate_input(["y", "yes"], "You'd better give the letter to her!").lower()
      time.sleep(1)
      clearConsole()
      delay_print("Kurigalu pores over the letter. 'Interesting...' she mumbles.")
      delay_print("She looks up after a few seconds of incoherent mumbling. 'Aviveki sent you?'")
      delay_print("No longer able to contain himself, Kosu nods. 'Yes.'")
      delay_print("Kurigalu frowns. 'Aviveki and I are not on the best of terms.'")
      delay_print("You wonder what she's talking about.")
      delay_print("Behind you, Kosu shifts nervously on his feet. 'We don't necessarily like her much either,' he lies, lacking conviction.")
      delay_print("'But we don't have much of a choice. We'd like to find Chief Amaliyah and restore her to her position.'")
      time.sleep(1)
      clearConsole()
      delay_print("Kurigalu folds the letter into a small square and drops it into the fire.")
      delay_print("She gives you a long, hard look, and sighs with exhaustion.")
      delay_print("'I'm an old lady,' she tells you. 'I no longer have as much energy as I did years ago. I can't offer you much help myself.'")
      delay_print("'On the other hand,' she continues, 'Amaliyah was one of my best students...'")
      delay_print("She meets your eyes. 'And you seem to take after your mother.'")
      time.sleep(1)
      clearConsole()
      delay_print("She pulls out a piece of aged charcoal and a sheet of pulpy wood paper.")
      delay_print("After spending a few seconds scribbling frantically in Oi'nan, she folds the letter and hands it to you.")
      delay_print("'Here,' she tells you. 'Take this letter to Nagara and find a man named Hukosu. He may be able to help you.'")
      delay_print("You nod.")
      delay_print("Kosu clears his throat. 'Do we have to go to Nagara?'")
      delay_print("He sounds uncharacteristically scared.")
      delay_print("Kurigalu looks up at him, expressio suddenly sharp. 'Yes,' she says slowly. 'You must go to Nagara.'")
      clearConsole()
  elif snowball == 6:
    if quest_completion == False:
      clearConsole()
      print(DARK_RED + "APOTHECARY" + DARK_RED)
      time.sleep(0.25)
      delay_print("The door is locked!")
      time.sleep(1)
      clearConsole()
      village_1()
    elif quest_completion == True:
      clearConsole()
      print(DARK_RED + "APOTHECARY" + DARK_RED)
      time.sleep(0.25)
      delay_print("This location is not finished. Make sure to come back when apothecaries are finished with development.")
  elif snowball == 7:
    delay_print("You push on the door and it squeaks open.")
    delay_print("The inside is dark.")
    delay_print("You swallow, beginning to regret leaving Kosu outside.")
    delay_print("There's a staircase leading downwards to your right. Will you go down it, or will you exit?")
    continue_down_stairs = validate_input(["y", "n", "yes", "no"], "That's not a valid answer.")
    if continue_down_stairs == "y" or continue_down_stairs == "yes":
      loop_battle([Esteri], [Kirin.copy()], "church", "As soon as you step onto the first step, something springs out at you!", "kirin", "You've been shoved outside!")
    if continue_down_stairs == "n" or continue_down_stairs == "no":
      delay_print("You step backwards slowly. An odd howl rises from the stairs.")
      delay_print("You bolt out the door, terrified!")
    time.sleep(1)
    clearConsole()
  elif snowball == 8:
    if quest_completion == False:
      clearConsole()
      print(DARK_RED + "TOWN SQUARE" + DARK_RED)
      time.sleep(0.25)
      delay_print("The area seems barren...")
      time.sleep(1)
      clearConsole()
      village_1()
    elif quest_completion == True:
      clearConsole()
      print(DARK_RED + "TOWN SQUARE" + DARK_RED)
      time.sleep(0.25)
      if square_visits == 0:
        delay_print(WHITE + "The town square is a bustling place, even in overcast weather. Then again, today is market day.")
        delay_print(WHITE + "Still, it feels vaguely like a holiday. The square is decorated with banners, and everyone seems cheerful.")
        delay_print(WHITE + "You turn to Kosu and ask, \"Is today a holiday?\"")
        delay_print(WHITE + "Kosu shrugs. \"I\'m not sure. They taught us more about where things are than what people do.\"")
        delay_print(WHITE + "Still curious, you ask someone selling scarves, \"Excuse me, is today a holiday?\"")
        delay_print(WHITE + "He smiles. \"Not before,\" he says, \"but who knows about the future?\" He winks at you before returning to his hawking.")
      elif square_visits == 1:
        delay_print(WHITE + "Kosu says, \"I'm going to ask the locals about the surrounding area.\"")
        delay_print(WHITE + "You tell him, \"Okay, don't get into trouble.\"")
        delay_print(WHITE + "Kosu nods. \"Of course! I'll stay in the town square.\"")
        delay_print()
        delay_print(WHITE + "You look around slightly uncertainly.")
        delay_print(WHITE + "\"Hello!\"")
        delay_print(WHITE + "You turn towards the voice. It's the scarf seller from earlier!")
        delay_print(WHITE + "\"Excuse me, but where're you from? Your coat looks a little different,\" he asks.")
        delay_print(WHITE + "Slightly surprised, you answer, \"From the mountains.\"")
        delay_print(WHITE + "\"Hm. It looks a bit thick.\"")
        delay_print(WHITE + "You shurg. \"It's very comfortable.\"")
        delay_print(WHITE + "He nods. \" I can see that. But let me know if you want a thinner coat. My name's Balliya, by the way.\"")
        get_coat = yes_no(False, "Please choose again.", "Do you accept Balliya's offer? ")
        balliya_coat = (get_coat == "Y") or (get_coat == "YES")
        data["data"]["village1"]["balliya_coat"] = balliya_coat
        cu.currentUser.updateAndPersist(data);

        delay_print(WHITE + "\"Okay, then. See you later!\"")
      elif square_visits == 2:
        delay_print(WHITE + "\"Hi, Esteri!\"")
        delay_print(WHITE + "You wave back. \"Hello... Balliya, right?\"")
        if balliya_coat:
          delay_print(WHITE + "He nods. \"Here's the coat my wife made for you. Hope you like it!\"")
          add_item("Coat from Balliya", "A lighter coat Balliya's wife made for you.")

      if square_visits <= 3: #3 is placeholder max number of unique events
        square_visits += 1
  elif snowball == 9:
    village_1_dark_forest_quest_thing()
  elif snowball == 10:
    if quest_completion == False:
      delay_print("Sorry, but you can't access this area yet. Please try again.")
      village_1()
    else:
      pass
コード例 #7
0
def adventureBeg():
    delay_print("""
    You pull your hair back into a ponytail and stare at yourself in the mirror for a moment. "Hmm..." You release it, dissatisfied, and it falls down your back. You're about to pin it up into a bun when a servant approaches, carrying a small bowl and a missive.
    "Lady Esteri, this missive is from Regent Aviveki. She requests your presence."
    You do a double take. "Regent Aviveki?"
    The servant nods. "She would like to see you before your ascendence ceremony."
    You grimace inwardly. "Fine," you say, grabbing the parchment and stuffing it in your pocket. The servant walks away as you glance at yourself in the mirror one more time, straightening your tunic and tightening your breastplate. When you're satisfied, you jog to the exit of your chamber, pushing down any final fears as you open the door and step outside.
  """,
                end="",
                indent=4)
    loading_effect()
    clearConsole()
    delay_print("""
    You dash through the streets, veering wildly around the houses, your spear clanking rhythmically on your back. Smoke floats leisurely out of the chimneys, and all around you can hear the sound of the village waking up as the sun begins to rise over the peaks of the snow-capped mountains.
    
    Your eyes land on a pair of stately doors with ornate staffs carved deep into the wood. The regent's residence.
  	""",
                indent=4)

    option = yes_no(False, "Do you want to go inside?")
    if (option != "YES") and (option != "Y"):
        delay_print("The Regent is waiting for you...")
        option = yes_no(False, "You must decide.", "Do you want to go in?")

    delay_print("""
    You walk towards the door and are stopped by two guards.
    "Excuse me, miss. You're not allowed here without permission."
    "Don't you know who I am?" You raise an eyebrow with some impatience. You aren't eager to display patience on your ascendence day. They owe you respect.
    The guards look at each other, blank-faced, before one of them blinks and winces. "Oh dear- Apologies, Lady Esteri. Please come inside. Regent Aviveki has been waiting for you." The guards bow and step aside.
  """,
                indent=4)
    loading_effect()
    delay_print("""
    You enter a warm, brightly lit room with ancient scripts pierced onto paintings on the walls. In the middle of the room sits a middle-aged woman draped with beaded necklaces and a thick woolen coat.
    "Please, sit down. We have much to discuss." Village Regent Aviveki meets your eyes with a solemn expression.
    Will you sit?""",
                indent=4)

    sit_with_regent_aviveki = validate_input(["yes", "y", "n", "no"],
                                             "You had better decide!").lower()
    if sit_with_regent_aviveki == "yes" or sit_with_regent_aviveki == "y":
        delay_print(
            "You quickly take a seat and listen. You want to get the situation over with as quickly as possible so you can prepare for your ascendance."
        )
    elif sit_with_regent_aviveki == "no" or sit_with_regent_aviveki == "n":
        delay_print(""" 
      "I don't want to sit down," you say, crossing your arms. 
      Aviveki frowns. "I do not believe I asked a question," she says, voice taking on an edge. "Sit down, please."
      You sit. 
    """,
                    indent=6)
    time.sleep(1)
    delay_print("""  
    Aviveki folds her hands and meets your eyes. "We have reason to believe that your mother, Chieftess Amaliyah, may in fact be alive."
    Your heart rate speeds up. Years ago, when you were young, your mother was sent on a quest to find new land for the people of Elyria. A few years into her quest, she disappeared and never returned. The village leaders seemed convinced that she was dead- Aviveki had been in power for ten years- but you didn't agree. 
    "As her descendant, the day has come for you to finally take on the responsibility of searching for her." Aviveki's mouth turns down a little as she says this, slightly derisive. 
    Silently, you pump your fist under the table, full of confidence. Finding your mother had been your goal for years. You lean forwards a little in anticipation.
    "As the true future Chieftess of Elyria, and my successor, you must embark on this quest to find your mother and complete her mission. Can we trust you to complete this task with honor?" Aviveki's expression is borderline disinterested.
  """,
                indent=4)

    option = yes_no(
        allow_maybe=True,
        errMessage=
        "Please give the regent a clear answer- this is an important matter.")
    if (option == 'MAYBE' or option == 'POSSIBLY'):
        delay_print(
            "\"Maybe? That is no way to answer a question from your regent!\"")
        option = yes_no(False, "You need to decide now.")

    if (option == 'NO' or option == 'N'):
        delay_print(
            "\"Then maybe I have overestimated your abilities. If you do wish to change your mind, please come back later. Elyria is counting on you.\""
        )
        option = yes_no(
            False,
            "You have one last chance to change your mind. Decide quickly.")
        if (option == 'NO' or option == 'N'):
            delay_print(
                "The pressure is way too much right now. And you're only seventeen! Maybe you could try again later when you're more prepared."
            )
            credits()
            sys.exit()

    delay_print("""
    "Wonderful." The regent tries to smile, mouth stretching upwards into a sort of grimace. "I knew that our people could count on you, Esteri."
    "Of course." You beam internally with pride. 
    "You'll require a naviagator for your journey, so I've select one of our skilled navigators-in-training to assist you."
    Aviveki frowns. "But he appears to be a bit late..."
  """,
                indent=4)
    delay_print()
    time.sleep(2)
    clearConsole()
    delay_print("""
    The door bursts open and a young man with an unruly mop of brown hair bursts in.
    The new arrival wipes sweat off of his brow, glancing up at the village head with a sheepish expression.
    The village head glares down at him in indignation. "You're late."
    Your eyes widen as you recognize the boy.
    Will you greet him?
  """,
                indent=4)
    kosu_is_here_yay = validate_input(
        ["yes", "no", "y", "n"],
        "You have to decide fast! It's getting awkward!").lower()
    if kosu_is_here_yay == "yes" or kosu_is_here_yay == "y":
        delay_print("""
      "Kosu!" You jump out of your chair, grinning, and hug your best friend. "How are you? How did your trip to the Southern Villages go?"
      "Hey, Esi!" Kosu grins. "It's been a few months, hasn't it? Nice to see you! I'm doing great. The trip went well. I assume you are too, seeing as you're finally going-"
    """,
                    indent=4)
    if kosu_is_here_yay == "no" or kosu_is_here_yay == "n":
        delay_print("""
      You force yourself to study the table, unwilling to jeopardize your chance to search for your mother by tarnishing Aviveki's trust. 
      The boy, unwilling to take a hint, taps your shoulder. "Hey, Esi! How are you? It's been a few months since I last saw you!"
      You make eye contact with Aviveki for a second- she appears disdainful- and look up at Kosu, suddenly guilty for trying to ignore your best friend. "Hi, Kosu!" You stand up and give him a hug. "I'm doing great. How was your trip to the Southern Villages?"
      Kosu smiles. "The trip went great."
      Aviveki clears her throat and you look back at her, remembering her presence. 
      "Thank you, Regent Aviveki!" Kosu says, grinning widely. "Esteri is thrilled to-"
    """,
                    indent=6)
    time.sleep(0.25)
    option = yes_no(
        False, "You need to decide quickly...",
        "Do you interrupt Kosu in order to preserve your dignity? ").lower()

    if option == "y" or option == "yes":
        delay_print("""
      You shoot Kosu a warning glance and he quiets. Then you turn to face the village regent.
      Her expression is haughty. "You're wasting time."
      Do you apologize?
    """,
                    indent=6)

        option = validate_input(["yes", "no", "y", "n"],
                                "Decide quickly!").lower()
        if option == "yes" or option == "y":
            delay_print("""
        "I apologize, Regent Aviveki," you say, and awkwardly curtsy, simmering internally with fury. Kosu bows his head, sheepish.
        "You're forgiven," the village leader says with an air of superiority. "But don't forget your manners in the future."
        You bite your tongue to hold back further remarks.
      """,
                        indent=8)
        elif option == "2":
            delay_print("""
        "Kosu and I deserve to enjoy our reunion," you say, glaring. 
        The village leader sniffs in indignation. "I am a very busy woman. Please enjoy your reunion when you are no longer in my presence."
        You bite your tongue to hold back further remarks.
      """,
                        indent=8)
        delay_print(
            "Kosu speaks up, a twinge of guilt in his voice. 'Is there anything else that we need to know before leaving?'"
        )
    else:
        delay_print("""
      "-get to search for your mom as you've wanted all these years," Kosu finishes.
      Your cheeks flush with embarrassment. "Yes," you mutter, and turn back to face the village leader.
      The village leader smriks pridefully. "What adorable youthful enthusiasm."
      Kosu shrinks back. "Is there anything else we need to know before leaving?" he asks quietly.
    """,
                    indent=6)
    delay_print("""
    The village regent folds her hands. "The path will be dangerous," she warns, and her face softens a little. "You really don't have to complete this journey if you are afraid."
    Kosu shakes his head in indignation. "We aren't quitters," he says, voice spiking with an undertone of determination. "Esteri and I will be fine." He brushes an unruly brown hair off his forehead, still sweating.
    Will you agree with him?
  """,
                indent=4)
    option_whee_yay_cookie_snowballcake = validate_input(
        ["yes", "y", "no", "n"], "Will you agree with Kosu?").lower()
    if option_whee_yay_cookie_snowballcake == "yes" or option_whee_yay_cookie_snowballcake == "y":
        delay_print("""
      "Kosu's right," you say, grinning with confidence. Adrenaline courses through your veins. "We'll be fine."
    """)
    if option_whee_yay_cookie_snowballcake == "no" or option_whee_yay_cookie_snowballcake == "n":
        delay_print("""
      You nod noncommitally. Aviveki already seems to believe that you are naive, and you don't wish to cement her opinion.
      """,
                    indent=6)
    time.sleep(1)
    clearConsole()
    delay_print("""
    Regent Aviveki smiles, eyes still cold. "Wonderful," she says. "I'll instruct you on where to go."
    Taking a map from beside her chair, she rolls it out on the table. "Here-" she points at a wide parcel of land- "is Elyria. This is our home."
    She moves her finger to a small spot on the map near your domain. "Here is a small village known as Ai'ko Le'po. An old friend of your mother's resides here. You will begin by traveling to this village, in the hopes that your mother's friend can offer you advice or assistance."
    She pulls a letter out of her desk and sets it in front of you. "Deliver this letter to an old woman by the name of Kurigalu. She should be willing to help you find your mother. At the very least, she'll find you someone who can aid you on your journey. You will also be given given 100 nagara scrip to begin your journey."
    She tosses a pouch of coins onto the desk.
    The regent stands up, leaving the letter and money on the desk in front of you. She meets your eyes.
    "Your mother was a friend of mine," she murmurs, more to herself than you. "I hope that you can bring her back."
    She turns, and you watch her retreating back, unable to wipe the sight of Regent Aviveki's regretful, resigned expression from your mind.
    Any annoyance you felt towards her during your encounter fades.
    Kosu reaches out and picks up the letter. He hands it to you. "I believe this belongs to you."
    You take the letter and place it in your bag along with the coins.
  """,
                indent=4)
    add_item(
        "Letter for Kurigalu",
        "An important letter from the regent, addressed to Kurigalu of Ai'ko Le'po."
    )
    set_money(100)
    time.sleep(1)
    #tutorial()
    #inventorymenu()
    #settings()
    delay_print("""
    "We should go," you tell Kosu.
    He nods. "If we don't leave within the hour, we won't make it to Ai'ko Le'po before nightfall."
    The two of you walk to the exit, and you rest your hand on the doorknob. Your mind wanders for a second.
  """,
                indent=4)
    time.sleep(1)
    delay_print(
        "You wonder how your mother felt when she was setting out on her journey."
    )
    time.sleep(1)
    clearConsole()
    delay_print(GREY_ITALIC + """
    Mother kneels down, caressing your cheek. "I'll be back soon, Esi," she whispers, smiling at you. The room is warm, despite the crisp air outside. 
    "Are you scared, ka’lan?" You look up at her, cheeks wet with tears. 
    Mother wrings her hands. She stares up at the ceiling, watching the warm light from the lanterns flicker. "Yes," she finally says, a tremor in her voice. "But I will be strong for Elyria." 
    "But you’re never scared of anything." You wipe your eyes furiously, determined to look brave like your mother.
    She stands. "There's nothing wrong with having fears, Esi," she says softly, touching your cheek. "There’s nothing wrong with crying once in a while. But real bravery is when you're scared and push through anyway." She smiles, but her eyes are sad. "Can you promise to be brave for me?" You nod, looking up at her with resolution in your eyes.
    "Goodbye, Mommy," you whisper, wrapping your arms around your mother’s leg. "Come back soon, okay?" 
    She looks down at you as if drinking in your appearance one last time. "I will, Esi. I promise."
    
  """,
                indent=4)
    time.sleep(0.5)
    delay_print("""
    Amaliyah walked to the door, the warm-colored wood reflecting the light in the room. Hand shaking, she placed her hand on the knob... and glanced back one last time, meeting her daughter's eyes and mustering a smile.
  """,
                indent=4)
    time.sleep(0.5)
    clearConsole()
    delay_print("She opened the door." + RESET)
    time.sleep(1)
    clearConsole()
    delay_print("""
    You step out into the blinding sunshine, holding a hand up to shield your eyes.
    Light reflects off the snow surrounding you, casting your village in a slight eerie glow.
    "Ai'ko Le'po is to the southeast," Kosu observes, holding up the map.
    You look at him, somewhat solemn. "You know she was right, Kosu? We could die on this mission." For the first time, your confidence wavers a little.
    Kosu grins at you. "We don't die," he says reassuringly, seeming to sense your fears. "After all, we're the best team in all of Elyria."
    You raise your eyebrows. "Is that so?" You swallow your misgivings and smile. You've been preparing for this journey for your entire life; you're ready.
    The two of you laugh and banter as you amble down the rocky foothill, traveling the same path that your mother had followed so many years earlier.
  """,
                indent=4)
    time.sleep(0.25)
    clearConsole()
    loading_effect()
    time.sleep(0.25)
    delay_print("""
    You slog along, grouchy, with branches snapping under your feet. Fog hangs thickly in the air around you.
    Do you express impatience?
  """,
                indent=4)
    fog_forest_complainer_oof = validate_input(
        ["yes", "y", "no", "n"],
        "You continue to trudge through the forest.").lower()
    if fog_forest_complainer_oof == "yes" or fog_forest_complainer_oof == "y":
        delay_print("""
      "Are we almost there?" you ask Kosu with an expression of consternation. "The woods don't seem to end anytime soon."
      Kosu studies his map. "Yeah," he assures you. "We'll arrive in the village any minute now."
    """,
                    indent=6)
    if fog_forest_complainer_oof == "no" or fog_forest_complainer_oof == "n":
        delay_print("""
      You bite your tongue, deciding to hold back any complaint after you glance at Kosu, who's laser-focused on his map. He stumbles over a root and you grab his arm.
      "Thanks," he says, grinning at you.
    """,
                    indent=6)
    delay_print("""
    Seconds later, the two of you break through the edge of the forest.
    The trees have been cleared unevenly from a patch of roughly packed land, lined with small huts that creak under the weight of the sky.
    "Here we are!" Kosu grins. "Let's go look for Kurigalu."
    The two of you stroll slowly through the town. It's silent: oddly so. 
    "There's no one here."
  """,
                indent=4)
コード例 #8
0
    def begin(
        self
    ):  #If you have better name suggestions, go ahead and change this (and the calls in main.py)
        delay_print(str(self.intro))
        result = validate_input([],
                                "",
                                "Are you ready to start the battle? ",
                                validate=False).lower()
        if result == "shaymin":
            return 3
        #Prompt may be changed
        delay_print("Ready or not, time to begin...")
        clearConsole()

        print(col.PURPLE_BOLD + "~~BATTLE START~~" + col.RESET)

        # Reset self.battleParty and self.enemyTeam
        self.reset()

        retreated = False
        while self.isFinished(retreated) == 0:
            #Reports HPs of enemies
            delay_print("\nEnemies:")
            num = 1
            for enemy in self.enemyTeam:
                delay_print(
                    str(num) + ". " + enemy.Name + ": " + str(enemy.HP) +
                    " HP")
                num += 1

            #Report HPs of party
            num = 1
            delay_print("\nParty:")
            for ally in self.battleParty:
                delay_print(
                    str(num) + ". " + ally.Name + ": " + str(ally.HP) + " HP")
                for effect in ally.Effects:
                    delay_print(", " + str(effect.name))
                num += 1

            #Ally turns
            for ally in self.battleParty:
                try:
                    # Note: Prevents calling self.turn(ally) if retreated is True
                    retreated = retreated or self.turn(ally)
                    clearTimers()
                except TimeOut:
                    print(col.RED_BOLD + "~Sorry, time is up.~" + col.RESET)

            #Enemy turns
            clearTimers()
            if (self.isFinished(retreated) == 0):
                for enemy in self.enemyTeam:
                    delay_print("\n" + enemy.Name + " begins their turn.")
                    enemy.turn(self.battleParty, self.enemyTeam)

        #Remove any running timers
        clearTimers()
        result = self.isFinished(retreated)
        if result == 1:  # Won
            delay_print("You and your team have won!")
        elif result == 2:  # Lost
            delay_print(self.loseMessage)
            loading_effect()
        elif result == 3:  # Retreated
            pass
        return result