import random import time while True : pn = input( "What is your superhero name?" ) if pn.isalpha() == True : break else: print( "Please enter a valid string input. J.A.R.V.I.S error " ) #start health SAH = 50 STH = 100 #Player health ah = 0 th = 0 #Damage ts = 0 am = 0 #deflect d = 0 #Choice ac = " " pa = "y" print( "The sky grows darker as the army of Thanos moves closer." ) time.sleep( 2 ) print( "Thor and Tony lie battered and motionless on the ground from the previous encounter." ) time.sleep( 3 ) print( "It is up to you, Cap, to finish this. The fate of the universe is your weight to bare." ) time.sleep( 3.5 ) print("You stand there, hurt. But you have your shield in arm hand and wield Johnathan in the other." ) time.sleep( 4 ) print( "You are worthy, but will the power of Thor be enough...." ) time.sleep( 3 ) print( "You are in the ENDGAME now" ) time.sleep( 1 ) while pa == "y" : while True : try : ah = int( input( "Select a health amount for {} between 50 and 80... " ) ) if ah < 50 or ah > 80 : print() print( "Please select an amount between 50 and 80" ) else : break except : print() print( "That is not a number.. you may need some additional tutoring from Mr Stark or Banner" ) th = STH while th > 0 : time.sleep( 1 ) print( ) print( "Current Health" ) print( "Cap has {} HP...".format(ah) ) print( "Thanos has {} HP...".format(th) ) time.sleep(2) print( ) print( "What do you choose?.." ) print( "[a]ttack with Johnathan" ) print( "or" ) print( "[d]efend with your shield" ) ac = input( "Your choice?... " ) print() if ac == "a" : ts = random.randint( 1, 20 ) print( "Thanos attacks you with his double bladed sword and deals {} damage".format( ts ) ) ah = ah - ts if ah < 1: break time.sleep( 1 ) am = random.randint( 1, 20 ) print( "You attack back with Johnathan in hand dealing {} damage in return".format( am ) ) th = th - am time.sleep( 1 ) else: print( "Thanos attacks you with his double bladed sword..." ) print( "You raise your shield and deflect to deflect the blow..." ) time.sleep( 1 ) d = random.randint( 1, 2 ) if d == 1 : ts = random.randint( 1, 20 ) print( "You were to slow in raising your shield and Thanos strikes you with his sword for {} damage".format( ts ) ) ah = ah - ts if ah < 1 : break time.sleep( 1 ) else: ts = random.randint(1, 20) print( "Thanos' sword rebounds off Caps vibranium shield and he deals himself {} damage".format( ts ) ) thanos_health = th - ts time.sleep( 1 ) if ah < 1: print() print( "Thanos is too strong. He has broken your shield and cut you down. This is the end of all life in our universe..." ) pa = input( "Do you want to play again? [y]es or [n]o" ) else: print() print( "Thanos has fallen!" ) time.sleep( .5 ) print( "You drop to your knees, exhausted." ) time.sleep( .5 ) print( "You stare out into a grateful universe." ) time.sleep( 1 ) print( "It is safe..." ) time.sleep( 3 ) print( " ..For now..." ) time.sleep( 5 ) pa = input( "Do you want to play again? [y]es or [n]o" ) time.sleep( 2 ) print( "Thanks for playing my game! ^^" )