Guest User

Untitled

a guest
Jul 17th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.17 KB | None | 0 0
  1.  -- MUD Alpha Test
  2.  
  3. -- Player Table
  4. player = {}
  5. player.x = 1
  6. player.y = 1
  7.  
  8. -- Location Table
  9. loc = {}
  10. loc.x = 1
  11. loc.y = 1
  12. loc.dir = "spawn"
  13.  
  14. -- Location Data
  15. locDat = {}
  16. locDat.spawn = "You are newly spawned into the game."
  17. locDat.bear = "You turn around to a standing bear. *pwn* *fucksyouup* *dead*."
  18. locDat.forestA = "You're in a fairly humid forest, and you think that you hear another person talking nearby."
  19. locDat.forestB = "You're in a very humid forest, and you hear small forest creatures creeping around as you trek through the forest."
  20. locDat.forestC = "You're in a very humid forest."
  21. locDat.swamp = "You're in a very muddy, humid swamp."
  22. locDat.tavern = "You're at the tavern. :D. HAPPY-FUN-TIME-BITCHES."
  23. locDat.ditch = "You trip on a rock and roll into a ditch filled with mud. Smooth move."
  24. locDat.trap = "You fell in a hole. Full of spikes and creepers. And the occasional hypodermic needle."
  25. locDat.admin = "How in the hell did you get here?"
  26.  
  27. --ditch - trap - swamp
  28. --forestB - forestC - tavern
  29. --spawn - bear - forestA
  30.  
  31. -- Main Function
  32. function mainMenu()
  33. print("Welcome to the Despair Alpha Test")
  34. print("A >> Play Game")
  35. print("B >> Enter a Cheat Code")
  36. print("C >> Quit")
  37. input = read()
  38. if input == "A" then initGame() end
  39. if input == "B" then initCheat() end
  40. if input == "C" then initQuit() end
  41. end
  42.  
  43. function moveNorth()
  44. if loc.dir == "spawn" then loc.dir = "forestB" end
  45. if loc.dir == "bear" then loc.dir = "forestC" end
  46. if loc.dir == "admin" then loc.dir = "spawn" end
  47. if loc.dir == "forestA" then loc.dir = "tavern" end
  48. if loc.dir == "forestB" then loc.dir = "ditch" end
  49. if loc.dir == "forestC" then loc.dir = "trap" end
  50. if loc.dir == "tavern" then loc.dir = "swamp" end
  51. if loc.dir == "ditch" then loc.dir = "spawn" end
  52. if loc.dir == "trap" then loc.dir = "bear" end
  53. if loc.dir == "swamp" then loc.dir = "forestA" end
  54. mainGame()
  55. end
  56.  
  57. function moveSouth()
  58. if loc.dir == "spawn" then loc.dir = "ditch" end
  59. if loc.dir == "bear" then loc.dir = "trap" end
  60. if loc.dir == "admin" then loc.dir = "spawn" end
  61. if loc.dir == "forestA" then loc.dir = "swamp" end
  62. if loc.dir == "forestB" then loc.dir = "spawn" end
  63. if loc.dir == "forestC" then loc.dir = "bear" end
  64. if loc.dir == "tavern" then loc.dir = "forestA" end
  65. if loc.dir == "ditch" then loc.dir = "forestB" end
  66. if loc.dir == "trap" then loc.dir = "forestC" end
  67. if loc.dir == "swamp" then loc.dir = "tavern" end
  68. mainGame()
  69. end
  70.  
  71. function moveEast()
  72. if loc.dir == "spawn" then loc.dir = "bear" end
  73. if loc.dir == "bear" then loc.dir = "forestA" end
  74. if loc.dir == "admin" then loc.dir = "spawn" end
  75. if loc.dir == "forestA" then loc.dir = "spawn" end
  76. if loc.dir == "forestB" then loc.dir = "forestC" end
  77. if loc.dir == "forestC" then loc.dir = "tavern" end
  78. if loc.dir == "tavern" then loc.dir = "forestB" end
  79. if loc.dir == "ditch" then loc.dir = "trap" end
  80. if loc.dir == "trap" then loc.dir = "swamp" end
  81. if loc.dir == "swamp" then loc.dir = "ditch" end
  82. mainGame()
  83. end
  84.  
  85. function moveWest()
  86. if loc.dir == "spawn" then loc.dir = "forestA" end
  87. if loc.dir == "bear" then loc.dir = "spawn" end
  88. if loc.dir == "admin" then loc.dir = "spawn" end
  89. if loc.dir == "forestA" then loc.dir = "bear" end
  90. if loc.dir == "forestB" then loc.dir = "tavern" end
  91. if loc.dir == "forestC" then loc.dir = "forestB" end
  92. if loc.dir == "tavern" then loc.dir = "forestC" end
  93. if loc.dir == "ditch" then loc.dir = "swamp" end
  94. if loc.dir == "trap" then loc.dir = "ditch" end
  95. if loc.dir == "swamp" then loc.dir = "trap" end
  96. mainGame()
  97. end
  98.  
  99. function mainGame()
  100. if loc.dir == "spawn" then print(locDat.spawn) end
  101. if loc.dir == "bear" then print(locDat.bear) end
  102. if loc.dir == "admin" then print(locDat.admin) end
  103. if loc.dir == "forestA" then print(locDat.forestA) end
  104. if loc.dir == "forestB" then print(locDat.forestB) end
  105. if loc.dir == "forestC" then print(locDat.forestC) end
  106. if loc.dir == "tavern" then print(locDat.tavern) end
  107. if loc.dir == "ditch" then print(locDat.ditch) end
  108. if loc.dir == "trap" then print(locDat.trap) end
  109. if loc.dir == "swamp" then print(locDat.swamp) end
  110. print("Enter the direction to move in (N, S, E or W):")
  111. input = read()
  112. if input == "N" then moveNorth() end
  113. if input == "S" then moveSouth() end
  114. if input == "E" then moveEast() end
  115. if input == "W" then moveWest() end
  116. if input == "n" then moveNorth() end
  117. if input == "s" then moveSouth() end
  118. if input == "e" then moveEast() end
  119. if input == "w" then moveWest() end
  120. end
  121.  
  122. function wrongCmd()
  123. print("Wrong Command")
  124. mainMenu()
  125. end
  126.  
  127. function initGame()
  128. print("Welcome to the Alpha Test of the Game :D. Please send anything that you find or want to Sledger721.")
  129. mainGame()
  130. end
  131.  
  132. function initCheat()
  133. print("Please enter your cheat code")
  134.  -- Cheating for a cheat? Bitchass :3
  135. input = read()
  136. if input == "721" then cheatA()
  137. if input == "sledger721kicksass" then cheatB()
  138. else print("Incorrect Code.")
  139. end
  140. end
  141. mainMenu()
  142. end
  143.  
  144. function initQuit()
  145. os.exit()
  146. end
  147.  
  148. function cheatA()
  149. print("Nice, but I have nothing to add yet :p")
  150. sleep(2)
  151. print("Bitch Please")
  152. end
  153.  
  154. function cheatB()
  155. print("Nice, but I have nothing to add yet :p")
  156. sleep(2)
  157. print("Bitch Please")
  158. end
  159.  
  160. function startUp()
  161. term.clear()
  162. mainMenu()
  163. end
  164.  
  165. startUp()
Add Comment
Please, Sign In to add comment