Advertisement
Lucidious89

EBS Compatibility (Zodiac Powers)

Apr 28th, 2017
791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.62 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # ZodiacPowers - Compatibility for Elite Battle System
  4. #
  5. #===============================================================================
  6. # This script is to be installed only to allow compatibility with the
  7. # Zodiac Power add-on for Pokemon Birthsigns, and Luka S.J.'s EliteBattle.
  8. #===============================================================================
  9. # ~Installation~
  10. #===============================================================================
  11. # Paste this script below EliteBattle_3. This will allow for compatibility
  12. # between the scripts.
  13. #===============================================================================
  14.  
  15. #===============================================================================
  16. # Fight Menu
  17. # UI ovarhaul
  18. #===============================================================================
  19. class NewFightWindow
  20. attr_accessor :index
  21. attr_accessor :battler
  22. attr_accessor :refreshpos
  23. attr_reader :nummoves
  24.  
  25. def initialize(viewport=nil)
  26. if !viewport.nil?
  27. view = Viewport.new(viewport.rect.x,viewport.rect.y,viewport.rect.width,viewport.rect.height)
  28. view.z = viewport.z
  29. view2 = Viewport.new(viewport.rect.x,viewport.rect.y,viewport.rect.width,viewport.rect.height)
  30. view2.z = viewport.z + 2
  31. viewport = view
  32. end
  33. @viewport=viewport
  34. @viewport2=(viewport.nil?) ? viewport : view2
  35. @index=0
  36. @over=false
  37. @refreshpos=false
  38. @battler=nil
  39. @nummoves=0
  40.  
  41. if EBUISTYLE==2
  42. @buttonBitmap=pbBitmap("#{checkEBFolderPath}/nextGen/moveSelButtons")
  43. else
  44. @buttonBitmap=pbBitmap("#{checkEBFolderPath}/moveSelButtons")
  45. end
  46. @categoryBitmap=pbBitmap("Graphics/Pictures/category")
  47.  
  48. @backdrop=Sprite.new(@viewport)
  49. @backdrop.bitmap=Bitmap.new(@viewport.rect.width,@viewport.rect.height)
  50. @backdrop.opacity=0
  51. @backdrop.tone=Tone.new(64,64,64)
  52.  
  53. @background=Sprite.new(@viewport)
  54. if EBUISTYLE==2
  55. @background.bitmap=pbBitmap("#{checkEBFolderPath}/nextGen/newBattleMessageBox")
  56. else
  57. @background.bitmap=pbBitmap("#{checkEBFolderPath}/newCommandBox")
  58. end
  59. @background.y=VIEWPORT_HEIGHT-98+(EBUISTYLE==2 ? 2 : 0)
  60. @background.z=100
  61.  
  62.  
  63. @selHand=Sprite.new(@viewport2)
  64. @selHand.bitmap=pbBitmap("#{checkEBFolderPath}/selHand")
  65. @selHand.oy=@selHand.bitmap.height
  66. @selHand.ox=@selHand.bitmap.width/2
  67. @selHand.z=150
  68. @selHand.visible=false
  69. @animdata=[0.1,0]
  70.  
  71. @arrow1=Sprite.new(@viewport)
  72. @arrow1.bitmap=pbBitmap("#{checkEBFolderPath}/dirArrow")
  73. @arrow1.y=@background.y+2
  74. @arrow1.z=140
  75. @arrow1.mirror=true
  76. @arrow1.opacity=0
  77.  
  78. @arrow2=Sprite.new(@viewport)
  79. @arrow2.bitmap=pbBitmap("#{checkEBFolderPath}/dirArrow")
  80. @arrow2.y=@background.y+2
  81. @arrow2.z=140
  82. @arrow2.x=Graphics.width-20
  83. @arrow2.opacity=0
  84.  
  85. @megaButton=Sprite.new(@viewport)
  86. path = (EBUISTYLE==2) ? "nextGen/" : ""
  87. @megaButton.bitmap=pbBitmap("#{checkEBFolderPath}/#{path}megaEvoButton")
  88. @megaButton.y=252
  89. @megaButton.x=-16
  90. @megaButton.z=145
  91. @megaButton.src_rect.set(0,0,116,48)
  92.  
  93. #===========================================================================
  94. if INCLUDE_ZPOWER
  95. @zodiacButton=Sprite.new(@viewport)
  96. if EBUISTYLE==0
  97. @zodiacButton.bitmap=pbBitmap("Graphics/Pictures/Birthsigns/Other/battlezodiac")
  98. elsif EBUISTYLE==1
  99. @zodiacButton.bitmap=pbBitmap("Graphics/Pictures/Birthsigns/Other/battlezodiacEB1")
  100. end
  101. @zodiacButton.y=252
  102. @zodiacButton.x=-16
  103. @zodiacButton.z=145
  104. @zodiacButton.src_rect.set(0,0,116,48)
  105. end
  106. #===========================================================================
  107.  
  108. #===========================================================================
  109. if INCLUDE_ZMOVES
  110. @zButton=Sprite.new(@viewport)
  111. path = (EBUISTYLE==2) ? "nextGen/" : ""
  112. @zButton.bitmap=pbBitmap("#{checkEBFolderPath}/#{path}ZMove")
  113. @zButton.y=252
  114. @zButton.x=-16
  115. @zButton.z=145
  116. @zButton.src_rect.set(0,0,116,48)
  117. end
  118. #===========================================================================
  119.  
  120. @button={}
  121. @moved=false
  122. @showMega=false
  123. #===========================================================================
  124. @showZodiac=false if INCLUDE_ZPOWER
  125. @showZMove=false if INCLUDE_ZMOVES
  126. #===========================================================================
  127. @position=[]
  128. @alternate=[0,0]
  129. end
  130.  
  131. def hide
  132. @backdrop.opacity-=25.5
  133. @selHand.visible=false
  134. @background.y+=10
  135. @megaButton.x-=10
  136. #===========================================================================
  137. @zodiacButton.x-=10 if INCLUDE_ZPOWER
  138. @zButton.x-=10 if INCLUDE_ZMOVES
  139. #===========================================================================
  140. @arrow1.y+=10
  141. @arrow2.y+=10
  142. @showMega=false
  143. #===========================================================================
  144. @showZodiac=false if INCLUDE_ZPOWER
  145. @showZMove=false if INCLUDE_ZMOVES
  146. #===========================================================================
  147. for i in 0...5
  148. next if !@button["#{i}"]
  149. @button["#{i}"].y=@background.y+10 if @button["#{i}"] && !@button["#{i}"].disposed?
  150. @button["#{i}_2"].y=@background.y+10 if @button["#{i}_2"] && !@button["#{i}_2"].disposed?
  151. end
  152. end
  153.  
  154. #=============================================================================
  155. def zodiacButton
  156. @showZodiac=true
  157. end
  158.  
  159. def zodiacButtonTrigger
  160. @zodiacButton.src_rect.y+=48
  161. @zodiacButton.src_rect.y=0 if @zodiacButton.src_rect.y >=96
  162. end
  163. #=============================================================================
  164. def zButton
  165. @showZMove=true
  166. end
  167.  
  168. def zButtonTrigger
  169. @zButton.src_rect.y+=48
  170. @zButton.src_rect.y=0 if @zButton.src_rect.y >=96
  171. end
  172. #=============================================================================
  173.  
  174. def update
  175. if @index==0 or @index==1
  176. @arrow2.opacity+=25.5 if @arrow2.opacity < 255
  177. elsif @index==2 or @index==3
  178. @arrow2.opacity-=25.5 if @arrow2.opacity > 0
  179. end
  180. if @index==1 or @index==2 or @index==3
  181. @arrow1.opacity+=25.5 if @arrow1.opacity < 255
  182. elsif @index==0
  183. @arrow1.opacity-=25.5 if @arrow1.opacity > 0
  184. end
  185. for i in 0...@position.length
  186. @position[i]=30+(i*220)-(@index*220) if @index < 3 or @refreshpos
  187. end
  188. @refreshpos=false
  189. for i in 0...@nummoves
  190. @button["#{i}_2"].visible=false
  191. @button["#{i}_2"].visible=true if @index==i
  192. if @index==i
  193. @button["#{i}"].y-=1 if @button["#{i}"].y > @background.y+2
  194. else
  195. @button["#{i}"].y+=1 if @button["#{i}"].y < @background.y+10
  196. end
  197. distance=@button["#{i}"].x-@position[i]
  198. @button["#{i}"].x-=distance/10
  199. @button["#{i}_2"].x=@button["#{i}"].x
  200. @button["#{i}_2"].y=@button["#{i}"].y
  201. end
  202. if @showMega
  203. @megaButton.x+=10 if @megaButton.x < -16
  204. end
  205. #===========================================================================
  206. if INCLUDE_ZPOWER
  207. if @showZodiac
  208. @zodiacButton.x+=10 if @zodiacButton.x < -16
  209. end
  210. end
  211. #===========================================================================
  212. if INCLUDE_ZMOVES
  213. if @showZMove
  214. @zButton.x+=10 if @zButton.x < -16
  215. end
  216. end
  217. #===========================================================================
  218. @selHand.x=@button["#{@index}"].x+@button["#{@index}"].src_rect.width/2
  219. @selHand.y=@button["#{@index}"].y
  220. @selHand.zoom_y-=@animdata[0]
  221. @selHand.visible=true
  222. @animdata[0]=-0.1 if @selHand.zoom_y <=0.5
  223. if @selHand.zoom_y >=1
  224. @animdata[0]=0
  225. @animdata[1]+=1
  226. if @animdata[1] > 14
  227. @animdata[0]=0.1
  228. @animdata[1]=0
  229. end
  230. end
  231. if defined?($mouse)
  232. @over = false
  233. for i in 0...5
  234. next if !@button["#{i}"]
  235. if $mouse.over?(@button["#{i}"])
  236. @over = true
  237. @index = i
  238. end
  239. end
  240. end
  241. end
  242.  
  243. def dispose
  244. @viewport.dispose
  245. @viewport2.dispose
  246. @selHand.dispose
  247. @backdrop.dispose
  248. @background.dispose
  249. @arrow1.dispose
  250. @arrow2.dispose
  251. @megaButton.dispose
  252. #===========================================================================
  253. @zodiacButton.dispose if INCLUDE_ZPOWER
  254. @zButton.dispose if INCLUDE_ZMOVES
  255. #===========================================================================
  256. pbDisposeSpriteHash(@button)
  257. end
  258.  
  259. #=============================================================================
  260. def overZodiac?
  261. return false if !defined?($mouse)
  262. return $mouse.over?(@zodiacButton)
  263. end
  264. #=============================================================================
  265. def overZMove?
  266. return false if !defined?($mouse)
  267. return $mouse.over?(@zButton)
  268. end
  269. #=============================================================================
  270. end
  271.  
  272. class PokeBattle_Scene
  273.  
  274. alias pbFightMenu_ebs pbFightMenu unless self.method_defined?(:pbFightMenu_ebs)
  275. def pbFightMenu(index)
  276. return pbFightMenu_ebs(index) if EBUISTYLE==0
  277. clearMessageWindow
  278. if EBUISTYLE==2
  279. @sprites["battlebox0"].visible = false if @sprites["battlebox0"]
  280. @sprites["battlebox2"].visible = false if @sprites["battlebox2"]
  281. end
  282. cw = @fightWindow
  283. mega = false
  284. #===========================================================================
  285. zodiac = false if INCLUDE_ZPOWER
  286. zMove = false if INCLUDE_ZMOVES
  287. #===========================================================================
  288. battler=@battle.battlers[index]
  289. cw.megaButton if @battle.pbCanMegaEvolve?(index)
  290. #===========================================================================
  291. cw.zodiacButton if (INCLUDE_ZPOWER && @battle.pbCanUseZodiacPower?(index))
  292. cw.zButton if (INCLUDE_ZMOVES && @battle.pbCanZMove?(index))
  293. #===========================================================================
  294. cw.battler=battler
  295. lastIndex=@lastmove[index]
  296. if battler.moves[lastIndex].id!=0
  297. cw.index=lastIndex
  298. else
  299. cw.index=0
  300. end
  301. cw.generateButtons
  302. pbSelectBattler(index)
  303. pbSEPlay("SE_Zoom4",50)
  304. moveUpperRight(cw)
  305. pbRefresh
  306. loop do
  307. pbGraphicsUpdate
  308. pbInputUpdate
  309. animateBattleSprites(true)
  310. cw.update
  311. # Update selected command
  312. if (defined?($mouse) && $mouse.active? && cw.mouseOver?)
  313. elsif (Input.trigger?(Input::LEFT) || Input.trigger?(Input::RIGHT)) && (EBUISTYLE==2)
  314. pbSEPlay("SE_Select1")
  315. cw.index=[0,1,2,3][[1,0,3,2].index(cw.index)]
  316. cw.index=(cw.nummoves-1) if cw.index < 0
  317. cw.index=0 if cw.index > (cw.nummoves-1)
  318. elsif (Input.trigger?(Input::UP) || Input.trigger?(Input::DOWN)) && (EBUISTYLE==2)
  319. pbSEPlay("SE_Select1")
  320. cw.index=[0,1,2,3][[2,3,0,1].index(cw.index)]
  321. cw.index=0 if cw.index < 0
  322. cw.index=(cw.nummoves-1) if cw.index > (cw.nummoves-1)
  323. elsif Input.trigger?(Input::LEFT) && cw.index < 4
  324. if cw.index > 0
  325. pbSEPlay("SE_Select1")
  326. cw.index-=1
  327. else
  328. pbSEPlay("SE_Select1")
  329. cw.index=cw.nummoves-1
  330. cw.refreshpos=true
  331. end
  332. elsif Input.trigger?(Input::RIGHT) && cw.index < 4
  333. if cw.index < (cw.nummoves-1)
  334. pbSEPlay("SE_Select1")
  335. cw.index+=1
  336. else
  337. pbSEPlay("SE_Select1")
  338. cw.index=0
  339. end
  340. end
  341. if Input.trigger?(Input::C) || (defined?($mouse) && cw.mouseOver? && $mouse.leftClick?) # Confirm choice
  342. if cw.index < 4
  343. @ret=cw.index
  344. @battle.pbRegisterMegaEvolution(index) if mega
  345. #=====================================================================
  346. if INCLUDE_ZPOWER
  347. @battle.pbRegisterZodiacPower(index) if zodiac
  348. end
  349. if INCLUDE_ZMOVES
  350. @battle.pbRegisterZMove(index) if zMove
  351. end
  352. #=====================================================================
  353. pbSEPlay("SE_Select2")
  354. @lastmove[index]=@ret
  355. @idleTimer=-1
  356. @inCMx=false
  357. break
  358. else
  359. @lastmove[index]=cw.index
  360. pbPlayCancelSE()
  361. @ret=-1
  362. break
  363. end
  364. #=========================================================================
  365. elsif Input.trigger?(Input::A) ||
  366. (defined?($mouse) && cw.overMega? && $mouse.leftClick?) ||
  367. (INCLUDE_ZPOWER && defined?($mouse) && cw.overZodiac? && $mouse.leftClick?) ||
  368. (INCLUDE_ZMOVES && (defined?($mouse) && cw.overZMove? && $mouse.leftClick?))
  369. #=========================================================================
  370. if @battle.pbCanMegaEvolve?(index) # Use Mega Evolution
  371. if mega
  372. mega = false
  373. else
  374. mega = true
  375. end
  376. cw.megaButtonTrigger
  377. pbSEPlay("SE_Select3")
  378. end
  379. #=========================================================================
  380. if INCLUDE_ZPOWER
  381. if @battle.pbCanUseZodiacPower?(index) # Use Zodiac Power
  382. if zodiac
  383. zodiac = false
  384. else
  385. zodiac = true
  386. end
  387. cw.zodiacButtonTrigger
  388. pbSEPlay("SE_Select3")
  389. end
  390. end
  391. #=========================================================================
  392. if INCLUDE_ZMOVES
  393. if @battle.pbCanZMove?(index) # Use Z-Move
  394. if zMove
  395. zMove = false
  396. else
  397. zMove = true
  398. end
  399. cw.zButtonTrigger
  400. pbSEPlay("SE_Select3")
  401. end
  402. end
  403. #=========================================================================
  404. elsif Input.trigger?(Input::B) || (defined?($mouse) && (cw.goBack? || $mouse.rightClick?)) # Cancel fight menu
  405. @lastmove[index]=cw.index
  406. #=======================================================================
  407. cw.megaButtonTrigger if mega
  408. cw.zodiacButtonTrigger if zodiac
  409. cw.zButtonTrigger if zMove
  410. #=======================================================================
  411. pbPlayCancelSE()
  412. @ret=-1
  413. break
  414. end
  415. end
  416. if @ret > -1
  417. vector = @battle.doublebattle ? VECTOR2 : VECTOR1
  418. @vector.set(vector)
  419. @orgPos=nil
  420. @vector.inc=0.2
  421. @vector.lock
  422. 10.times do
  423. cw.hide
  424. wait(1,true)
  425. end
  426. else
  427. moveLowerLeft(cw)
  428. end
  429. if EBUISTYLE==2 && !@battle.doublebattle
  430. @sprites["battlebox0"].visible = true if @sprites["battlebox0"]
  431. @sprites["battlebox2"].visible = true if @sprites["battlebox2"]
  432. end
  433. @sprites["battlebox#{index}"].visible = true if EBUISTYLE==2 && @doublebattle
  434. if EBUISTYLE==2 && @battle.doublebattle
  435. @sprites["battlebox0"].positionX = 0
  436. @sprites["battlebox2"].positionX = Graphics.width
  437. end
  438. return @ret
  439. end
  440. end
  441.  
  442. #===============================================================================
  443. # Fight Menu (Next Generation)
  444. # UI ovarhaul
  445. #===============================================================================
  446. class NextGenFightWindow
  447.  
  448. def initialize(viewport=nil,battle=nil)
  449. if !viewport.nil?
  450. view = Viewport.new(viewport.rect.x,viewport.rect.y,viewport.rect.width,viewport.rect.height)
  451. view.z = viewport.z
  452. view2 = Viewport.new(viewport.rect.x,viewport.rect.y,viewport.rect.width,viewport.rect.height)
  453. view2.z = viewport.z# + 2
  454. viewport = view
  455. end
  456. @viewport=viewport
  457. @viewport2=(viewport.nil?) ? viewport : view2
  458. @battle=battle
  459. @index=0
  460. @oldindex=-1
  461. @over=false
  462. @refreshpos=false
  463. @battler=nil
  464. @nummoves=0
  465.  
  466. @opponent=nil
  467. @player=nil
  468. @opponent=@battle.battlers[1] if !@battle.doublebattle
  469. @player=@battle.battlers[0] if !@battle.doublebattle
  470.  
  471. @buttonBitmap=pbBitmap("#{checkEBFolderPath}/nextGen/moveSelButtons")
  472.  
  473. @background=Sprite.new(@viewport)
  474. @background.bitmap=pbBitmap("#{checkEBFolderPath}/nextGen/newBattleMessageBox")
  475. @background.y=VIEWPORT_HEIGHT-96
  476. @background.z=100
  477.  
  478. @megaButton=Sprite.new(@viewport)
  479. @megaButton.bitmap=pbBitmap("#{checkEBFolderPath}/nextGen/megaEvoButton")
  480. @megaButton.z=101
  481. @megaButton.x=10
  482. @megaButton.y=316 + 100
  483. @megaButton.src_rect.set(0,0,44,44)
  484.  
  485. #===========================================================================
  486. if INCLUDE_ZPOWER
  487. @zodiacButton=Sprite.new(@viewport)
  488. @zodiacButton.bitmap=pbBitmap("Graphics/Pictures/Birthsigns/Other/battlezodiacEB2")
  489. @zodiacButton.z=101
  490. @zodiacButton.x=10
  491. @zodiacButton.y=316 + 100
  492. @zodiacButton.src_rect.set(0,0,44,44)
  493. end
  494. #===========================================================================
  495.  
  496. #===========================================================================
  497. if INCLUDE_ZMOVES
  498. @zButton=Sprite.new(@viewport)
  499. @zButton.bitmap=pbBitmap("#{checkEBFolderPath}/nextGen/ZMove")
  500. @zButton.z=101
  501. @zButton.x=10
  502. @zButton.y=316 + 100
  503. @zButton.src_rect.set(0,0,44,44)
  504. end
  505. #===========================================================================
  506.  
  507. @backButton=Sprite.new(@viewport)
  508. @backButton.bitmap=pbBitmap("#{checkEBFolderPath}/nextGen/backButton")
  509. @backButton.z=101
  510. @backButton.x=462
  511. @backButton.y=316
  512.  
  513. @button={}
  514. @moved=false
  515. @showMega=false
  516. #===========================================================================
  517. @showZodiac=false if INCLUDE_ZPOWER
  518. @showZMove=false if INCLUDE_ZMOVES
  519. #===========================================================================
  520. @ox=[60,258,60,258]
  521. @oy=[294,294,338,338]
  522. @category=[_INTL("PHYS"),_INTL("SPEC"),_INTL("STAT")]
  523. eff=[_INTL("Normal damage"),_INTL("Not very effective"),_INTL("Super effective")]
  524. @typeInd=Sprite.new(@viewport)
  525. @typeInd.bitmap=Bitmap.new(192,24*3)
  526. pbSetSmallFont(@typeInd.bitmap)
  527. for i in 0...3
  528. pbDrawOutlineText(@typeInd.bitmap,0,24*i,192,24,eff[i],Color.new(255,255,255),Color.new(0,0,0),1)
  529. end
  530. @typeInd.src_rect.set(0,0,192,24)
  531. @typeInd.ox=96
  532. @typeInd.oy=16
  533. @typeInd.z=103
  534. @typeInd.visible=false
  535. end
  536.  
  537. def hide
  538. @typeInd.visible=false
  539. @background.y += 10
  540. @megaButton.y += 10
  541. @backButton.y += 10
  542. #===========================================================================
  543. @zodiacButton.y += 10 if INCLUDE_ZPOWER
  544. @zButton.y += 10 if INCLUDE_ZMOVES
  545. #===========================================================================
  546. for i in 0...@nummoves
  547. @button["#{i}"].x -= ((i%2==0) ? 26 : -26)
  548. end
  549. @showMega=false
  550. #===========================================================================
  551. @showZodiac=false if INCLUDE_ZPOWER
  552. @showZMove=false if INCLUDE_ZMOVES
  553. #===========================================================================
  554. end
  555.  
  556. #=============================================================================
  557. def zodiacButton
  558. @showZodiac=true
  559. end
  560.  
  561. def zodiacButtonTrigger
  562. @zodiacButton.src_rect.x+=44
  563. @zodiacButton.src_rect.x=0 if @zodiacButton.src_rect.x > 44
  564. @zodiacButton.src_rect.y = -4
  565. end
  566. #=============================================================================
  567. def zButton
  568. @showZMove=true
  569. end
  570.  
  571. def zButtonTrigger
  572. @zButton.src_rect.x+=44
  573. @zButton.src_rect.x=0 if @zButton.src_rect.x > 44
  574. @zButton.src_rect.y = -4
  575. end
  576. #=============================================================================
  577.  
  578. def update
  579. if @showMega
  580. @megaButton.y -= 10 if @megaButton.y > 316
  581. @megaButton.src_rect.y += 1 if @megaButton.src_rect.y < 0
  582. end
  583. #===========================================================================
  584. if INCLUDE_ZPOWER
  585. if @showZodiac
  586. @zodiacButton.y -= 10 if @zodiacButton.y > 316
  587. @zodiacButton.src_rect.y += 1 if @zodiacButton.src_rect.y < 0
  588. end
  589. end
  590. #===========================================================================
  591. if INCLUDE_ZMOVES
  592. if @showZMove
  593. @zButton.y -= 10 if @zButton.y > 316
  594. @zButton.src_rect.y += 1 if @zButton.src_rect.y < 0
  595. end
  596. end
  597. #===========================================================================
  598. if @oldindex!=@index
  599. @button["#{@index}"].src_rect.y = -4
  600. if SHOWTYPEADVANTAGE && !@battle.doublebattle
  601. move = @battler.moves[@index]
  602. @modifier = move.pbTypeModifier(move.type,@player,@opponent)
  603. end
  604. @oldindex = @index
  605. end
  606. for i in 0...@nummoves
  607. @button["#{i}"].src_rect.x = 198*(@index == i ? 0 : 1)
  608. @button["#{i}"].y = @y[i]
  609. @button["#{i}"].src_rect.y += 1 if @button["#{i}"].src_rect.y < 0
  610. next if i!=@index
  611. if [0,1].include?(i)
  612. @button["#{i}"].y = @y[i] - ((@nummoves < 3) ? 18 : 34)
  613. elsif [2,3].include?(i)
  614. @button["#{i}"].y = @y[i] - 34
  615. @button["#{i-2}"].y = @y[i-2] - 34
  616. end
  617. end
  618. if SHOWTYPEADVANTAGE && !@battle.doublebattle
  619. @typeInd.visible = true
  620. @typeInd.y = @button["#{@index}"].y
  621. @typeInd.x = @button["#{@index}"].x + @button["#{@index}"].src_rect.width/2
  622. eff=0
  623. if @modifier<8
  624. eff=1 # "Not very effective"
  625. elsif @modifier>8
  626. eff=2 # "Super effective"
  627. end
  628. @typeInd.src_rect.y = 24*eff
  629. end
  630. if defined?($mouse)
  631. @over = false
  632. for i in 0...@nummoves
  633. if $mouse.overPixel?(@button["#{i}"])
  634. @index = i
  635. @over = true
  636. end
  637. end
  638. end
  639. end
  640.  
  641. def dispose
  642. @viewport.dispose
  643. @viewport2.dispose
  644. @background.dispose
  645. @megaButton.dispose
  646. #===========================================================================
  647. @zodiacButton.dispose if INCLUDE_ZPOWER
  648. @zButton.dispose if INCLUDE_ZMOVES
  649. #===========================================================================
  650. @backButton.dispose
  651. @typeInd.dispose
  652. pbDisposeSpriteHash(@button)
  653. end
  654.  
  655. #=============================================================================
  656. def overZodiac?
  657. return false if !defined?($mouse)
  658. return $mouse.over?(@zodiacButton)
  659. end
  660. #=============================================================================
  661. def overZMove?
  662. return false if !defined?($mouse)
  663. return $mouse.over?(@zButton)
  664. end
  665. #=============================================================================
  666. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement