Dieselkaine

shitty battle sim

Jul 1st, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.75 KB | None | 0 0
  1. ### shitty battle simulator ###
  2. import random
  3. import time
  4.  
  5. playerHealth = 50
  6. compHealth = 50
  7.  
  8. def battleIntro():
  9.     print ("You enter the arena to the cheers of the crowds. ")
  10.     print ("Across fomr you stands your opponent. ")
  11.     print ("Only one you will leave this place alive. ")
  12.     print ("Prepare to fight!" )
  13.  
  14. def battlePlayer():
  15.     missChance = 2
  16.     while playerHealth >  0 and compHealth > 0:
  17.         print ("Do you wish to attack")
  18.         time.sleep(input())
  19.  
  20.         miss = random.randint (1, 4)
  21.        
  22.         if (missChance) == (miss):
  23.             print ("You swing wildly and miss your opponent. ")
  24.         else:
  25.             print ("You strike your opponent doing damage. ")
  26.             global compHealth = global compHealth - 5
  27.             ###syntax error on the = ###
  28.            
  29. def battleComp():
  30.      missChance = 2
  31.     while playerHealth >  0 and compHealth > 0:
  32.         print ("Your opponent charges at you. ")
  33.         time.sleep(2)
  34.  
  35.         miss = random.randint (1, 4)
  36.        
  37.         if (missChance) == (miss)
  38.             print ("You dodge his attack. ")
  39.         else:
  40.             print ("He manages to strike you doing damage. ")
  41.             global playerHealth = global playerHealth - 5
  42.  
  43. def battleResult():
  44.     if global comphealth == 0:
  45.         print ("Your hands are slick with his blood. ")
  46.         print ("You have slayen your opponent." )
  47.  
  48.     or if global playerHealth == 0:
  49.         print ("Your opponent stands over you and drives his sword into your chest. ")
  50.         print ("You have died! ")
  51.  
  52. playAgain = "yes"
  53. while playAgain == "yes" or playAgain == "y":
  54.  
  55.     battleIntro()
  56.     ### unsure of what needs to go here ###
  57.    
  58.     print ("Do you want to play again?")
  59.     playAgain = input()
Add Comment
Please, Sign In to add comment