#------------------------------------------------------------------------------------------------- # Name: Shaun Zeldenrust # Purpose: 11DGT # Date: 2/23/2024 # File: Legends of heros # Copyright @ Shaun Zeldenrust 2024 #------------------------------------------------------------------------------------------------- import time import random def setup() : global name global HP global MP global move global enemyHP setup() HP=random.randint(5,20) MP=random.randint(1,20) armorstat=random.randint(1,20) luck=random.randint(1,8) name=input("What is your name traveler? ") print ("Welcome to Middle Earth, " + name) time.sleep(2) print ("\nYour health is" + " " + str(HP)) print ("Your magic skill level is" + " " + str(MP)) print ("Your defense stat is" +" " + str(armorstat)) print ("Your luck stat is"+" " + str(luck)) print() time.sleep(1) Choice=input("Would you like to venture out into the land? Press y then enter to continue ") while HP > 1 : if Choice == "y": print ("You are in your home, with a roaring fireplace in front of you, above the fire you can see your sword and shield ") print ("Would you like to take your sword and shield? Press y then enter to continue ") if input() == "y": weapons = [] weapons.append("sword") weapons.append("shield") print ("You are now carrying your" + " " + weapons[0] + " " + "and your" + " " + weapons[1]) print ("Armed with your " + weapons[0] + " " + "and " + weapons[1] + " you swing open the door to your home and see a green valley gleaming in the sunshine.") else: print ("You choose not to take your weapons") print ("Armed with your sense of humour, You swing open the door to see a green valley full of opportunity awaiting you.") else: print ("You stay at home, sat in your favourite chair watching the fire grow colder. Middle Earth no longer has a hero.") print ("Game Over")