Advertisement
Guest User

python code

a guest
Apr 11th, 2014
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.92 KB | None | 0 0
  1. import time
  2. import random
  3.  
  4. #DEF GAME
  5. def game():
  6.     ignorethisvariable = 0
  7.  
  8. random.seed()
  9.  
  10. print ("Welcome to world of ZED")
  11.  
  12. time.sleep (3)
  13.  
  14. #Game Start
  15. print ("You wake up and see a man staning alone across a red bridge, what will you do?")
  16. time.sleep (2)
  17. print  ("YOU")
  18. print ("------")
  19. print ("ATTACK")
  20. print ("SLEEP")
  21. print ("SHOUT")
  22. print ("TALK")
  23. print ("------")
  24. time.sleep (2)
  25. standing = raw_input("What will you do?:")
  26. standing = standing.lower()
  27. allowed = ["attack", "shout", "sleep", "talk"]
  28.  
  29. #Invalid choice 1
  30. while standing not in allowed:
  31.     print ("R U DUM?! CAN U NAWT GIVE ME A VALID RESPONSE?!")
  32.     time.sleep (3)
  33.     standing = raw_input('Lets try again, what will you do?:')
  34.  
  35. #ATTACK MAN
  36. standing = standing.lower()
  37. if standing == 'attack':
  38.     print ('You choose to attack the man, he quickly reacts and knocks you over')
  39.     time.sleep (3)
  40.     print ('You stand up and see the man holding an arm out to help you')
  41.     time.sleep (3)
  42.     print ("???: Don't make too much noise, quickly tell me your name quietly")
  43.     time.sleep (3)
  44.     namechoice = raw_input('Will you tell him your name?: (y/n)')
  45.     namechoice == namechoice.lower()
  46.     if namechoice == 'y':
  47.         name = raw_input('What is your name?')
  48.         print ('???: Ah so your name is %s, my name is Drake!') % (name)
  49.         time.sleep (1)
  50.         print ('You think to yourself about how that name is awfully familiar')
  51.     elif namechoice == 'n':
  52.         time.sleep (1)
  53.         print ("???:We don't have time to be acting like children but fine i'll find out soonner or later")
  54.  
  55. #SHOUT
  56. standing = standing.lower()
  57. if standing == 'shout':
  58.     time.sleep (2)
  59.     print ("You see the man noticing you")
  60.     time.sleep (2)
  61.     print ('Out of self defense you prepare for a battle, which may be impulsive')
  62.     time.sleep (3)
  63.     print ('BATTLE BEGIN!')
  64.     print ("-------------")
  65.     time.sleep (3)
  66.  
  67. #SHOUT - BATTLE STATS
  68. MYSTERYMAN = 99999
  69. MYSTATK = 5000
  70. MYSTDEF = 2000
  71. MYSTSPEC = 10000
  72. UHP = 100
  73. UATK = 10
  74. UATKPWR = 15
  75. UDEFR = 10
  76. UDEFM = 15
  77. USPEC = 25
  78.  
  79. #SHOUT - BATTLE
  80. if standing == "shout":
  81.     print ("Mystery Man is ready to battle!")
  82.     print ("-------------------------------")
  83.     time.sleep (3)
  84.     print ("BEGIN!")
  85.     print ("------")
  86.     time.sleep (3)
  87.     while UHP > 0:
  88.         print ("HP = %s"  % (UHP))
  89.         print ("What will you do?")
  90.         print ("ATTACK - FISTS")
  91.         print ("SPECIAL - UNAVALIBLE")
  92.         print ("DEFEND - FETAL POSITION")
  93.         move1 = raw_input("What shall you do?:")
  94.         move1 = move1.lower()
  95.         if move1 == "attack":
  96.             iAtk = random.randint(UATK, UATKPWR)
  97.             iDamage = iAtk - MYSTATK
  98.             print ("You throw a mean swing and deal %s damage") % (iDamage)
  99.             time.sleep (2)
  100.             if iDamage <= 0:
  101.                 print ("The attack did nothing!")
  102.                 time.sleep ()
  103.         print ("The Mystery Man prepares to attack!")
  104.         defe = random.randint(UDEFR, UDEFR + 10)
  105.         eAtk = random.randint(MYSTATK, MYSTATK + 100)
  106.         eDamage = eAtk - defe
  107.         UHP = UHP - eDamage
  108.         time.sleep (2)
  109.         print ("A small beam appears from the mans hand")
  110.         time.sleep (2)
  111.         print ("You get hit and pain strikes your body! He deals %s damage!") % (eDamage)
  112.         time.sleep (2)
  113.  
  114.         if move1 == "defend":
  115.             print ("You are now defending")
  116.             time.sleep (3)
  117.             print ("The Mystery Man prepares to attack!")
  118.             defe = random.randint(UDEFM, UDEFM + 10)
  119.             eAtk = random.randint(MYSTATK, MYSTATK + 100)
  120.             eDamage = eAtk - defe
  121.             print ("A small beam appears from the mans hand")
  122.             time.sleep (2)
  123.             print ("You get hit and pain strikes your body! He deals %s damage!") % (eDamage)
  124.         if UHP  <= 0:
  125.             print ("You collapse and your opponent wins")
  126.  
  127.  
  128.  
  129.  
  130.  
  131. #SLEEP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement