import time import random Player_Health=50 Enemy_Health=250 playerchoice= "a" or "d" or "p" print("A troll ran towards you, swinging his club in th air") time.sleep(2) print("You tried to run but you were not fast enough") time.sleep(3) print("FIGHT") while Enemy_Health > 0 and Player_Health > 0 : time.sleep(1) print() print("Current Health") print("Player has {} HP...".format(Player_Health)) print("Troll has {} HP...".format(Enemy_Health)) time.sleep(2) print() print("What do you choose?..") time.sleep(1) print("[a]ttack with sword ") time.sleep(1) print("[d]efend with shield") time.sleep(1) print("[p]Parry") Player_choice = input("Your choice? ") print() if Player_choice == "a" : Enemy_Swordamage=random.randint(1,20) print("Enemy attacks dealing {} damage".format(Enemy_Swordamage)) Player_Health=Player_Health-Enemy_Swordamage if Player_Health < 1: break time.sleep(1) Player_sworddamage=random.randint(1,20) print("Player attacks back dealing {} damage in return".format(Player_sworddamage)) Enemy_Health=Enemy_Health-Player_sworddamage time.sleep(1) if Player_choice == "d": print("Enemy attacks you with his double bladed sword...") print("You raise your shield and deflect to deflect the blow...") time.sleep(1) deflect=random.randint(1,2) if deflect==1 : Enemy_Swordamage=random.randint(1,20) print("You were to slow to block the hit and Enemy strikes back dealing {} damage".format(Enemy_Swordamage)) Player_Health=Player_Health-Enemy_Swordamage if Player_Health <1 : break time.sleep(1) else: Enemy_Swordamage=random.randint(1,20) print("Enemy' sword rebounds off Players shield and he deals himself {} damage".format(Enemy_Swordamage)) Enemy_Health=Enemy_Health-Enemy_Swordamage time.sleep(1) if Player_choice == "p" : Enemy_Swordamage=random.randint(1,20) print("Enemy is about to strike you with his sword about to deal {} damage".format(Enemy_Swordamage)) print() time.sleep(2) print("Quickly,You parried Enemies sword, negating all damage!?!") time.sleep(1) print("Enemy was shocked as his sword jolted back towards him with force") time.sleep(1) parry=1 if parry==1 : Player_Health=Player_Health time.sleep(1) if Player_Health < 1 : print() print("Enemy is too strong. He has broken your shield and cut you down. This is the end...") else: print() print("Enemy 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)