#------------------------------------------------------ # Name : Endgame # Purpose : 11DGT # Author : Monty Page # Copyright © Monty 18/02/25 #Import Libraries import random import time #Set starting variables # Beginning health start_hp_cap = 50 start_hp_thanos = 50 cap_health = 50 thanos_health =100 #Damage sets thanos_sword = 0 cap_mjolnir = 0 #Deflect Set deflect = 0 # Player decision cap_choice = " " play_again = "y" #intro print("The sky grows darker as Thanos' army makes its way 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 if your weight to bare.") time.sleep(3.5) print("You stand there, hurt. But you have your shield in arm hand and wield Mjolnir in the other.") time.sleep(4) print("You are worthy, but will the power of Thor be enough. . . . ") time.sleep(3) print("You're in the ENDGAME now") time.sleep(1) #start of play again loop while play_again == "y" : #reset health levesl for characters cap_health = start_hp_cap thanos_health = start_hp_thanos while thanos_health > 0 : #print health level time.sleep(1) print() print("Current Health") print("Cap has {} HP. . .".format(cap_health)) print("Thanos aas {} HP. . .".format(thanos_health)) time.sleep(2) #Action selction print() print("What do you choose?. . .") print("[a]ttack with Mjolnir") print("or") print("[d]efend with your shield") cap_choice = input("Your Choice?. . .") print() #player choice #choice A if cap_choice == "a" : thanos_sword = random.randint(1, 20) print("Thanos attacks you with his double bladed sword and deals {} damage".format(thanos_sword)) cap_health = cap_health - thanos_sword if cap_health < 1: break time.sleep(1) cap_mjolnir = random.randint(1, 20) print("You can attack with Mjolnir in hand deaing {} damage in return".format(cap_mjolnir)) thanos_health = thanos_health - cap_mjolnir time.sleep(1) #choice D else: print("Thanos attacks ou with his double bladed sword") print("You raise your shield and deflect to neutralise the blow") time.sleep(1) deflect = random.randint(1, 2) if deflect == 1 : thanos_sword = random.randint(1, 20) print("You were to slow in raising your shield and Thano strikes you with his sword for {} damage".format(thanos_sword)) cap_health = cap_health - thanos_sword if cap_health < 1: break time.sleep(1) else: thanos_sword = random.randint(1, 20) print("Thanos' sword rebounds off Captain Americas vibranium shield and he deals himself {} damage".format(thanos_sword)) thanos_health = thanos_health - thanos_sword time.sleep(1) #End of game loop. Winner determntaion if cap_health < 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...") 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)