Ejemplo n.º 1
0
def town(name, objective, firsttime=False):
    name = colour_it(name, Color.PLACE)
    objective = colour_it(objective, Color.QUEST)
    print(
        f"""{name}'s citizens are up and about. Merchant's shout their wares, guttersnipes pick the pockets of unsuspecting
townsfolk, and those more fortunate in life look down their nose at those with less luck."""
    )
    if firsttime:
        time.sleep(6)
    activity = input_stuff(
        f"""What would you like to do?
1. Look at the markets        ~ {ability.ability["health"]}/{ability.ability["maxhealth"]} health ~
2. Visit the blacksmith       ~ {equipment.equipment["gold"]} gold ~
3. Rest at the inn            ~ [{ability.ability["xp"]}/100] xp ~
4. Train                      ~ {weapon.weapon["stability"]}/{weapon.weapon["max stability"]} weapon stability ~
5. Check your inventory
6. {objective}

> """, ["1", "2", "3", "4", "5", "6"])
    if activity == "1":
        market(name, objective)
    elif activity == "2":
        blacksmith(name, objective)
    elif activity == "3":
        inn(name, objective)
    elif activity == "4":
        trainer(name, objective)
    elif activity == "5":
        inventory_shown = inventory.show()
        if not inventory_shown:
            town(name, objective)
    elif activity == "6":
        return False
Ejemplo n.º 2
0
def level_up(levels):
    if levels == 1:
        plurals = "time"
    else:
        plurals = "times"
    print_stuff([
        colour_it(f"You've leveled up {int(levels)} {plurals}!",
                  Color.FUNCTION)
    ])
    time.sleep(3)
    ability['level'] += levels
    ability['xp'] %= 100
    counter = 0
    while counter < levels:
        print(f"""Which ability do you want to increase?
1. {colour_it("Strength", Color.STRENGTH)}
2. {colour_it("Agility", Color.AGILITY)}
3. {colour_it("Awareness", Color.AWARENESS)}
4. {colour_it("Endurance", Color.ENDURANCE)}
5. {colour_it("Persona", Color.PERSONA)}""")
        ability_boost = int(input_stuff('> ', ["1", "2", "3", "4", "5"]))
        choices = ["strength", "agility", "awareness", "endurance", "persona"]
        choice = choices[(ability_boost - 1)]
        ability[choice] += 1
        print(f"Your {choice.capitalize()} increased by 1!")
        time.sleep(3)

        print("""Which action do you want to improve?
1. Strike
2. Parry
3. Distract""")
        action_boost = int(input_stuff('> ', ["1", "2", "3"]))
        action_choices = ["strike", "parry", "distract"]
        action_choice = action_choices[(action_boost - 1)]
        ability[f"{action_choice}_lvl"] += 1
        print(f"{action_choice.capitalize()} has been upgraded!")
        time.sleep(3)

        ability["maxhealth"] = ability["endurance"] + 10
        ability["maxhealth"] += (5 * (ability["level"] - 1))
        ability["maxhealth"] = int(ability["maxhealth"])
        ability["health"] = ability["maxhealth"]
        counter += 1
Ejemplo n.º 3
0
def distract(enemy):
    reference = enemy["reference"]
    distracts = [
        known for known in weapon.weapon["distracts"] if known['enabled']
    ]
    lacerating = False
    deadly = False
    prompt = ""
    counter = 0
    options = []
    for distract in distracts:
        counter += 1
        prompt = prompt + str(
            counter) + ". " + distract["name"] + distract["description"] + """
		"""
        options.append(str(counter))
    prompt = prompt + "> "
    distract = input_stuff(prompt, options)
    if distract == "2":
        lacerating = True
    elif distract == "3":
        deadly = True
    initial_script = [
        "Suddenly, you lean down, scoop up a handful of dirt and throw it in your enemy's face.",
        f"You yell fiercely into the face of your opponent. {reference['he'].capitalize()} recoils at the sudden noise.",
        f"""You feint sideways, then come back to your previous position. {reference['object'].capitalize()} staggers slightly at the sudden move.""",
        f"As your enemy moves closer, you swiftly kick {reference['him']} painfully in the shin.",
        f"Your opponent brings down {reference['his']} attack. You raised your blade at the last second, and with your free hand punch {reference['him']} in the face, sending {reference['him']} staggering away."
    ]
    print(random.choice(initial_script))
    time.sleep(5)
    attack_chance = random.randrange(1, 101)
    if attack_chance <= (50 + ability.ability['agility'] +
                         ability.ability["distract_lvl"]):
        if lacerating == True:
            enemy["bleeding"] += 2
            print(
                "Your enemy's loss of focus allows you to cut them, causing them to bleed!"
            )
            time.sleep(3)
        elif deadly == True:
            buffs[0] += 2
            buffs[1] += 2
            print(
                "Your enemy's loss of focus opens them up to significant damage!"
            )
            time.sleep(3)
        else:
            enemy["playermod"] += (10 + ability.ability["agility"] +
                                   ability.ability["distract_lvl"] * 2)
            print("Your enemy's loss of focus allows you to make an attack!")
            time.sleep(3)
            strike(enemy)
    else:
        return False
Ejemplo n.º 4
0
def show():
	menu = input_stuff(f"""

		~ {character.character["fullname"]} ~
		~ Level {ability.ability["level"]} ~ [{ability.ability['xp']}/100] xp
		{character.character["gender"].capitalize()}

		Health: {ability.ability["health"]}/{ability.ability["maxhealth"]}
		Armour: {ability.ability["armour"]}
		Gold: {equipment.equipment["gold"]}
		1. Character Stats
		2. Weapon
		3. Items
		4. Exit
> """, ["1", "2", "3", "4"])

	if menu == "1":
		leave1 = input_stuff(f"""
Your stats are:
		{colour_it('Strength', Color.STRENGTH)} {ability.ability["strength"]}
		{colour_it('Agility', Color.AGILITY)} {ability.ability["agility"]}
		{colour_it('Awareness', Color.AWARENESS)} {ability.ability["awareness"]}
		{colour_it('Endurance', Color.ENDURANCE)} {ability.ability["endurance"]}
		{colour_it('Persona', Color.PERSONA)} {ability.ability["persona"]}

	Enter 'b' to go back
> """, ["b"])
		if leave1 == "b":
			show()

	elif menu == "2":
		weapon_stats()

	elif menu == "3":
		item_list()

	elif menu == "4":
		return False
Ejemplo n.º 5
0
def weapon_stats():
	menu = input_stuff(f""" ~ {weapon.weapon["weaponname"]} ~
	
{weapon.weapon["weaponname"]}'s stats are:
		Sharpness {weapon.weapon["sharpness"]}
		Finesse {weapon.weapon["finesse"]}
		Stability {weapon.weapon["stability"]} / {weapon.weapon["max stability"]}
	
	Enter 'n' to rename your weapon
	Enter 'b' to go back
> """, ["n", "b"])
	if menu == "n":
		weapon.weapon["weaponname"] = input(f"""What do you want to call your weapon? (Previous name "{weapon.weapon["weaponname"]})
> """)
		weapon_stats()
	if menu == "b":
		show()
Ejemplo n.º 6
0
def prologue():
	elfa = colour_it("Elfa", Color.NPC)
	micha = colour_it("Micha", Color.NPC)
	bertholt = colour_it("Bertholt Omar", Color.NPC)
	blackburrow = colour_it("Blackburrow", Color.PLACE)
	lizardtongue = colour_it("Lizardtongue Mountains", Color.PLACE)
	corocana = colour_it("Corocana", Color.PLACE)

	print_stuff([f"""In this text based adventure, you will be taking on the role of a Nighthawk, an elite monster hunter, a sword
for hire when the ordinary folk can't handle the danger.""",
f"""The adventure begins in the town of {blackburrow}, a bustling place just East of the {lizardtongue}, and South of 
the vast jungles of {corocana}.""", """Your current task is to look for the missing son and daughter of the very worried, very rich
baron. If there is a threat to the town that was the cause of their disappearing, then you must eliminate it.""",
f"""You know the following things:
- The son and daughter were aspiring adventurers, and were seeking adventure in the {lizardtongue}, where a treasure
hoard was said to lie in a cave at the top of the largest mountain.
- The son is called {micha} and the daughter is called {elfa}. The baron himself is {bertholt}.""",
"""Before setting off on your task, you have the chance to prepare."""])

	town.town("Blackburrow", "Leave to look for the Omar children", True)
	print_stuff([f"Your preparations complete, you head towards the main gates of {blackburrow}.",
"You stop when you hear the sound of a woman crying in an alley, and the harsh voice of a man."])
	choice = input_stuff("""1. Investigate the sounds.
2. Continue on your way.
> """, ["1", '2'])

	if choice == "1":
		print_stuff(["You move into the dark alley. Ahead, you can see a trembling, feminine form and a man holding a sword.",
"The man turns as you approach and shoves the woman into you. You push the woman away, and only then realise that you don't need to.",
"The woman moves to the alley wall and picks up a sword leaning against it. She turns to you, grinning.",
f'''"It's amazing how effective that old gag is," she laughes, raising her weapon.''',
f"""The man behind you speaks up. "Strip the {character.character["titles"]["insult"]} of {character.character['titles']['his']} loot!" """])
		enemy_1 = encounters.monster_access("fbandit")
		enemy_2 = encounters.monster_access("mbandit")
		gang = [enemy_1, enemy_2]
		enemy_round.initialize(gang)
		if post_combat.victory == False:
			print_stuff(["You wake up lying in the alley. You hurt where you were hit, and you feel that your money was stripped from you.",
"You lost all gold!"])
			equipment.equipment["gold"] = 0
			ability.ability["health"] = int(ability.ability["maxhealth"] / 2)
Ejemplo n.º 7
0
def get_turn_choice(enemy):
    reference = enemy["reference"]
    initial_script = [
        f"""You circle each other, sizing each other up.""",
        f"""You ready your weapon and glare at your opponent.""",
        f"""You feel your heart pounding, feel your chest rising with smooth, even breaths.""",
        f"""{reference['object'].capitalize()} lunges. You jump aside at the last second."""
    ]
    if enemy["type"] == "human":
        initial_script.append(
            """Steel meets, and you stare at each other, blades locked in a clinch."""
        )
    action = input_stuff(
        random.choice(initial_script) + f""" Do you...
	1. Strike
	2. Parry
	3. Distract       ~ {ability.ability["health"]} / {ability.ability["maxhealth"]} health ~
	4. Use Item
	5. Check Inventory
> """, ["1", "2", "3", "4", "5"])
    return action
Ejemplo n.º 8
0
def item_list():
	while True:
		plurals = {
			"potions": "Potions",
			"knives": "Knives",
			"oils": "Oils",
			"smoke bombs": "Smoke Bombs"
		}
		if equipment.equipment["potions"] == 1:
			plurals["potions"] = "Potion"
		if equipment.equipment["knives"] == 1:
			plurals["knives"] = "Knife"
		if equipment.equipment["oils"] == 1:
			plurals["oils"] = "Oil"
		if equipment.equipment["smoke bombs"] == 1:
			plurals["smoke bombs"] = "Smoke Bomb"

		menu = input_stuff(f"""You have:
			{equipment.equipment["potions"]} {plurals["potions"]}
			{equipment.equipment["knives"]} {plurals["knives"]}
			{equipment.equipment["oils"]} {plurals["oils"]}
			{equipment.equipment["smoke bombs"]} {plurals["smoke bombs"]}
		
		Enter 'h' to consume a healing potion.
		Enter 'b' to go back
	> """, ["b", "h"])
		if menu == "h":
			if equipment.equipment["potions"] <= 0:
				print("You have no more potions!")
			else:
				equipment.equipment["potions"] -= 1
				ability.heal(random.randrange(4,9))
				print()
		elif menu == "b":
			break
	show()
Ejemplo n.º 9
0
def descentb():
    micha = colour_it("Micha", Color.NPC)
    blackburrow = colour_it("Blackburrow", Color.PLACE)
    tamara = colour_it("Tamara", Color.NPC)
    denvar = colour_it("Denvar", Color.NPC)
    print_stuff([
        f"The three of you make your way down the mountain. With your guidance you arrive at {denvar}'s cabin. You notice that {denvar} is home.",
        f"Light shines from the windows, and you see movement from inside. You approach the door and knock sharply. Almost instantly, {denvar} answers the knock."
    ])
    if character.story["denvar"]["knows_name"]:
        print_stuff([
            f""""Greetings, {character.character["firstname"]}," {denvar} says warmly. "How may I help you?" """
        ])
    else:
        print_stuff([
            f""""Greetings, traveller," {denvar} says warmly. "How may I help you?" """
        ])
    ability.heal(15)
    print_stuff([
        f"Quickly, you usher {tamara} inside, but {micha} is shaking his head.",
        f""""I'm shall return to {blackburrow}," he says. "I've had enough madness for one day." After a brief farewell, {micha} leaves alone, descending the mountain. """,
        f"The next thing you know, you and {tamara} are sitting at a table with bowls of steaming meat stew. {denvar} crouches by the fireplace, coaxing a small blaze.",
        f"The stew restores 15 health!", f"""{tamara} looks up at you."""
    ])
    if character.story["tamara"]["name_known"] != tamara:
        print_stuff([
            f""""I should probably introduce myself," she says. "I'm {tamara}." """
        ])
    print_stuff(
        [f"What's your name, {character.character['titles']['casual']}?"])
    choice = input_stuff(
        f"""1. "I'm {character.character['firstname']}." 
2. "I'm not sure I trust you." 
> """, ["1", "2"])
    if choice == "2":
        print_stuff([
            f"""{tamara} raises an eyebrow. "I can't trust you unless you trust me with your name," she warns. Reluctantly, you tell her your name."""
        ])
    print_stuff([
        f""""I'm glad you told me... {character.character['firstname']}," {tamara} says kindly. "Do you have any questions for me?" """
    ])
    while True:
        quest = colour_it("I have no further questions.", Color.QUEST)
        daughters = colour_it("Daughters of Chaos", Color.ENEMY)
        question = input_stuff(
            f"""1. "Who were those people?" 
2. "Why did you save me?" 
3. "Who are you?"
4. "You're dressed as those women are. Yet you oppose them?"
5. "{quest}" 
> """, ["1", "2", "3", "4", "5"])
        if question == "1":
            print_stuff([
                f""""They're called the {daughters}," {tamara} says. "An organisation that wants humanity to return to the old ways of hunting and gathering." """,
                """"They are not evil. They are... misguided. And at the moment their leader is more fanatical and insane than any other before them." """
            ])
        elif question == "2":
            print_stuff([
                f"""{tamara} shrugs. "I figured you could help me. I've been following the {daughters} for a while. I stumbled upon you, and..." Tamara pauses awkwardly. """,
                """"I figured you could help me. You look like the fighting sort, so you're exactly what I need." """
            ])
        elif question == "3":
            print_stuff([
                f""""I've already given you my name," {tamara} says. "I assume your asking what I do in life?" """,
                f""""I have a complicated past, but let's just say I have something personal against the {daughters}." """
            ])
        elif question == "4":
            print_stuff([
                f""""I have their clothes, but I do not follow them. As soon as I have some privacy, I shall change from these garments." """,
                f"""{tamara} laughs. "They were too... exposing for me anyway." """
            ])
            awareness_roll = random.randrange(1, 10)
            if awareness_roll <= ability.ability["awareness"]:
                aware = colour_it("aware", Color.AWARENESS)
                print_stuff([
                    f"You are {aware} enough to notice her use of past tense."
                ])
                choice = input_stuff(
                    """1. "Why do you use past tense?" 
2. Say nothing.
> """, ["1", "2"])
                if choice == "1":
                    print_stuff([
                        f"""You see {tamara} give a start. "No reason," she says quickly. "Or at least, a reason that I do not wish to reveal currently." """
                    ])
        elif question == "5":
            break
    print_stuff([
        f"Suddenly, you hear the sound of footsteps. {tamara} jumps to her feet and runs to the window.",
    ])
    enemy_round.initialize([encounters.monster_access("chaos_daughter")])
    if post_combat.victory == False:
        ability.ability["health"] = (ability.ability["maxhealth"] / 2)
        print_stuff([
            f"The light returns to your vision and you see {tamara}'s face looking down at you",
            """"That was quite a hit you took," she says cheekily. She offers her hand to you to help you up.s"""
        ])
        choice = input_stuff("""1. Take her hand.
2. Get up by yourself.
> """, ["1", "2"])
        if choice == "1":
            print_stuff([
                f"""You take {tamara}'s hand, and she pulls you to your feet, with surprising strength for someone of her build."""
            ])
        elif choice == "2":
            print_stuff([
                f"You get to your feet without taking {tamara}'s hand. She gives you a look but says nothing."
            ])
        print_stuff([
            f"""You look around and see the bodies of the two {daughters} with deep lacerations on them. "My handiwork," {tamara} says. """,
            """"Don't worry though. I forgive you." But you can tell she's joking. """
        ])
    print_stuff([f"After the fight, you return to {denvar}'s cabin to rest."])
    rest.rest()
    print_stuff([
        f""""We should return to {blackburrow} also," {tamara} says. "There is much to discuss." """,
        f"""After bidding {denvar} farewell and descend the mountain carefully, returning to the trail and making your way back to {blackburrow}."""
    ])
Ejemplo n.º 10
0
def beginning():
    save('chapter2.beginning')
    elfa = colour_it("Elfa", Color.NPC)
    micha = colour_it("Micha", Color.NPC)
    print_stuff([
        "You wake up, your head throbbing painfully. You hear voices, but they are echoing and far away. You look around and find yourself sitting in a large cage.",
        "The cage itself is made of wood, but all your belongings are gone. The wooden cage's bars and supports are thick, and you cannot break them.",
        "To your left is a man and a woman. Each looks only sixteen, and each is covered in blood. It only takes you a moment to realise two things.",
        f"These must be {micha} and {elfa}, the baron's children. You also realise that {elfa} is dead. {micha} looks like he's on his last legs also."
    ])
    choice = input_stuff(f"""1. Approach {micha}.
2. Wait. 
> """, ["1", "2"])
    if choice == "1":
        print_stuff([
            f"You approach {micha} and sit down next to him. He turns to you, and you see his eyes are red and puffy from tears.",
            """"What do you want?" he asks, almsot a bit angrily. """
        ])
        reply = input_stuff(
            """1. "We're in a bit of a sticky situation, aren't we?"
2. "Are you Micha?" 
> """, ["1", "2"])
        if reply == "1":
            print_stuff([
                f"""{micha} smiles slightly. "We are indeed," he says with cold humour."""
            ])
        elif reply == "2":
            print_stuff([
                f""""I am. Have you been sent to look for me?" {micha} sighs. "Then this is my fault, {character.character['titles']['casual']}." """
            ])
        print_stuff([
            f"""{micha} looks over to {elfa}'s body, and sighs sadly. "If you came here for us..." he starts, then swallows and turns away."""
        ])
        while True:
            quest = colour_it(""""Don't worry; we'll get through this." """,
                              Color.QUEST)
            question = input_stuff(
                f"""1. "Who are these people?"
2. "What are you doing on the mountain?"
3. "What's the escape plan?"
4. {quest}
> """, ["1", "2", "3", "4"])
            if question == "1":
                print_stuff([
                    f"""{micha} shakes his head. "I don't have a clue," he says. "{elfa} and I were treasure hunting." """,
                    """"Found this cavern, but soon after us, these women came. They took us prisoner and began to search the place, gathering all the treasures they found." """,
                    f""""I asked them who they were and why they were here, but got no response. {elfa} insisted that they talked to her and..." He breaks of suddenly and swallows. """
                ])
            elif question == "2":
                print_stuff([
                    """"Treasure hunting, as father no doubt told you. There were tales of treasure, but all it has brought me is misery." """
                ])
            elif question == "3":
                print_stuff([
                    f""""There is none. I've tried many things, but nothing has yielded anything resembling success." {micha} sighs sadly.""",
                    f""""{elfa} would have figured something out," he murmurs. He turns his head away."""
                ])
                choice = input_stuff(
                    """1. "I'm sorry for your loss." 
2. "Toughen up. There's nothing you can do for her."
3. Say nothing. 
> """, ["1", "2", "3"])
                if choice == "1":
                    print_stuff([
                        f"""{micha} nods. "I'm sorry too. I shouldn't let my grief dampen both of our spirits." """
                    ])
                elif choice == "2":
                    print_stuff([
                        f"""{micha} glares at you. "If you had any loved ones to lose, you wouldn't be saying that," he snaps. """
                    ])
            elif question == "4":
                print_stuff([
                    f"""{micha} smiles weakly and closes his eyes. "I trust you, whoever you are," he says softly. Suddenly, he gives a start and looks over your shoulder. """
                ])
                break
    print_stuff([
        "One of the women approach you now. But there is something different about this one."
    ])
    awareness_roll = random.randrange(1, 7)
    if awareness_roll <= ability.ability["awareness"]:
        print_stuff([
            f"You are {colour_it('aware', Color.AWARENESS)} enough to notice that her eyes are darting, and she looks nervous."
        ])
    else:
        print_stuff([
            f"You are not {colour_it('aware', Color.AWARENESS)} enough to figure out the discrepancy."
        ])
    print_stuff([
        "The woman has mousy brown hair tied in a ponytail, and round, blue eyes. She, too, has a curved sword.",
        "The woman approaches the locked door, and pulls a key from the leg of her tights. Looking around cautiously, she begins to unlock the cage.",
        f"At this, {micha} moves forwards and opens his mouth to speak, but the woman pushes a finger to her lips. Slowly, the cage door opens.",
        f"She pulls two backpacks from behind a rock, one of them you recognise as yours. She tosses it to you, and throws the other to {micha}.",
        f""""We must leave this place," she says quietly. "Swiftly now!" """
    ])
    choice = input_stuff("""1. Follow the woman.
2. Stay where you are.
> """, ["1", "2"])
    if choice == "2":
        print_stuff([
            f"You stay put as {micha} and the woman run silently from the cavern. It is not long before some of the strangely dressed women find you.",
            "Furious at your escape, they attack without mercy. You are beaten down by a barrage of blows, with far too many opponents and no time to react."
        ])
        exit()
    print_stuff([
        f"You run silently beside {micha} and behind the woman. She leads you through the cavern, mirroring the route you took. Within minutes, you are under the open sky.",
        f""""We must get off the mountain," says the woman rapidly. She looks between both you and {micha}. "Do either of you have a quick way of descending?" """
        f"""{micha} shakes his head, and the woman turns to you."""
    ])
    while True:
        if character.story["denvar"]["exists"]:
            choice = input_stuff(
                """1. "Unfortunately not." 
2. "Slow down. Who are you?"
3. "No, but I know a man named Denvar who may help us." 
> """, ["1", "2", "3"])
        else:
            choice = input_stuff(
                """1. "Unfortunately not." 
2. "Slow down. Who are you?" 
> """, ["1", "2"])
        if choice == "1":
            print_stuff([
                f"""{character.story['tamara']['name_known'].capitalize()} curses under her breath. "Then we must move quickly. They could be onto us at any moment." """
            ])
            break
        elif choice == "2":
            tamara = colour_it("Tamara", Color.NPC)
            print_stuff([
                f"""{character.story['tamara']['name_known'].capitalize()} gives an impatient groan. "I'm {tamara}, if you insist," she says finally. """
            ])
            character.story["tamara"]["name_known"] = tamara
        elif choice == "3":
            print_stuff([
                f"""{character.story['tamara']['name_known'].capitalize()} lifts an eyebrow. "Then let us meet this Denvar." """
            ])
            descent = "chapter2.descentb"
            break
Ejemplo n.º 11
0
def descenta():
    micha = colour_it("Micha", Color.NPC)
    blackburrow = colour_it("Blackburrow", Color.PLACE)
    tamara = colour_it("Tamara", Color.NPC)
    print_stuff([
        f"""{character.story['tamara']['name_known'].capitalize()} nods. "At least let us begone from this mountain," she says. "Even if the journey is long and hard." """,
        """The three of you descend the mountain, haste making the journey a lot quicker. You meet with no dangers on the way down, and no one speaks.""",
        f"""As you put distance between yourselves and the cave, you see {character.story['tamara']['name_known']}'s face begin to relax.""",
        """Suddenly, you've reached the base of the mountain. Already the air is warmed, and you feel far more relaxed, though questions still swim in your mind.""",
        f""""I'm going back to {blackburrow}," {micha} says. "To get some rest." He looks to both you and {character.story['tamara']['name_known']}. "Thank you. Both of you." """,
        f"""{micha} begins walking back towards {blackburrow}. {character.story['tamara']['name_known'].capitalize()} watches {micha} disappear along the trail. Then she turns to you."""
    ])
    if character.story["tamara"]["name_known"] != colour_it(
            "Tamara", Color.NPC):
        print_stuff([
            f""""I should probably introduce myself," she says. "I'm {tamara}." """
        ])
    print_stuff(["What's your name?"])
    choice = input_stuff(
        f"""1. "I'm {character.character['firstname']}." 
2. "I'm not sure I trust you." 
> """, ["1", "2"])
    if choice == "2":
        print_stuff([
            f"""{tamara} raises an eyebrow. "I can't trust you unless you trust me with your name," she warns. Reluctantly, you tell her your name."""
        ])
    print_stuff([
        f""""I'm glad you told me... {character.character['firstname']}," {tamara} says kindly. "Do you have any questions for me?" """
    ])
    while True:
        quest = colour_it("I have no further questions.", Color.QUEST)
        daughters = colour_it("Daughters of Chaos", Color.ENEMY)
        question = input_stuff(
            f"""1. "Who were those people?" 
2. "Why did you save me?" 
3. "Who are you?"
4. "You're dressed as those women are. Yet you oppose them?"
5. "{quest}" 
> """, ["1", "2", "3", "4", "5"])
        if question == "1":
            print_stuff([
                f""""They're called the {daughters}," {tamara} says. "An organisation that wants humanity to return to the old ways of hunting and gathering." """,
                """"They are not evil. They are... misguided. And at the moment their leader is more fanatical and insane than any other before them." """
            ])
        elif question == "2":
            print_stuff([
                f"""{tamara} shrugs. "I figured you could help me. I've been following the {daughters} for a while. I stumbled upon you, and..." Tamara pauses awkwardly. """,
                """"I figured you could help me. You look like the fighting sort, so you're exactly what I need." """
            ])
        elif question == "3":
            print_stuff([
                f""""I've already given you my name," {tamara} says. "I assume your asking what I do in life?" """,
                f""""I have a complicated past, but let's just say I have something personal against the {daughters}." """
            ])
        elif question == "4":
            print_stuff([
                f""""I have their clothes, but I do not follow them. As soon as I have some privacy, I shall change from these garments." """,
                f"""{tamara} laughs. "They were too... exposing for me anyway." """
            ])
            awareness_roll = random.randrange(1, 10)
            if awareness_roll <= ability.ability["awareness"]:
                aware = colour_it("aware", Color.AWARENESS)
                print_stuff([
                    f"You are {aware} enough to notice her use of past tense."
                ])
                choice = input_stuff(
                    """1. "Why do you use past tense?" 
2. Say nothing.
> """, ["1", "2"])
                if choice == "1":
                    print_stuff([
                        f"""You see {tamara} give a start. "No reason," she says quickly. "Or at least, a reason that I do not wish to reveal currently." """
                    ])
        elif question == "5":
            break
    print_stuff([
        f"Suddenly, {tamara} looks over your shoulder and draws her sword. You turn around and see two {daughters} walking towards you.",
        f""""I'll take one," {tamara} says quickly. The {daughters} run forwards, swords in hand. {tamara} lunges towards one of them."""
    ])
    enemy_round.initialize([encounters.monster_access("chaos_daughter")])
    if post_combat.victory == False:
        ability.ability["health"] = (ability.ability["maxhealth"] / 2)
        print_stuff([
            f"The light returns to your vision and you see {tamara}'s face looking down at you",
            """"That was quite a hit you took," she says cheekily. She offers her hand to you to help you up.s"""
        ])
        choice = input_stuff("""1. Take her hand.
2. Get up by yourself.
> """, ["1", "2"])
        if choice == "1":
            print_stuff([
                f"""You take {tamara}'s hand, and she pulls you to your feet, with surprising strength for someone of her build."""
            ])
        elif choice == "2":
            print_stuff([
                f"You get to your feet without taking {tamara}'s hand. She gives you a look but says nothing."
            ])
        print_stuff([
            f"""You look around and see the bodies of the two {daughters} with deep lacerations on them. "My handiwork," {tamara} says. """,
            """"Don't worry though. I forgive you." But you can tell she's joking. """,
            f""""We should return to {blackburrow}," {tamara} says. "There is much to discuss." """,
            f"""You descend the mountain carefully, returning to the trail and making your way back to {blackburrow}."""
        ])
Ejemplo n.º 12
0
def strike(enemy, damage_mod=1.0, smoke=False, bonus=0, critical_bonus=10):
    global buffs
    damage_bonus = bonus
    critical = critical_bonus
    bleeding = 20
    bleed_lvl = 1
    vampiric = False
    agility_check = 30
    reference = enemy["reference"]
    attacks = [known for known in weapon.weapon["attacks"] if known['enabled']]
    prompt = ""
    counter = 0
    options = []
    for attack in attacks:
        counter += 1
        prompt = prompt + str(
            counter) + ". " + attack["name"] + attack["description"] + """
"""
        options.append(str(counter))
    prompt = prompt + "> "
    attack = input_stuff(prompt, options)
    if attack == "2":
        enemy["playermod"] -= 10
        damage_mod += 0.5
    elif attack == "3":
        enemy["playermod"] += 10
        damage_mod -= 0.25
    elif attack == "4":
        enemy["playermod"] -= 10
        damage_mod += 1
        bleeding = 1000
        bleed_lvl = 2
    elif attack == "5":
        damage_mod -= 0.25
        agility_check = 1000
    elif attack == "6":
        damage_mod -= 0.25
        vampiric = True

    initial_script = [
        "You lunge forward suddenly, sword leading the way.",
        "You swiftly close the distance between you and your adversary, weapon raised high.",
        f"""You rush towards {reference["object"]}, sword grasped firmly.""",
        f"You approach {reference['object']}, attacking when you are only a few paces away.",
        f"Your opponent jumps towards you. You parry the blow easily, spin your sword, and riposte swiftly.",
        f"You charge forwards, spin on one foot, and bring your sword crashing down on {reference['object']}.",
        "Your opponent moves to attack, but stumbles on some irregular terrain. You seize your chance and lunge forwards."
    ]
    success_script = [
        f"You feel the tip of your sword bury in your enemy's flesh, accompanied by a {reference['pain']} of pain.",
        "Your opponent tries to duck away from the blow, but you feel a bit of resistance, and see a spurt of blood.",
        f"""You're too fast for your opponent. {reference['he'].capitalize()} raises {reference['his']} defenses weakly, but you easily bat away the blockage and cut into {reference["him"]} with your sword deeply.""",
        f"""You twirl your sword in a silver spiral, feeling with satisfaction as the sword bites deeply into {reference["object"]}.""",
        f"{reference['object'].capitalize()} readies {reference['him']}self for your attack. At the last second you duck and roll behind {reference['him']}, under {reference['his']} guard and slash {reference['him']} across the back.",
        f"You enemy tries to step backwards, but {reference['his']} heel hits a raised section of ground. {reference['he'].capitalize()} staggers, and you slash {reference['him']} easily.",
        f"With a deft sword movement you explode into action, striking with your whirling sword, spilling the blood of {reference['object']}."
    ]
    fail_script = [
        "Your sword slices through the air, but meets nothing as your adversary sidesteps",
        "You swing your sword in a cruel lateral strike, but your opponent ducks just in time, the wind chasing the blade making a whistling sound.",
        f"""You swing your sword downwards, grunting with the effort. {reference["object"].capitalize()} jumps back at the last second, the tip of your sword barely a inch from {reference["his"]} body."""
    ]
    agility_script = [
        "You're quick enough to strike a second time.",
        "You bring your blade back quickly for a second attempt.",
        "You spin with the momentum of the sword, whirling and attacking again swiftly."
    ]
    parry_script = [
        f"You swing your sword, but {reference['object']} is ready, dodging sideways at the last second.",
        f"As you charge forwards, {reference['object']} slams into you, pushing you back, staggering."
    ]
    if enemy["type"] == "human":
        success_script.extend([
            f"{reference['he'].capitalize()} moves to block your blow, but you bring your foot up suddenly in a kick. Then you strike, {reference['his']} staggering form an easy victim to your blade.",
            f"""You feel your sword find its target, and hear a scream of pain. "A pox on you!" {reference['object']} spits. """
        ])
        fail_script.extend([
            f"There's the ring of steel on steel as {reference['object']} brings {reference['his']} sword up just in time.",
            f"""{reference['object'].capitalize()} pushes your attack aside and grins wickedly. "What now, you {reference['insult']}?" {reference['he']} hisses. """
        ])
    print(random.choice(initial_script))
    time.sleep(5)
    counter = 0
    agility_roll = random.randrange(1, 101)
    attacks = 1
    if agility_roll <= (agility_check + (ability.ability["agility"])):
        attacks = 3
    if smoke:
        attacks = 4
        counter = -1
    while counter < attacks:
        damage_multi = damage_mod
        roll = random.randrange(1, 101)
        if roll <= (75 + (ability.ability["strength"] * 1.5) +
                    enemy["playermod"] - enemy["agility"]):
            print(random.choice(success_script))
            time.sleep(5)
            if roll <= (critical + (weapon.weapon["finesse"] * 2) +
                        ability.ability["strike_lvl"] + (buffs[1] * 5)):
                print("The strike was well aimed, and scored a critical hit!")
                time.sleep(3)
                damage_multi += 1
            if roll <= (
                    bleeding +
                (weapon.weapon["sharpness"] + ability.ability["strength"])):
                enemy["bleeding"] += bleed_lvl
                print("Your attack cuts deep, and causes your enemy to bleed!")
                time.sleep(4)
            min_damage = int((ability.ability["strength"] / 2) * damage_multi)
            max_damage = int((ability.ability["strength"] + 2) * damage_multi)
            player_damage = random.randrange(
                min_damage,
                max_damage) + ability.ability["strike_lvl"] + weapon.weapon[
                    "sharpness"] + damage_bonus + (buffs[0] * 2)
            if vampiric:
                healing = random.randrange(1, 101)
                if healing <= 50:
                    ability.ability["health"] += player_damage
                    print(
                        f"You regained {player_damage} health from your vampiric attack!"
                    )
                    if ability.ability["health"] > ability.ability["maxhealth"]:
                        ability.ability["health"] = ability.ability[
                            "maxhealth"]
            enemy["hp"] -= player_damage
            print(f"You hit for {player_damage} damage!")
            time.sleep(5)
            weapon.lose_stability()
            counter += 1
        else:
            if enemy["parry"]:
                print(random.choice(parry_script))
                time.sleep(5)
                print("Your enemy parries your blow and counter attacks!")
                time.sleep(3)
                counter += 1
                enemy_round.enemy_attack(enemy)
            else:
                print(random.choice(fail_script))
                time.sleep(5)
                print(f"You miss your attack!")
                time.sleep(5)
                counter += 1
        if attacks == 3:
            attacks -= 1
            print(random.choice(agility_script))
            time.sleep(5)
        elif attacks == 4:
            attacks -= 1
            print(
                "You use the smoke to disappear, then emerge again suddenly.")
            time.sleep(5)
Ejemplo n.º 13
0
def parry(enemy):
    reference = enemy["reference"]
    parries = [known for known in weapon.weapon["parries"] if known['enabled']]
    opportunist = False
    vengeance = False
    prompt = ""
    counter = 0
    options = []
    for parry in parries:
        counter += 1
        prompt = prompt + str(
            counter) + ". " + parry["name"] + parry["description"] + """
"""
        options.append(str(counter))
    prompt = prompt + "> "
    parry = input_stuff(prompt, options)
    if parry == "2":
        opportunist = True
    elif parry == "3":
        vengeance = True
    initial_script = [
        "You raise your sword in a defensive position.",
        "You brace yourself for your charging adversary, ready and waiting",
        f"You bring your sword to bare, watching {reference['object']} closely."
    ]
    success_script = [
        f"Your enemy runs forward, but at the last second you kick {reference['him']} back, knocking the breath from {reference['his']} body.",
        f"{reference['he'].capitalize()} runs forward suddenly, but you are ready. {reference['his'].capitalize()} attack is caught on your sword and you twirl the blade swifty, knocking {reference['him']} off balance.",
        f"As your opponent charges, you sidestep. {reference['he'].capitalize()} runs straight past you, back exposed, almost asking to be slashed.",
        f"""{reference['object'].capitalize()} attacks, but you spin away from the blow, ending your twirl on your opponent's flank.""",
        f"Your adversary closes in, but at the last second you lunge forwards, slamming your shoulder into {reference['him']}. {reference['he'].capitalize()} stumbles backwards, sputtering for breath."
    ]
    fail_script = [
        "You raise your sword against the expected attack, but it comes quicker than you thought. You feel a cut upon your face.",
        "Your opponent rushes forwards. You try and duck to the side at the last second, but are too slow. Pain racks your body and you jump away, cursing.",
        "You deflect the first attack, but the second comes in quicker than you can react. You manage to avoid the worst of the blow, but still, it hurts."
    ]
    print(random.choice(initial_script))
    enemy["modifier"] -= (10 + ability.ability["agility"] +
                          ability.ability["parry_lvl"])
    enemy_roll = random.randrange(1, 101)
    time.sleep(5)
    if enemy_roll <= (enemy["skill"] + enemy["modifier"] -
                      ability.ability['agility']):
        print(random.choice(fail_script))
        enemy_damage = random.randrange(enemy["mindamage"], enemy["maxdamage"])
        ability.ability["health"] -= enemy_damage
        time.sleep(5)
        print(f"You are hit for {enemy_damage} damage!")
        time.sleep(5)
        enemy_round.player_defeat()
        if vengeance:
            print(
                "You shrug off the pain and lunge forwards in an attempt to take revenge!"
            )
            time.sleep(3)
            strike(enemy, bonus=enemy_damage)
        turn(enemy)
    else:
        print(random.choice(success_script))
        time.sleep(5)
        print("Your parry succeeds and you riposte!")
        time.sleep(3)
        if opportunist:
            turn(enemy)
            return False
        if vengeance:
            strike(enemy)
        else:
            strike(enemy, damage_mod=1.5)