def riverwoodvisit(): separate() printslow("Riverwood is a small town, only a short ride from Whiterun,") time.sleep(1) printslow("There are only three areas of interest in this town:") time.sleep(0.5) printslow("Riverwood Blacksmith *Not Available*") printslow("The Sleeping Giant Inn") printslow("The Riverwood Trader *Not Available*") while True: ans = str(input(inputslow("Where would you like to go? "))) if ans.lower( ) == "the sleeping giant inn" or "inn" or "sleeping giant inn" or "the inn": printslow("You have chosen to go to the Sleeping Giant Inn") separate() time.sleep(1.5) printslow("You enter the Sleeping Giant Inn") sleepinggiantinn() break elif ans.lower( ) == "the blacksmith" or "riverwood blacksmith" or "blacksmith": printslow("This area is not available yet, please select another.") separate() break elif ans.lower( ) == "the riverwood trader" or "trader" or "riverwood trader": printslow("This area is not available yet please select another,") separate() break else: printslow("That is not a place in Riverwood, dragonborn.") separate()
def dragonattack(): separate() printslow("As you are travelling down the road,") time.sleep(0.5) printslow("you hear a bone-chilling roar,") printslow("and a shadow passes over your head") time.sleep(0.5) printslow("The unmistakable shape of a Dragon!") separate() time.sleep(1) while True: ansb = str( input( inputslow( """Are you going to face this monster?\nYes or No """))) if ansb.lower() == "yes" or answer.lower() == "y": printslow("To Battle!!") dragonbattle() break elif ansb.lower() == "no" or answer.lower() == "n": printslow("Retreat!!!") break else: printslow("Answer Me!")
def rwevent(): printslow("You chose to head to Riverwood") separate() time.sleep(1) printslow("You set off from your travels to Riverwood") time.sleep(0.25) printslow("a scenic town in a valley,") time.sleep(0.25) printslow("surrounded by huge mountains") time.sleep(2) rwrandomevents() separate() printslow("You have arrived in Riverwood") riverwoodvisit()
from slowprints import printslow, inputslow, separate, ps from skyrimarrays import races, places from riverwood import rwevent, rwrandomevents, dragonattack from battles import dragonbattle from random import * from playerinfo import player import time, sys def RNG(): global rng rng = randrange(0, 100) separate() time.sleep(1) printslow("Welcome to Skyrim: Python Edition") time.sleep(1) while True: #while loop allows the code to repeat if they do not write a correct answer answer = str(input(inputslow("Would you like to play? "))) if answer.lower() == "yes" or answer.lower() == "y": printslow("On your way then") break elif answer == "no" or answer.lower() == "n": printslow("Begone from this land") sys.exit() else: printslow("Answer me.")
def sleepinggiantinn(): #printslow("You enter the Sleeping Giant Inn and see there are 4 interesting people.") separate() time.sleep(0.7) while True: printslow("There are 4 interesting people") printslow("There is the Innkeeper") printslow("There is the Shady figure in the corner of the room") printslow("There is the Guard by the hearth") printslow("There is the bard, playing her lute and singing") separate() time.sleep(0.5) printslow("Who would you like to talk to?") persans = str("") persans = str(input(inputslow("Answer: "))) if persans.lower() == "innkeeper" or persans.lower( ) == "the innkeeper": separate() time.sleep(0.5) printslow("You have chosen to speak to the Innkeeper") separate() printslow( """You approach the Innkeeper, she is busy cleaning a tankard. "Hello """ + player.race + """, my name is Delphine, how can I help you?" (1) I would like to rent a room. (2) Heard any rumours lately? (3) Who is that man in the corner? """) separate() choice = input(inputslow("Choice: ")) if choice == "1": printslow("Okay! Your room is on the right there.") separate() time.sleep(3) printslow("You wake up the next morning feeling well rested.") time.sleep(1) separate() elif choice == "2": separate() printslow( """"I believe that there are a high quantity of bandits on the road to Whiterun, I would be careful if I was you." """ ) elif choice == "3": separate() printslow( """"I don't know friend. He pays, so i dont ask questions" """ ) else: ps("Please enter the correct number") elif persans.lower( ) == "shady" or persans.lower() == "the shady figure" or persans.lower( ) == "shady figure" or persans.lower() == "mr slim shady": separate() time.sleep(0.5) ps("You have chosen to speak to the Shady Figure in the corner of the room." ) separate() ps("""You approach the shady figure, he sees you coming and stares at you. "Get away if you want to live, """ + player.race + """" """ + "You decide it's best to leave him be.") elif persans.lower() == "bard" or persans.lower() == "the bard": separate() time.sleep(0.5) ps("You have chosen to speak to the Bard, playing her lute and singing." ) separate() ps("""You approach the bard, she see you coming. She stares at you while shes singing, and gestures for you to get lost, You decide its best to leave her alone.""") elif persans.lower() == "the guard" or persans.lower( ) == "guard" or persans.lower( ) == "the guard by the hearth" or persans.lower( ) == "guard by the hearth": separate() time.sleep(0.5) ps("You have chosen to speak to the Guard by the hearth") separate() while True: quote = randrange(1, 10) if quote == 1: ps(""" You approach the guard, he looks bored. "I'd be a lot warmer and a lot happier with a bellyful of mead..." He then stares at you blankly.""") if quote == 2: ps("""You approach the guard, he looks in pain. "I used to be an adventurer like you. Then I took an arrow in the knee..." He then stares at you blankly.""") if quote == 3: ps("""You approach the guard, he looks bored. "No lollygaggin'." He then stares at you blankly.""") if quote == 4: ps("""You approach the guard, he looks angry. "Let me guess... someone stole your sweetroll." He then stares at you blankly.""") if quote == 5: ps("""You approach the guard, he looks bored. "My cousin's out fighting dragons, and what do I get? Guard duty." He then stares at you blankly.""") if quote == 6: ps("""You approach the guard, he looks concerned. "What is it? Dragons?" He then stares at you blankly.""") if quote == 7: ps("""You approach the guard, he looks angry. "Disrespect the law, and you disrespect me." He then stares at you blankly.""") if quote == 8: ps("""You approach the guard, he looks anxious. "Gotta keep my eyes open. Damn dragons could swoop down at any time." He then stares at you blankly.""") if quote == 9: ps("""You approach the guard, he looks anxious; "Fear not. Come dragon or giant, we'll be ready." He then stares at you blankly.""") if quote == 10: ps("""You approach the guard, he looks disinterested. "I mostly deal with petty thievery and drunken brawls. Been too long since we've had a good bandit raid." He then stares at you blankly""") separate() ps("Would you like to interact with him again? \nYes or No") answer = str(input(inputslow("Answer: "))) if answer.lower() == "yes" or answer.lower() == "y": ps("You speak to the Guard again") separate() elif answer.lower() == "no" or answer.lower() == "n": ps("You have chosen to not speak to the Guard again") break else: ps("I'll take your weird answer as a no") break separate() ps("Would you like to talk to another person?\nYes or No") answer = str(input(inputslow("Answer: "))) if answer.lower() == "yes" or answer.lower() == "y": ps("You have chosen to talk to people again.") separate() continue elif answer.lower() == "no" or answer.lower() == "n": ps("You exit the Inn") break else: ps("I'll take your weird answer as a no") break ps("You have exited the inn")
def dragonbattle(): drnum = randrange(1, 10) import playerinfo player1 = player(player.name, player.race, 100) playerhp = player1.hp if drnum <= 4: dragon = dragons("Fire Dragon", 120) global dragonname dragonname = dragon.name dragonhp = dragon.hp if drnum > 4 and drnum <= 10: dragon = dragons("Ice Dragon", 120) dragonname = dragon.name dragonhp = dragon.hp if drnum < 8 and drnum <= 10: dragon = dragons("Legendary Dragon", 160) dragonname = dragon.name dragonhp = dragon.hp separate() ps("The enemy is a " + dragon.name + "!") time.sleep(0.5) playerhp = str(playerhp) printslow('''You have ''' + playerhp + '''HP, and you carry a sword, a bow with arrows, and can cast fireball spells.''') playerhp = int(playerhp) time.sleep(0.5) separate() printslow("Sword, has a medium hit chance, and does medium damage,") time.sleep(0.5) printslow( "Bow and Arrow, has a very high hit chance, but does less damage,") time.sleep(0.5) printslow("Fireball, has a lower hit chance, but does higher damage.") separate() time.sleep(0.5) printslow("The " + dragon.name + " swoops in, slashing with its claws, but they just miss.") separate() while True: time.sleep(0.5) while True: separate() printslow("You attack, what are you going to attack with?") time.sleep(0.5) printslow("Sword") time.sleep(0.4) printslow("Bow") time.sleep(0.4) printslow("Fireball") time.sleep(0.2) atkans = str(input(inputslow("Attack: "))) if atkans.lower() == "sword": RNG() if rng <= 75: dragonhp = int(dragonhp - sworddmg) dragonhp = str(dragonhp) printslow("Your attack hit! The " + dragonname + " is now on " + dragonhp + "HP.") time.sleep(0.5) dragonhp = int(dragonhp) dmg = int(randrange(1, 15)) playerhp = int(playerhp - dmg) playerhp = str(playerhp) dmg = str(dmg) printslow("The dragon strikes you back for " + dmg + " damage! You are now on " + playerhp + "HP.") dmg = int(dmg) playerhp = int(playerhp) break else: printslow("Your attack has missed!") dmg = int(randrange(1, 20)) playerhp = int(playerhp - dmg) playerhp = str(playerhp) dmg = str(dmg) printslow("The dragon strikes you for " + dmg + " damage! You are now on " + playerhp + "HP.") playerhp = int(playerhp) dmg = int(dmg) break elif atkans.lower() == "bow": RNG() if rng <= 90: dragonhp = int(dragonhp - 10) dragonhp = str(dragonhp) printslow("Your attack hit! The " + dragonname + " is now on " + dragonhp + "HP.") dragonhp = int(dragonhp) time.sleep(0.5) dmg = int(randrange(1, 15)) playerhp = int(playerhp - dmg) playerhp = str(playerhp) dmg = str(dmg) printslow("The dragon strikes you back for " + dmg + " damage! You are now on " + playerhp + "HP.") dmg = int(dmg) playerhp = int(playerhp) break else: printslow("Your attack has missed!") dmg = int(randrange(1, 20)) playerhp = int(playerhp - dmg) playerhp = str(playerhp) dmg = str(dmg) printslow("The dragon strikes you for " + dmg + " damage! You are now on " + playerhp + "HP.") playerhp = int(playerhp) dmg = int(dmg) break elif atkans.lower() == "fireball": RNG() if rng <= 60: dragonhp = int(dragonhp - firedmg) dragonhp = str(dragonhp) printslow("Your attack hit! The " + dragonname + " is now on " + dragonhp + "HP.") dragonhp = int(dragonhp) time.sleep(0.5) dmg = int(randrange(1, 15)) playerhp = int(playerhp - dmg) playerhp = str(playerhp) dmg = str(dmg) printslow("The dragon strikes you back for " + dmg + " damage! You are now on " + playerhp + "HP.") dmg = int(dmg) playerhp = int(playerhp) else: printslow("Your attack has missed!") dmg = int(randrange(1, 20)) playerhp = int(playerhp - dmg) playerhp = str(playerhp) dmg = str(dmg) printslow("The dragon strikes you for " + dmg + " damage! You are now on " + playerhp + "HP.") playerhp = int(playerhp) dmg = int(dmg) break elif atkans == "admin.command.end": playerhp = 0 break elif atkans == "admin.command.win": dragonhp = 0 break else: printslow("Choose your method of attack, Dragonborn!") if dragonhp < 0 or dragonhp == 0 or playerhp < 0 or playerhp == 0: break if playerhp <= 0: separate() printslow("No! The " + dragonname + " has defeated you!") time.sleep(1.5) printslow("GAME OVER!") time.sleep(0.4) printslow("Program closing in:") print("3") time.sleep(1) print("2") time.sleep(1) print("1") time.sleep(1) printslow("bye!") sys.exit() if dragonhp <= 0 or dragonhp == 0: separate() printslow("The dragon crashes to the ground, defeated!") time.sleep(0.8) printslow("Congratulations! You killed the " + dragonname + "!") separate() time.sleep(0.5) ps("You start to absorb the " + dragonname + "'s soul.") if dragonname == "Fire Dragon": separate() time.sleep(1) ps("As you absorb the dragon's soul, you feel your fireball spell increasing in power." ) firedmg = firedmg + 5 firedmg = str(firedmg) ps("Instead of doing " + (firedmg - 5) + ", your new and improved spell now does " + firedmg + "!") firedmg = int(firedmg) if dragonname == "Ice dragon": separate() time.sleep(1) ps("As you absorb the dragon's soul, you feel your health increasing." ) playerhp = playerhp + 10 playerhp = str(playerhp) ps("You now have " + playerhp + "HP!") playerhp = int(playerhp) player.hp = playerhp if dragonname == "Legendary Dragon": separate() time.sleep(1) ps("As you absorb the dragon's soul, you feel your health increasing\nand your fireball spell growing in power" ) firedmg = firedmg + 5 playerhp = playerhp + 10 playerhp = str(playerhp) firedmg = str(firedmg) ps("Instead of doing " + (firedmg - 5) + ", your new and improved spell now does " + firedmg + "!") ps("You now have " + playerhp + "HP!") firedmg = int(firedmg) playerhp = int(playerhp) player.hp = playerhp separate() printslow("Would you like to continue, or end the game?") while True: contans = str(input(inputslow("Continue or End? "))) if contans.lower() == "continue": time.sleep(0.4) printslow("Off you go then!") break elif contans.lower() == "end": time.sleep(0.8) printslow("Program closing in:") print("3") time.sleep(1) print("2") time.sleep(1) print("1") time.sleep(1) printslow("bye!") sys.exit() elif contans.lower() == "retry": separate() dragonbattle() break else: printslow("Correct answer please?") time.sleep(0.5)