Advertisement
Guest User

Untitled

a guest
Oct 20th, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. /////////////////
  2. //PlayerVars
  3. //20 - inCave 0 = no, 1 = yes
  4. //21 - Row
  5. //22 - Column
  6. //
  7. //
  8. #include fp_NewbCave.mit //Specify floorplan filename
  9.  
  10. //GLOBAL $mapHeight = 20
  11. //GLOBAL $mapWidth = 20
  12. event ("accessbuilding","7")
  13. {
  14.  
  15.  
  16. $gPlayerVar[20] = 1
  17. $gPlayerVar[21] = 15
  18. $gPlayerVar[22] = 20
  19.  
  20.  
  21. CaveInit($gPlayerVar[21],$gPlayerVar[22])
  22.  
  23. }
  24. $mapHeight = 20
  25. $mapWidth = 20
  26. $m_MapData[ ] = {
  27. 1,1,1,1,1,1,1,1,7,0,0,0,0,0,0,0,0,0,0,0
  28. 0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0
  29. 0,0,0,0,0,0,0,0,2,0,0,0,0,0,"E",0,0,0,0,0
  30. 0,0,E,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0
  31. 0,0,2,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0
  32. 0,0,2,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0
  33. 0,0,9,1,1,1,1,1,A,1,1,1,1,1,8,0,0,0,0,0
  34. 0,0,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0
  35. 0,0,9,1,1,1,B,1,1,1,F,0,0,0,2,0,0,0,0,0
  36. 0,0,2,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0
  37. 0,0,2,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0
  38. 0,0,2,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0
  39. 0,0,2,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0
  40. 0,0,2,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0
  41. 0,0,2,0,0,0,5,1,1,1,1,1,1,1,3,1,1,1,1,1
  42. 0,0,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0
  43. 0,0,C,D,1,1,7,0,0,0,0,0,0,0,2,0,0,0,0,0
  44. 0,0,0,0,0,0,5,1,1,1,1,1,1,0,2,0,0,0,0,0
  45. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0
  46. 0,D,1,1,1,1,1,1,1,1,1,1,1,1,4,0,0,0,0,0
  47. }
  48. Function CaveInit($row,$col)
  49. {
  50.  
  51. osdcreate(osdbuilding,"Cave1","A Cavern")
  52. osdaddat(osdbigtext,50,100,500,50,"","Directions of movement available")
  53.  
  54.  
  55. CheckBlock($row,$col)
  56. }
  57. Function CheckBlock($row,$col)
  58. {
  59.  
  60. //*say $row row
  61. //*say $col col
  62. $pos1 =$row - 1
  63. $pos2 = $pos1 * $mapWidth
  64. $playerPos = $pos2 + $col
  65. //*say $playerPos Pos
  66. GetButtons($m_MapData[$playerPos])
  67.  
  68. }
  69.  
  70. Function GetButtons($type)
  71. {
  72. *say $type celltype
  73. if ($type = 0)
  74. {
  75. }
  76. else if ($type = 1)
  77.  
  78. {
  79. AddButton(3)
  80. AddButton(1)
  81. }
  82. else if ($type = 2)
  83. {
  84. AddButton(0)
  85. AddButton(2)
  86. }
  87. else if ($type = 3)
  88. {
  89. AddButton(0)
  90. AddButton(1)
  91. AddButton(2)
  92. AddButton(3)
  93. }
  94. else if ($type = 4)
  95. {
  96. AddButton(0)
  97. AddButton(3)
  98. }
  99. else if ($type = 5)
  100. {
  101. AddButton(0)
  102. AddButton(1)
  103. }
  104. else if ($type = 6)
  105. {
  106. AddButton(1)
  107. AddButton(2)
  108. }
  109. else if ($type = 7)
  110. {
  111. AddButton(2)
  112. AddButton(3)
  113. }
  114. else if ($type = 8)
  115. {
  116. AddButton(0)
  117. AddButton(2)
  118. AddButton(3)
  119. }
  120. else if ($type = 9)
  121. {
  122. AddButton(0)
  123. AddButton(1)
  124. AddButton(2)
  125. }
  126. else if ($type = "A")
  127. {
  128. //*say wat
  129. AddButton(0)
  130. AddButton(1)
  131. AddButton(3)
  132. }
  133. else if ($type = "B")
  134. {
  135. AddButton(1)
  136. AddButton(2)
  137. AddButton(3)
  138. }
  139. else if ($type = "C")
  140. {
  141. AddButton(0)
  142. }
  143. else if ($type = "D")
  144. {
  145. AddButton(1)
  146. }
  147. else if ($type = "E")
  148. {
  149. AddButton(2)
  150. }
  151. else if ($type = "F")
  152. {
  153. AddButton(3)
  154. }
  155.  
  156.  
  157.  
  158. OSDACTIVATE()
  159.  
  160.  
  161.  
  162.  
  163. }
  164. function AddButton($dir)
  165. {
  166. if ($dir = 0)
  167. {
  168. osdaddat(osdbutton,250,130,75,35,"North","Go North")
  169. }
  170. if ($dir = 1)
  171. {
  172. osdaddat(osdbutton,335,180,60,35,"East","Go East")
  173. }
  174. if ($dir = 2)
  175. {
  176. osdaddat(osdbutton,250,240,75,35,"South","Go South")
  177. }
  178. if ($dir = 3)
  179. {
  180. osdaddat(osdbutton,180,180,60,35,"West","Go West")
  181. }
  182. }
  183.  
  184. event("osdselect","Cave1:North")
  185. {
  186.  
  187. $gplayervar[21] -= 1
  188. CaveInit($gPlayerVar[21],$gPlayerVar[22])
  189. }
  190. event("osdselect","Cave1:South")
  191. {
  192. $gplayervar[21] += 1
  193. CaveInit($gPlayerVar[21],$gPlayerVar[22])
  194. }
  195. event("osdselect","Cave1:West")
  196. {
  197. $gplayervar[22] -= 1
  198. CaveInit($gPlayerVar[21],$gPlayerVar[22])
  199. }
  200. event("osdselect","Cave1:East")
  201. {
  202. $gplayervar[22] += 1
  203. CaveInit($gPlayerVar[21],$gPlayerVar[22])
  204. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement