Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.54 KB | None | 0 0
  1. import random
  2. #Values
  3. shipwreckloot = 0
  4. encounter = 0
  5. escape = "nothing"
  6. combat = 0
  7. complayer = "nothing"
  8. RNG_heal = 0
  9. RNG_stun = 0
  10.  
  11. #Enemies
  12. slime_hp = 50
  13. slime_attacks = random.choice(["Slime ball","Healing gel","Slime stomp"])
  14.  
  15.  
  16.  
  17. #player stats and items
  18. numhunger = 100
  19. numhealth = 100
  20. medicine = 0
  21. food = 0
  22. ship_parts = 0
  23.  
  24.  
  25. #Start of game
  26. print("Welcome to adventure land!")
  27. print("Only use yes, and no to make decisions also use fight, and flee when needed.")
  28. print("Type eat or medicine to use items.")
  29. PlayerName = input("What is your name adventurer: ")
  30.  
  31. print("You've shipwrecked on this strange island",PlayerName,"all you have is the clothes on your back. Now it's your job to find your way off this island alive!")
  32. print("As you regain consciousness you find yourself on a beach next to your ship. Now resorted to a pile of rubble, maybe you can scavenge whats left inside")
  33. print("for any tools or items that could come in use. But there could be things inside that could also be dangerous.")
  34.  
  35.  
  36.  
  37. print("You have",numhunger,"hunger left and you have",numhealth,"health")
  38. player = input("Should you try to search the shipwreck for any goods?: ")
  39.  
  40. if player == "yes":
  41. shipwreck = random.randint(1, 10)
  42. shipwreckloot = random.randint(1, 5)
  43. shipwreckamount = random.randint(1, 2)
  44. if shipwreck < 10:
  45. if shipwreckloot == 1:
  46. print("You found 2 medicine in the shipwreck!")
  47. medicine += 2
  48. elif shipwreckloot == 2 or 5:
  49. print("You found 2 food in the shipwreck!")
  50. food += 2
  51. elif shipwreckloot == 3 or 4:
  52. print("You found nothing useful in the shipwreck")
  53. else:
  54. print("The shipwreck collapses with you in it taking 10 health of damage!")
  55. numhealth -= 10
  56.  
  57. #Types of encounters
  58. while escape != "win":
  59.  
  60. if numhealth <= 0:
  61. print("You ran out of health and died!")
  62. print("You lose!")
  63. break
  64.  
  65. numhunger -=20
  66.  
  67. if numhunger <= 0:
  68. numhunger = 0
  69.  
  70. if numhunger > 100:
  71. numhunger = 100
  72.  
  73. print("You have",medicine,"medicine",food,"food",ship_parts,"ship parts")
  74. print("You have",numhunger,"hunger left and you have",numhealth,"health")
  75. UI = input("Do you want to eat or use anything?: ")
  76. if UI == "eat":
  77. if food >= 1:
  78. if numhunger != 100:
  79. food -=1
  80. numhunger +=35
  81. if UI == "medicine":
  82. if medicine >= 1:
  83. if numhealth != 100:
  84. medicine -= 1
  85. numhealth =+ 20
  86. if numhealth > 100:
  87. numhealth == 100
  88.  
  89. encounter = random.randint(3,3)
  90.  
  91. if encounter == 1:
  92. print("As your walking through the forest you come across an abundance of berries")
  93. player = input("Should you harvest the berries?: ")
  94. if player == "yes":
  95. RNG = random.randint(1,5)
  96. if RNG <= 3:
  97. food += 1
  98. print("You harvested one food worth of berries")
  99. if RNG == 4:
  100. food += 2
  101. print("You got lucky and were able to harvest two food from the berries")
  102. if RNG == 5:
  103. print("While you were harvesting the berries a wild slime attacks")
  104. complayer = input("fight or flee?: ")
  105. if player == "no":
  106. print("You decide not to harvest the berries and continue on")
  107.  
  108.  
  109. if encounter == 2:
  110. print("While you are looking for means of survival in the forest you find an abandon house")
  111. player = input("Should you search the house?: ")
  112.  
  113.  
  114. if encounter == 3:
  115. combat == 1
  116. print("A wild slime attacks while you were looking for food")
  117. complayer = input("fight or flee?: ")
  118.  
  119.  
  120.  
  121.  
  122. if encounter == 4:
  123. print("While searching for anything to aid in survival you find nothing")
  124.  
  125.  
  126.  
  127. if encounter == 5:
  128. print("You stumble upon some suspicious plants")
  129. player = input("Should you eat the plants?: ")
  130.  
  131. #Combat function
  132.  
  133.  
  134. if complayer == "flee":
  135. PL_flee = random.randint(1, 2)
  136. PL_flee2 = random.randint(2, 3)
  137. if food and medicine == 0:
  138. print("You lost nothing while you fled!")
  139. elif PL_flee == 1 and food >= 1:
  140. food -= 1
  141. print("While you fled you lost 1 food!")
  142. elif PL_flee2 == 3 and medicine >= 1:
  143. medicine -= 1
  144. print("While you fled you lost 1 medicine!")
  145. elif PL_flee == 1 and PL_flee2 == 3 and food and medicine >= 1:
  146. print("While you fled you lost 1 food and 1 medicine!")
  147. elif PL_flee and PL_flee2 == 2:
  148. print("You lost nothing while you fled!")
  149.  
  150. if complayer == "fight":
  151. print("The slime has 50hp")
  152. while slime_hp >= 1:
  153. #Attacks
  154. if RNG_stun >= 1:
  155. RNG_stun -= 1
  156. print("The slimes hit chance is decreased for",RNG_stun,"more turns!")
  157.  
  158.  
  159. print("You have",numhealth,"health left and",medicine,"medicine")
  160. player = input("What item or attack do you want to use? throw rock, punch, kick up dirt: ")
  161. if player == "medicine":
  162. if medicine >= 1:
  163. if numhealth != 100:
  164. medicine -= 1
  165. numhealth =+ 20
  166. if numhealth > 100:
  167. numhealth == 100
  168.  
  169. if player == "throw rock" or "rock":
  170. RNG = random.randint(10,25)
  171. miss_one = random.randint(1,10)
  172. if miss_one >= 7:
  173. RNG = 0
  174. print("You missed and did no damage!")
  175.  
  176. if player == "punch":
  177. RNG = random.randint(5,15)
  178. miss_two = random.randint(1,10)
  179. if miss_two >= 8:
  180. RNG = 0
  181. print("You missed and did no damage!")
  182.  
  183. if player == "kick up dirt" or "kick" or "kick up":
  184. RNG_stun = random.randint(1,3)
  185. miss_three = random.randint(1,3)
  186. if miss_three == 1:
  187. print("You missed and didn't stun the enemy!")
  188. if miss_three >= 2 or 3:
  189. print("The attack was successful!")
  190. print("The slimes hit chance has decreased for",RNG_stun,"turns!")
  191.  
  192. if slime_hp <= 0:
  193. print("You defeated the slime!")
  194. elif RNG != 0:
  195. slime_hp -= (RNG)
  196. print("You did",RNG,"damage!")
  197. print("Slime has",slime_hp,"health left")
  198. RNG = 0
  199.  
  200. if slime_hp <= 0:
  201. break
  202. if slime_hp >= 50:
  203. Slime_attacks = random.choice(["slime ball","slime stomp"])
  204. else:
  205. slime_attacks = random.choice(["slime ball","healing gel","slime stomp"])
  206.  
  207.  
  208. if slime_attacks == "slime ball":
  209. print("Slime attacks with slime ball!")
  210. RNG = random.randint(10,18)
  211. miss_enemy = random.randint(11,21)
  212. if RNG_stun == 1:
  213. if miss_enemy >= 17:
  214. RNG = 0
  215. print("The slime missed you and did no damage")
  216. else:
  217. miss_enemy >= 16
  218. RNG = 0
  219. print("The slime missed you and did no damage")
  220.  
  221. if slime_attacks == "healing gel":
  222. RNG_heal = random.randint(5,15)
  223. miss_enemy = random.randint(1,10)
  224. print("Slime uses healing gel")
  225. if miss_enemy == 1:
  226. RNG_heal = 0
  227. print("The slime failed to heal")
  228. else:
  229. slime_hp += (RNG_heal)
  230. print("Slime healed",RNG_heal,"health")
  231.  
  232.  
  233. if slime_attacks == "slime stomp":
  234. print("Slime attacks with slime stomp!")
  235. RNG = random.randint(5,15)
  236. miss_enemy = random.randint(1,10)
  237. if RNG_stun == 1:
  238. if miss_enemy >= 7:
  239. RNG = 0
  240. print("The slime missed you and did no damage")
  241. else:
  242. if miss_enemy >= 6:
  243. RNG = 0
  244. print("The slime missed you and did no damage")
  245.  
  246. if RNG != 0:
  247. numhealth -= (RNG)
  248. print("You took",RNG,"damage!")
  249. RNG == 0
  250.  
  251.  
  252. if numhealth <= 0:
  253. print("You ran out of health and died!")
  254. print("You lose!")
  255. break
  256.  
  257. if ship_parts == 10:
  258. print("You managed to build a boat from what you found on the island and escaped!")
  259. print("You win!")
  260. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement