Advertisement
xPokejosex

Untitled

Aug 4th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.68 KB | None | 0 0
  1. class Menu2
  2. def update;end
  3.  
  4. def pbStartScene
  5. @sprites={}
  6. @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
  7. @viewport.z=99999
  8.  
  9. @sprites["bg"]=Sprite.new(@viewport)
  10. @sprites["bg"].bitmap=RPG::Cache.picture("MenuSM")
  11.  
  12. @sprites["title"]=Sprite.new(@viewport)
  13. @sprites["title"].z=99999
  14. pbSEPlay("abrirM")
  15. end
  16.  
  17. def pbEndScene
  18. pbDisposeSpriteHash(@sprites)
  19. @viewport.dispose if @viewport
  20. end
  21.  
  22. def pbUpdate
  23. @xcount=0
  24. @posible1=0
  25. @posible2=0
  26. @posible3=0
  27. loop do
  28. Graphics.update
  29. Input.update
  30.  
  31.  
  32. if Input.trigger?(Input::RIGHT)
  33. if @xcount==1 || @xcount==3 || @xcount==5
  34. @xcount-=1
  35. pbSEPlay("MoverM")
  36. else
  37. @xcount+=1
  38. pbSEPlay("MoverM")
  39. end
  40. end
  41. if Input.trigger?(Input::LEFT)
  42. if @xcount==0 || @xcount==2 || @xcount==4
  43. @xcount+=1
  44. pbSEPlay("MoverM")
  45. else
  46. @xcount-=1
  47. pbSEPlay("MoverM")
  48. end
  49. end
  50. if Input.trigger?(Input::UP)
  51. if @xcount==0 || @xcount==1
  52. @xcount+=4
  53. pbSEPlay("MoverM")
  54. else
  55. @xcount-=2
  56. pbSEPlay("MoverM")
  57. end
  58. end
  59. if Input.trigger?(Input::DOWN)
  60. if @xcount==4 || @xcount==5
  61. @xcount-=4
  62. pbSEPlay("MoverM")
  63. else
  64. @xcount+=2
  65. pbSEPlay("MoverM")
  66. end
  67. end
  68. if (@xcount == -1)
  69. @xcount= @totalElements-1
  70. end
  71.  
  72. if (@xcount == @totalElements)
  73. @xcount=0
  74. end
  75.  
  76. if (@xcount==1)
  77. @sprites["title"].bitmap=RPG::Cache.picture("Flechita2")
  78. @sprites["title"].x = (Graphics.width-@sprites["title"].bitmap.width)/2
  79. @sprites["title"].y = (Graphics.height-@sprites["title"].bitmap.height)/2
  80.  
  81. loop do
  82. if Input.trigger?(Input::C) and !$Trainer.pokedex
  83. pbSEPlay("EscogerMenu")
  84. Kernel.pbMessage(_INTL("No tienes la Pokedex."))
  85. end
  86. Input.update
  87. Graphics.update
  88. end
  89.  
  90. loop do
  91. if Input.trigger?(Input::C)
  92. pbSEPlay("EscogerMenu")
  93. end
  94. Input.update
  95. Graphics.update
  96. if DEXDEPENDSONLOCATION
  97. pbFadeOutIn(99999) {
  98. scene=PokemonPokedexScene.new
  99. screen=PokemonPokedex.new(scene)
  100. screen.pbStartScreen
  101. #@scene.pbRefresh
  102. }
  103. else
  104. if $PokemonGlobal.pokedexViable.length==1
  105. $PokemonGlobal.pokedexDex=$PokemonGlobal.pokedexViable[0]
  106. $PokemonGlobal.pokedexDex=-1
  107. if $PokemonGlobal.pokedexDex==$PokemonGlobal.pokedexUnlocked.length-1
  108. pbFadeOutIn(99999) {
  109. scene=PokemonPokedexScene.new
  110. screen=PokemonPokedex.new(scene)
  111. screen.pbStartScreen
  112. #@scene.pbRefresh
  113. }
  114. else
  115. pbLoadRpgxpScene(Scene_PokedexMenu.new)
  116. end
  117. end
  118. end
  119. end
  120. end
  121.  
  122. if (@xcount==0)
  123. @sprites["title"].bitmap=RPG::Cache.picture("Flechita1")
  124. @sprites["title"].x = (Graphics.width-@sprites["title"].bitmap.width)/2
  125. @sprites["title"].y = (Graphics.height-@sprites["title"].bitmap.height)/2
  126.  
  127. if $Trainer.party.length<1
  128. if Input.trigger?(Input::C)
  129. Kernel.pbMessage(_INTL("No tienes ningun pokémon."))
  130. end
  131. end
  132. if Input.trigger?(Input::C)
  133. sscene=PokemonScreen_Scene.new
  134. sscreen=PokemonScreen.new(sscene,$Trainer.party)
  135. hiddenmove=nil
  136. pbFadeOutIn(99999) {
  137. hiddenmove=sscreen.pbPokemonScreen
  138. if hiddenmove
  139. pbEndScene
  140. else
  141. #@scene.pbRefresh
  142. end
  143. }
  144. if hiddenmove
  145. Kernel.pbUseHiddenMove(hiddenmove[0],hiddenmove[1])
  146. return
  147. end
  148. end
  149. end
  150.  
  151. if (@xcount==2)
  152. @sprites["title"].bitmap=RPG::Cache.picture("Flechita3")
  153. @sprites["title"].x = (Graphics.width-@sprites["title"].bitmap.width)/2
  154. @sprites["title"].y = (Graphics.height-@sprites["title"].bitmap.height)/2
  155.  
  156. if Input.trigger?(Input::C)
  157. item=0
  158. scene=PokemonBag_Scene.new
  159. screen=PokemonBagScreen.new(scene,$PokemonBag)
  160. pbFadeOutIn(99999) {
  161. item=screen.pbStartScreen
  162. if item>0
  163. pbEndScene
  164. else
  165. #@scene.pbRefresh
  166. end
  167. }
  168. if item>0
  169. Kernel.pbUseKeyItemInField(item)
  170. return
  171. end
  172. end
  173. end
  174.  
  175. if (@xcount==3)
  176. @sprites["title"].bitmap=RPG::Cache.picture("Flechita4")
  177. @sprites["title"].x = (Graphics.width-@sprites["title"].bitmap.width)/2
  178. @sprites["title"].y = (Graphics.height-@sprites["title"].bitmap.height)/2
  179.  
  180. if Input.trigger?(Input::C)
  181. PBDebug.logonerr {
  182. scene=PokemonTrainerCardScene.new
  183. screen=PokemonTrainerCard.new(scene)
  184. pbFadeOutIn(99999) {
  185. screen.pbStartScreen
  186. #@scene.pbRefresh
  187. }
  188. }
  189. end
  190. end
  191.  
  192. if (@xcount==5)
  193. @sprites["title"].bitmap=RPG::Cache.picture("Flechita6")
  194. @sprites["title"].x = (Graphics.width-@sprites["title"].bitmap.width)/2
  195. @sprites["title"].y = (Graphics.height-@sprites["title"].bitmap.height)/2
  196.  
  197. if Input.trigger?(Input::C)
  198. scene=PokemonOptionScene.new
  199. screen=PokemonOption.new(scene)
  200. pbFadeOutIn(99999) {
  201. screen.pbStartScreen
  202. pbUpdateSceneMap
  203. #@scene.pbRefresh
  204. }
  205. end
  206. end
  207.  
  208. if (@xcount==4)
  209. @sprites["title"].bitmap=RPG::Cache.picture("Flechita5")
  210. @sprites["title"].x = (Graphics.width-@sprites["title"].bitmap.width)/2
  211. @sprites["title"].y = (Graphics.height-@sprites["title"].bitmap.height)/2
  212.  
  213. if Input.trigger?(Input::C)
  214. scene=PokemonSaveScene.new
  215. screen=PokemonSave.new(scene)
  216. if screen.pbSaveScreen
  217. endscene=false
  218. break
  219. else
  220. pbUpdateSceneMap
  221. end
  222. end
  223. end
  224.  
  225.  
  226. break if Input.trigger?(Input::B)
  227. end
  228.  
  229. end
  230.  
  231. end
  232.  
  233.  
  234.  
  235. def pbCallMenu2
  236. scene=Menu2.new
  237. scene.pbStartScene
  238. scene.pbUpdate
  239. scene.pbEndScene
  240. end
  241.  
  242.  
  243. def getXPolygon(element, total, x_centre, radius)
  244. return radius * Math.cos(2*Math::PI*element/total + (Math::PI*1.5)) + x_centre
  245. end
  246.  
  247. def getYPolygon(element, total, y_centre, radius)
  248. return radius * Math.sin(2*Math::PI*element/total + (Math::PI*1.5)) + y_centre
  249. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement