Advertisement
Guest User

Untitled

a guest
May 30th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.44 KB | None | 0 0
  1. import random
  2.  
  3. author = 'aftonweb'
  4. welcome = 'Welcome to the Hell!'
  5.  
  6. life = 20
  7.  
  8. clowns = 0
  9.  
  10. hit = 0
  11.  
  12. hitMultiplier = [0, 1, 1, 2, 2, 2, 2, 2, 3, 3, 4]
  13.  
  14. weapon = {"Crowbar": 1, "Stechkin Pistol": 2, "Energy Crossbow": 3, "Energy Sword": 4, "Revolver": 5, "Balloon": 7}
  15.  
  16. supplies = ["Candy", "Cup Ramen", "Chips", "4no Raisins", "Dr.Gibb", "Baguette"]
  17.  
  18. inventory = {"Chips": 5,
  19. "Candy": 1,
  20. "Cup Ramen": 0,
  21. "4no Raisins": 0,
  22. "Dr.Gibb": 0,
  23. "Baguette": 0
  24. }
  25.  
  26. flavorText = {"Candy": "Nougat love it or hate it",
  27. "Cup Ramen": "A taste that reminds you of your school years.",
  28. "Chips": "Commander Riker's What-The-Crisps",
  29. "4no Raisins": "Best Raisins in the universe. Not sure why.",
  30. "Dr.Gibb": "A delicious mixture of 42 different flavors.",
  31. "Baguette": "Bon appetit!"
  32. }
  33. myWeapons = ["Crowbar"]
  34.  
  35. stations = ["Infinity Station", "Soviet Station", "Tau Ceti Station", "Animus Station"]
  36. youAreHere = 0
  37.  
  38. def fightClowns(clowns):
  39. global life
  40. if clowns != 0:
  41. print(str(clowns) + " clowns stagger towards you. Ready your " + str.lower(myWeapons[0]) + "!n")
  42. attack = raw_input("Attack, or Run? (A for attack, R for run)n")
  43. if (str.upper(attack) == "A"):
  44. life = life - (hitMultiplier[random.randrange(1, len(hitMultiplier))]*weapon[myWeapons[0]])
  45. hit = (hitMultiplier[random.randrange(1, len(hitMultiplier))]*weapon[myWeapons[0]])
  46. print("Your life is now: " + str(life))
  47. while (hit < 0):
  48. if hit > 0:
  49. print("You successfully killed them!")
  50. life = life - life - hit
  51. if (hit == 0):
  52. print("That was a lucky miss. Next time you should attack! (You successfully runned)")
  53. return 0
  54. else:
  55. print(str(clowns) + " clowns try to ravage you, but you killed them. Your life health is now " + str(life))
  56. return 0
  57. elif clowns == 0:
  58. print ("But Nobody Came!")
  59. else:
  60. hit = (hitMultiplier[random.randrange(0, len(hitMultiplier))]*weapon[myWeapons[0]])
  61. if hit > 0:
  62. life = life - hit
  63. print (str(clowns) + " attack you, but you killed themn" "Life health is now " + str(life))
  64.  
  65.  
  66. def lootRoom():
  67. global life
  68. runAway = False
  69. loot = raw_input("Loot this Room? (Y/N)n")
  70. if(str.upper(loot) == "Y"):
  71. foundItem = supplies[random.randrange(0, len(supplies)-1)]
  72. foundWeapon = weapon.keys()[random.randrange(1, len(weapon)-1)]
  73. clowns = random.randrange(0, 4)
  74. print(str(clowns) + " clowns found in room.")
  75. if clowns != 0:
  76. attack = raw_input("Attack or Run? (A/R)n")
  77. if str.upper(attack) == "A":
  78. hit = clowns-1 * (hitMultiplier[random.randrange(0, len(hitMultiplier)-4)])
  79. life = life - hit
  80. print (str(clowns) + " clowns attacked you, and you killed them with your " + str(myWeapons[0]) + "nLife health is now " + str(life))
  81. else:
  82. runAway = True
  83. print("You run away quietly, with no cool stuff.")
  84. else:
  85. print ("The room is empty of clowns, but full of cool stuff...")
  86. if (runAway != True):
  87. takeItem = raw_input("You found a " + foundItem + "nEquip? (Y/N)")
  88. takeWeapon = raw_input("Cool! You found a " + foundWeapon + "nEquip? (Y/N)")
  89. if str.upper(takeWeapon) == "Y": myWeapons.insert(0, foundWeapon)
  90. if str.upper(takeItem) == "Y": inventory[foundItem] += 1
  91. print ("Current weapon: " + str(myWeapons[0]))
  92. print ("Destruction power: " + str(weapon[myWeapons[0]]))
  93. print("Inventory:n==========")
  94. for item in inventory:
  95. if(inventory[item] > 0):
  96. print (item + ": " + str(inventory[item]))
  97. print("n")
  98. def lootBodies():
  99. loot = raw_input("On your way you found the bodies. Would you like to loot the bodies? (Y/N)n")
  100. if (str.upper(loot) == "Y"):
  101. if (random.randrange(0,9)>7):
  102. print("A clown was not yet dead!n")
  103. hit = 1 * hitMultiplier[random.randrange(0, len(hitMultiplier))]
  104. life = int(life) - int(hit)
  105. print("Clown did " + str(hit) + " damage to you.nYour life is " + str(life))
  106. else:
  107. foundItem = supplies[random.randrange(0, len(inventory)-1)]
  108. print("You found a " + foundItem)
  109. equip = raw_input("Equip? (Y/N)")
  110. if (str.upper(equip) == "Y"):
  111. inventory[foundItem] += 1
  112. print("Inventory: " + str(inventory))
  113. def leaveStation():
  114. global stations
  115. global youAreHere
  116. global life
  117. print("Where would you like to go? You are currently in " + stations[youAreHere])
  118. whereTo = ""
  119. i = 1
  120. for station in stations:
  121. if station != stations[youAreHere]:
  122. whereTo = whereTo + " " + str(i) + ") " + station + "n"
  123. i = i + 1
  124. stationIndex = int(raw_input("I want to go to: " + "n" + whereTo))
  125. youAreHere = stationIndex
  126. print("Welcome to " + stations[youAreHere])
  127. def checkInventory():
  128. global life
  129. global flavorText
  130. print ("Current weapon: " + str(myWeapons[0]))
  131. print ("Destruction power: " + str(weapon[myWeapons[0]]))
  132. print("Inventory:n==========")
  133. i = 1
  134. invArray = []
  135. for item in inventory:
  136. if(inventory[item] > 0):
  137. print (str(i) + ") " + item + ": " + str(inventory[item]))
  138. invArray.append(item)
  139. i = i + 1
  140. print str(i) + ") Exit Inventory"
  141. inventoryIndex = int(raw_input("Select the item from the list.n"))-1
  142. if inventoryIndex != len(invArray):
  143. myItem = invArray[inventoryIndex]
  144. if myItem == "Candy":
  145. life = life + 5
  146. print flavorText[myItem]
  147. inventory[myItem] -= 1
  148. def changeWeapon():
  149. print("Current weapon equipped: " + myWeapons[0])
  150. print ("Select weapon to equip from the list.")
  151. i = 1
  152. for weapon in myWeapons:
  153. print str(i) + ") " + weapon
  154. i += 1
  155. equip = int(raw_input("Equip:n"))-1
  156. w = myWeapons.pop(equip)
  157. myWeapons.insert(0, w)
  158.  
  159. print myWeapons[0] + " is equipped.n"
  160.  
  161. print ("Author: " + author)
  162. print (welcome)
  163.  
  164. print ("nLook, a small horde of clowns approaches! Take this crowbar and go bash some heads!")
  165.  
  166. ready = raw_input("Ready to fight?n")
  167.  
  168. if (str.upper(ready) != "Y"):
  169. print "Too bad, this is Infinity Station. You better get ready.n"
  170. else:
  171. print "Lock and load!n"
  172.  
  173. fightClowns(3)
  174. lootBodies()
  175.  
  176. print("Now let's go loot a room")
  177. lootRoom()
  178.  
  179. print("You seem to be getting this on your own. Here's a candy bar to restore your health, and one for the road. n")
  180. inventory["Candy"] += 1
  181.  
  182. while (life > 0):
  183. print("Life: " + str(life))
  184. action = raw_input("What would you like to do now?n1)Find more clownsn2)Loot more roomsn3)Leave the stationn4)Check inventoryn5)Change Weaponnn")
  185. if (action == "1"):
  186.  
  187. fightClowns(random.randrange(0,10))
  188. if (life > 0) and clowns !=0:
  189. lootBodies()
  190. elif (life <= 0):
  191. break
  192. elif (action == "2"):
  193. lootRoom()
  194. elif (action == "3"):
  195. leaveStation()
  196. elif (action == "4"):
  197. checkInventory()
  198. elif (action == "5"):
  199. changeWeapon()
  200. else:
  201. print("Invalid input!")
  202.  
  203. print("You died.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement