#--------------------------------------------- # Name : Endgame # Purpose : 11DGT # Author : Eli # Created : 18/02/2025 # Copyright : Eli 18/02/2025 #--------------------------------------------- import random import time while True: player_name = input("what is your superhero name? ") if player_name.isalpha() == True: break else: print("please enter a string input. J.A.R.V.I.S error ") while True: try: HP=int(input("how much HP do you want for {}? ".format(player_name))) if HP < 50 or HP > 80: print("the number must be between 50 and 80") else: break except: print() print("bro you are cooked that isn't a number... you need some help from stark") Start_player_HP= HP Start_thanos_purple_grape_HP= 100 player_HP = 0 thanos_purple_grape_HP = 0 thanos_blade= 0 players_mjolnir = 0 deflect= 0 player_choice = "" play_again = "y" print("Your teamates have been juiced by the purple grape") time.sleep(2) print("the purple grape a.k.a thanos is getting revenge for his grape kind") time.sleep(2) print("you are the last line of defence for human kind") time.sleep(3) print("you either win or everyone is juiced") time.sleep(2.5) print("this is the Endgame") while play_again == "y": player_HP = Start_player_HP thanos_purple_grape_HP = Start_thanos_purple_grape_HP while thanos_purple_grape_HP>player_HP>0: time.sleep(0.5) print() print("current HP") print("{} has {} HP ...".format(player_name,player_HP)) print("thanos purple grape has {} HP..".format(thanos_purple_grape_HP)) time.sleep(1) print() print("What do you choose?..") print("[a]ttack with Mjolnir") print("or") print("[d]efend with your sheild") player_choice = input("your choice?...") print() if player_choice=="a": thanos_blade = random.randint(1,20) print("Thanos the purple grape attacks you with his powerful sword and deals {} damage".format(thanos_blade)) player_HP = player_HP - thanos_blade if player_HP < 1: break players_mjolnir = random.randint(1,20) print("You attack back with mjolnir in hand dealing {} damage in return".format(players_mjolnir)) thanos_purple_grape_HP = thanos_purple_grape_HP - players_mjolnir time.sleep(1) else: deflect = random.randint(1,2) if deflect == 1: thanos_blade = random.randint(1,20) print("you were to distracted from your dead teamates and thanos the purple grape hit you for {} damage".format(thanos_blade)) player_HP = player_HP - thanos_blade if player_HP < 1: break else: thanos_blade=random.randint(1,20) print("Thanos' blade decided not to work and hit himself instead doing {} damage".format(thanos_blade)) thanos_purple_grape_HP = thanos_purple_grape_HP - thanos_blade time.sleep(1) if player_HP < 1: print() print("You failed! Everyone is juiced!") play_again = input("do you want to play again? [y]es or [n]o..." ) else: print() print("the grape thanos has been squised") time.sleep(3) print("You look around seeing everyone who have perished") time.sleep(4) print("you can't help but smile at their sacrifice and as you look up you can see them smile back down at you") time.sleep(5) print("You walk off the world is safe.") time.sleep(2) print("..........................................................................") time.sleep(3) play_again = input("do you want to play again? [y]es or [n]o..." ) time.sleep(3) print("thank you for playing!") time.sleep(3)