Advertisement
Guest User

Untitled

a guest
Sep 6th, 2017
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. import random
  2. onward = "\n..."
  3. boss_hp = 20
  4. player_hp = 10
  5. num_lines = 100
  6.  
  7. Turn = True
  8.  
  9. while Turn:
  10. action_play = input("Choose an action(attack or run): ")
  11. if action_play == "attack":
  12. player_atk = random.randint(3, 5)
  13. damage = player_atk
  14. boss_hp = boss_hp - damage
  15. print("\nYou did %d damage!\nBoss HP is now %d!" % (damage, boss_hp))
  16. if damage == 5:
  17. print(' CRITICAL!')
  18. if boss_hp <= 0:
  19. print("The Boss is Dead!\nYou Win!!")
  20. break
  21. print("\nBoss Attacks!")
  22. boss_atk = random.randint(1, 3)
  23. boss_damage = boss_atk
  24. player_hp = player_hp - boss_damage
  25. print("Ouch! You took %d damage! You now have %d HP!" % (boss_damage, player_hp))
  26. if player_hp <= 0:
  27. print("YOU DIED!")
  28. break
  29. if action_play == "run":
  30. print("You ran away...")
  31. break
  32. input(onward)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement