Exemple #1
0
def explain_scrolls():

	dialogue("Press the [E] key to use a scroll.")
	dialogue("The Fire Scroll will burn up trees...", [], 'DarkOrange')
	dialogue("The Ice Scroll will freeze water...", [], 'DarkOrange')
	dialogue("And the Thunder Scroll will break rocks.", [], 'DarkOrange')
	dialogue("You can also use them in fights for massive damage.", [], 'DarkOrange')
Exemple #2
0
 def execute(self, player, enemy):
     chance = randint(0, 1)
     player.current_SP -= self.cost
     if chance == 0:
         player.items['Potions'] += 1
         dialogue(self.description, speed=.1, right=True)
     else:
         dialogue("Failed to steal a potion.", speed=.01, right=True)
Exemple #3
0
    def use_potion(self):
        self.items['Potions'] -= 1
        self.current_HP += round(randint(4, 10) * 4.2)

        if self.current_HP > self.base_HP:
            self.current_HP = self.base_HP

        dialogue(f'HP restored to {self.current_HP}/{self.base_HP}.',
                 speed=.01,
                 right=True)
Exemple #4
0
    def run(self, enemy):
        # The escape formula is based on what level the player is versus what level the monster is.
        # The if the player has a higher level than the opponent, they have a higher chance of escape..
        # Conversly, if the monster has a higher level, it'll be harder for the player to run.
        j = self.lvl - enemy.lvl
        if j == 0:
            j = 1

        if (j * 2) + randint(4, 8) > 8:
            dialogue('Escape succeeded!', right=True)

        else:
            dialogue('Escape failed!', right=True)
Exemple #5
0
    def execute(self, player, enemy):
        damage = round(self.scalar * (randint(1, 5) + (player.attack / 2.5)))
        enemy.current_HP -= damage

        dialogue(
            f'{player.name} uses {self.name} on {enemy.name} for {damage} DMG.',
            speed=.01,
            right=True)
        player.current_SP -= self.cost
        if enemy.current_HP < 0:
            enemy.current_HP = 0

        dialogue(f"{enemy.name}'s HP dropped to {enemy.current_HP} ",
                 speed=.01,
                 right=True)
Exemple #6
0
def town():

	prior = len(glbl.gw.items)


	gold_box = Gold_Box(glbl.player.gold)

	background = Image(Point(750, 250), glbl.MAPS / "sprites" / "village.png")
	background.draw(glbl.gw)

	#musicplays here
	#pygame.mixer.music.stop()
	
	if glbl.game_stats["town_tutorial"]:
		glbl.game_stats["town_tutorial"] = False
		town_tutorial()

	while True:
		pygame.mixer.music.stop()
		town_music = pygame.mixer.music.load("Town_Music.mp3")
		pygame.mixer.music.play(-1)
		if glbl.game_stats['orc_dead'] == "Dead":
			for i in glbl.gw.items[prior:]: i.undraw()
			return

		x = dialogue("Where would you like to go?", [
			"Inn", 
			"Wizard" if glbl.player.character_class == "Sorcerer" else "Blacksmith",
			"Shop",
			"Librarian",
			"Explore Forest"], right=True)

		if x == 0:
			pygame.mixer.music.stop()
			town_music = pygame.mixer.music.load("inn.mp3")
			pygame.mixer.music.play(-1)
			inn(gold_box)

		if x == 1:
			pygame.mixer.music.stop()
			shop_music = pygame.mixer.music.load("shop.mp3")
			pygame.mixer.music.play(-1)
			weapon_maker(gold_box)

		if x == 2:
			shop(gold_box)

		if x == 3:
			pygame.mixer.music.stop()
			librarian(gold_box)
		
		if x == 4:
			pygame.mixer.music.stop()
			town_music = pygame.mixer.music.load("Overworld_Music.mp3")
			pygame.mixer.music.play(-1)
			prep_exploration()
			if glbl.game_stats['reginald'] == 6:
				glbl.game_stats['reginald'] = 7
			if glbl.game_stats['reginald'] == 7:
				raise glbl.GameOver('Rat Invasion')
Exemple #7
0
def prep_exploration():
	i = 0
	while True:
		try:
			i += 1
			x = Path(glbl.MAPS / f"level_{i}.txt").read_text().split("\n")
			

			background = PIL_Image.open(glbl.MAPS / f"level_{i}.png")
			flower = PIL_Image.open(glbl.MAPS / "sprites" / "harvest1.png")

			for j in range(50, len(x) - 1):
				line = list(x[j])

				for k in range(len(line)):

					if line[k] in ["B", "C", "D", "E"]:
						if randint(0, 2) == 0:
							line[k] = chr(ord(x[j][k]) - 1)
							if line[k] == "A":
								background.paste(flower, (k * 48, j * 48))

				x[j] = "".join(line)

			overworld_objects = x[-1].split()
			for i in range(len(1, overworld_objects), 2):
				if int(i) > 0:
					overworld_objects[i] = str(int(i) - 1)
			
			background.save(glbl.MAPS / f"level_{i}.png")

			file = open(glbl.MAPS / f"level_{i}.txt", "w")
			file.write("\n".join(x))
			file.close()
		except:
			break
	
	choices = []
	if (glbl.MAPS / "level_15.txt").exists():
		choices.append("Go to Floor 15")
	if (glbl.MAPS / "level_11.txt").exists():
		choices.append("Go to Floor 11")
	if (glbl.MAPS / "level_6.txt").exists():
		choices.append("Go to Floor 6")
		choices.append("Go to Floor 1")

	if choices:
		x = dialogue("Where would you like to go?", choices, return_arg=True, right=True)
		if x.count("15") > 0:
			exploring(15)
		elif x.count("11") > 0:
			exploring(11)
		elif x.count("6") > 0:
			exploring(6)
		else:
			exploring(1)
		
	else: exploring(1)
Exemple #8
0
def load_game():

    file = open("save_state.txt", 'r')
    content = file.readline()
    file.close()

    decoded_contents = b64decode(
        content.encode("UTF-8")).decode("UTF-8").split('\n')
    for i in range(2, 12):
        decoded_contents[i] = int(decoded_contents[i])

    character_class = decoded_contents[0]
    character_stats = decoded_contents[1:12]
    character_stats.append(literal_eval(decoded_contents[12]))
    glbl.game_stats = literal_eval(decoded_contents[13])

    if character_class == 'Warrior':
        glbl.player = Warrior(*character_stats)
    elif character_class == 'Sorcerer':
        glbl.player = Sorcerer(*character_stats)
    elif character_class == 'Rogue':
        glbl.player = Rogue(*character_stats)
    else:
        dialogue('Wuh oh, looks like your save file got corrupted.')
Exemple #9
0
    def take_turn(self, other):
        if self.attack >= other.defense:
            # get a random damage amount
            damage = self.get_damage()
            dialogue(f'{self.name} did {damage} DMG.', right=True)
            other.current_HP -= damage
            if other.current_HP < 0:
                other.current_HP = 0
            dialogue(f"{other.name}'s HP dropped to {other.current_HP}.",
                     right=True)

        # Otherwise, the attack missed.
        else:
            dialogue(f"{self.name}'s attack missed!", right=True)
Exemple #10
0
    def battleInput(self):

        while True:

            x = dialogue('What will you do?', [
                'Attack', f'Special ({self.current_SP}/{self.base_SP})',
                f'Potion ({self.items["Potions"]})', 'Run'
            ],
                         speed=.01,
                         return_arg=True,
                         right=True)

            # get which special ability
            if x.count('Special') > 0:

                options = []

                for a in self.abilities:
                    options.append(f'{a.name} ({a.cost}SP)')
                options.append('Cancel')

                while True:
                    x = dialogue(
                        f'Current SP:  ({self.current_SP}/{self.base_SP})\n',
                        options,
                        speed=.01,
                        right=True)

                    if x != 3 and self.current_SP < self.abilities[x].cost:
                        dialogue("You don't have enough SP for that.",
                                 speed=.01,
                                 right=True)

                    elif x == 3:
                        break
                    else:
                        return str(x)

            elif x.count('Potion') > 0:
                if self.items["Potions"] == 0:
                    dialogue("You don't have any potions to drink!",
                             speed=.01,
                             right=True)
                else:
                    break

            else:
                break

        return x
Exemple #11
0
    def attack_enemy(self, enemy):
        # The battle system is like DnD. There a roll to see if the attack hits, then another for the actual damage dealt.
        attack = randint(10, 20) + (self.attack / 2)
        if attack >= enemy.defense:
            damage = round(randint(1, 5) + (self.attack / 2.5))
            enemy.current_HP -= damage

            dialogue(
                f'{self.name} {self.attack_type} the enemy for {damage} DMG.',
                speed=.01,
                right=True)
            if enemy.current_HP < 0:
                enemy.current_HP = 0

            # Tell the player how much damage the attack did.
            dialogue(f"{enemy.name}'s HP dropped to {enemy.current_HP}.",
                     speed=.01,
                     right=True)

        # And in case the attack missed:
        else:
            dialogue('Your attack missed!', speed=.01, right=True)
Exemple #12
0
 def execute(self, player, enemy):
     player.current_HP = player.base_HP
     player.current_SP -= self.cost
     dialogue(self.description, speed=.1, right=True)
Exemple #13
0
def tutorial():

    # If the glbl.player had a previous save state, or has completed the game, they have the option to skip the tutorial.
    if Path('Hall of Fame.txt').exists() or Path('save_state.txt').exists():
        if dialogue("Skip tutorial?", ["Yes", 'No']) == 0:
            return

    # Else, meet "System".
    dialogue("Hello! I am the game system.")
    dialogue("I'll be with you every step of the way as you play this game.\n")

    # Create the dialogue box
    name = dialogue('First, what is your name?', type_length=13)
    for i in glbl.punctuation + [' ']:
        if name.count(i):
            dialogue("Cheeky, ain't ya?")
            dialogue("I'll put you down as Charles.")
            name = 'Charles'
    else:
        glbl.game_stats['user'] = name
    dialogue(f"Hi there {name}!")
    dialogue(
        "Use [W][A][S][D] or the arrow keys to change selections/dialogue options."
    )
    dialogue("Then, use [SPACEBAR] or [ENTER] to complete the selection.")
    dialogue("You can also at any time press the [M] key to open the menu.")
    line = "Got it?"

    # These loops are what allow the glbl.player to input their actions.
    # It accounts for both upper and lower case, and prevents the glbl.player from inputing an invalid action.
    # There are a few like this one in this document, so I will only explain how it works here.
    while True:
        if dialogue(line, ["Nope, not at all.", "Got it."]) == 1:
            dialogue(" Coolio.")
            break

        else:
            line = "Are you sure? Because you're doing it just fine right now."

    dialogue("Alright, let's get the game underway!")
Exemple #14
0
    def level_up(self):

        # Raises the player's level by 1, while subracting how much is required for that level up.
        self.lvl += 1

        # Tell the player they've just leveled up.
        dialogue(f"{self.name} levels up!", right=True)

        # This is the formula for how much more experience the player will need to obtain the next level.
        # I fiddled with values in graph making software to come up with this one.
        self.next_EXP += round((6 * (self.lvl**.769)) - 7.182)

        points = randint(1, 5)
        dialogue(f'You gained {points} points to spend.', right=True)
        while points != 0:
            x = dialogue(f'Assign a point to which stat?\n({points} left)', [
                f'ATT ({self.attack})', f'HP ({self.base_HP})',
                f'SP ({self.base_SP})'
            ],
                         right=True)

            if x == 0:
                self.attack += 1

            elif x == 1:
                self.base_HP += 1
                self.current_HP = self.base_HP

            else:
                self.base_SP += 1
                self.current_SP = self.base_SP

            points -= 1

        x = randint(1, 9)
        if x > 6:
            if x == 9: self.defense += 2
            else: self.defense += 1
            dialogue(f"DEF also rose to: {self.defense}", right=True)
        else:
            dialogue(f"DEF remains:  {self.defense}", right=True)

        # And for good measure, tell the player how much more they'll need for their next level.
        dialogue(f"Next Lv. at {self.next_EXP} EXP.", right=True)
Exemple #15
0
def character_select():

    prior = len(glbl.gw.items)

    # Create the dialogue box
    dialogue_box = Rectangle(Point(11, 403), Point(489, 488))
    dialogue_box.setFill(color_rgb(50, 50, 50))
    dialogue_box.setWidth(3)
    dialogue_box.draw(glbl.gw)

    # Create the Text object that will display dialogue.
    dialogue_text = Text(Point(25, 418), "")
    dialogue_text.setSize(20)
    dialogue_text.setAnchor("nw")
    dialogue_text.draw(glbl.gw)

    # If the array of choices that is passed in isn't empty, the glbl.player is supposed to make a
    #	 selection.
    p = (658, 250)

    character_chart_background = Rectangle(Point(533, 61), Point(928, 439))
    character_chart_background.setFill(color_rgb(50, 50, 50))
    character_chart_background.setWidth(3)
    character_chart_background.draw(glbl.gw)

    selector = Polygon(Point(p[0] - 95, p[1] - 125),
                       Point(p[0] - 95, p[1] - 101),
                       Point(p[0] - 61, p[1] - 113))
    selector.setFill("red")
    selector.draw(glbl.gw)

    warrior_portait = Image(Point(p[0], p[1] - 113),
                            glbl.CHARACTERS / 'Warrior_portrait.png')
    warrior_portait.draw(glbl.gw)

    warrior_text_1 = Text(Point(p[0] + 58, p[1] - 113),
                          "Warrior\nHP:       \nATT: Average\nDEF: Average")
    warrior_text_1.setSize(17)
    warrior_text_2 = warrior_text_1.clone()
    warrior_text_2.setText('\n    Higher\n\n')
    warrior_text_2.setTextColor('SpringGreen')
    warrior_text_1.draw(glbl.gw)
    warrior_text_2.draw(glbl.gw)

    sorcerer_portait = Image(Point(p[0], p[1]),
                             glbl.CHARACTERS / 'Sorcerer_portrait.png')
    sorcerer_portait.draw(glbl.gw)

    sorcerer_text_1 = Text(Point(p[0] + 58, p[1]), "Sorcerer\nHP:\nATT:\nDEF:")
    sorcerer_text_1.setSize(17)
    warrior_text_2 = sorcerer_text_1.clone()
    warrior_text_2.setText('\n    Higher\n\n     Higher')
    warrior_text_2.setTextColor('SpringGreen')
    warrior_text_3 = sorcerer_text_1.clone()
    warrior_text_3.setText('\n\n     Lower\n')
    warrior_text_3.setTextColor('IndianRed')
    sorcerer_text_1.draw(glbl.gw)
    warrior_text_2.draw(glbl.gw)
    warrior_text_3.draw(glbl.gw)

    rogue_portait = Image(Point(p[0], p[1] + 113),
                          glbl.CHARACTERS / 'Rogue_portrait.png')
    rogue_portait.draw(glbl.gw)

    rogue_text_1 = Text(Point(p[0] + 58, p[1] + 113), "Rogue\nHP:\nATT:\nDEF:")
    rogue_text_1.setSize(17)
    warrior_text_2 = rogue_text_1.clone()
    warrior_text_2.setText('\n\n     Higher\n')
    warrior_text_2.setTextColor('SpringGreen')
    warrior_text_3 = rogue_text_1.clone()
    warrior_text_3.setText('\n    Lower\n\n     Lower')
    warrior_text_3.setTextColor('IndianRed')
    rogue_text_1.draw(glbl.gw)
    warrior_text_2.draw(glbl.gw)
    warrior_text_3.draw(glbl.gw)

    selection = 0
    options = ['Warrior', 'Sorcerer', 'Rogue']

    while True:

        dialogue_text.setText('')
        skip = False
        for i in 'What class would you like to \nplay?':

            key = glbl.gw.checkKey().lower()
            if key in ["return", "space", "escape"]:
                skip = True

            dialogue_text.setText(dialogue_text.getText() + i)

            if not skip:
                sleep(.02)

        while True:
            key = glbl.gw.checkKey().lower()

            if key != "":
                if key in ["space", "return"]:

                    if dialogue(
                            f'Are you sure you want to play as a {options[selection]}?',
                        ['Yes', 'No']) == 0:
                        break

                elif key in ["escape"]:
                    while selection > 0:
                        selector.move(0, -113)
                        selection -= 1

                if key in ["up", "w", "left", "a"]:
                    selection = (selection - 1) % 3
                    if selection != 2:
                        selector.move(0, -113)
                    else:
                        selector.move(0, 226)

                elif key in ["down", "s", "right", "d"]:
                    selection = (selection + 1) % 3
                    if selection != 0:
                        selector.move(0, 113)
                    else:
                        selector.move(0, -226)

        name = dialogue(f"What is the {options[selection]}'s name?",
                        type_length=8)
        if name in [
                '', ' ', '  ', '   ', '    ', '     ', '      ', '       ',
                '        '
        ]:
            if selection == 0: name = 'Grog'
            elif selection == 1: name = 'Magnus'
            else: name = 'Fief'

        if dialogue(
                f"You're certain you want to play as `{name} the {options[selection]}`?",
            ['Yes', 'No'], ['white', 'SpringGreen', 'white']) == 0:
            break

    if selection == 0:
        glbl.player = Warrior(name=name)
    elif selection == 1:
        glbl.player = Sorcerer(name=name)
    else:
        glbl.player = Rogue(name=name)

    glbl.gw.clear(prior)
Exemple #16
0
def librarian(gold_box):

	color = 'DarkOrange'

	# This plays the first time the glbl.player meets the librarian.
	if glbl.game_stats["librarian"] == 0:
		dialogue("Oh. Hello...", [], color)
		dialogue("What brings you around here?", ["Just checking things out."], color)
		dialogue("Oh, that's cool...", [], color)
		dialogue("Wait, are you that new adventurer?", [], color)
		dialogue("I... need your help.", [], color)
		dialogue("As you may have heard... the other adventurers can't find the orc.", [], color)
		dialogue("I think it's because it moves around so much...", [], color)
		dialogue("So I thought, why not... map out the local area?", [], color)
		dialogue("That way, you guys won't get lost...", [], color)
		dialogue("I've been... asking all the adventurers to help me out.", [], color)
		x = dialogue("Will you help too...?", ["Eh, why not?", "Heck yeah!", "No thanks!"], color)

		if x == 2:
			glbl.game_stats["librarian"] = 1
			dialogue("Oh, okay then...", [], color)
			dialogue("Well, if you change your mind, I'm right here.", [], color)
		
		else:
			glbl.game_stats["librarian"] = 2
			dialogue("Wait, really? Thanks!", [], color)
			dialogue("Okay, so let's start by getting the first two areas...", [], color)
			dialogue("Sketch down wherever you find the stairs up.", [], color)
			dialogue("Then bring your maps back here...", [], color)
			dialogue("I'll grab your reward in the meantime.", [], color)
			dialogue("Okay, I'll see you later.", [], color)


	elif glbl.game_stats["librarian"] == 1:
		glbl.game_stats["librarian"] = 2
		dialogue("Oh, welcome back...", [], color)
		x = dialogue("Are you here to help now?", ["Fiiiiine", "Nope!"], color)

		if x == 1:
			dialogue("Are you just bullying me?", [], color)
			dialogue("If so, please stop it.", ["Sorry, sorry."], color)
			dialogue("Hmph.", [], color)

		dialogue("I want you to start with the first two areas of the forest.", [], color)
		dialogue("Make sure to write down where you found both pairs of stairs.", [], color)
		dialogue("Even though you've been really mean, I'll try to prepare some reward in the meantime.", [], color)
		dialogue("Okay, I'll see you later.", [], color)


	elif glbl.game_stats["librarian"] == 2:
		dialogue("Welcome back.", [], color)
		dialogue("How's it coming along?", ["Here you go."], color)

		if not (glbl.MAPS / "map_1.txt").exists():
			dialogue("Wait, you haven't even gone into the forest yet?", [], color)
			dialogue("Stop messing with me and at least do the bare minimum.", [], color)

		elif not (glbl.MAPS / "map_2.txt").exists():
			dialogue("You still haven't made it to the second floor?", [], color)
			dialogue("Come back after at least trying.", [], color)

		else:
			f1 = open(glbl.MAPS / "map_1.txt", "r")
			f2 = open(glbl.MAPS / "map_2.txt", "r")

			missing_1 = False
			if f1.read().count("|") < 1:
				missing_1 = True
				dialogue("You forgot to write down where the first stairs up are...", [], color)
			if f2.read().count("|") < 1:
				dialogue(f"You{' also' if missing_1 else ''} forgot to write down where the second set of stairs are...", [], color)
				dialogue("Do that then come back here.", [], color)

			if f1.read().count("|") < 1 or f2.read().count("|") < 1:
				glbl.game_stats["librarian"] = 3
				dialogue("This looks great...", [], color)
				dialogue("For your reward, I found these scrolls.", ["Scrolls?"], color)
				dialogue("Yeah. While exploring, sometimes trees and junk might block your path.", [], color)
				dialogue("You can use a scroll to clear them out of the way.", [], color)
				explain_scrolls()
				dialogue("If you ever need any more, come back here and I'll sell you some.", [], color)
				dialogue("Okay, good luck out there.", [], color)

				glbl.player.items['Fire Scroll'] += 1
				glbl.player.items['Ice Scroll'] += 1
				glbl.player.items['Thunder Scroll'] += 1
				
	elif glbl.game_stats["librarian"] > 2:
		if glbl.game_stats["librarian"] == 3:
			glbl.game_stats["librarian"] = 4
			dialogue("Welcome back...", [], color)
			dialogue("I forgot to mention this earlier, but if you're ever well and truly stuck, come back here.", [], color)
			dialogue("There's several paths up the mountain, and we can always start over from a new spot.", [], color)
			line = "Anyways, what can I help you with?"


		else:
			line = "Welcome back. What can I do?"

		gold_box.show()
		
		# Placing while loop to keep glbl.player in the menus until they want to leave.
		while True:

			x = dialogue(line, ["Buy Scrolls", "Start Over", "What scrolls do what?", "Leave"], color)

			# This part here is for buying srolls.  
			if x == 0:

				line = "Which one? They all cost 15G."

				while True:
					x = dialogue(line, ["Fire Scroll", "Ice Scroll", "Thunder Scroll", "Never mind."], color)
					if x != 3:
						if glbl.player.gold < 15: dialogue("That's not enough gold. These things are expensive, you know.", [], color)
						else:
							glbl.player.gold -= 15
							gold_box.update(glbl.player.gold)
							dialogue("Here you are.", [], color)
							if x == 0: glbl.player.items["Fire Scroll"] += 1
							elif x == 1: glbl.player.items["Ice Scroll"] += 1
							elif x == 2: glbl.player.items["Thunder Scroll"] += 1

					# Return to the Buy/Start Over/Explanation Menu		
					else:
						break

					line = "Any others?"


			# The part for Starting Over
			elif x == 1:
				if dialogue("Are you sure? This will reset all progress made while exploring, sending you back to Floor 1.", ["Yes", "No"]) == 0:
					x = dialogue("Okay, just hand me your old maps, and we can try to find a new spot to start.", ["Actually, never mind.", "Sure thing."], color)
					if x == 0:
						dialogue("Oh. Okay then.", [], color)
					else:
						for i in range(1, 16):
							try:
								(glbl.MAPS / f"floor_{i}.png").unlink()
								(glbl.MAPS / f"map_{i}.txt").unlink()
							except:
								pass

						dialogue("You hand over the maps and together look for a new starting location.")
						while True:
							dialogue("...")
							dialogue("...")
							dialogue("...!")
							dialogue("The Librarian points at a spot on the map you two were looking over.")
							if dialogue("Wait, what about here?", ["Looks good to me.", "'Bout as good as any other.", "Let's keep searching."], color) != 2:
								
								
								
								dialogue("Okay, I think an old adventurer already had something from here.", [], color)
								if random() < .5: dialogue("Here's a copy of her old map for you.", [], color)
								else: dialogue("Here's a copy of his old map for you.", [], color)
							
								level_layout, level_x, level_y = fetch_level(1, True)
								padding = level_layout.pop()
								level_layout = level_layout[1:]
								map_layout = []

								for i in range(len(level_layout)):
									row = level_layout[i]
									map_lower, map_upper = [], []
									for j in row:

										if j == "x":
											pass

										elif j == "|":
											map_lower.append("g")
											map_upper.append("|")
										elif j == "/":
											map_lower.append("g")
											map_upper.append("/")
										else:
											if j == ".":
												map_lower.append("g")
											elif j == "W":
												map_lower.append("b")
											elif j == "X":
												map_lower.append("o")
											elif j == "R":
												map_lower.append("y")
											map_upper.append(".")

									for j in range(15):
										map_lower.append(".")
										map_upper.append(".")
									
									map_layout.insert(i, map_lower)
									map_layout.append(map_upper)

								for i in range(15, 25):
									map_layout.insert(i, ["." for j in range(30)])
									map_layout.append(["." for j in range(30)])

								level_layout.insert(0, padding)
								level_layout.append(padding)
									
								save_and_close(1, level_layout, map_layout, len(glbl.gw.items))
								break
							
							
							
							else:
								dialogue("Okay then.", [], color)


			# Explain scrolls again.
			elif x == 2:
				explain_scrolls()

			# Let the glbl.player leave the library.
			else:
				break


			line = "Anything else?"

		
		gold_box.hide()
		dialogue("See you around!", [], color)
Exemple #17
0
def goodbyes():
    if glbl.player.current_HP < (glbl.player.base_HP / 4):
        dialogue("After a close battle, you've finally defeated the orc!")
    else:
        dialogue("At long last, the village is free from its enemy.")

    dialogue(
        " When you return with the news, you are showered with gratitude.")
    sleep(3)
    dialogue(" A big party is put on in your honor!")
    sleep(2)
    dialogue(
        " Afterwards, you fall asleep in the inn, perhaps for the last time.")
    sleep(3)
    dialogue("\n Z", end=""), sleep(.8), dialogue(
        "z", end=""), sleep(.8), dialogue("z", end=""), sleep(.8), dialogue(
            ".", end=""), sleep(.8), dialogue(
                ".", end=""), sleep(.8), dialogue(".\n\n", end=""), sleep(1.2)
    dialogue(
        " Upon waking up, you decide to say some final goodbyes before leaving.\n"
    )
    sleep(2.75)

    # The glbl.player is given the option to talk to some, all, or none of the important villagers they've met to say some final goodbyes.
    shopkeep = False
    innkeep = False
    weaponer = False
    w = glbl.game_stats['magic_weaponer']
    while True:
        if shopkeep == False: dialogue(" [S]hopkeep")
        else: dialogue(" [S]hopkeep", end="")

        if innkeep == False: dialogue("    [I]nnkeep")
        else: dialogue("    [I]nnkeep", end="")

        if weaponer == False: dialogue("    [" + w[0] + ']' + w[1:])
        else: dialogue("    [" + w[0] + ']' + w[1:], end="")

        dialogue("    [L]eave\n")
        x = input(' >>> ').lower()
        dialogue()

        if x == 's':
            if shopkeep == False:
                shopkeep = True
                dialogue(" Gotta say, you've been one fine customer, " +
                         glbl.game_stats['p_name'] + ".\n")
                sleep(3)
                dialogue(" We'll all forever be in you're gratitude.\n")
                sleep(3)

                if glbl.game_stats['shopbro'] == 1 or glbl.game_stats[
                        'shopbro'] == 3:
                    dialogue("\n Me especially, the handsomer brother.\n")
                    sleep(2.75)
                    dialogue(" We both know I'm more handsome.\n")
                    sleep(2)
                    dialogue(" No, I clearly am.\n")
                    sleep(2)
                    dialogue(" Nu uh!\n")
                    sleep(1)
                    dialogue(" Ya huh!\n")
                    sleep(1)
                    dialogue(" Nu uh!\n")
                    sleep(1)
                    dialogue(" Ya huh!\n")
                    sleep(1)
                    while True:
                        dialogue(" Nu uh!\n")
                        sleep(1)
                        dialogue(' [G]uys!\n')
                        x = input(' >>> ').lower()
                        dialogue()
                        if x == 'g':
                            break
                        dialogue(" Ya huh!\n")
                        sleep(1)
                        dialogue(' [G]uys!\n')
                        x = input(' >>> ').lower()
                        dialogue()
                        if x == 'g':
                            break
                    dialogue(" Sorry.")
                dialogue(
                    " Thanks again for everything. Don't be a stranger!\n\n")
                sleep(4)

            else:
                dialogue(
                    " You've already said your goodbyes to the Shopkeep.\n")
                sleep(1)

        elif x == 'i':
            if innkeep == False:

                innkeep = True
                dialogue(" Thanks for everything, " +
                         glbl.game_stats['p_name'] + "!\n")
                sleep(2.5)
                dialogue(" Hey, did you ever find those fairies?\n")
                while True:
                    dialogue(" [I] did!    [N]ope, never.\n")
                    x = input(' >>> ').lower()
                    dialogue()

                    if x == 'i':
                        dialogue(
                            " Really? I guess my dad really was telling the truth.\n"
                        )
                        sleep(2)
                        dialogue(
                            " I've been thinking about going out on my own adventure to look for\n"
                        )
                        dialogue(" them myself.\n")
                        sleep(4.5)
                        dialogue(
                            " Now that I know they're out there, I want to see them with my own eyes.\n"
                        )
                        sleep(4)
                        break

                    else:
                        dialogue(
                            " Well, I still hold out hope they're out there.\n"
                        )
                        sleep(3)
                        dialogue(
                            " I've actually been preparing for my own excursion into the forest.\n"
                        )
                        sleep(3)
                        dialogue(
                            " Now that the orc's gone, I want to try to find those fairies myself.\n"
                        )
                        sleep(3)
                        dialogue(
                            " You've inspired me to go out and prove my father's tale was true.\n"
                        )
                        sleep(3)

                        break

                dialogue(
                    " Anyways, if you ever find yourself in the neighborhood, let me put\n"
                )
                dialogue(" you up for the night!\n\n")
                sleep(4)

            else:
                dialogue(
                    " You've already said your goodbyes to the Innkeep.\n")
                sleep(1)

        elif x == w[0].lower():
            if weaponer == False:
                weaponer = True
                dialogue(" Welcome back, " + glbl.game_stats['p_name'] + "!\n")
                sleep(2)
                dialogue(" Last night was some party, huh?\n")
                sleep(2)
                if glbl.game_stats['mwc'] == True:
                    if glbl.game_stats['magic_weapon'] == "Vorpal Daggers":
                        dialogue(
                            " Listen, I've been thinking, and I think I have a theory on how to make\n those"
                        )
                    else:
                        dialogue(
                            " Listen, I've been thinking, and I think I have a theory on how to make\n that"
                        )
                    dialogue(" " + glbl.game_stats['magic_weapon'] +
                             " even better.\n")
                    sleep(4.5)
                    dialogue(
                        " I'll need a lot more time to research about it, though.\n"
                    )
                    sleep(3)
                    dialogue(
                        " Come back in a few years, and I know I'll have something good!\n\n"
                    )
                    sleep(3)
                else:
                    dialogue(
                        " I'm still working on figuring out that new weapon.\n"
                    )
                    sleep(3)
                    dialogue(
                        " If you ever find youself back here, drop on by.\n")
                    sleep(3)
                    dialogue(" It might finally be done then!\n\n")
                    sleep(3)

            else:
                dialogue(" You've already said your goodbyes to the ", w,
                         ".\n")
                sleep(1)

        else:
            if innkeep == False and shopkeep == False and weaponer == False:
                dialogue(" Deciding not to trouble the villagers any longer,",
                         glbl.game_stats['p_name'], "suits up and")
                dialogue(" heads off for the next adventure!")
            else:
                dialogue(
                    " Having said their final goodbyes, the villagers wave as",
                    glbl.game_stats['p_name'], "heads on")
                dialogue(" to the next adventure!")

            break
def rat_w_hat():

    # This plays if this is the first time the glbl.player has met Reginald.
    if glbl.game_stats['reginald'] == 1:

        glbl.game_stats['reginald'] = 2
        dialogue('You notice a rat wearing a top hat and a monocle.')
        dialogue('It also seems to be holding a cane in its tail.')

        # I like to imagine Reginald has a British accent here.
        if dialogue(
                "Pip pip cheerio old chap! Wonderful weather we have this noon, wouldn't you say?",
            ["Yes", "No"], "red") == 1:
            dialogue("Ah, you're a glass half empty type of fellow, I see.",
                     color="red")

        name = dialogue("If I may ask, good sir, what is your name?",
                        [glbl.player.name, 'Ratt Slayir', 'Dave'], "red", True)
        glbl.game_stats["rat_name"] = name

        # If the glbl.player gives the first fake name:
        if name == 'Ratt Slayir':
            dialogue("The rat visibly sudders.")
            dialogue('Ratt Slayir? Tis an, uh, "interesting"name.',
                     color='red')

        # If the glbl.player gives the other fake name:
        elif name == 'Dave':
            dialogue(
                """Huh. I've never had the pleasure of meeting a "Dave"before.""",
                color="red")

        # If the glbl.player gives their real name:
        else:
            dialogue(f"{name}, eh? That's a splendid name.", color='red')

        # Here the glbl.player learns Reginald's name, and gets an inkling of his nefarious goals.
        dialogue('Well, my friends call me Reginald.', color="red")
        dialogue(
            "Say, you wouldn't happen to know where the nearest town is, would you?",
            color="red")
        dialogue("Reginald twirls his(?) cane and smiles menacingly.")

        # If the glbl.player selects this, they are eventually taken to the battle with Reginald.
        if dialogue(
                """I need a place to feed- er, "rest", after my strenuous travels.""",
            ["Aren't you a talking rat?", "Yeah, follow me."], "red") == 0:
            dialogue('No, no, I am most definitely a human.', color='red')
            dialogue("Reginald's tail flicks around.",
                     ['You look like a rat.'])
            dialogue(
                f"Now that's quite a rude thing to say, {name}. I've always been rather sensitive about my appearance.",
                color='red')
            dialogue("The hat droops a little.",
                     ["What pointy ears you have!"])
            dialogue("The better to hear you with.",
                     ['What beady eyes you have!'], 'red')
            dialogue("The better to see you with.",
                     ['What gnarly teeth you have!'], 'red')
            dialogue("The better to... bah! Forget it!", color='red')
            dialogue("Saw through my ingenious disguise, eh?", color='red')
            dialogue("Well, you're not leaving here alive! Muahaha!",
                     color='red')
            dialogue("Reginald brandishes the cane.")
            return 'fight'

    if glbl.game_stats['reginald'] == 5:
        glbl.game_stats['reginald'] = 6
        dialogue('Thank you kindly for taking me all the way here.',
                 color='red')
        dialogue("I'm going to rest for a little bit before heading on.",
                 color='red')
        dialogue('Must uh... look presentable for the villagers, right?',
                 color='red')
        dialogue(
            f'I do hope we have the chance to run into each other again some day, {glbl.game_stats["rat_name"]}.',
            color='red')
        dialogue("I bid you adieu.", color='red')

    # This dialogue plays when the glbl.player has selected for Reginald to follow them.
    # It lets them change their mind and fight Reginald anyways before reaching the town.
    else:
        dialogue("Reginald darts his eyes around nervously.")
        x = dialogue("Is something the matter?", [
            'Stay here.' if glbl.game_stats['reginald'] == 2 else 'Follow me.',
            "I don't trust you.", 'Nevermind.'
        ],
                     'red',
                     return_arg=True)
        if x.count('Stay') > 0:
            glbl.game_stats['reginald'] = 3
            return 'stay'
        elif x.count('Follow') > 0:
            glbl.game_stats['reginald'] = 2
            return 'follow'

        if x.count('I') > 0:
            if dialogue(
                    "What ever could you mean? I've been nothing if not trustworthy!",
                ["Sounds pretty sus.", 'Forget about it.'], 'red') == 0:
                dialogue("I swear I'm not... bah! Forget it!", color='red')
                dialogue("Saw through my ingenious disguise, eh?", color='red')
                dialogue("I've been a rat all along and you didn't even know!",
                         color='red')
                dialogue(
                    "I'll just find another fool to take me to the village.",
                    color='red')
                dialogue("En guarde!")
                return 'fight'
Exemple #19
0
def town_tutorial():
	dialogue("Welcome to the world of Console Quest!")
	dialogue("You work at the Adventurer's Guild in the city of Krocus.")
	dialogue("After gaining experience completing small quests, it's time your first major one.")
	dialogue("A small village in the backcountry has been forced to pay tributes to an orc for several years.")
	dialogue("It regulaly moves around, so others have had trouble finding and slaying it.")
	dialogue("Up until now, the villagers were able to keep the orc satisfied.")
	dialogue("But recently, it's been asking for ever larger tributes, and the villagers' pockets aren't deep.")
	dialogue("Find the orc, and kill him before he attacks and kills the townsfolk.")
	dialogue("You just arrived in town the other day, so many of the villagers only know rumors of you.")
	dialogue("Feel free to introduce yourself, or head straight into the forest to start your adventure!")
Exemple #20
0
def inn(gold_box):

	color = "SpringGreen"
	staying = False

	# This part plays when the glbl.player comes to the inn for the first time.
	if glbl.game_stats["inn_stays"] == -1:
		glbl.game_stats["inn_stays"] = 0
		dialogue("Welcome to my inn.", [], color)
		dialogue("You're the adventurer here to beat the orc, right?", [], color)
		dialogue("Would you like to stay the night?", [], color)
		dialogue("It'll cost 4G.", [], color)
		gold_box.show()
		x = dialogue("Staying the night will recover all your lost health.",  ["Yes (7G)", "No"])

	# This part plays every other time the glbl.player visits the inn.
	else:
		gold_box.show()
		x = dialogue("Welcome back! Here for the night again?", ["Yes (4G)", "No"], color)
	
	if x == 0:
		# If their health is already at max, they are reminded, just in case they don't want to waste 7G.
		if glbl.player.current_HP == glbl.player.base_HP:
			x = dialogue("Are you sure? Your HP is already at max.", ["Yes", "No"])
			if x == 1:
				dialogue("See you later!", [], color)
				gold_box.hide()
				return

		# Check to see if the glbl.player has enough money.
		if glbl.player.gold < 4:

			# If the glbl.player is short on cash, but has stayed at the inn seven other times, the fee is waved.
			# All remaining money is taken, but they can still heal up.
			if glbl.game_stats["inn_stays"] > 8:
				dialogue("You've been such a good customer, I'll waive the fee for tonight.", [], color)
				dialogue(" Just give me what you can, and I'll put the rest on your tab.", [], color)
				staying = True

			else:
				dialogue("You don't have enough money to stay right now.", [], color)

		else:
			staying = True


	# If the glbl.player has deicided to stay, or the Innkeep has allowed them to.
	if staying:
		glbl.game_stats["inn_stays"] += 1
		glbl.player.gold -= 4
		if glbl.player.gold < 0:
			glbl.player.gold = 0

		gold_box.update(glbl.player.gold)

		# This line for the final part of the Magic Weapon Quest.
		# The glbl.player has to go do something else to give the Weapon Maker some time to make the weapon.
		if glbl.game_stats["magic_weapon_status"] == 2: glbl.game_stats["magic_weapon_status"] = 3


		# Just a small touch, the glbl.player is directed to 1 of 4 rooms to sleep in.
		x = randint(1,4)
		if x == 1: dialogue("Your room is right down the hall, second on the left.", [], color)
		elif x == 2: dialogue(" Your room is up the stairs, third on the right.", [], color)
		elif x == 3: dialogue(" Your room is right down the hall, first on the right.", [], color)
		elif x == 4: dialogue(" Your room is up the stairs, third on the left.", [], color)


		# The HP is restored to max, and a short sleep cycle is played.
		glbl.player.current_HP = glbl.player.base_HP

		dialogue("Zzz...", [])
		dialogue("Zzzzz...", [])
		dialogue("Zzzzzzz...", [])
		dialogue("Health fully restored!", [])

	# If the glbl.player has not talked to the Innkeep about the fairies yet, this section will begin that sidequest for the thrid part of the game.
	if glbl.game_stats['fairies'] == -1 and glbl.game_stats["inn_stays"] > 1:
		glbl.game_stats['fairies'] = 0
		dialogue("As you're about to leave, the Innkeep waves you down.", [])
		dialogue(" You haven't heard of the mischievous fairies, have you?", [], color)
		dialogue(" My father used to tell me tales of how deep in the forest, he and his adventuring party discovered a cave with fairies in it.", [], color)
		dialogue(" When offered a brightly colored juice, some of them became stronger than ever before.", [], color)
		dialogue(" However, a couple others oddly turned weaker.", [], color)
		dialogue(" The other villagers always mocked him for that story, all the way to his grave.", [], color)
		dialogue(" It's always been a dream of mine to prove him right.", [], color)
		dialogue(" If you ever do see them, please tell me where they are.", [], color)
		dialogue(" Alright, see you later!", [], color)
		return
		
	dialogue("See you around!", [], color)
	gold_box.hide()
	return
Exemple #21
0
def shop(gold_box):

	color = "turquoise"
	gold_box.show()

	# The default price of potions. This changes if you meet and help the shopkeep's brother Daniel in the forest.
	pprice = 10

	# If the glbl.player succeeded the shopbro quest, they will see this special dialogue when they enter the shop.
	if glbl.game_stats['shopbro'] == 1 or glbl.game_stats['shopbro'] == 3:
		pprice = 7

		if glbl.game_stats['shopbro'] != 3:
			glbl.game_stats['shopbro'] = 3

			dialogue("Hey there! I heard you bumped into my brother in the forest.", [], color)
			dialogue("He might not be as awesome as me, but I still love the guy.", [], color)
			dialogue("I'll lower their price a little for you.", [], color)

	# However, if the glbl.player failed to save Daniel, the Shopkeep has this dialogue instead.
	elif glbl.game_stats['shopbro'] == 4:
		glbl.game_stats['shopbro'] = 5

		dialogue("Hey there. It's been a rough day.", [], color)
		dialogue("I just heard my brother Daniel was found dead in the forest.", [], color)
		dialogue("Since he was the one that made my potions, I don't have many left.", [], color)
		dialogue("I'll try to keep acting chipper though.", [], color)
		dialogue("Thanks for hearing me out.", [], color)


	# The shopkeep David introduces himself the first time the glbl.player comes to his shop.
	# glbl.game_stats["shopbro"] is used to keep track of if this is the first time the glbl.player has visited the shop.
	# There is more dialogue that plays for the first time the glbl.player leaves the shop, so it is updated there rather than here.
	if glbl.game_stats['shopbro'] == -1 or glbl.game_stats['shop_visits'] == 0:
		glbl.game_stats['shopbro'] = 0
		dialogue("Welcome to my shop!", [], color)
		dialogue("You must be that adventurer the town's been buzzing about.", [], color)
		dialogue("I'm the shopkeep, and town's best-looking dude. The name's David.", [], color)
		line = "What can I do for you?"

	# If the glbl.player has come before, David just gives this short line:
	else:
		line = "Welcome back to my shop! Is there anything you want?"


	
	glbl.game_stats['shop_visits'] += 1
		
	# Placing while loop to keep glbl.player in the menus until they want to leave.
	while True:

		x = dialogue(line, ["Buy", "Sell", "Leave"], color)

		# This part here is for buying stuff.  
		if x == 0:

			while True:
				
				x = dialogue("Here's what I have in stock.",[
					"Shield: 30G",
					f"Potions: {pprice}G{' ' + str(glbl.game_stats['p_left']) if glbl.game_stats['shopbro'] == 4 else ''}",
					"Information",
					"Back",
				], color)

				# Getting a shield.
				if x == 0:
					# The glbl.player doesn't have enough money
					if glbl.player.gold < 30: dialogue("You'll need more money for that.", [], color)
					# The glbl.player already has a shield in their inventory.
					elif glbl.player.items["Shield"] == 1:
						dialogue("Looks like you already have a mighty fine shield there.", [], color)
						dialogue("Whoever gave you it must've been a really handsome dude.", [], color)
					# The glbl.player buys a shield.
					else:
						glbl.player.gold -= 30
						gold_box.update(glbl.player.gold)
						glbl.player.items["shield"] = 1
						glbl.player.DEF += 3
						dialogue("Thanks for your purchase!", [], color)
						dialogue("DEF just rose by 3!")

				# Getting potions.
				elif x == 1:

					# The glbl.player failed the shopbro quest and the shop is out of stock.
					if glbl.game_stats['shopbro'] == 2 and glbl.game_stats['p_left'] == 0:
						dialogue("Sorry, I'm all out of potions.")

					# The glbl.player doesn't have enough money.
					elif glbl.player.gold < pprice: dialogue("You'll need more money for that.", [], color)
					
					# The glbl.player buys a potion.
					else:
						glbl.player.gold -= pprice
						gold_box.update(glbl.player.gold)		
						glbl.player.items["Potions"] += 1
						dialogue("Thanks for your purchase!", [], color)
						
						# If the glbl.player failed the shopbro quest, take away a potion from stock.
						if glbl.game_stats['shopbro'] == 2: glbl.game_stats['p_left'] -= 1

				# Getting information.
				elif x == 2:
					while True:

						x = dialogue("What do you wanna know about?", ["Shield", "Potions", "Fire Scrolls", "Ice Scrolls", "Thunder Scrolls", "Back"], color)

						if x == 0:
							dialogue("The shield will increase your your DEF some.", [], color)
						elif x == 1:
							dialogue("Potions will restore your HP by several points.", [], color)
						elif x == 2:
							dialogue("Fire Scrolls will burn up any trees.", [], color)
						elif x == 3:
							dialogue("Ice Scrolls will freeze bodies of water.", [], color)
						elif x == 4:
							dialogue("Thunder Scrolls will shatterer rocks.", [], color)
						# Return to the Buy Menu
						else:
							break

				# Return to the Buy/Sell Menu		
				else:
					break


		# The part for selling stuff.  
		# Note that the glbl.player cannot actually sell anything, since this is, you know, a shop.
		# As such, this area is completely for humor.
		elif x == 1:
			while True:

				line = []
				sell_amount = {
					"Shield": "15G", "Potions": "3G",
					"Fire Scroll": "5G", "Ice Scroll": "5G", "Thunder Scroll": "5G", 
					"Apples": "1G", "Herbs": "2G", "magic_item": "7G" 
				}

				for i in glbl.player.items:
					i_count = glbl.player.items[i]
					if i_count != 0:
						if i == "magic_item":
							item = "Magic Wood" if glbl.player.character_class == "Sorcerer" else "Magic Ore"
							line.append(f"{item} ({i_count}): {sell_amount[i]}")
						else: line.append(f"{i} ({i_count}): {sell_amount[i]}")
				line.append("Back")


				x = dialogue("What would you like to sell?", line, color, True)

				if x == "Shield":
					dialogue("That's a really nice shield you have there.") 
					if dialogue("Are you sure you want to get rid of it?", ["Yes", "No"]) == 0:	
						if dialogue("Are you really sure?", ["Yes", "No"]) == 0:
							if dialogue("I mean, it's a really nice shield, and there's no real reason to.", ["Yes", "No"]) == 0: 
								if dialogue("Your stats'll go down...", ["Just do it.", "No"]) == 0:
									if  dialogue("...and you don't really get much money back for it.", ["Sell my shield!", "No"]) == 0:
										if dialogue("I'm not sure I want to, with that tone of voice.", ["I'm sorry. Please?", "No"]) == 0:
											dialogue("Alright, since you're so sure.")
											dialogue("Just don't come crying to me if you die because you're DEF was so low you got hit a bunch of times.")
											dialogue("You want to return this shield?", [], color)
											dialogue("Sorry, but I don't take refunds.", [], color)

				elif x == "Potions":
					dialogue("Look man, don't take this personally, but I'm trying to run a business here.", [], color)
					dialogue("Why the heck would I buy some strange liquid from a rando adventurer I only met like, a few days ago?", [], color)
					dialogue("Also, I'm pretty sure at least some of this is my own stock.", [], color)

				elif x.find("Scroll") != -1:
					dialogue("Sorry, I already have plent of parchment.", [], color)

				elif x == "Apples":
					dialogue("TODO: Write Apple Stuff")
				
				elif x == "Herbs":
					dialogue("TODO: Write Herb Stuff")

				elif x == "Magic Ore" or x == "Magic Wood":
					dialogue(f"I have no use for magic items, but I think the {'Wizard' if glbl.player.character_class == 'Sorcerer' else 'Blacksmith'} might need it for a certain project she's been working on.", [], color)
				
				else:
					break


		# Let the glbl.player leave the shop.
		elif x == 2:
			break

		line = "Anything else?"

	
	gold_box.hide()
	dialogue("See you around!", [], color)

	# As mentioned above, this is the dialogue that play the first time the glbl.player leaves the shop.
	# It starts the Daniel questline, in which the glbl.player has to find the shopkeep's brother in the forest.
	if glbl.game_stats['shopbro'] == -1:
		glbl.game_stats['shopbro'] = 0
		dialogue("By the way, my brother Daniel has been missing for several days.", [], color)
		dialogue("He's actually the one who makes my potions.", [], color)
		dialogue("Every now and then he goes up the mountain to gather materials.", [], color)
		dialogue("It isn't uncommon for him to disappear for days at a time, but I just have a bad feeling.", [], color)
		dialogue("If you see him, tell him his more handsome brother's worried.", [], color)
Exemple #22
0
def final_message():
    # If this is the second, third, or nth time playing the game, this dialogue directly from me will play.
    if Path('Hall of Fame.txt').exists():
        dialogue("Hey, it's Jeffrey again!")
        dialogue(
            " I can't believe you cared so much that you'd play my game start to"
        )
        dialogue(" finish again.")
        dialogue(
            " I don't really have anything special for you this time around.")
        dialogue(" Oh! How about this?")

        # Here, I give the glbl.player a gold star with the graphics library.
        p1 = Point(750, 32)
        p2 = Point(799, 183)
        p3 = Point(957, 183)
        p4 = Point(829, 278)
        p5 = Point(878, 427)
        p6 = Point(750, 333)
        p7 = Point(622, 427)
        p8 = Point(671, 278)
        p9 = Point(543, 183)
        p10 = Point(701, 183)

        star = Polygon(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)
        star.setWidth(5)
        star.setFill('gold')
        star.draw(glbl.gw)

        dialogue("It's a gold star for your efforts!")
        dialogue("I hope it made this all worthwhile.")
        dialogue("...", speed=(1.5))
        dialogue(
            "So... when I said to go out on your own adventure, I didn't mean to just start a new game."
        )
        dialogue("Go out and DO something.")
        dialogue("Personally, as a Boy Scout, I recommend camping.")
        dialogue(
            "Get some friends to go with you, and it can be a great experience."
        )
        dialogue("What are you waiting for?")
        dialogue("The world is an oyster, and it's your job to crack it open!")
        sleep(5)

    # If this is the first time the glbl.player has beaten the game, this dialogue from me will play.
    else:
        dialogue(f" Thanks for playing this game, {glbl.game_stats['user']}.")
        dialogue(" I'm the creator, Jeffrey.")
        dialogue(
            " Making this game has been a real experience for me, and I'm so happy I got to share it with you."
        )
        dialogue(
            " This started out as a small project for one of my classes, and spiraled WAY out of control!"
        )
        dialogue(
            " I just want to thank you for taking the time to play all of it.")
        dialogue(
            " If you want to dive into the code, I have a ton of comments that make up a running commentary of my experiences."
        )
        dialogue(
            f" Oh, and before I forget, in the folder this is contained in, there'll be a file that contains {glbl.game_stats['p_name']}'s stats after beating the orc."
        )
        dialogue("It's in 'Hall of Fame.txt'")
        dialogue(
            f"There, {glbl.game_stats['p_name']} will be immortalized, for as long as this file exists and you don't go changing it."
        )
        dialogue(" Anyways, this is truly good bye.")
        dialogue(
            " I hope you have a wonderful rest of the day, as you head on to you're own next adventure!"
        )
Exemple #23
0
    def battle(self, enemy):

        pygame.mixer.music.stop()

        # musicChoice = (randint(1,2)

        # if musicChoice == '1':
        # 	battle_music = pygame.mixer.music.load("Battle_Music.wav")
        # 	pygame.mixer.music.play(-1)
        # else:
        # 	battle_music2 = pygame.mixer.music.load("battle2.mp3")
        # 	pygame.mixer.music.play(-1)

        battle_music = pygame.mixer.music.load("Battle_Music.wav")

        pygame.mixer.music.play(-1)

        prior = len(glbl.gw.items)

        battle_background = Rectangle(Point(-2, -2), Point(1002, 502))
        battle_background.setFill(color_rgb(150, 150, 150))
        battle_background.draw(glbl.gw)

        e_name_box = Rectangle(Point(11, 11),
                               Point(len(enemy.name) * 20 + 22, 50))
        e_name_box.setFill(color_rgb(50, 50, 50))
        e_name_box.setWidth(3)
        e_name_box.draw(glbl.gw)
        e_name = Text(Point(22, 16), enemy.name)
        e_name.setAnchor('nw')
        e_name.setStyle('bold')
        e_name.setSize(20)
        e_name.draw(glbl.gw)

        e_name.draw(glbl.gw)
        e_health = Bar(enemy.current_HP, enemy.base_HP, 'red', Point(11, 55),
                       Point(331, 81))
        e_health.show()

        p_name_box = Rectangle(Point(978 - (len(self.name) * 20), 11),
                               Point(989, 50))
        p_name_box.setFill(color_rgb(50, 50, 50))
        p_name_box.setWidth(3)
        p_name_box.draw(glbl.gw)
        p_name = Text(Point(978, 16), self.name)
        p_name.setAnchor('ne')
        p_name.setStyle('bold')
        p_name.setSize(20)
        p_name.draw(glbl.gw)

        p_health = Bar(self.current_HP, self.base_HP, 'red', Point(669, 55),
                       Point(989, 81))
        p_health.show()
        p_exp = Bar(self.current_EXP,
                    self.next_EXP,
                    'green',
                    Point(719, 86),
                    Point(989, 100),
                    show_text=False)
        p_exp.show()

        while True:
            # Check to see if the player has died.
            if self.current_HP <= 0:
                raise GameOver('lost battle')

            #this calls the menu and takes the input to be called here.
            # returns a valid player selection
            x = self.battleInput()

            if x == 'Attack':
                self.attack_enemy(enemy)

            elif x in '012':
                self.abilities[int(x)].execute(self, enemy)

            elif x.count('Potion') > 0:
                self.use_potion()

            elif x == 'Run':
                self.run(enemy)

            # Since the player attacked the enemy, update their health bar.
            e_health.update(enemy.current_HP)

            # Check to see if the enemy died last turn.
            # If so, give out rewards, and maybe level up.
            if enemy.current_HP <= 0:
                pygame.mixer.music.stop()

                dialogue(f'{enemy.name} died!', speed=.01, right=True)

                if enemy.name == 'Orc':
                    glbl.game_stats['orc_dead'] = True
                    raise GameOver('orc dead')

                else:
                    pygame.mixer.music.stop()
                    town_music = pygame.mixer.music.load("Overworld_Music.mp3")
                    pygame.mixer.music.play(-1)

                    line = f'{self.name} gained {enemy.current_EXP} XP'
                    if enemy.gold > 0:
                        line += f'and {enemy.gold} gold'
                    line += '.'
                    dialogue(line, speed=.01, right=True)
                    self.current_EXP += enemy.current_EXP
                    self.gold += enemy.gold

                    p_exp.update(self.current_EXP)
                    while self.current_EXP >= self.next_EXP:
                        self.level_up()
                        p_exp.update(self.current_EXP, self.next_EXP)

                sleep(1)
                glbl.gw.clear(prior)
                return

            enemy.take_turn(self)

            p_health.update(self.current_HP)
Exemple #24
0
def weapon_maker(gold_box):

	color = 'magenta'

	# Based on the character's class, they might see the Blacksmith, or the Wizard.
	# Both has slightly different dialogue, so the changes are loaded in here.
	blacksmith = False if glbl.player.character_class == 'Sorcerer' else True
	cue = ["forge", "Ore", "3", "hammer out"] if blacksmith else ["shop", "Wood", "5", "carve up"]

	# Show the gold_box if the glbl.player is on either of the first two steps of this quest.
	if glbl.game_stats["magic_weapon_status"] < 2: gold_box.show()
	

	# This plays the first time the glbl.player meets the Weapon Maker.
	if glbl.game_stats["magic_weapon_status"] == 0:

		glbl.game_stats["magic_weapon_status"] = 1

		dialogue(f"Hello there! Welcome to my {cue[0]}.", [], color)
		dialogue("You must be that adventurer who's here to kill that orc.", [], color)
		dialogue(f"{glbl.player.name}, was it?", [], color)
		dialogue("I'm the one who makes the shields that the shop sells.", [], color)
		dialogue("I'm currently working on a project you might be able to help with.", [], color)

		# It's possible the glbl.player has already found magic items in the forest before meeting the Weapon Maker.
		# If so, this instance of dialogue will have a line that the glbl.player can say, with a response from the Weapon Maker.
		x = dialogue(f"In the forest you might come across some Magic {cue[1]}.", ["Like this?"] if glbl.player.items['magic_item'] > 0 else [], color)
		if x == 0:
			dialogue("Yes, that's it!", [], color)
		

		# The Sword and Daggers only need 3 Ore, while the Staff needs 5 Wood.
		dialogue(f"If you can gather up {cue[2]} of 'em and 25G, I'll be able to {cue[3]} a special weapon.", ["You can count on me!"], color)
		dialogue(f"Great! I'll see you later!", [], color)


	# When the glbl.player returns to the Weapon Maker, this dialogue plays.
	elif glbl.game_stats["magic_weapon_status"] == 1:

		x = dialogue("How's the search coming?", ["Got everything right here.", "Still searching."], color)
			
		# If they claim to have everything, the Weapon Maker checks.
		if x == 0:

			# In case the glbl.player is missing some ore and/or gold, she will tell them what they need.
			if (blacksmith and glbl.player.items[3][1] < 3) or ((not blacksmith) and glbl.player.items[3][1] < 5) or glbl.player.gold < 25:
				
				# The Weapon Maker's line starts out with the following text, and will be built from here.
				string = " Hold on, you're still missing "
				also = False

				# If the glbl.player is missing magic items, that is appended to "string".
				# Also, for proper grammar the boolean "also" is set to true.
				if blacksmith and glbl.player.items[3][1] < 3:
					string += f"{3 - glbl.player.items[3][1]} Ore"
					also = True
				elif (not blacksmith) and glbl.player.items[3][1] < 5:
					string += f"{5 - glbl.player.items[3][1]} Wood"
					also = True

				# If the above append triggered, and the glbl.player is also missing gold, append the word "and" to "string"
				if also == True and glbl.player.gold < 25: string += " and "

				# If the glbl.player is missing gold, append the amount to "string".
				if glbl.player.gold < 25: string += f"{25 - glbl.player.gold}G"

				# Finally, append a period for proper punctuation.
				string += "."

				# Now that the full line has been built, pass that in as the Weapon Maker's dialogue.
				dialogue(string, [], color)
				dialogue("Come back when you've gotten everything. I'm itching to get started!", [], color)


			# Else if everything is in order, the Weapon Maker will start making the weapon.
			else:
				glbl.game_stats["magic_weapon_status"] = 2
				if blacksmith: glbl.player.items[3][1] -= 3
				else: glbl.player.items[3][1]-= 5
				glbl.player.gold -= 25

				gold_box.update(glbl.player.gold)

				dialogue("Sweet! I'll get right to it.", [], color)
				dialogue("Come back a little later, and it should be done!", [], color)


		# Else the glbl.player tells the Weapon Maker they don't have everything, thereby leaving the area and returning to town.
		# The Weapon Maker will remind the glbl.player what they need.
		else:
			dialogue("Well then I'll leave you to it.", [], color)
			dialogue(f"Remember, you need {cue[2]} {cue[1]} and 25 G.", [], color)


	# The Weapon Maker needs time to make the weapon, and if not given it, this dialogue will play.
	# The glbl.player will have to either explore the forest once, or sleep off the night to get past this point.
	elif glbl.game_stats["magic_weapon_status"] == 2:
		dialogue("Hey there! Progress on your weapon is going good.", [], color)
		dialogue("Give me a little more time, and I should be finished.", [], color)
		dialogue("I can't wait for you to see it!", [], color)


	# Once the glbl.player has given the Weapon Maker time, they'll award the new weapon.
	elif glbl.game_stats["magic_weapon_status"] == 3:
		glbl.game_stats["magic_weapon_status"] = 4
		dialogue("Welcome back! I'm finally done!", [], color)
		weapon = "Storm Blade" if glbl.player.character_class == "Warrior" else "Blaze Rod" if glbl.player.character_class == "Sorcerer" else "Vorpal Daggers"
		dialogue(f"I present to you: the {weapon}!", [], color)
		dialogue("ATT rose by 7!")

		if glbl.player.character_class == "Warrior":
			dialogue("I imbued that sword with the power of thunder, so it should be able to break any rocks you come across!", [], color)
		elif glbl.player.character_class == "Wizard":
			dialogue("I imbued that staff with extra firepower, so it should be able to burn any trees you come across!", [], color)
		else:
			dialogue("I imbued those daggers with void magic, so you should be able to teleport across any bodies of water you come across!", [], color)
			
		# Explain how to use the weapon's special ability.
		# This should be slightly different depending on whether or not the glbl.player has finished the Librarian's sidequest.
		if glbl.game_stats["librarian"] > 2:
			dialogue(f"The {weapon} can be used in the forest the same way you use scrolls.")
		else: dialogue(f"To use the {weapon}'s special ability, press the [E] key in the field.")



		# Since the rogue recieves the Vorpal Daggers as a pair, gramatically the Weapon Maker should refer to "them" rather than "it".
		dialogue(f"Hope you like {'them' if glbl.player.character_class == 'Rogue' else 'it'}!", [], color)


	# If the glbl.player ever returns afterwards, this short dialogue plays.
	elif glbl.game_stats["magic_weapon_status"] == 4:
		dialogue("So, how's my magnum opus treating ya?", [], color)
		dialogue("I don't have anything else I can help you with, so get out there and beat that orc!", [], color)


	# If the glbl.player was shown the gold_box, hide it now.
	if glbl.game_stats["magic_weapon_status"] < 2:
		gold_box.hide()
def shopbro():

    color = 'deepskyblue'

    # The first time talking with Daniel.
    if glbl.game_stats['shopbro'] == 1:

        dialogue(
            "As you walk through the forest, you notice a handsome man riddled with arrows."
        )
        dialogue(
            "Beside his pool of blood is a large basket with a few plant leaves."
        )
        x = dialogue("Good day... fellow traveler. What brings you out here?",
                     [
                         "Just out for a stroll.", "I'm looking for the Orc.",
                         "Nunya business."
                     ],
                     color=color)
        if x == 0:
            dialogue("Well you chose quite the day to come out.", color=color)

        elif x == 1:
            dialogue("You're the new adventurer, eh? Thank goodness.",
                     color=color)

        elif x == 2:
            dialogue("Well then. Little rude of you.", color=color)

        x = dialogue(
            "Hey, you wouldn't happen to have something to fix all of... this, would you?",
            ['What can I do to help?', 'Sorry, I have things to do.'], color)
        if x == 1:
            glbl.game_stats['shopbro'] = 4
            dialogue("Oh, I guess we all have our troubles.", color=color)
            dialogue("Sorry to take up your time.", color=color)
            dialogue(
                "You walk away from the dying man, ignoring the tears rolling down his face."
            )
            return

        dialogue(
            "Oh, I dunno, if you had a couple spare potions, that'd be pretty nifty.",
            color=color)

        options = ['Fresh out.', 'No, these are mine.']
        if glbl.player.items['Potions'] > 0:
            options.insert(0, 'Sorry, I only have 1.')
        if glbl.player.items['Potions'] > 1:
            options.insert(0, 'Yeah, take these.')

        x = dialogue(f'You have {glbl.player.items["Potions"]} Potions.',
                     options,
                     return_arg=True)
        if x.count('Yeah') > 0:
            glbl.game_stats['shopbro'] = 3
            glbl.player.items['Potions'] -= 2

            dialogue('Thank you so much friend!', color=color)
            dialogue('The stranger immediately drinks one of the potions.',
                     color=color)
            dialogue(
                "It'll take me a while to get all my strength back in between removing these arrows.",
                color=color)
            dialogue("Meet me at the shop when you get back to town.",
                     color=color)
            dialogue("I'll see you then!", color=color)

        elif x.count('Sorry') > 0:
            dialogue("No... don't apologize yet!", color=color)
            dialogue(
                "If I drink that now, it should... keep me stable for a little while.",
                color=color)
            dialogue(
                "In the meantime, you can try... to find the other one from somewhere.",
                color=color)
            y = dialogue(
                'What do you say? Willing to... do this random stranger a massive solid?',
                ['Here you go.', 'Mmmm, nah.'], color)

            if y == 0:
                glbl.game_stats['shopbro'] = 2
                glbl.player.items['Potions'] -= 1
                dialogue(
                    'You hand over the potion, and the man drinks it in a flash.'
                )
                dialogue("Oooh, I'm feeling better already.", color=color)
                dialogue("Good luck. I'll just... chill here for now.",
                         color=color)

            else:
                glbl.game_stats['shopbro'] = 4
                dialogue('The man looks flabergasted.')
                dialogue("Oh. Um, okay then.", color=color)
                dialogue(
                    "Well... didn't think my last moments... would be with such a jerk.",
                    color=color)
                dialogue(
                    "Hope and life literally drain out of the man's eyes as he slumps over dead."
                )

        else:
            glbl.game_stats['shopbro'] = 4

            if x.count('Fresh') > 0:
                dialogue(
                    "The hope that had touched the man's face as you arrived just as quickly drains away."
                )
                dialogue("Well, that's a real pickle, huh.", color=color)
                dialogue("Can you at least stay here... so I don't die alone?",
                         ['Of course.'],
                         color=color)
                dialogue(
                    "Once the man draws his last breath, you continue somberly on your way."
                )

            else:
                dialogue(
                    "The man sticks up his middle finger in your general direction."
                )
                dialogue("Some help you turned out to be ya selfish jerk.",
                         color=color)
                dialogue("The stranger then slumps over dead.")

    elif glbl.game_stats['shopbro'] == 2:
        dialogue("Oh hey, welcome back.", color=color)
        options = ["Still searching."]
        if glbl.player.items['Potions'] > 0: options.insert(0, 'Here you go.')

        x = dialogue("Do you... have that extra potion I need?", options,
                     color, True)
        if x.count('Here') > 0:
            glbl.game_stats['shopbro'] = 3
            glbl.player.items['Potions'] -= 1

            dialogue('Thank you so much, stranger.', color=color)
            dialogue(
                "It'll take me a while to get all... my strength back in between removing these arrows.",
                color=color)
            dialogue("Meet me at the shop when you get back to town.",
                     color=color)
            dialogue("I'll see you then!", color=color)

        else:
            dialogue('Well I wish you luck, but try to be quick.', color=color)
            dialogue(
                'I can already feel that first potion losing its effects.',
                color=color)

    elif glbl.game_stats['shopbro'] == 3:
        dialogue("Oh hey, welcome back.", color=color)
        if dialogue("The name's Daniel, by the way.",
                    [f"My name's {glbl.player.name}.", "Say Nothing"],
                    color) == 0:
            dialogue(f"Well, it was nice meeting you, {glbl.player.name}.",
                     color=color)
        dialogue(
            "I should be fine here on my own. I'll see you back at the village!",
            color=color)
        dialogue("You leave Daniel in high spirits.", color=color)
Exemple #26
0
def main():

    skip_menu = False

    while True:

        if not skip_menu:

            title = Text(
                Point(500, 125), """
             _____                                                                   
            |  _  |       ___   ___   _   _    ____   ___   _     ____        / \    
            | |_| |      /  _| | _ | |  \| |  |  __| | _ | | |   | ___|      / //    
            |_____|\     | |_  ||_|| | |\  |  _\ \   ||_|| | |_  | __|      / //     
                 \  \    \___| |___| |_| \_| |___/   |___| |___| |____|    / //      
                  \  \    --------------------------------------------    / //       
                   \  \        ___    _  _   ____    ____   _____        / //        
                    \  \      | _ |  | || | | ___|  |  __| |_   _|    __/_//         
                     \  \     ||_||_ | || | | __|   _\ \     | |     /___  \         
                      \  \    |____/ |____| |____| |___/     |_|      /\/\_|         
                       \  \    ----------------------------------    /\/             
                        \__\                                        /_/              """
            )
            title.setAnchor("c")
            title.setSize(10)
            title.draw(glbl.gw)

            # If the glbl.player has a previous save state, they have the option of loading it in to skip the introduction, glbl.player creation, and story.
            if Path('save_state.txt').exists():

                # By default load in the last saved game:
                load_game()

                # Everything for the Character Information
                info_box = Rectangle(Point(551, 100), Point(959, 400))
                info_box.setFill(color_rgb(50, 50, 50))
                info_box.setWidth(3)
                info_box.draw(glbl.gw)

                # The Character Icon
                info_icon = Image(
                    Point(613, 163), glbl.MAPS / "characters" /
                    f"{glbl.player.character_class}_portrait.png")
                info_icon.draw(glbl.gw)

                # Shows the Header that includes the glbl.player's name and level.
                info_header = Text(Point(572, 179))
                info_header.setAnchor("w")
                info_header.setSize(22)
                info_header.setText(
                    f"      {glbl.player.name + f'LV: {glbl.player.lvl}'.rjust(16)[len(glbl.player.name):]}\n      HP:\n      EXP:\nItems:"
                )
                info_header.draw(glbl.gw)

                # Draw the HP bar.
                hp_bar = glbl.Bar(glbl.player.current_HP, glbl.player.base_HP,
                                  "red", Point(750, 149), Point(948, 173))
                hp_bar.show()

                # Draws the EXP bar
                exp_bar = glbl.Bar(glbl.player.current_EXP,
                                   glbl.player.next_EXP, "green",
                                   Point(750, 179), Point(948, 203))
                exp_bar.show()

                # Lists off the glbl.player's current glbl.inventory.
                info_header_underline = Line(Point(573, 240), Point(937, 240))
                info_header_underline.setWidth(1)
                info_header_underline.setOutline("white")
                info_header_underline.draw(glbl.gw)
                info_footer = Text(Point(573, 246))
                info_footer.setAnchor("nw")
                info_footer.setSize(14)
                info_footer.setText(glbl.inventory())
                info_footer.draw(glbl.gw)

                hide_character = Rectangle(Point(498, -2), Point(1002, 502))
                hide_character.setFill('black')
                hide_character.setWidth(1)
                hide_character.draw(glbl.gw)
                title.lift()

                while True:
                    menu_background = Rectangle(Point(15, 325),
                                                Point(485, 485))
                    menu_background.setFill(color_rgb(50, 50, 50))
                    menu_background.draw(glbl.gw)

                    menu_text = Text(Point(60, 405), "")
                    menu_text.setText("New Game\nLoad Game\nQuit")
                    menu_text.setSize(28)
                    menu_text.draw(glbl.gw)

                    selector = Polygon(Point(30, 354), Point(30, 374),
                                       Point(50, 364))
                    selector.setFill("red")
                    selector.draw(glbl.gw)
                    selection = 0

                    while True:
                        key = glbl.gw.checkKey().lower()

                        if key != "":
                            if key in ["space", "return"]:
                                break

                            elif key in ["up", "w"]:
                                selection = (selection - 1) % 3
                                if selection != 2:
                                    selector.move(0, -40)
                                else:
                                    selector.move(0, 80)

                            elif key in ["down", "s"]:
                                selection = (selection + 1) % 3
                                if selection != 0:
                                    selector.move(0, 40)
                                else:
                                    selector.move(0, -80)

                            if selection == 1:
                                title.lower()
                                hide_character.lower(title)
                            else:
                                title.lift()
                                hide_character.lower(title)

                    for i in glbl.gw.items[1:]:
                        i.undraw()

                    # Start new game
                    if selection == 0:
                        # Because they already have a save file, and making a new one would would overwrite it, ask for certainty
                        menu_background.draw(glbl.gw)
                        certainty_text1 = Text(
                            Point(30, 335),
                            "Are you sure?\nThis may overwrite the old \nsave file!"
                        )
                        certainty_text1.setAnchor('nw')
                        certainty_text1.draw(glbl.gw)

                        certainty_text2 = Text(Point(30, 464), "    Yes		No")
                        certainty_text2.setAnchor('w')
                        certainty_text2.draw(glbl.gw)

                        certainty_selector = Polygon(Point(60, 454),
                                                     Point(60, 474),
                                                     Point(80, 464))
                        certainty_selector.setFill("red")
                        certainty_selector.draw(glbl.gw)
                        certainty_selection = True

                        while True:
                            key = glbl.gw.checkKey().lower()

                            if key != "":
                                if key in ["space", "return"]:
                                    break

                                elif key in [
                                        "up", "w", "left", "a", "down", "s",
                                        "right", "d"
                                ]:
                                    # The glbl.player was hovering over "Yes"
                                    if certainty_selection:
                                        certainty_selector.move(190, 0)
                                    # The glbl.player was hovering over "No"
                                    else:
                                        certainty_selector.move(-190, 0)
                                    certainty_selection = not certainty_selection

                        if certainty_selection:
                            glbl.gw.clear()
                            new_game()
                            break

                    # Pretend to load the saved game.
                    if selection == 1:
                        pygame.mixer.music.stop()
                        break

                    # Quit out of the game
                    if selection == 2:
                        return

            # Else, the glbl.player is opening the game for the first time, and we need to go through glbl.player creation and story.
            else:
                pygame.mixer.music.stop()
                new_game()

        try:
            glbl.gw.clear()
            town()
        except glbl.GameOver as reason:
            color = 'red'

            if reason.type == 'Lost Battle':
                dialogue('You died!', color=color)
                dialogue('The villagers ran out of tributes for the orc.',
                         color=color)
                dialogue(
                    "With no adventurers to protect them, the orc finally killed everybody.",
                    color=color)
                if dialogue('Continue?', ['Yes', 'No'], color=color) == 0:
                    load_game()
                    skip_menu = True
                else:
                    return

            elif reason.type == 'Rat Invasion':
                dialogue(
                    'Upon returning to the town, you notice all of the buildings have been damaged.',
                    color=color)
                dialogue(
                    'All the villagers are dead, their corpses gnawed apart, while rats line the streets.',
                    color=color)
                dialogue('Additionally, several rat corpses line the road.',
                         color=color)
                dialogue('What possibly could have happened here?',
                         color=color)
                dialogue(
                    "With no other options, you head back to the Adventurer's guild to report this failure.",
                    color=color)

                if dialogue('Continue?', ['Yes', 'No'], color=color) == 0:
                    load_game
                    skip_menu = True
                else:
                    return

            if reason.type == 'Orc Dead':
                goodbyes()
                hall_of_fame()
                final_message()
                return

            elif reason.type == 'Town Quit':
                return

            elif reason.type == 'Mountain Quit':
                return