Vendily

move old

Jul 5th, 2018
313
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #===============================================================================
  2. # Elite Battle system
  3. # by Luka S.J.
  4. # ----------------
  5. # MoveAnimations Script
  6. # ----------------
  7. # system is based off the original Essentials battle system, made by
  8. # Poccil & Maruno
  9. # No additional features added to AI, mechanics
  10. # or functionality of the battle system.
  11. # This update is purely cosmetic, and includes a B/W like dynamic scene with a
  12. # custom interface.
  13. #
  14. # Enjoy the script, and make sure to give credit!
  15. # (DO NOT ALTER THE NAMES OF THE INDIVIDUAL SCRIPT SECTIONS OR YOU WILL BREAK
  16. # YOUR SYSTEM!)
  17. #-------------------------------------------------------------------------------
  18. # New move animation engine. Plays custom animations for defined Pokemon moves,
  19. # if present. Otherwise defaults to default move animations based on the move type
  20. # and category. Overrides the default animation player, and doesn't allow
  21. # animations from the Editor to be played. Should you wish to make your own
  22. # move animations in the editor, do not include this script section in your project.
  23. # You can code your own move animations, by making a def and calling it
  24. # pbMoveAnimationSpecific#{3 digit move id}(userindex,targetindex,hitnum=0,multihit=false)
  25. #===============================================================================
  26. class PokeBattle_Scene
  27. attr_accessor :animationCount
  28. #-----------------------------------------------------------------------------
  29. # Main animation handling core
  30. #-----------------------------------------------------------------------------
  31. def pbAnimation(moveid,user,target,hitnum=0)
  32. # for hitnum, 1 is the charging animation, 0 is the damage animation
  33. return if !moveid
  34. # move information
  35. movedata = PBMoveData.new(moveid)
  36. move = PokeBattle_Move.pbFromPBMove(@battle,PBMove.new(moveid))
  37. numhits = user.thisMoveHits
  38. multihit = !numhits.nil? ? (numhits > @animationCount) : false
  39. @animationCount+=1
  40. if numhits.nil?
  41. @animationCount=1
  42. elsif @animationCount > numhits
  43. @animationCount=1
  44. end
  45. multitarget = false
  46. multitarget = move.target if (move.target==PBTargets::AllOpposing || move.target==PBTargets::AllNonUsers)
  47. target = user if !target
  48. # clears the current UI
  49. clearMessageWindow
  50. isVisible=[false,false,false,false]
  51. for i in 0...4
  52. if @sprites["battlebox#{i}"]
  53. isVisible[i]=@sprites["battlebox#{i}"].visible
  54. @sprites["battlebox#{i}"].visible=false
  55. end
  56. end
  57. # Substitute animation
  58. if @sprites["pokemon#{user.index}"] && @battle.battlescene
  59. subbed = @sprites["pokemon#{user.index}"].isSub
  60. self.setSubstitute(user.index,false) if subbed
  61. end
  62. # gets move animation def name
  63. anm = "pbMoveAnimationSpecific"+sprintf("%03d",moveid)
  64. handled = false
  65. if @battle.battlescene
  66. # checks if def for specific move exists, and then plays it
  67. if !handled && eval("defined?(#{anm})")
  68. handled = eval("#{anm}(#{user.index},#{target.index},#{hitnum},#{multihit})")
  69. end
  70. # in case people want to use the old animation player
  71. if REPLACEMISSINGANIM && !handled
  72. animid=pbFindAnimation(moveid,user.index,hitnum)
  73. return if !animid
  74. anim=animid[0]
  75. animations=load_data("Data/PkmnAnimations.rxdata")
  76. name=PBMoves.getName(moveid)
  77. pbSaveShadows {
  78. if animid[1] # On opposing side and using OppMove animation
  79. pbAnimationCore(animations[anim],target,user,true,name)
  80. else # On player's side, and/or using Move animation
  81. pbAnimationCore(animations[anim],user,target,false,name)
  82. end
  83. }
  84. handled = true
  85. end
  86. # decides which global move animation to play, if any
  87. if !handled
  88. handled = playGlobalMoveAnimation(move.type,user.index,target.index,multitarget,multihit,movedata.category,hitnum)
  89. end
  90. # if all above failed, plays the move animation for Tackle
  91. if !handled
  92. pbMoveAnimationSpecific303(user.index,target.index,0,multihit)
  93. end
  94. end
  95. # Change form to transformed version
  96. if PBMoveData.new(moveid).function==0x69 && user && target # Transform
  97. pbChangePokemon(user,target.pokemon)
  98. end
  99. # restores cleared UI
  100. for i in 0...4
  101. if @sprites["battlebox#{i}"]
  102. @sprites["battlebox#{i}"].visible=true if isVisible[i]
  103. end
  104. end
  105. self.afterAnim = true
  106. end
  107. #-----------------------------------------------------------------------------
  108. # Bug Bite
  109. #-----------------------------------------------------------------------------
  110. def pbMoveAnimationSpecific008(userindex,targetindex,hitnum=0,multihit=false)
  111. # inital configuration
  112. usersprite = @sprites["pokemon#{userindex}"]
  113. targetsprite = @sprites["pokemon#{targetindex}"]
  114. player = (targetindex%2==0)
  115. itself = (userindex==targetindex)
  116. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  117. @vector.set(getRealVector(targetindex,player))
  118. wait(16,true)
  119. # set up animation
  120. factor = targetsprite.zoom_x
  121. cx, cy = getCenter(targetsprite,true)
  122. fp = {}
  123. dx = []
  124. dy = []
  125. da = []
  126. for j in 0...12
  127. fp["s#{j}"] = Sprite.new(targetsprite.viewport)
  128. fp["s#{j}"].bitmap = pbBitmap("Graphics/Animations/eb008")
  129. fp["s#{j}"].src_rect.set(32*rand(2),0,32,32)
  130. fp["s#{j}"].ox = fp["s#{j}"].src_rect.width/2
  131. fp["s#{j}"].oy = fp["s#{j}"].src_rect.height/2
  132. r = 32*factor
  133. fp["s#{j}"].x = cx - r + rand(r*2)
  134. fp["s#{j}"].y = cy - r + rand(r*2)
  135. fp["s#{j}"].z = targetsprite.z + 1
  136. fp["s#{j}"].visible = false
  137. end
  138. for j in 0...32
  139. fp["#{j}"] = Sprite.new(targetsprite.viewport)
  140. fp["#{j}"].bitmap = pbBitmap("Graphics/Animations/eb008_2")
  141. fp["#{j}"].ox = fp["#{j}"].bitmap.width/2
  142. fp["#{j}"].oy = fp["#{j}"].bitmap.height/2
  143. r = 32*factor
  144. x = cx - r + rand(r*2)
  145. y = cy - r + rand(r)
  146. fp["#{j}"].x = x
  147. fp["#{j}"].y = y
  148. fp["#{j}"].z = targetsprite.z
  149. fp["#{j}"].visible = false
  150. fp["#{j}"].angle = rand(360)
  151. ox = (x < cx ? x-rand(24*factor)-24*factor : x+rand(24*factor)+24*factor)
  152. oy = y - rand(24*factor) - 24*factor
  153. dx.push(ox)
  154. dy.push(oy)
  155. a = (x < cx ? rand(6)+1 : -rand(6)-1)
  156. da.push(a)
  157. end
  158. # play animation
  159. for i in 0...64
  160. for j in 0...32
  161. next if j>i
  162. fp["#{j}"].visible = true
  163. if ((fp["#{j}"].x - dx[j])*0.2).abs < 1
  164. fp["#{j}"].y += 4
  165. fp["#{j}"].opacity -= 16
  166. else
  167. fp["#{j}"].x -= (fp["#{j}"].x - dx[j])*0.2
  168. fp["#{j}"].y -= (fp["#{j}"].y - dy[j])*0.2
  169. end
  170. fp["#{j}"].angle += da[j]*8
  171. end
  172. for j in 0...12
  173. next if j>(i/4)
  174. fp["s#{j}"].visible = true
  175. fp["s#{j}"].opacity -= 32
  176. fp["s#{j}"].zoom_x += 0.02
  177. fp["s#{j}"].zoom_y += 0.02
  178. fp["s#{j}"].angle += 8
  179. end
  180. targetsprite.zoom_y = factor + 0.32 if i%4 == 0 && i < 48
  181. targetsprite.zoom_y -= 0.08 if targetsprite.zoom_y > factor
  182. pbSEPlay("eb_bug1",80) if i%4==0 && i < 48
  183. wait(1)
  184. end
  185. @vector.set(defaultvector) if !multihit
  186. pbDisposeSpriteHash(fp)
  187. return true
  188. end
  189. #-----------------------------------------------------------------------------
  190. # Struggle Bug
  191. #-----------------------------------------------------------------------------
  192. def pbMoveAnimationSpecific010(userindex,targetindex,hitnum=0,multihit=false)
  193. # inital configuration
  194. usersprite = @sprites["pokemon#{userindex}"]
  195. targetsprite = @sprites["pokemon#{targetindex}"]
  196. player = (targetindex%2==0)
  197. player2 = (userindex%2==0)
  198. itself = (userindex==targetindex)
  199. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  200. # configure animation
  201. @vector.set(getRealVector(userindex,player2))
  202. wait(16,true)
  203. factor = usersprite.zoom_x
  204. cx, cy = getCenter(usersprite,true)
  205. dx = []
  206. dy = []
  207. fp = {}
  208. for j in 0...24
  209. fp["#{j}"] = Sprite.new(targetsprite.viewport)
  210. fp["#{j}"].bitmap = pbBitmap("Graphics/Animations/eb010")
  211. fp["#{j}"].ox = fp["#{j}"].bitmap.width/2
  212. fp["#{j}"].oy = fp["#{j}"].bitmap.height/2
  213. r = 64*factor
  214. x, y = randCircleCord(r)
  215. x = cx - r + x
  216. y = cy - r + y
  217. fp["#{j}"].x = cx
  218. fp["#{j}"].y = cx
  219. fp["#{j}"].z = usersprite.z
  220. fp["#{j}"].visible = false
  221. fp["#{j}"].angle = rand(360)
  222. z = [0.5,1,0.75][rand(3)]
  223. fp["#{j}"].zoom_x = z
  224. fp["#{j}"].zoom_y = z
  225. dx.push(x)
  226. dy.push(y)
  227. end
  228. # start animation
  229. pbSEPlay("eb_ground1",80)
  230. for i in 0...48
  231. for j in 0...24
  232. next if j>(i*2)
  233. fp["#{j}"].visible = true
  234. if ((fp["#{j}"].x - dx[j])*0.1).abs < 1
  235. fp["#{j}"].opacity -= 32
  236. else
  237. fp["#{j}"].x -= (fp["#{j}"].x - dx[j])*0.1
  238. fp["#{j}"].y -= (fp["#{j}"].y - dy[j])*0.1
  239. end
  240. end
  241. wait(1)
  242. end
  243. @vector.set(getRealVector(targetindex,player))
  244. wait(16,true)
  245. factor = targetsprite.zoom_x
  246. cx, cy = getCenter(targetsprite,true)
  247. for j in 0...12
  248. fp["s#{j}"] = Sprite.new(targetsprite.viewport)
  249. fp["s#{j}"].bitmap = pbBitmap("Graphics/Animations/eb244_2")
  250. fp["s#{j}"].ox = fp["s#{j}"].bitmap.width/2
  251. fp["s#{j}"].oy = fp["s#{j}"].bitmap.height/2
  252. r = 32*factor
  253. fp["s#{j}"].x = cx - r + rand(r*2)
  254. fp["s#{j}"].y = cy - r + rand(r*2)
  255. fp["s#{j}"].z = targetsprite.z + 1
  256. fp["s#{j}"].visible = false
  257. fp["s#{j}"].tone = Tone.new(255,255,255)
  258. fp["s#{j}"].angle = rand(360)
  259. end
  260. # anim2
  261. for i in 0...32
  262. for j in 0...12
  263. next if j>(i*2)
  264. fp["s#{j}"].visible = true
  265. fp["s#{j}"].opacity -= 32
  266. fp["s#{j}"].zoom_x += 0.02
  267. fp["s#{j}"].zoom_y += 0.02
  268. fp["s#{j}"].angle += 8
  269. fp["s#{j}"].tone.red -= 32
  270. fp["s#{j}"].tone.green -= 32
  271. fp["s#{j}"].tone.blue -= 32
  272. end
  273. targetsprite.still
  274. pbSEPlay("eb_normal2",80) if i%4==0 && i < 16
  275. wait(1)
  276. end
  277. @vector.set(defaultvector) if !multihit
  278. pbDisposeSpriteHash(fp)
  279. return true
  280. end
  281. #-----------------------------------------------------------------------------
  282. # Crunch
  283. #-----------------------------------------------------------------------------
  284. def pbMoveAnimationSpecific024(userindex,targetindex,hitnum=0,multihit=false)
  285. # inital configuration
  286. usersprite = @sprites["pokemon#{userindex}"]
  287. targetsprite = @sprites["pokemon#{targetindex}"]
  288. player = (targetindex%2==0)
  289. itself = (userindex==targetindex)
  290. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  291. # set up animation
  292. fp = {}
  293. rndx = []
  294. rndy = []
  295. fp["bg"] = Sprite.new(targetsprite.viewport)
  296. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  297. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(66,60,81))
  298. fp["bg"].opacity = 0
  299. for i in 0...10
  300. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  301. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb024")
  302. fp["#{i}"].ox = 6
  303. fp["#{i}"].oy = 5
  304. fp["#{i}"].opacity = 0
  305. fp["#{i}"].z = 50
  306. fp["#{i}"].zoom_x = (targetsprite.zoom_x)
  307. fp["#{i}"].zoom_y = (targetsprite.zoom_y)
  308. rndx.push(rand(128))
  309. rndy.push(rand(128))
  310. end
  311. fp["fang1"] = Sprite.new(targetsprite.viewport)
  312. fp["fang1"].bitmap = pbBitmap("Graphics/Animations/eb028")
  313. fp["fang1"].ox = fp["fang1"].bitmap.width/2
  314. fp["fang1"].oy = fp["fang1"].bitmap.height - 20
  315. fp["fang1"].opacity = 0
  316. fp["fang1"].z = 41
  317. fp["fang2"] = Sprite.new(targetsprite.viewport)
  318. fp["fang2"].bitmap = pbBitmap("Graphics/Animations/eb028")
  319. fp["fang2"].ox = fp["fang1"].bitmap.width/2
  320. fp["fang2"].oy = fp["fang1"].bitmap.height - 20
  321. fp["fang2"].opacity = 0
  322. fp["fang2"].z = 40
  323. fp["fang2"].angle = 180
  324. shake = 4
  325. # start animation
  326. @vector.set(getRealVector(targetindex,player))
  327. for i in 0...72
  328. cx, cy = getCenter(targetsprite,true)
  329. fp["fang1"].x = cx; fp["fang1"].y = cy
  330. fp["fang1"].zoom_x = targetsprite.zoom_x; fp["fang1"].zoom_y = targetsprite.zoom_y
  331. fp["fang2"].x = cx; fp["fang2"].y = cy
  332. fp["fang2"].zoom_x = targetsprite.zoom_x; fp["fang2"].zoom_y = targetsprite.zoom_y
  333. if i.between?(20,29)
  334. fp["fang1"].opacity += 5
  335. fp["fang1"].oy += 2
  336. fp["fang2"].opacity += 5
  337. fp["fang2"].oy += 2
  338. elsif i.between?(30,40)
  339. fp["fang1"].opacity += 25.5
  340. fp["fang1"].oy -= 4
  341. fp["fang2"].opacity += 25.5
  342. fp["fang2"].oy -= 4
  343. else i > 40
  344. fp["fang1"].opacity -= 26
  345. fp["fang1"].oy += 2
  346. fp["fang2"].opacity -= 26
  347. fp["fang2"].oy += 2
  348. end
  349. if i==32
  350. pbSEPlay("#{SE_EXTRA_PATH}Super Fang")
  351. end
  352. for j in 0...10
  353. next if i < 40
  354. if fp["#{j}"].opacity == 0 && fp["#{j}"].visible
  355. fp["#{j}"].x = cx
  356. fp["#{j}"].y = cy
  357. end
  358. x2 = cx - 64*targetsprite.zoom_x + rndx[j]*targetsprite.zoom_x
  359. y2 = cy - 64*targetsprite.zoom_y + rndy[j]*targetsprite.zoom_y
  360. x0 = fp["#{j}"].x
  361. y0 = fp["#{j}"].y
  362. fp["#{j}"].angle += 16
  363. fp["#{j}"].x += (x2 - x0)*0.2
  364. fp["#{j}"].y += (y2 - y0)*0.2
  365. fp["#{j}"].zoom_x += 0.001
  366. fp["#{j}"].zoom_y += 0.001
  367. if (x2 - x0)*0.2 < 1 && (y2 - y0)*0.2 < 1
  368. fp["#{j}"].opacity -= 32
  369. else
  370. fp["#{j}"].opacity += 45
  371. fp["#{j}"].angle += 16
  372. end
  373. fp["#{j}"].visible = false if fp["#{j}"].opacity <= 0
  374. end
  375. fp["bg"].opacity += 4 if i < 40
  376. if i >= 40
  377. if i >= 56
  378. targetsprite.tone.red -= 3*2
  379. targetsprite.tone.green -= 3*2
  380. targetsprite.tone.blue -= 3*2
  381. fp["bg"].opacity -= 10
  382. else
  383. targetsprite.tone.red += 3*2 if targetsprite.tone.red < 48*2
  384. targetsprite.tone.green += 3*2 if targetsprite.tone.green < 48*2
  385. targetsprite.tone.blue += 3*2 if targetsprite.tone.blue < 48*2
  386. end
  387. targetsprite.addOx(shake)
  388. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  389. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  390. targetsprite.still
  391. end
  392. wait(1,true)
  393. end
  394. targetsprite.ox = targetsprite.bitmap.width/2
  395. @vector.set(defaultvector) if !multihit
  396. pbDisposeSpriteHash(fp)
  397. return true
  398. end
  399. #-----------------------------------------------------------------------------
  400. # Night Slash
  401. #-----------------------------------------------------------------------------
  402. def pbMoveAnimationSpecific027(userindex,targetindex,hitnum=0,multihit=false)
  403. # inital configuration
  404. usersprite = @sprites["pokemon#{userindex}"]
  405. targetsprite = @sprites["pokemon#{targetindex}"]
  406. player = (targetindex%2==0)
  407. itself = (userindex==targetindex)
  408. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  409. @vector.set(getRealVector(targetindex,player))
  410. wait(16,true)
  411. # set up animation
  412. factor = targetsprite.zoom_x
  413. cx, cy = getCenter(targetsprite,true)
  414. fp = {}
  415. dx = []
  416. dy = []
  417. fp["bg"] = ScrollingSprite.new(targetsprite.viewport)
  418. fp["bg"].speed = 64
  419. fp["bg"].setBitmap("Graphics/Animations/eb027_bg")
  420. fp["bg"].opacity = 0
  421. fp["bg"].z = 50
  422. for j in 0...12
  423. fp["s#{j}"] = Sprite.new(targetsprite.viewport)
  424. fp["s#{j}"].bitmap = pbBitmap("Graphics/Animations/eb027_2")
  425. fp["s#{j}"].ox = fp["s#{j}"].bitmap.width/2
  426. fp["s#{j}"].oy = fp["s#{j}"].bitmap.height/2
  427. r = 128*factor
  428. x, y = randCircleCord(r)
  429. x = cx - r + x
  430. y = cy - r + y
  431. z = [1,0.75,0.5][rand(3)]
  432. fp["s#{j}"].zoom_x = z
  433. fp["s#{j}"].zoom_y = z
  434. fp["s#{j}"].x = cx
  435. fp["s#{j}"].y = cy
  436. fp["s#{j}"].z = targetsprite.z + 1
  437. fp["s#{j}"].visible = false
  438. dx.push(x)
  439. dy.push(y)
  440. end
  441. fp["slash"] = Sprite.new(targetsprite.viewport)
  442. fp["slash"].bitmap = pbBitmap("Graphics/Animations/eb027")
  443. fp["slash"].oy = fp["slash"].bitmap.height/2
  444. fp["slash"].y = cy
  445. fp["slash"].x = targetsprite.viewport.rect.width
  446. fp["slash"].opacity = 0
  447. fp["slash"].z = 50
  448. # play animation
  449. pbSEPlay("#{SE_EXTRA_PATH}gust",90)
  450. for m in 0...2
  451. shake = 2
  452. for i in 0...(m < 1 ? 32 : 16)
  453. fp["bg"].opacity += 16 if m < 1
  454. fp["bg"].update
  455. if m < 1
  456. fp["slash"].x -= 64 if i >= 28
  457. fp["slash"].opacity += 64 if i >= 28
  458. else
  459. fp["slash"].x += 64 if i >= 12
  460. fp["slash"].opacity += 64 if i >= 12
  461. end
  462. wait(1,true)
  463. end
  464. pbSEPlay("#{SE_EXTRA_PATH}hit")
  465. for i in 0...16
  466. fp["bg"].opacity -= 16
  467. for j in 0...12
  468. fp["s#{j}"].visible = true
  469. fp["s#{j}"].x -= (fp["s#{j}"].x - dx[j])*0.1
  470. fp["s#{j}"].y -= (fp["s#{j}"].y - dy[j])*0.1
  471. fp["s#{j}"].zoom_x -= 0.04
  472. fp["s#{j}"].zoom_y -= 0.04
  473. fp["s#{j}"].tone.gray += 16
  474. fp["s#{j}"].tone.red -= 8
  475. fp["s#{j}"].tone.green -= 8
  476. fp["s#{j}"].tone.blue -= 8
  477. fp["s#{j}"].opacity -= 16
  478. end
  479. if m < 1
  480. fp["slash"].x -= 64
  481. else
  482. fp["slash"].x += 64
  483. end
  484. fp["slash"].opacity -= 32
  485. targetsprite.addOx(shake)
  486. shake = -2 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  487. shake = 2 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  488. targetsprite.still
  489. wait(1)
  490. end
  491. targetsprite.ox = targetsprite.bitmap.width/2
  492. dx.clear
  493. dy.clear
  494. fp["slash"].mirror = true
  495. fp["slash"].ox = fp["slash"].bitmap.width
  496. fp["slash"].opacity = 0
  497. fp["slash"].x = 0
  498. for j in 0...12
  499. fp["s#{j}"].x = cx
  500. fp["s#{j}"].y = cy
  501. fp["s#{j}"].tone = Tone.new(0,0,0,0)
  502. fp["s#{j}"].opacity = 255
  503. fp["s#{j}"].visible = false
  504. z = [1,0.75,0.5][rand(3)]
  505. fp["s#{j}"].zoom_x = z
  506. fp["s#{j}"].zoom_y = z
  507. r = 128*factor
  508. x, y = randCircleCord(r)
  509. x = cx - r + x
  510. y = cy - r + y
  511. dx.push(x)
  512. dy.push(y)
  513. end
  514. end
  515. wait(8)
  516. @vector.set(defaultvector) if !multihit
  517. pbDisposeSpriteHash(fp)
  518. return true
  519. end
  520. #-----------------------------------------------------------------------------
  521. # Bite
  522. #-----------------------------------------------------------------------------
  523. def pbMoveAnimationSpecific028(userindex,targetindex,hitnum=0,multihit=false)
  524. # inital configuration
  525. usersprite = @sprites["pokemon#{userindex}"]
  526. targetsprite = @sprites["pokemon#{targetindex}"]
  527. player = (targetindex%2==0)
  528. itself = (userindex==targetindex)
  529. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  530. # set up animation
  531. fp = {}
  532. rndx = []
  533. rndy = []
  534. fp["bg"] = Sprite.new(targetsprite.viewport)
  535. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  536. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(66,60,81))
  537. fp["bg"].opacity = 0
  538. fp["fang1"] = Sprite.new(targetsprite.viewport)
  539. fp["fang1"].bitmap = pbBitmap("Graphics/Animations/eb028")
  540. fp["fang1"].ox = fp["fang1"].bitmap.width/2
  541. fp["fang1"].oy = fp["fang1"].bitmap.height - 20
  542. fp["fang1"].opacity = 0
  543. fp["fang1"].z = 41
  544. fp["fang2"] = Sprite.new(targetsprite.viewport)
  545. fp["fang2"].bitmap = pbBitmap("Graphics/Animations/eb028")
  546. fp["fang2"].ox = fp["fang1"].bitmap.width/2
  547. fp["fang2"].oy = fp["fang1"].bitmap.height - 20
  548. fp["fang2"].opacity = 0
  549. fp["fang2"].z = 40
  550. fp["fang2"].angle = 180
  551. shake = 4
  552. # start animation
  553. @vector.set(getRealVector(targetindex,player))
  554. for i in 0...72
  555. cx, cy = getCenter(targetsprite,true)
  556. fp["fang1"].x = cx; fp["fang1"].y = cy
  557. fp["fang1"].zoom_x = targetsprite.zoom_x; fp["fang1"].zoom_y = targetsprite.zoom_y
  558. fp["fang2"].x = cx; fp["fang2"].y = cy
  559. fp["fang2"].zoom_x = targetsprite.zoom_x; fp["fang2"].zoom_y = targetsprite.zoom_y
  560. if i.between?(20,29)
  561. fp["fang1"].opacity += 5
  562. fp["fang1"].oy += 2
  563. fp["fang2"].opacity += 5
  564. fp["fang2"].oy += 2
  565. elsif i.between?(30,40)
  566. fp["fang1"].opacity += 25.5
  567. fp["fang1"].oy -= 4
  568. fp["fang2"].opacity += 25.5
  569. fp["fang2"].oy -= 4
  570. else i > 40
  571. fp["fang1"].opacity -= 26
  572. fp["fang1"].oy += 2
  573. fp["fang2"].opacity -= 26
  574. fp["fang2"].oy += 2
  575. end
  576. if i==32
  577. pbSEPlay("#{SE_EXTRA_PATH}Super Fang")
  578. end
  579. fp["bg"].opacity += 4 if i < 40
  580. if i >= 40
  581. fp["bg"].opacity -= 10 if i >= 56
  582. targetsprite.addOx(shake)
  583. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  584. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  585. targetsprite.still
  586. end
  587. wait(1,true)
  588. end
  589. targetsprite.ox = targetsprite.bitmap.width/2
  590. @vector.set(defaultvector) if !multihit
  591. pbDisposeSpriteHash(fp)
  592. return true
  593. end
  594. #-----------------------------------------------------------------------------
  595. # Dragon Claw
  596. #-----------------------------------------------------------------------------
  597. def pbMoveAnimationSpecific057(userindex,targetindex,hitnum=0,multihit=false)
  598. # inital configuration
  599. usersprite = @sprites["pokemon#{userindex}"]
  600. targetsprite = @sprites["pokemon#{targetindex}"]
  601. player = (targetindex%2==0)
  602. player2 = (userindex%2==0)
  603. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  604. vector = getRealVector(targetindex,player)
  605. vector2 = getRealVector(userindex,player2)
  606. # set up animation
  607. fp = {}
  608. speed = []
  609. for j in 0...32
  610. fp["#{j}"] = Sprite.new(usersprite.viewport)
  611. fp["#{j}"].z = player2 ? 29 : 19
  612. fp["#{j}"].bitmap = pbBitmap("Graphics/Animations/eb057")
  613. fp["#{j}"].ox = fp["#{j}"].bitmap.width/2
  614. fp["#{j}"].oy = fp["#{j}"].bitmap.height/2
  615. fp["#{j}"].color = Color.new(255,255,255,255)
  616. z = [0.5,1.5,1,0.75,1.25][rand(5)]
  617. fp["#{j}"].zoom_x = z
  618. fp["#{j}"].zoom_y = z
  619. fp["#{j}"].opacity = 0
  620. speed.push((rand(8)+1)*4)
  621. end
  622. for j in 0...8
  623. fp["s#{j}"] = Sprite.new(usersprite.viewport)
  624. fp["s#{j}"].z = player2 ? 29 : 19
  625. fp["s#{j}"].bitmap = pbBitmap("Graphics/Animations/eb057_2")
  626. fp["s#{j}"].ox = fp["s#{j}"].bitmap.width/2
  627. fp["s#{j}"].oy = fp["s#{j}"].bitmap.height
  628. #z = [0.5,1.5,1,0.75,1.25][rand(5)]
  629. fp["s#{j}"].color = Color.new(255,255,255,255)
  630. #fp["s#{j}"].zoom_y = z
  631. fp["s#{j}"].opacity = 0
  632. end
  633. usersprite.color = Color.new(255,0,0,0)
  634. # start animation
  635. @vector.set(vector2)
  636. @vector.inc = 0.1
  637. oy = usersprite.oy
  638. k = -1
  639. for i in 0...64
  640. k *= -1 if i%4==0
  641. pbSEPlay("eb_dragon2") if i == 12
  642. cx, cy = getCenter(usersprite,true)
  643. for j in 0...32
  644. next if i < 8
  645. next if j>(i-8)
  646. if fp["#{j}"].opacity == 0 && fp["#{j}"].color.alpha == 255
  647. fp["#{j}"].y = usersprite.y + 8*usersprite.zoom_y - rand(24)*usersprite.zoom_y
  648. fp["#{j}"].x = cx - 64*usersprite.zoom_x + rand(128)*usersprite.zoom_x
  649. end
  650. if fp["#{j}"].color.alpha <= 96
  651. fp["#{j}"].opacity -= 32
  652. else
  653. fp["#{j}"].opacity += 32
  654. end
  655. fp["#{j}"].color.alpha -= 16
  656. fp["#{j}"].y -= speed[j]
  657. end
  658. for j in 0...8
  659. next if i < 12
  660. next if j>(i-12)/2
  661. if fp["s#{j}"].opacity == 0 && fp["s#{j}"].color.alpha == 255
  662. fp["s#{j}"].y = usersprite.y + 48*usersprite.zoom_y - rand(16)*usersprite.zoom_y
  663. fp["s#{j}"].x = cx - 64*usersprite.zoom_x + rand(128)*usersprite.zoom_x
  664. end
  665. if fp["s#{j}"].color.alpha <= 96
  666. fp["s#{j}"].opacity -= 32
  667. else
  668. fp["s#{j}"].opacity += 32
  669. end
  670. fp["s#{j}"].color.alpha -= 16
  671. fp["s#{j}"].zoom_y += speed[j]*0.25*0.01
  672. fp["s#{j}"].y -= speed[j]
  673. end
  674. if i < 48
  675. usersprite.color.alpha += 4
  676. else
  677. usersprite.color.alpha -= 16
  678. end
  679. usersprite.oy -= 2*k if i%2==0
  680. usersprite.still
  681. usersprite.anim = true
  682. wait(1,true)
  683. end
  684. usersprite.oy = oy
  685. @vector.set(vector)
  686. @vector.inc = 0.2
  687. wait(16,true)
  688. cx, cy = getCenter(targetsprite,true)
  689. fp["claw1"] = Sprite.new(targetsprite.viewport)
  690. fp["claw1"].bitmap = pbBitmap("Graphics/Animations/eb057_3")
  691. fp["claw1"].src_rect.set(-82,0,82,174)
  692. fp["claw1"].ox = fp["claw1"].src_rect.width
  693. fp["claw1"].oy = fp["claw1"].src_rect.height/2
  694. fp["claw1"].x = cx - 32*targetsprite.zoom_x
  695. fp["claw1"].y = cy
  696. fp["claw1"].z = player ? 29 : 19
  697. fp["claw2"] = Sprite.new(targetsprite.viewport)
  698. fp["claw2"].bitmap = pbBitmap("Graphics/Animations/eb057_3")
  699. fp["claw2"].src_rect.set(-82,0,82,174)
  700. fp["claw2"].ox = 0
  701. fp["claw2"].oy = fp["claw2"].src_rect.height/2
  702. fp["claw2"].x = cx + 32*targetsprite.zoom_x
  703. fp["claw2"].y = cy
  704. fp["claw2"].z = player ? 29 : 19
  705. fp["claw2"].mirror = true
  706. shake = 4
  707. for i in 0...32
  708. targetsprite.still
  709. pbSEPlay("#{SE_EXTRA_PATH}Slash10") if i == 4 || i == 16
  710. for j in 1..2
  711. next if (j-1)>(i/12)
  712. fp["claw#{j}"].src_rect.x += 82 if fp["claw#{j}"].src_rect.x < 82*3 && i%2==0
  713. end
  714. fp["claw1"].visible = false if i == 16
  715. fp["claw2"].visible = false if i == 32
  716. if i.between?(4,12) || i.between?(20,28)
  717. targetsprite.addOx(shake)
  718. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  719. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  720. end
  721. wait(1,true)
  722. end
  723. targetsprite.ox = targetsprite.bitmap.width/2
  724. @vector.set(defaultvector) if !multihit
  725. pbDisposeSpriteHash(fp)
  726. return true
  727. end
  728. #-----------------------------------------------------------------------------
  729. # Dragon Breath
  730. #-----------------------------------------------------------------------------
  731. def pbMoveAnimationSpecific059(userindex,targetindex,hitnum=0,multihit=false)
  732. # inital configuration
  733. usersprite = @sprites["pokemon#{userindex}"]
  734. targetsprite = @sprites["pokemon#{targetindex}"]
  735. player = (targetindex%2==0)
  736. player2 = (userindex%2==0)
  737. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  738. vector = getRealVector(targetindex,player)
  739. vector2 = getRealVector(userindex,player2)
  740. factor = player2 ? 2 : 1
  741. # set up animation
  742. fp = {}
  743. rndx = []
  744. rndy = []
  745. dx = []
  746. dy = []
  747. targetsprite.color = Color.new(255,0,0,0)
  748. for m in 0...2
  749. rndx.push([]); rndy.push([]); dx.push([]); dy.push([])
  750. for i in 0...96
  751. str = ["","_2"][rand(2)]
  752. str = "Graphics/Animations/eb59"+str
  753. str = "Graphics/Animations/eb59_3" if m == 1
  754. fp["#{i}#{m}"] = Sprite.new(targetsprite.viewport)
  755. fp["#{i}#{m}"].bitmap = pbBitmap(str)
  756. fp["#{i}#{m}"].ox = fp["#{i}#{m}"].bitmap.width/2
  757. fp["#{i}#{m}"].oy = fp["#{i}#{m}"].bitmap.height/2
  758. fp["#{i}#{m}"].angle = rand(360)
  759. fp["#{i}#{m}"].opacity = 0
  760. if m == 0
  761. fp["#{i}#{m}"].zoom_x = 0.8
  762. fp["#{i}#{m}"].zoom_y = 0.8
  763. end
  764. fp["#{i}#{m}"].z = player ? 29 : 19
  765. rndx[m].push(rand([16,128][m]))
  766. rndy[m].push(rand([16,128][m]))
  767. dx[m].push(0)
  768. dy[m].push(0)
  769. end
  770. end
  771. shake = 4
  772. # start animation
  773. for i in 0...96
  774. pbSEPlay("eb_dragon2") if i==8
  775. pbSEPlay("eb_dragon1") if i==74
  776. for m in 0...2
  777. for j in 0...96
  778. next if j>(i*2)
  779. if fp["#{j}#{m}"].opacity == 0 && fp["#{j}#{m}"].tone.gray == 0
  780. cx, cy = getCenter(usersprite,true)
  781. dx[m][j] = cx - [8,64][m]*usersprite.zoom_x*0.5 + rndx[m][j]*usersprite.zoom_x*0.5
  782. dy[m][j] = cy - [8,64][m]*usersprite.zoom_y*0.5 + rndy[m][j]*usersprite.zoom_y*0.5
  783. fp["#{j}#{m}"].x = dx[m][j]
  784. fp["#{j}#{m}"].y = dy[m][j]
  785. if m == 1
  786. fp["#{j}#{m}"].opacity = 55 + rand(151)
  787. z = [0.5,0.75,1,0.3][rand(4)]
  788. fp["#{j}#{m}"].zoom_x = z
  789. fp["#{j}#{m}"].zoom_y = z
  790. end
  791. end
  792. cx, cy = getCenter(usersprite,true)
  793. x0 = dx[m][j]
  794. y0 = dy[m][j]
  795. cx, cy = getCenter(targetsprite,true)
  796. x2 = cx - [8,64][m]*targetsprite.zoom_x*0.5 + rndx[m][j]*targetsprite.zoom_x*0.5
  797. y2 = cy - [8,64][m]*targetsprite.zoom_y*0.5 + rndy[m][j]*targetsprite.zoom_y*0.5
  798. fp["#{j}#{m}"].x += (x2 - x0)*0.1
  799. fp["#{j}#{m}"].y += (y2 - y0)*0.1
  800. fp["#{j}#{m}"].opacity += 51 if m == 0
  801. fp["#{j}#{m}"].zoom_x += 0.04 if m == 0
  802. fp["#{j}#{m}"].zoom_y += 0.04 if m == 0
  803. nextx = fp["#{j}#{m}"].x# + (x2 - x0)*0.1
  804. nexty = fp["#{j}#{m}"].y# + (y2 - y0)*0.1
  805. if !player
  806. if nextx > cx && nexty < cy
  807. fp["#{j}#{m}"].visible = false if m == 0
  808. fp["#{j}#{m}"].opacity -= 75 if m == 1
  809. fp["#{j}#{m}"].tone.gray = 1 if m == 1
  810. end
  811. else
  812. if nextx < cx && nexty > cy
  813. fp["#{j}#{m}"].visible = false if m == 0
  814. fp["#{j}#{m}"].opacity -= 75 if m == 1
  815. fp["#{j}#{m}"].tone.gray = 1 if m == 1
  816. end
  817. end
  818. end
  819. end
  820. if i >= 58 && i < 74
  821. targetsprite.addOx(shake)
  822. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  823. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  824. targetsprite.color.alpha += 12
  825. targetsprite.still
  826. end
  827. targetsprite.zoom_y += 0.16 if i == 74
  828. if i >= 74 && i < 90
  829. targetsprite.color.alpha -= 12
  830. targetsprite.ox = targetsprite.bitmap.width/2
  831. targetsprite.still
  832. targetsprite.zoom_y -= 0.01
  833. end
  834. targetsprite.anim = true
  835. @vector.set(DUALVECTOR) if i == 32
  836. @vector.inc = 0.1 if i == 32
  837. wait(1,!(i >= 74 && i < 90))
  838. end
  839. targetsprite.ox = targetsprite.bitmap.width/2
  840. @vector.set(defaultvector) if !multihit
  841. @vector.inc = 0.2
  842. pbDisposeSpriteHash(fp)
  843. return true
  844. end
  845. #-----------------------------------------------------------------------------
  846. # Bolt Strike
  847. #-----------------------------------------------------------------------------
  848. def pbMoveAnimationSpecific064(userindex,targetindex,hitnum=0,multihit=false)
  849. # Charging animation
  850. pbMoveAnimationSpecific081(userindex,targetindex,hitnum,multihit,false,true)
  851. # inital configuration
  852. usersprite = @sprites["pokemon#{userindex}"]
  853. targetsprite = @sprites["pokemon#{targetindex}"]
  854. player = (targetindex%2==0)
  855. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  856. vector = getRealVector(targetindex,player)
  857. factor = player ? 2 : 1.5
  858. # set up animation
  859. fp = {}
  860. rndx = []
  861. rndy = []
  862. dx = []
  863. dy = []
  864. fp["bg"] = Sprite.new(targetsprite.viewport)
  865. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  866. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(0,0,0))
  867. fp["bg2"] = Sprite.new(targetsprite.viewport)
  868. fp["bg2"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  869. fp["bg2"].bitmap.stretch_blt(Rect.new(0,0,fp["bg2"].bitmap.width,fp["bg2"].bitmap.height),pbBitmap("Graphics/Animations/eb064_bg"),Rect.new(0,0,512,384))
  870. fp["bg2"].opacity = 0
  871. l = 0
  872. m = 0
  873. q = 0
  874. for i in 0...24
  875. fp["c#{i}"] = Sprite.new(targetsprite.viewport)
  876. fp["c#{i}"].bitmap = pbBitmap("Graphics/Animations/eb081")
  877. fp["c#{i}"].ox = fp["c#{i}"].bitmap.width/2
  878. fp["c#{i}"].oy = fp["c#{i}"].bitmap.height/2
  879. fp["c#{i}"].opacity = 0
  880. fp["c#{i}"].z = 51
  881. rndx.push(rand(256))
  882. rndy.push(rand(256))
  883. end
  884. for i in 0...12
  885. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  886. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb064_2")
  887. fp["#{i}"].ox = fp["#{i}"].bitmap.width/2
  888. fp["#{i}"].oy = fp["#{i}"].bitmap.height/2
  889. fp["#{i}"].opacity = 0
  890. fp["#{i}"].z = 51
  891. end
  892. fp["circle"] = Sprite.new(targetsprite.viewport)
  893. fp["circle"].bitmap = pbBitmap("Graphics/Animations/eb081_3")
  894. fp["circle"].src_rect.set(0,0,fp["circle"].bitmap.width/2,fp["circle"].bitmap.height)
  895. fp["circle"].ox = fp["circle"].src_rect.width/2
  896. fp["circle"].oy = fp["circle"].src_rect.height/2
  897. fp["circle"].opacity = 0
  898. fp["circle"].z = targetsprite.z + 1
  899.  
  900. fp["half"] = Sprite.new(targetsprite.viewport)
  901. fp["half"].bitmap = pbBitmap("Graphics/Animations/eb064")
  902. fp["half"].ox = fp["half"].src_rect.width/2
  903. fp["half"].oy = fp["half"].src_rect.height/2
  904. fp["half"].opacity = 0
  905. fp["half"].zoom_x = 0.5
  906. fp["half"].zoom_y = 0.5
  907. fp["half"].color = Color.new(255,255,255,255)
  908. fp["half"].z = targetsprite.z + 2
  909.  
  910. shake = 4
  911. # start animation
  912. @vector.set(vector)
  913. for i in 0...72
  914. cx, cy = getCenter(targetsprite,true)
  915. fp["circle"].x = cx; fp["circle"].y = cy
  916. fp["half"].x = cx; fp["half"].y = cy
  917. pbSEPlay("#{SE_EXTRA_PATH}Paralyze1") if i >= 16 && (i-16)%8==0
  918. if i == 16
  919. pbSEPlay("#{SE_EXTRA_PATH}slam")
  920. pbSEPlay("#{SE_EXTRA_PATH}Thunder3")
  921. end
  922. for k in 0...24
  923. next if i < 16
  924. if fp["c#{k}"].opacity == 0 && fp["c#{k}"].tone.gray == 0
  925. r = rand(2)
  926. fp["c#{k}"].zoom_x = (r==0 ? 1 : 0.5)
  927. fp["c#{k}"].zoom_y = (r==0 ? 1 : 0.5)
  928. fp["c#{k}"].tone = rand(2)==0 ? Tone.new(196,196,196) : Tone.new(0,0,0)
  929. x, y = randCircleCord(128*factor)
  930. rndx[k] = cx - 128*factor*targetsprite.zoom_x + x*targetsprite.zoom_x
  931. rndy[k] = cy - 128*factor*targetsprite.zoom_y + y*targetsprite.zoom_y
  932. fp["c#{k}"].x = targetsprite.x
  933. fp["c#{k}"].y = targetsprite.y
  934. end
  935. x2 = rndx[k]
  936. y2 = rndy[k]
  937. x0 = fp["c#{k}"].x
  938. y0 = fp["c#{k}"].y
  939. fp["c#{k}"].x += (x2 - x0)*0.1
  940. fp["c#{k}"].y += (y2 - y0)*0.1
  941. if (x2 - x0)*0.1 < 1 && (y2 - y0)*0.1 < 1
  942. fp["c#{k}"].tone.gray = 1
  943. fp["c#{k}"].opacity -= 51
  944. else
  945. fp["c#{k}"].opacity += 51
  946. end
  947. end
  948. for n in 0...12
  949. next if i < 16
  950. if fp["#{n}"].opacity == 0 && fp["#{n}"].tone.gray == 0
  951. r = rand(2); r2 = rand(4)
  952. fp["#{n}"].zoom_x = [0.2,0.25,0.5,0.75][r2]
  953. fp["#{n}"].zoom_y = [0.2,0.25,0.5,0.75][r2]
  954. fp["#{n}"].tone = rand(2)==0 ? Tone.new(196,196,196) : Tone.new(0,0,0)
  955. x, y = randCircleCord(64*factor)
  956. fp["#{n}"].x = cx - 64*factor*targetsprite.zoom_x + x*targetsprite.zoom_x
  957. fp["#{n}"].y = cy - 64*factor*targetsprite.zoom_y + y*targetsprite.zoom_y
  958. fp["#{n}"].angle = -Math.atan(1.0*(fp["#{n}"].y-cy)/(fp["#{n}"].x-cx))*(180.0/Math::PI) + rand(2)*180 + rand(90)
  959. end
  960. next if m>(i-16)/4
  961. fp["#{n}"].opacity += 51 if fp["#{n}"].tone.gray == 0
  962. fp["#{n}"].angle += 180 if (i-16)%3==0
  963. fp["#{n}"].tone.gray = 1 if fp["#{n}"].opacity >= 255
  964. q += 1 if fp["#{n}"].opacity >= 255
  965. fp["#{n}"].opacity -= 10 if fp["#{n}"].tone.gray > 0 && q > 96
  966. end
  967. if i < 64
  968. fp["bg2"].opacity += 15
  969. else
  970. fp["bg2"].opacity -= 32
  971. end
  972. if i.between?(16,24)
  973. targetsprite.x += (player ? -8 : 4)*((i-16)/4>0 ? -1 : 1)
  974. targetsprite.y -= (player ? -4 : 2)*((i-16)/4>0 ? -1 : 1)
  975. end
  976. targetsprite.tone = Tone.new(250,250,250) if i == 16
  977. if i >= 16
  978. if (i-16)/3 > l
  979. m += 1
  980. m = 0 if m > 1
  981. l = (i-16)/3
  982. end
  983. targetsprite.zoom_y -= 0.16*(m==0 ? 1 : -1)
  984. targetsprite.zoom_x += 0.08*(m==0 ? 1 : -1)
  985. targetsprite.tone.red -= 15 if targetsprite.tone.red > 100
  986. targetsprite.tone.green -= 17 if targetsprite.tone.green > 80
  987. targetsprite.tone.blue -= 19 if targetsprite.tone.blue > 60
  988. fp["circle"].zoom_x += 0.2
  989. fp["circle"].zoom_y += 0.2
  990. fp["circle"].opacity += (i>=20 ? -24 : 48)
  991. fp["half"].zoom_x += 0.1
  992. fp["half"].zoom_y += 0.06
  993. fp["half"].opacity += (i>=24 ? -40 : 40)
  994. end
  995. usersprite.color.alpha -= 20 if usersprite.color.alpha > 0
  996. usersprite.anim = true
  997. wait(1,(i < 16))
  998. end
  999. @vector.set(defaultvector) if !multihit
  1000. 20.times do
  1001. fp["bg"].opacity -= 15
  1002. targetsprite.tone.red -= 5
  1003. targetsprite.tone.green -= 4
  1004. targetsprite.tone.blue -= 3
  1005. wait(1,true)
  1006. end
  1007. pbDisposeSpriteHash(fp)
  1008. return true
  1009. end
  1010. #-----------------------------------------------------------------------------
  1011. # Thunderbolt
  1012. #-----------------------------------------------------------------------------
  1013. def pbMoveAnimationSpecific069(userindex,targetindex,hitnum=0,multihit=false,beam=false,strike=false)
  1014. # inital configuration
  1015. usersprite = @sprites["pokemon#{userindex}"]
  1016. targetsprite = @sprites["pokemon#{targetindex}"]
  1017. player = (targetindex%2==0)
  1018. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  1019. vector = getRealVector(targetindex,player)
  1020. q = 0
  1021. # set up animation
  1022. fp = {}
  1023. fp["bg"] = Sprite.new(targetsprite.viewport)
  1024. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  1025. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(0,0,0))
  1026. fp["bg"].opacity = 0
  1027. usersprite.color = Color.new(217,189,52,0) if strike
  1028. for i in 0...8
  1029. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  1030. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb069_2")
  1031. fp["#{i}"].src_rect.set(0,0,98,430)
  1032. fp["#{i}"].ox = fp["#{i}"].src_rect.width/2
  1033. fp["#{i}"].oy = fp["#{i}"].src_rect.height
  1034. fp["#{i}"].zoom_x = 0.5
  1035. fp["#{i}"].z = 50
  1036. end
  1037. for i in 0...16
  1038. fp["s#{i}"] = Sprite.new(targetsprite.viewport)
  1039. fp["s#{i}"].bitmap = pbBitmap("Graphics/Animations/eb069_3")
  1040. fp["s#{i}"].ox = fp["s#{i}"].bitmap.width/2
  1041. fp["s#{i}"].oy = fp["s#{i}"].bitmap.height/2
  1042. fp["s#{i}"].opacity = 0
  1043. fp["s#{i}"].z = 51
  1044. end
  1045. m = 0
  1046. fp["circle"] = Sprite.new(usersprite.viewport)
  1047. fp["circle"].bitmap = pbBitmap("Graphics/Animations/eb069")
  1048. fp["circle"].ox = fp["circle"].bitmap.width/2 + 4
  1049. fp["circle"].oy = fp["circle"].bitmap.height/2 + 4
  1050. fp["circle"].opacity = 0
  1051. fp["circle"].z = 50
  1052. fp["circle"].zoom_x = 1
  1053. fp["circle"].zoom_y = 1
  1054. # start animation
  1055. @vector.set(vector)
  1056. 16.times do
  1057. fp["bg"].opacity += 12
  1058. wait(1,true)
  1059. end
  1060. cx, cy = getCenter(targetsprite,true)
  1061. fp["circle"].x = cx
  1062. fp["circle"].y = cy
  1063. for i in 0...96
  1064. for j in 0...8
  1065. next if j>(i/4)
  1066. if fp["#{j}"].y <= 0 && i < 32
  1067. pbSEPlay("#{SE_EXTRA_PATH}Thunder3",80) if i%8==0
  1068. fp["#{j}"].x = cx - 32*targetsprite.zoom_x + rand(64)*targetsprite.zoom_x
  1069. fp["#{j}"].src_rect.x = 98*rand(3)
  1070. t = rand(5)*48
  1071. fp["#{j}"].opacity = 255
  1072. fp["#{j}"].tone = Tone.new(t,t,t)
  1073. fp["#{j}"].mirror = (rand(2)==0 ? true : false)
  1074. end
  1075. fp["#{j}"].src_rect.x += 98
  1076. fp["#{j}"].src_rect.x = 0 if fp["#{j}"].src_rect.x >= 294
  1077. fp["#{j}"].y += (player ? @vector.y : @vector.y2)/8.0 if fp["#{j}"].y < (player ? @vector.y : @vector.y2) + 32
  1078. fp["#{j}"].opacity -= 32 if fp["#{j}"].y >= (player ? @vector.y : @vector.y2) + 32
  1079. fp["#{j}"].y = 0 if fp["#{j}"].opacity <= 0
  1080. end
  1081. for n in 0...16
  1082. next if i < 48
  1083. next if n>(i-48)/4
  1084. if fp["s#{n}"].opacity == 0 && fp["s#{n}"].tone.gray == 0
  1085. pbSEPlay("eb_electric1",60) if i%8==0
  1086. r = rand(2); r2 = rand(4)
  1087. fp["s#{n}"].zoom_x = [1,0.8,0.5,0.75][r2]
  1088. fp["s#{n}"].zoom_y = [1,0.8,0.5,0.75][r2]
  1089. fp["s#{n}"].tone = rand(2)==0 ? Tone.new(196,196,196) : Tone.new(0,0,0)
  1090. x, y = randCircleCord(48)
  1091. fp["s#{n}"].x = cx - 48*targetsprite.zoom_x + x*targetsprite.zoom_x
  1092. fp["s#{n}"].y = cy - 48*targetsprite.zoom_y + y*targetsprite.zoom_y
  1093. fp["s#{n}"].angle = -Math.atan(1.0*(fp["s#{n}"].y-cy)/(fp["s#{n}"].x-cx))*(180.0/Math::PI) + rand(2)*180 + rand(90)
  1094. end
  1095. fp["s#{n}"].opacity += 128 if fp["s#{n}"].tone.gray == 0
  1096. fp["s#{n}"].angle += 180 if (i-16)%2==0
  1097. fp["s#{n}"].tone.gray = 1 if fp["s#{n}"].opacity >= 255
  1098. q += 1 if fp["s#{n}"].opacity >= 255
  1099. fp["s#{n}"].opacity -= 51 if fp["s#{n}"].tone.gray > 0 && q > 96
  1100. end
  1101. fp["circle"].opacity += (i < 48 ? 32 : - 64)
  1102. fp["circle"].angle += 64
  1103. fp["bg"].opacity -= 32 if i >= 90
  1104. targetsprite.still if i >= 32
  1105. wait(1,true)
  1106. end
  1107. @vector.set(defaultvector) if !multihit
  1108. pbDisposeSpriteHash(fp)
  1109. return true
  1110. end
  1111. #-----------------------------------------------------------------------------
  1112. # Thunder Punch
  1113. #-----------------------------------------------------------------------------
  1114. def pbMoveAnimationSpecific072(userindex,targetindex,hitnum=0,multihit=false)
  1115. # inital configuration
  1116. usersprite = @sprites["pokemon#{userindex}"]
  1117. targetsprite = @sprites["pokemon#{targetindex}"]
  1118. player = (targetindex%2==0)
  1119. itself = (userindex==targetindex)
  1120. factor = (player ? 2 : 1.5)
  1121. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  1122. # set up animation
  1123. fp = {}
  1124. fp["bg"] = Sprite.new(targetsprite.viewport)
  1125. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  1126. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(217/6,189/6,52/6))
  1127. fp["bg"].opacity = 0
  1128. l = 0; m = 0; q = 0
  1129. for i in 0...12
  1130. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  1131. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb064_2")
  1132. fp["#{i}"].ox = fp["#{i}"].bitmap.width/2
  1133. fp["#{i}"].oy = fp["#{i}"].bitmap.height/2
  1134. fp["#{i}"].opacity = 0
  1135. fp["#{i}"].z = 51
  1136. end
  1137. fp["punch"] = Sprite.new(targetsprite.viewport)
  1138. fp["punch"].bitmap = pbBitmap("Graphics/Animations/eb108")
  1139. fp["punch"].ox = fp["punch"].bitmap.width/2
  1140. fp["punch"].oy = fp["punch"].bitmap.height/2
  1141. fp["punch"].opacity = 0
  1142. fp["punch"].z = 40
  1143. fp["punch"].angle = 180
  1144. fp["punch"].zoom_x = player ? 6 : 4
  1145. fp["punch"].zoom_y = player ? 6 : 4
  1146. fp["punch"].color = Color.new(217,189,52,50)
  1147. # start animation
  1148. @vector.set(getRealVector(targetindex,player))
  1149. pbSEPlay("#{SE_EXTRA_PATH}fog2",75)
  1150. for i in 0...72
  1151. cx, cy = getCenter(targetsprite,true)
  1152. fp["punch"].x = cx
  1153. fp["punch"].y = cy
  1154. fp["punch"].angle -= 45 if i < 40
  1155. fp["punch"].zoom_x -= player ? 0.2 : 0.15 if i < 40
  1156. fp["punch"].zoom_y -= player ? 0.2 : 0.15 if i < 40
  1157. fp["punch"].opacity += 8 if i < 40
  1158. if i >= 40
  1159. fp["punch"].tone = Tone.new(255,255,255) if i == 40
  1160. fp["punch"].toneAll(-25.5)
  1161. fp["punch"].opacity -= 25.5
  1162. end
  1163. pbSEPlay("#{SE_EXTRA_PATH}hit") if i==40
  1164. pbSEPlay("#{SE_EXTRA_PATH}Thunder3") if i==40
  1165. pbSEPlay("#{SE_EXTRA_PATH}Paralyze1") if i%8==0 && i>=52
  1166. for n in 0...12
  1167. next if i < 40
  1168. if fp["#{n}"].opacity == 0 && fp["#{n}"].tone.gray == 0
  1169. r = rand(2); r2 = rand(4)
  1170. fp["#{n}"].zoom_x = [0.2,0.25,0.5,0.75][r2]
  1171. fp["#{n}"].zoom_y = [0.2,0.25,0.5,0.75][r2]
  1172. fp["#{n}"].tone = rand(2)==0 ? Tone.new(196,196,196) : Tone.new(0,0,0)
  1173. x, y = randCircleCord(48*factor)
  1174. fp["#{n}"].x = cx - 48*factor*targetsprite.zoom_x + x*targetsprite.zoom_x
  1175. fp["#{n}"].y = cy - 48*factor*targetsprite.zoom_y + y*targetsprite.zoom_y
  1176. fp["#{n}"].angle = -Math.atan(1.0*(fp["#{n}"].y-cy)/(fp["#{n}"].x-cx))*(180.0/Math::PI) + rand(2)*180 + rand(90)
  1177. end
  1178. next if m>(i-40)/4
  1179. fp["#{n}"].opacity += 51 if fp["#{n}"].tone.gray == 0
  1180. fp["#{n}"].angle += 180 if (i-16)%3==0
  1181. fp["#{n}"].tone.gray = 1 if fp["#{n}"].opacity >= 255
  1182. q += 1 if fp["#{n}"].opacity >= 255
  1183. fp["#{n}"].opacity -= 10 if fp["#{n}"].tone.gray > 0 && q > 96
  1184. end
  1185. fp["bg"].opacity += 4 if i < 40
  1186. fp["bg"].opacity -= 10 if i >= 56
  1187. targetsprite.tone = Tone.new(100,80,60) if i == 40
  1188. if i >= 40
  1189. if (i-40)/3 > l
  1190. m += 1
  1191. m = 0 if m > 1
  1192. l = (i-40)/3
  1193. end
  1194. targetsprite.zoom_y -= 0.16*(m==0 ? 1 : -1)
  1195. targetsprite.zoom_x += 0.08*(m==0 ? 1 : -1)
  1196. targetsprite.tone.red -= 5 if targetsprite.tone.red > 0
  1197. targetsprite.tone.green -= 4 if targetsprite.tone.green > 0
  1198. targetsprite.tone.blue -= 3 if targetsprite.tone.blue > 0
  1199. targetsprite.still
  1200. end
  1201. wait(1,(i < 40))
  1202. end
  1203. @vector.set(defaultvector) if !multihit
  1204. pbDisposeSpriteHash(fp)
  1205. return true
  1206. end
  1207. #-----------------------------------------------------------------------------
  1208. # Thunder Fang
  1209. #-----------------------------------------------------------------------------
  1210. def pbMoveAnimationSpecific075(userindex,targetindex,hitnum=0,multihit=false)
  1211. # inital configuration
  1212. usersprite = @sprites["pokemon#{userindex}"]
  1213. targetsprite = @sprites["pokemon#{targetindex}"]
  1214. player = (targetindex%2==0)
  1215. itself = (userindex==targetindex)
  1216. factor = player ? 2 : 1.5
  1217. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  1218. # set up animation
  1219. fp = {}
  1220. rndx = []
  1221. rndy = []
  1222. fp["bg"] = Sprite.new(targetsprite.viewport)
  1223. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  1224. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(217/6,189/6,52/6))
  1225. fp["bg"].opacity = 0
  1226. fp["fang1"] = Sprite.new(targetsprite.viewport)
  1227. fp["fang1"].bitmap = pbBitmap("Graphics/Animations/eb028")
  1228. fp["fang1"].ox = fp["fang1"].bitmap.width/2
  1229. fp["fang1"].oy = fp["fang1"].bitmap.height - 20
  1230. fp["fang1"].opacity = 0
  1231. fp["fang1"].color = Color.new(217,189,52,50)
  1232. fp["fang1"].z = 41
  1233. fp["fang2"] = Sprite.new(targetsprite.viewport)
  1234. fp["fang2"].bitmap = pbBitmap("Graphics/Animations/eb028")
  1235. fp["fang2"].ox = fp["fang1"].bitmap.width/2
  1236. fp["fang2"].oy = fp["fang1"].bitmap.height - 20
  1237. fp["fang2"].opacity = 0
  1238. fp["fang2"].color = Color.new(217,189,52,50)
  1239. fp["fang2"].z = 40
  1240. fp["fang2"].angle = 180
  1241. l = 0; m = 0; q = 0
  1242. for i in 0...12
  1243. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  1244. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb064_2")
  1245. fp["#{i}"].ox = fp["#{i}"].bitmap.width/2
  1246. fp["#{i}"].oy = fp["#{i}"].bitmap.height/2
  1247. fp["#{i}"].opacity = 0
  1248. fp["#{i}"].z = 51
  1249. end
  1250. # start animation
  1251. @vector.set(getRealVector(targetindex,player))
  1252. for i in 0...72
  1253. cx, cy = getCenter(targetsprite,true)
  1254. fp["fang1"].x = cx; fp["fang1"].y = cy
  1255. if i < 32
  1256. fp["fang1"].zoom_x = targetsprite.zoom_x; fp["fang1"].zoom_y = targetsprite.zoom_y
  1257. end
  1258. fp["fang2"].x = cx; fp["fang2"].y = cy
  1259. if i < 32
  1260. fp["fang2"].zoom_x = targetsprite.zoom_x; fp["fang2"].zoom_y = targetsprite.zoom_y
  1261. end
  1262. if i.between?(20,29)
  1263. fp["fang1"].opacity += 5
  1264. fp["fang1"].oy += 2
  1265. fp["fang2"].opacity += 5
  1266. fp["fang2"].oy += 2
  1267. elsif i.between?(30,40)
  1268. fp["fang1"].opacity += 25.5
  1269. fp["fang1"].oy -= 4
  1270. fp["fang2"].opacity += 25.5
  1271. fp["fang2"].oy -= 4
  1272. else i > 40
  1273. fp["fang1"].opacity -= 26
  1274. fp["fang1"].oy += 2
  1275. fp["fang2"].opacity -= 26
  1276. fp["fang2"].oy += 2
  1277. end
  1278. if i==32
  1279. pbSEPlay("#{SE_EXTRA_PATH}Super Fang")
  1280. end
  1281. pbSEPlay("#{SE_EXTRA_PATH}Paralyze1") if i%8==0 && i>=48
  1282. for n in 0...12
  1283. next if i < 32
  1284. if fp["#{n}"].opacity == 0 && fp["#{n}"].tone.gray == 0
  1285. r = rand(2); r2 = rand(4)
  1286. fp["#{n}"].zoom_x = [0.2,0.25,0.5,0.75][r2]
  1287. fp["#{n}"].zoom_y = [0.2,0.25,0.5,0.75][r2]
  1288. fp["#{n}"].tone = rand(2)==0 ? Tone.new(196,196,196) : Tone.new(0,0,0)
  1289. x, y = randCircleCord(48*factor)
  1290. fp["#{n}"].x = cx - 48*factor*targetsprite.zoom_x + x*targetsprite.zoom_x
  1291. fp["#{n}"].y = cy - 48*factor*targetsprite.zoom_y + y*targetsprite.zoom_y
  1292. fp["#{n}"].angle = -Math.atan(1.0*(fp["#{n}"].y-cy)/(fp["#{n}"].x-cx))*(180.0/Math::PI) + rand(2)*180 + rand(90)
  1293. end
  1294. next if m>(i-32)/4
  1295. fp["#{n}"].opacity += 51 if fp["#{n}"].tone.gray == 0
  1296. fp["#{n}"].angle += 180 if (i-16)%3==0
  1297. fp["#{n}"].tone.gray = 1 if fp["#{n}"].opacity >= 255
  1298. q += 1 if fp["#{n}"].opacity >= 255
  1299. fp["#{n}"].opacity -= 10 if fp["#{n}"].tone.gray > 0 && q > 96
  1300. end
  1301. fp["bg"].opacity += 4 if i < 40
  1302. fp["bg"].opacity -= 10 if i >= 56
  1303. targetsprite.tone = Tone.new(100,80,60) if i == 32
  1304. if i >= 32
  1305. if (i-32)/3 > l
  1306. m += 1
  1307. m = 0 if m > 1
  1308. l = (i-32)/3
  1309. end
  1310. targetsprite.zoom_y -= 0.16*(m==0 ? 1 : -1)
  1311. targetsprite.zoom_x += 0.08*(m==0 ? 1 : -1)
  1312. targetsprite.tone.red -= 5 if targetsprite.tone.red > 0
  1313. targetsprite.tone.green -= 4 if targetsprite.tone.green > 0
  1314. targetsprite.tone.blue -= 3 if targetsprite.tone.blue > 0
  1315. targetsprite.still
  1316. end
  1317. wait(1,(i < 32))
  1318. end
  1319. @vector.set(defaultvector) if !multihit
  1320. pbDisposeSpriteHash(fp)
  1321. return true
  1322. end
  1323. #-----------------------------------------------------------------------------
  1324. # Charge Beam
  1325. #-----------------------------------------------------------------------------
  1326. def pbMoveAnimationSpecific078(userindex,targetindex,hitnum=0,multihit=false)
  1327. # Charging animation
  1328. pbMoveAnimationSpecific081(userindex,targetindex,hitnum,multihit,true)
  1329. # inital configuration
  1330. usersprite = @sprites["pokemon#{userindex}"]
  1331. targetsprite = @sprites["pokemon#{targetindex}"]
  1332. player = (targetindex%2==0)
  1333. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  1334. vector = getRealVector(targetindex,player)
  1335. factor = player ? 2 : 1.5
  1336. targetsprite.viewport.color = Color.new(255,255,255,255)
  1337. # set up animation
  1338. fp = {}
  1339. rndx = []
  1340. rndy = []
  1341. dx = []
  1342. dy = []
  1343. fp["bg"] = Sprite.new(targetsprite.viewport)
  1344. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  1345. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(0,0,0))
  1346. fp["bg"].opacity = 255*0.75
  1347. for i in 0...72
  1348. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  1349. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb078")
  1350. fp["#{i}"].ox = fp["#{i}"].bitmap.width/2
  1351. fp["#{i}"].oy = fp["#{i}"].bitmap.height/2
  1352. fp["#{i}"].opacity = 0
  1353. fp["#{i}"].z = 19
  1354. rndx.push(rand(16))
  1355. rndy.push(rand(16))
  1356. dx.push(0)
  1357. dy.push(0)
  1358. end
  1359. shake = 4
  1360. # start animation
  1361. pbSEPlay("#{SE_EXTRA_PATH}Flash")
  1362. pbSEPlay("#{SE_EXTRA_PATH}Pollen")
  1363. for i in 0...96
  1364. pbSEPlay("#{SE_EXTRA_PATH}Paralyze1") if i%8==0
  1365. for j in 0...72
  1366. if fp["#{j}"].opacity == 0 && fp["#{j}"].tone.gray == 0
  1367. cx, cy = getCenter(usersprite)
  1368. dx[j] = cx - 8*usersprite.zoom_x*0.5 + rndx[j]*usersprite.zoom_x*0.5
  1369. dy[j] = cy - 8*usersprite.zoom_y*0.5 + rndy[j]*usersprite.zoom_y*0.5
  1370. fp["#{j}"].x = dx[j]
  1371. fp["#{j}"].y = dy[j]
  1372. end
  1373. cx, cy = getCenter(targetsprite,true)
  1374. next if j>(i)
  1375. x2 = cx - 8*targetsprite.zoom_x*0.5 + rndx[j]*targetsprite.zoom_x*0.5
  1376. y2 = cy - 8*targetsprite.zoom_y*0.5 + rndy[j]*targetsprite.zoom_y*0.5
  1377. x0 = dx[j]
  1378. y0 = dy[j]
  1379. fp["#{j}"].x += (x2 - x0)*0.05
  1380. fp["#{j}"].y += (y2 - y0)*0.05
  1381. fp["#{j}"].opacity += 32
  1382. fp["#{j}"].angle = -Math.atan(1.0*(y2-y0)/(x2-x0))*180/Math::PI + (rand(4)==0 ? 180 : 0)
  1383. nextx = fp["#{j}"].x + (x2 - x0)*0.05
  1384. nexty = fp["#{j}"].y + (y2 - y0)*0.05
  1385. if !player
  1386. fp["#{j}"].visible = false if nextx > cx && nexty < cy
  1387. else
  1388. fp["#{j}"].visible = false if nextx < cx && nexty > cy
  1389. end
  1390. end
  1391. if i >= 32
  1392. cx, cy = getCenter(targetsprite,true)
  1393. targetsprite.tone.red += 8 if targetsprite.tone.red < 160
  1394. targetsprite.tone.green += 6.4 if targetsprite.tone.green < 128
  1395. targetsprite.tone.blue += 6.4 if targetsprite.tone.blue < 128
  1396. targetsprite.addOx(shake)
  1397. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  1398. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  1399. targetsprite.still
  1400. end
  1401. @vector.set(DUALVECTOR) if i == 24
  1402. @vector.inc = 0.1 if i == 24
  1403. targetsprite.viewport.color.alpha -= 5 if targetsprite.viewport.color.alpha > 0
  1404. wait(1,true)
  1405. end
  1406. 20.times do
  1407. cx, cy = getCenter(targetsprite,true)
  1408. targetsprite.tone.red -= 8
  1409. targetsprite.tone.green -= 6.4
  1410. targetsprite.tone.blue -= 6.4
  1411. targetsprite.addOx(shake)
  1412. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  1413. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  1414. targetsprite.still
  1415. fp["bg"].opacity -= 15
  1416. wait(1,true)
  1417. end
  1418. targetsprite.ox = targetsprite.bitmap.width/2
  1419. targetsprite.tone = Tone.new(0,0,0)
  1420. @vector.set(defaultvector) if !multihit
  1421. @vector.inc = 0.2
  1422. pbDisposeSpriteHash(fp)
  1423. return true
  1424. end
  1425. #-----------------------------------------------------------------------------
  1426. # Charge
  1427. #-----------------------------------------------------------------------------
  1428. def pbMoveAnimationSpecific081(userindex,targetindex,hitnum=0,multihit=false,beam=false,strike=false)
  1429. # inital configuration
  1430. usersprite = @sprites["pokemon#{userindex}"]
  1431. targetsprite = @sprites["pokemon#{targetindex}"]
  1432. player = (userindex%2==0)
  1433. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  1434. vector = getRealVector(userindex,player)
  1435. factor = 2
  1436. # set up animation
  1437. fp = {}
  1438. fp["bg"] = Sprite.new(targetsprite.viewport)
  1439. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  1440. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(0,0,0))
  1441. fp["bg"].opacity = 0
  1442. usersprite.color = Color.new(217,189,52,0) if strike
  1443. rndx = []
  1444. rndy = []
  1445. for i in 0...8
  1446. fp["#{i}"] = Sprite.new(usersprite.viewport)
  1447. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb081_2")
  1448. fp["#{i}"].ox = fp["#{i}"].bitmap.width/2
  1449. fp["#{i}"].oy = fp["#{i}"].bitmap.height/2
  1450. fp["#{i}"].opacity = 0
  1451. fp["#{i}"].z = 50
  1452. end
  1453. for i in 0...16
  1454. fp["c#{i}"] = Sprite.new(usersprite.viewport)
  1455. fp["c#{i}"].bitmap = pbBitmap("Graphics/Animations/eb081")
  1456. fp["c#{i}"].ox = fp["c#{i}"].bitmap.width/2
  1457. fp["c#{i}"].oy = fp["c#{i}"].bitmap.height/2
  1458. fp["c#{i}"].opacity = 0
  1459. fp["c#{i}"].z = 51
  1460. rndx.push(0)
  1461. rndy.push(0)
  1462. end
  1463. m = 0
  1464. fp["circle"] = Sprite.new(usersprite.viewport)
  1465. fp["circle"].bitmap = pbBitmap("Graphics/Animations/eb081_3")
  1466. fp["circle"].ox = fp["circle"].bitmap.width/4
  1467. fp["circle"].oy = fp["circle"].bitmap.height/2
  1468. fp["circle"].opacity = 0
  1469. fp["circle"].src_rect.set(0,0,484,488)
  1470. fp["circle"].z = 50
  1471. fp["circle"].zoom_x = 0.5
  1472. fp["circle"].zoom_y = 0.5
  1473. # start animation
  1474. @vector.set(vector)
  1475. for i in 0...112
  1476. pbSEPlay("#{SE_EXTRA_PATH}Flash3",90) if i == 32
  1477. pbSEPlay("#{SE_EXTRA_PATH}Saint8") if i == 64
  1478. cx, cy = getCenter(usersprite)
  1479. for j in 0...8
  1480. if fp["#{j}"].opacity == 0
  1481. r = rand(2)
  1482. fp["#{j}"].zoom_x = factor*(r==0 ? 1 : 0.5)
  1483. fp["#{j}"].zoom_y = factor*(r==0 ? 1 : 0.5)
  1484. fp["#{j}"].tone = rand(2)==0 ? Tone.new(196,196,196) : Tone.new(0,0,0)
  1485. x, y = randCircleCord(96*factor)
  1486. fp["#{j}"].x = cx - 96*factor*usersprite.zoom_x + x*usersprite.zoom_x
  1487. fp["#{j}"].y = cy - 96*factor*usersprite.zoom_y + y*usersprite.zoom_y
  1488. end
  1489. next if j>(i/8)
  1490. x2 = cx
  1491. y2 = cy
  1492. x0 = fp["#{j}"].x
  1493. y0 = fp["#{j}"].y
  1494. fp["#{j}"].x += (x2 - x0)*0.1
  1495. fp["#{j}"].y += (y2 - y0)*0.1
  1496. fp["#{j}"].zoom_x -= fp["#{j}"].zoom_x*0.1
  1497. fp["#{j}"].zoom_y -= fp["#{j}"].zoom_y*0.1
  1498. fp["#{j}"].angle = -Math.atan(1.0*(y2-y0)/(x2-x0))*(180.0/Math::PI)# + (rand{4}==0 ? 180 : 0)
  1499. fp["#{j}"].mirror = !fp["#{j}"].mirror if i%2==0
  1500. if i >= 96
  1501. fp["#{j}"].opacity -= 35
  1502. elsif (x2 - x0)*0.1 < 1 && (y2 - y0)*0.1 < 1
  1503. fp["#{j}"].opacity = 0
  1504. else
  1505. fp["#{j}"].opacity += 35
  1506. end
  1507. end
  1508. for k in 0...16
  1509. if fp["c#{k}"].opacity == 0
  1510. r = rand(2)
  1511. fp["c#{k}"].zoom_x = (r==0 ? 1 : 0.5)
  1512. fp["c#{k}"].zoom_y = (r==0 ? 1 : 0.5)
  1513. fp["c#{k}"].tone = rand(2)==0 ? Tone.new(196,196,196) : Tone.new(0,0,0)
  1514. x, y = randCircleCord(48*factor)
  1515. rndx[k] = cx - 48*factor*usersprite.zoom_x + x*usersprite.zoom_x
  1516. rndy[k] = cy - 48*factor*usersprite.zoom_y + y*usersprite.zoom_y
  1517. fp["c#{k}"].x = cx
  1518. fp["c#{k}"].y = cy
  1519. end
  1520. next if k>(i/4)
  1521. x2 = rndx[k]
  1522. y2 = rndy[k]
  1523. x0 = fp["c#{k}"].x
  1524. y0 = fp["c#{k}"].y
  1525. fp["c#{k}"].x += (x2 - x0)*0.05
  1526. fp["c#{k}"].y += (y2 - y0)*0.05
  1527. fp["c#{k}"].opacity += 5
  1528. end
  1529. fp["circle"].x = cx
  1530. fp["circle"].y = cy
  1531. fp["circle"].opacity += 25.5
  1532. if i < 124
  1533. fp["circle"].zoom_x += 0.01
  1534. fp["circle"].zoom_y += 0.01
  1535. else
  1536. fp["circle"].zoom_x += 0.05
  1537. fp["circle"].zoom_y += 0.05
  1538. end
  1539. m = 1 if i%4==0
  1540. fp["circle"].src_rect.x = 484*m
  1541. m = 0 if i%2==0
  1542. if i < 96
  1543. if strike
  1544. fp["bg"].opacity += 10 if fp["bg"].opacity < 255
  1545. else
  1546. fp["bg"].opacity += 5 if fp["bg"].opacity < 255*0.75
  1547. end
  1548. else
  1549. fp["bg"].opacity -= 10 if !beam && !strike
  1550. end
  1551. if strike && i > 16
  1552. usersprite.color.alpha += 10 if usersprite.color.alpha < 200
  1553. fp["circle"].opacity -= 76.5 if i > 106
  1554. for k in 0...16
  1555. next if i < 96
  1556. fp["c#{k}"].opacity -= 30.5
  1557. end
  1558. for j in 0...8
  1559. next if i < 96
  1560. fp["#{j}"].opacity -= 30.5
  1561. end
  1562. end
  1563. usersprite.still if !strike
  1564. usersprite.anim = true if strike
  1565. wait(1,true)
  1566. end
  1567. if strike
  1568. for i in 0...2
  1569. 8.times do
  1570. usersprite.x -= (player ? 12 : -6)*(i==0 ? 1 : -1)
  1571. usersprite.y += (player ? 4 : -2)*(i==0 ? 1 : -1)
  1572. usersprite.zoom_y -= (factor*0.04)*(i==0 ? 1 : -1)
  1573. usersprite.still
  1574. wait(1)
  1575. end
  1576. end
  1577. end
  1578. pbDisposeSpriteHash(fp)
  1579. if !beam && !strike
  1580. @vector.set(defaultvector) if !multihit
  1581. targetsprite.viewport.color = Color.new(255,255,255,255)
  1582. 10.times do
  1583. targetsprite.viewport.color.alpha -= 25.5
  1584. wait(1,true)
  1585. end
  1586. return true
  1587. end
  1588. end
  1589. #-----------------------------------------------------------------------------
  1590. # Close Combat
  1591. #-----------------------------------------------------------------------------
  1592. def pbMoveAnimationSpecific086(userindex,targetindex,hitnum=0,multihit=false)
  1593. # inital configuration
  1594. usersprite = @sprites["pokemon#{userindex}"]
  1595. targetsprite = @sprites["pokemon#{targetindex}"]
  1596. player = (targetindex%2==0)
  1597. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  1598. vector = getRealVector(targetindex,player)
  1599. # set up animation
  1600. fp = {}
  1601. fp["bg"] = ScrollingSprite.new(targetsprite.viewport)
  1602. fp["bg"].speed = 64
  1603. fp["bg"].setBitmap("Graphics/Animations/eb086_bg")
  1604. fp["bg"].color = Color.new(0,0,0,255)
  1605. fp["bg"].opacity = 0
  1606. @vector.set(vector)
  1607. for i in 0...16
  1608. fp["bg"].opacity += 32 if i >= 8
  1609. wait(1,true)
  1610. end
  1611. factor = targetsprite.zoom_x
  1612. cx, cy = getCenter(targetsprite,true)
  1613. for j in 0...12
  1614. fp["f#{j}"] = Sprite.new(targetsprite.viewport)
  1615. fp["f#{j}"].bitmap = pbBitmap("Graphics/Animations/eb086")
  1616. fp["f#{j}"].ox = fp["f#{j}"].bitmap.width/2
  1617. fp["f#{j}"].oy = fp["f#{j}"].bitmap.height/2
  1618. fp["f#{j}"].z = targetsprite.z + 1
  1619. r = 32*factor
  1620. fp["f#{j}"].x = cx - r + rand(r*2)
  1621. fp["f#{j}"].y = cy - r + rand(r*2)
  1622. fp["f#{j}"].visible = false
  1623. fp["f#{j}"].zoom_x = factor
  1624. fp["f#{j}"].zoom_y = factor
  1625. fp["f#{j}"].color = Color.new(180,53,2,0)
  1626. end
  1627. dx = []
  1628. dy = []
  1629. for j in 0...96
  1630. fp["p#{j}"] = Sprite.new(targetsprite.viewport)
  1631. fp["p#{j}"].bitmap = pbBitmap("Graphics/Animations/eb086_2")
  1632. fp["p#{j}"].ox = fp["p#{j}"].bitmap.width/2
  1633. fp["p#{j}"].oy = fp["p#{j}"].bitmap.height/2
  1634. fp["p#{j}"].z = targetsprite.z
  1635. r = 148*factor + rand(32)*factor
  1636. x, y = randCircleCord(r)
  1637. fp["p#{j}"].x = cx
  1638. fp["p#{j}"].y = cy
  1639. fp["p#{j}"].visible = false
  1640. fp["p#{j}"].zoom_x = factor
  1641. fp["p#{j}"].zoom_y = factor
  1642. fp["p#{j}"].color = Color.new(180,53,2,0)
  1643. dx.push(cx - r + x)
  1644. dy.push(cy - r + y)
  1645. end
  1646. k = -4
  1647. for i in 0...72
  1648. k *= - 1 if i%4==0
  1649. fp["bg"].color.alpha -= 32 if fp["bg"].color.alpha > 0
  1650. for j in 0...12
  1651. next if j>(i/4)
  1652. pbSEPlay("#{SE_EXTRA_PATH}hit",80) if fp["f#{j}"].opacity == 255
  1653. fp["f#{j}"].visible = true
  1654. fp["f#{j}"].zoom_x -= 0.025
  1655. fp["f#{j}"].zoom_y -= 0.025
  1656. fp["f#{j}"].opacity -= 16
  1657. fp["f#{j}"].color.alpha += 32
  1658. end
  1659. for j in 0...96
  1660. next if j>(i*2)
  1661. fp["p#{j}"].visible = true
  1662. fp["p#{j}"].x -= (fp["p#{j}"].x - dx[j])*0.2
  1663. fp["p#{j}"].y -= (fp["p#{j}"].y - dy[j])*0.2
  1664. fp["p#{j}"].opacity -= 32 if ((fp["p#{j}"].x - dx[j])*0.2).abs < 16
  1665. fp["p#{j}"].color.alpha += 16 if ((fp["p#{j}"].x - dx[j])*0.2).abs < 32
  1666. fp["p#{j}"].zoom_x += 0.1
  1667. fp["p#{j}"].zoom_y += 0.1
  1668. fp["p#{j}"].angle = -Math.atan(1.0*(fp["p#{j}"].y-cy)/(fp["p#{j}"].x-cx))*(180.0/Math::PI)
  1669. end
  1670. fp["bg"].update
  1671. targetsprite.still
  1672. targetsprite.zoom_x -= factor*0.01*k if i < 56
  1673. targetsprite.zoom_y += factor*0.02*k if i < 56
  1674. wait(1)
  1675. end
  1676. @vector.set(defaultvector) if !multihit
  1677. 16.times do
  1678. fp["bg"].color.alpha += 16
  1679. fp["bg"].opacity -= 16
  1680. fp["bg"].update
  1681. wait(1,true)
  1682. end
  1683. pbDisposeSpriteHash(fp)
  1684. return true
  1685. end
  1686. #-----------------------------------------------------------------------------
  1687. # Aura Sphere
  1688. #-----------------------------------------------------------------------------
  1689. def pbMoveAnimationSpecific093(userindex,targetindex,hitnum=0,multihit=false)
  1690. # inital configuration
  1691. usersprite = @sprites["pokemon#{userindex}"]
  1692. targetsprite = @sprites["pokemon#{targetindex}"]
  1693. player = (targetindex%2==0)
  1694. player2 = (userindex%2==0)
  1695. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  1696. vector = getRealVector(targetindex,player)
  1697. vector2 = getRealVector(userindex,player2)
  1698. # set up animation
  1699. fp = {}
  1700. rndx = []; prndx = []
  1701. rndy = []; prndy = []
  1702. rangl = []
  1703. dx = []
  1704. dy = []
  1705. fp["bg"] = ScrollingSprite.new(targetsprite.viewport)
  1706. fp["bg"].speed = 64
  1707. fp["bg"].setBitmap("Graphics/Animations/eb093_bg")
  1708. fp["bg"].color = Color.new(0,0,0,255)
  1709. fp["bg"].opacity = 0
  1710.  
  1711. fp["cir"] = Sprite.new(targetsprite.viewport)
  1712. fp["cir"].bitmap = pbBitmap("Graphics/Animations/eb093")
  1713. fp["cir"].ox = fp["cir"].bitmap.width/2
  1714. fp["cir"].oy = fp["cir"].bitmap.height/2
  1715. fp["cir"].z = usersprite.z + 1
  1716. fp["cir"].mirror = player2
  1717. fp["cir"].zoom_x = (player ? 0.75 : 1)
  1718. fp["cir"].zoom_y = (player ? 0.75 : 1)
  1719. fp["cir"].opacity = 0
  1720.  
  1721. shake = 4
  1722. k = 0
  1723. # start animation
  1724. for i in 0...40
  1725. if i < 8
  1726. fp["bg"].opacity += 32
  1727. else
  1728. fp["bg"].color.alpha -= 32
  1729. fp["cir"].x, fp["cir"].y = getCenter(usersprite)
  1730. fp["cir"].angle += 24*(player2 ? -1 : 1)
  1731. fp["cir"].opacity += 24
  1732. end
  1733. if i == 8
  1734. @vector.set(vector2)
  1735. pbSEPlay("#{SE_EXTRA_PATH}eb_grass2",80)
  1736. end
  1737. fp["bg"].update
  1738. wait(1,true)
  1739. end
  1740. cx, cy = getCenter(usersprite,true)
  1741. dx = []
  1742. dy = []
  1743. for i in 0...8
  1744. fp["#{i}s"] = Sprite.new(targetsprite.viewport)
  1745. fp["#{i}s"].bitmap = pbBitmap("Graphics/Animations/eb093_2")
  1746. fp["#{i}s"].src_rect.set(rand(3)*36,0,36,36)
  1747. fp["#{i}s"].ox = fp["#{i}s"].src_rect.width/2
  1748. fp["#{i}s"].oy = fp["#{i}s"].src_rect.height/2
  1749. r = 128*usersprite.zoom_x
  1750. z = [0.5,0.25,1,0.75][rand(4)]
  1751. x, y = randCircleCord(r)
  1752. x = cx - r + x
  1753. y = cy - r + y
  1754. fp["#{i}s"].x = cx
  1755. fp["#{i}s"].y = cy
  1756. fp["#{i}s"].zoom_x = z*usersprite.zoom_x
  1757. fp["#{i}s"].zoom_y = z*usersprite.zoom_x
  1758. fp["#{i}s"].visible = false
  1759. fp["#{i}s"].z = usersprite.z + 1
  1760. dx.push(x)
  1761. dy.push(y)
  1762. end
  1763.  
  1764. fp["shot"] = Sprite.new(targetsprite.viewport)
  1765. fp["shot"].bitmap = pbBitmap("Graphics/Animations/eb093_3")
  1766. fp["shot"].ox = fp["shot"].bitmap.width/2
  1767. fp["shot"].oy = fp["shot"].bitmap.height/2
  1768. fp["shot"].z = usersprite.z + 1
  1769. fp["shot"].zoom_x = usersprite.zoom_x
  1770. fp["shot"].zoom_y = usersprite.zoom_x
  1771. fp["shot"].opacity = 0
  1772.  
  1773. x = defaultvector[0]; y = defaultvector[1]
  1774. x2, y2 = @vector.spoof(defaultvector)
  1775. fp["shot"].x = cx
  1776. fp["shot"].y = cy
  1777. pbSEPlay("eb_normal5",80)
  1778. k = -1
  1779. for i in 0...20
  1780. cx, cy = getCenter(usersprite)
  1781. @vector.set(defaultvector) if i == 0
  1782. if i > 0
  1783. fp["shot"].angle = Math.atan(1.0*(@vector.y-@vector.y2)/(@vector.x2-@vector.x))*(180.0/Math::PI) + (player ? 180 : 0)
  1784. fp["shot"].opacity += 32
  1785. fp["shot"].zoom_x -= (fp["shot"].zoom_x - targetsprite.zoom_x)*0.1
  1786. fp["shot"].zoom_y -= (fp["shot"].zoom_y - targetsprite.zoom_y)*0.1
  1787. fp["shot"].x += (player ? -1 : 1)*(x2 - x)/24
  1788. fp["shot"].y -= (player ? -1 : 1)*(y - y2)/24
  1789. for j in 0...8
  1790. fp["#{j}s"].visible = true
  1791. fp["#{j}s"].opacity -= 32
  1792. fp["#{j}s"].x -= (fp["#{j}s"].x - dx[j])*0.2
  1793. fp["#{j}s"].y -= (fp["#{j}s"].y - dy[j])*0.2
  1794. end
  1795. fp["cir"].angle += 24*(player2 ? -1 : 1)
  1796. fp["cir"].opacity -= 16
  1797. fp["cir"].x = cx
  1798. fp["cir"].y = cy
  1799. end
  1800. fp["bg"].update
  1801. factor = targetsprite.zoom_x if i == 12
  1802. if i >= 12
  1803. k *= -1 if i%4==0
  1804. targetsprite.zoom_x -= factor*0.01*k
  1805. targetsprite.zoom_y += factor*0.04*k
  1806. targetsprite.still
  1807. end
  1808. cx, cy = getCenter(targetsprite,true)
  1809. if !player
  1810. fp["shot"].z = targetsprite.z - 1 if fp["shot"].x > cx && fp["shot"].y < cy
  1811. else
  1812. fp["shot"].z = targetsprite.z + 1 if fp["shot"].x < cx && fp["shot"].y > cy
  1813. end
  1814. wait(1,i < 12)
  1815. end
  1816. shake = 2
  1817. 16.times do
  1818. fp["shot"].angle = Math.atan(1.0*(@vector.y-@vector.y2)/(@vector.x2-@vector.x))*(180.0/Math::PI) + (player ? 180 : 0)
  1819. fp["shot"].opacity += 32
  1820. fp["shot"].zoom_x -= (fp["shot"].zoom_x - targetsprite.zoom_x)*0.1
  1821. fp["shot"].zoom_y -= (fp["shot"].zoom_y - targetsprite.zoom_y)*0.1
  1822. fp["shot"].x += (player ? -1 : 1)*(x2 - x)/24
  1823. fp["shot"].y -= (player ? -1 : 1)*(y - y2)/24
  1824. fp["bg"].color.alpha += 16
  1825. fp["bg"].update
  1826. targetsprite.addOx(shake)
  1827. shake = -2 if targetsprite.ox > targetsprite.bitmap.width/2 + 4
  1828. shake = 2 if targetsprite.ox < targetsprite.bitmap.width/2 - 4
  1829. targetsprite.still
  1830. cx, cy = getCenter(targetsprite,true)
  1831. if !player
  1832. fp["shot"].z = targetsprite.z - 1 if fp["shot"].x > cx && fp["shot"].y < cy
  1833. else
  1834. fp["shot"].z = targetsprite.z + 1 if fp["shot"].x < cx && fp["shot"].y > cy
  1835. end
  1836. wait(1,true)
  1837. end
  1838. targetsprite.ox = targetsprite.bitmap.width/2
  1839. 16.times do
  1840. targetsprite.still
  1841. wait(1,true)
  1842. end
  1843. 16.times do
  1844. fp["bg"].opacity -= 16
  1845. wait(1,true)
  1846. end
  1847. pbDisposeSpriteHash(fp)
  1848. return true
  1849. end
  1850. #-----------------------------------------------------------------------------
  1851. # Flare Blitz
  1852. #-----------------------------------------------------------------------------
  1853. def pbMoveAnimationSpecific129(userindex,targetindex,hitnum=0,multihit=false)
  1854. # inital configuration
  1855. usersprite = @sprites["pokemon#{userindex}"]
  1856. targetsprite = @sprites["pokemon#{targetindex}"]
  1857. player = (targetindex%2==0)
  1858. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  1859. vector = getRealVector(targetindex,player)
  1860. # set up animation
  1861. frame = []
  1862. fp = {}
  1863. fp["bg"] = Sprite.new(targetsprite.viewport)
  1864. fp["bg"].bitmap = pbBitmap("Graphics/Animations/eb129_bg")
  1865. fp["bg"].color = Color.new(0,0,0,255)
  1866. fp["bg"].opacity = 0
  1867. for j in 0...16
  1868. fp["f#{j}"] = Sprite.new(usersprite.viewport)
  1869. fp["f#{j}"].bitmap = pbBitmap("Graphics/Animations/eb129")
  1870. fp["f#{j}"].ox = fp["f#{j}"].bitmap.width/2
  1871. fp["f#{j}"].oy = fp["f#{j}"].bitmap.height/2
  1872. fp["f#{j}"].x = usersprite.x - 64*usersprite.zoom_x + rand(128)*usersprite.zoom_x
  1873. fp["f#{j}"].y = usersprite.y - 16*usersprite.zoom_y + rand(32)*usersprite.zoom_y
  1874. fp["f#{j}"].visible = false
  1875. z = [1,0.75,0.5,0.8][rand(4)]
  1876. fp["f#{j}"].zoom_x = usersprite.zoom_x*z
  1877. fp["f#{j}"].zoom_y = usersprite.zoom_y*z
  1878. fp["f#{j}"].z = usersprite.z + 1
  1879. frame.push(0)
  1880. end
  1881. pbSEPlay("eb_fire2",60)
  1882. pbSEPlay("eb_fire3",60)
  1883. for i in 0...48
  1884. for j in 0...16
  1885. next if j>(i/2)
  1886. fp["f#{j}"].visible = true
  1887. fp["f#{j}"].y -= 8*usersprite.zoom_y
  1888. fp["f#{j}"].opacity -= 32 if frame[j] >= 8
  1889. frame[j] += 1
  1890. end
  1891. fp["bg"].opacity += 8 if i >= 32
  1892. wait(1,true)
  1893. end
  1894. pbSEPlay("eb_fire4",80)
  1895. @vector.set(vector)
  1896. wait(16,true)
  1897. cx, cy = getCenter(targetsprite)
  1898. fp["flare"] = Sprite.new(targetsprite.viewport)
  1899. fp["flare"].bitmap = pbBitmap("Graphics/Animations/eb129_2")
  1900. fp["flare"].ox = fp["flare"].bitmap.width/2
  1901. fp["flare"].oy = fp["flare"].bitmap.height/2
  1902. fp["flare"].x = cx
  1903. fp["flare"].y = cy
  1904. fp["flare"].zoom_x = targetsprite.zoom_x
  1905. fp["flare"].zoom_y = targetsprite.zoom_y
  1906. fp["flare"].z = targetsprite.z
  1907. fp["flare"].opacity = 0
  1908. for j in 0...3
  1909. fp["#{j}"] = Sprite.new(targetsprite.viewport)
  1910. fp["#{j}"].bitmap = pbBitmap("Graphics/Animations/eb129_3")
  1911. fp["#{j}"].ox = fp["#{j}"].bitmap.width/2
  1912. fp["#{j}"].oy = fp["#{j}"].bitmap.height/2
  1913. fp["#{j}"].x = cx - 32 + rand(64)
  1914. fp["#{j}"].y = cy - 32 + rand(64)
  1915. fp["#{j}"].z = targetsprite.z + 1
  1916. fp["#{j}"].visible = false
  1917. fp["#{j}"].zoom_x = targetsprite.zoom_x
  1918. fp["#{j}"].zoom_y = targetsprite.zoom_y
  1919. end
  1920. for m in 0...12
  1921. fp["p#{m}"] = Sprite.new(targetsprite.viewport)
  1922. fp["p#{m}"].bitmap = pbBitmap("Graphics/Animations/eb129_4")
  1923. fp["p#{m}"].ox = fp["p#{m}"].bitmap.width/2
  1924. fp["p#{m}"].oy = fp["p#{m}"].bitmap.height/2
  1925. fp["p#{m}"].x = cx - 48 + rand(96)
  1926. fp["p#{m}"].y = cy - 48 + rand(96)
  1927. fp["p#{m}"].z = targetsprite.z + 2
  1928. fp["p#{m}"].visible = false
  1929. fp["p#{m}"].zoom_x = targetsprite.zoom_x
  1930. fp["p#{m}"].zoom_y = targetsprite.zoom_y
  1931. end
  1932. targetsprite.color = Color.new(0,0,0,0)
  1933. for i in 0...64
  1934. fp["bg"].opacity += 16 if fp["bg"].opacity < 255 && i < 32
  1935. fp["bg"].color.alpha -= 32 if fp["bg"].color.alpha > 0
  1936. fp["flare"].opacity += 32*(i < 8 ? 1 : -1)
  1937. fp["flare"].angle += 32
  1938. pbSEPlay("eb_fire1",80) if i == 8
  1939. for j in 0...3
  1940. next if i < 12
  1941. next if j>(i-12)/4
  1942. fp["#{j}"].visible = true
  1943. fp["#{j}"].opacity -= 16
  1944. fp["#{j}"].angle += 16
  1945. fp["#{j}"].zoom_x += 0.1
  1946. fp["#{j}"].zoom_y += 0.1
  1947. end
  1948. for m in 0...12
  1949. next if i < 6
  1950. next if m>(i-6)
  1951. fp["p#{m}"].visible = true
  1952. fp["p#{m}"].opacity -= 16
  1953. fp["p#{m}"].y -= 8
  1954. end
  1955. if i >= 48
  1956. fp["bg"].opacity -= 16
  1957. targetsprite.color.alpha -= 16
  1958. else
  1959. targetsprite.color.alpha += 16 if targetsprite.color.alpha < 192
  1960. end
  1961. targetsprite.anim = true
  1962. wait(1)
  1963. end
  1964. @vector.set(defaultvector) if !multihit
  1965. pbDisposeSpriteHash(fp)
  1966. return true
  1967. end
  1968. #-----------------------------------------------------------------------------
  1969. # Heat Wave
  1970. #-----------------------------------------------------------------------------
  1971. def pbMoveAnimationSpecific132(userindex,targetindex,hitnum=0,multihit=false)
  1972. # inital configuration
  1973. usersprite = @sprites["pokemon#{userindex}"]
  1974. targetsprite = @sprites["pokemon#{targetindex}"]
  1975. player = (targetindex%2==0)
  1976. itself = (userindex==targetindex)
  1977. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  1978. # set up animation
  1979. fp = {}
  1980. fp["bg"] = Sprite.new(targetsprite.viewport)
  1981. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  1982. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(130,52,42))
  1983. fp["bg"].opacity = 0
  1984. fp["wave"] = AnimatedPlane.new(targetsprite.viewport)
  1985. fp["wave"].bitmap = Bitmap.new(1026,targetsprite.viewport.rect.height)
  1986. fp["wave"].bitmap.stretch_blt(Rect.new(0,0,fp["wave"].bitmap.width,fp["wave"].bitmap.height),pbBitmap("Graphics/Animations/eb132"),Rect.new(0,0,1026,212))
  1987. fp["wave"].opacity = 0
  1988. fp["wave"].z = 50
  1989. @vector.set(DUALVECTOR)
  1990. @vector.inc = 0.1
  1991. pulse = 10
  1992. shake = [4,4,4,4]
  1993. # start animation
  1994. for j in 0...64
  1995. pbSEPlay("#{SE_EXTRA_PATH}Wind8") if j == 24
  1996. fp["wave"].ox += 48
  1997. fp["wave"].opacity += pulse
  1998. pulse = -5 if fp["wave"].opacity > 160
  1999. pulse = +5 if fp["wave"].opacity < 100
  2000. fp["bg"].opacity += 1 if fp["bg"].opacity < 255*0.35
  2001. for i in 0...4
  2002. next if !(player ? [0,2] : [1,3]).include?(i)
  2003. next if !(@sprites["pokemon#{i}"] && @sprites["pokemon#{i}"].visible) || @sprites["pokemon#{i}"].disposed?
  2004. @sprites["pokemon#{i}"].toneAll(3) if j.between?(16,48)
  2005. if j >= 32
  2006. @sprites["pokemon#{i}"].addOx(shake[i])
  2007. shake[i] = -4 if @sprites["pokemon#{i}"].ox > @sprites["pokemon#{i}"].bitmap.width/2 + 2
  2008. shake[i] = 4 if @sprites["pokemon#{i}"].ox < @sprites["pokemon#{i}"].bitmap.width/2 - 2
  2009. end
  2010. end
  2011. @sprites["pokemon#{userindex}"].toneAll(3) if j < 32
  2012. @sprites["pokemon#{userindex}"].still
  2013. wait(1,true)
  2014. end
  2015. for i in 0...4
  2016. next if !(player ? [0,2] : [1,3]).include?(i)
  2017. next if !(@sprites["pokemon#{i}"] && @sprites["pokemon#{i}"].visible) || @sprites["pokemon#{i}"].disposed?
  2018. @sprites["pokemon#{i}"].ox = @sprites["pokemon#{i}"].bitmap.width/2
  2019. end
  2020. for j in 0...64
  2021. fp["wave"].ox += 48
  2022. if j < 32
  2023. fp["wave"].opacity += pulse
  2024. pulse = -5 if fp["wave"].opacity > 160
  2025. pulse = +5 if fp["wave"].opacity < 100
  2026. end
  2027. fp["wave"].opacity -= 4 if j >= 32
  2028. fp["bg"].opacity -= 4 if j >= 32
  2029. for i in 0...4
  2030. next if !(player ? [0,2] : [1,3]).include?(i)
  2031. next if !(@sprites["pokemon#{i}"] && @sprites["pokemon#{i}"].visible)
  2032. @sprites["pokemon#{i}"].toneAll(-3) if j >= 32
  2033. end
  2034. @sprites["pokemon#{userindex}"].toneAll(-3) if j >= 32
  2035. @sprites["pokemon#{userindex}"].still
  2036. wait(1,true)
  2037. end
  2038. @vector.set(defaultvector) if !multihit
  2039. @vector.inc = 0.2
  2040. pbDisposeSpriteHash(fp)
  2041. return true
  2042. end
  2043. #-----------------------------------------------------------------------------
  2044. # Flamethrower
  2045. #-----------------------------------------------------------------------------
  2046. def pbMoveAnimationSpecific136(userindex,targetindex,hitnum=0,multihit=false)
  2047. # inital configuration
  2048. usersprite = @sprites["pokemon#{userindex}"]
  2049. targetsprite = @sprites["pokemon#{targetindex}"]
  2050. player = (targetindex%2==0)
  2051. itself = (userindex==targetindex)
  2052. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  2053. # set up animation
  2054. fp = {}
  2055. rndx = []
  2056. rndy = []
  2057. fp["bg"] = Sprite.new(targetsprite.viewport)
  2058. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  2059. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(130,52,42))
  2060. fp["bg"].opacity = 0
  2061. for i in 0...16
  2062. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  2063. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb136")
  2064. fp["#{i}"].src_rect.set(0,101*rand(3),53,101)
  2065. fp["#{i}"].ox = 26
  2066. fp["#{i}"].oy = 101
  2067. fp["#{i}"].opacity = 0
  2068. fp["#{i}"].z = (player ? 29 : 19)
  2069. rndx.push(rand(64))
  2070. rndy.push(rand(64))
  2071. end
  2072. shake = 2
  2073. # start animation
  2074. for i in 0...132
  2075. for j in 0...16
  2076. if fp["#{j}"].opacity == 0 && fp["#{j}"].tone.gray == 0
  2077. fp["#{j}"].zoom_x = usersprite.zoom_x
  2078. fp["#{j}"].zoom_y = usersprite.zoom_y
  2079. cx, cy = getCenter(usersprite)
  2080. fp["#{j}"].x = cx
  2081. fp["#{j}"].y = cy + 50*usersprite.zoom_y
  2082. end
  2083. next if j>(i/4)
  2084. cx, cy = getCenter(targetsprite,true)
  2085. x2 = cx - 32*targetsprite.zoom_x + rndx[j]*targetsprite.zoom_x
  2086. y2 = cy - 32*targetsprite.zoom_y + rndy[j]*targetsprite.zoom_y + 50*targetsprite.zoom_y
  2087. x0 = fp["#{j}"].x
  2088. y0 = fp["#{j}"].y
  2089. fp["#{j}"].x += (x2 - x0)*0.1
  2090. fp["#{j}"].y += (y2 - y0)*0.1
  2091. fp["#{j}"].zoom_x -= (fp["#{j}"].zoom_x - targetsprite.zoom_x)*0.1
  2092. fp["#{j}"].zoom_y -= (fp["#{j}"].zoom_y - targetsprite.zoom_y)*0.1
  2093. fp["#{j}"].src_rect.x += 53 if i%4==0
  2094. fp["#{j}"].src_rect.x = 0 if fp["#{j}"].src_rect.x >= fp["#{j}"].bitmap.width
  2095. if (x2 - x0)*0.1 < 1 && (y2 - y0)*0.1 < 1
  2096. fp["#{j}"].opacity -= 8
  2097. fp["#{j}"].tone.gray += 8
  2098. fp["#{j}"].tone.red -= 2; fp["#{j}"].tone.green -= 2; fp["#{j}"].tone.blue -= 2
  2099. fp["#{j}"].zoom_x -= 0.02
  2100. fp["#{j}"].zoom_y += 0.04
  2101. else
  2102. fp["#{j}"].opacity += 12
  2103. end
  2104. end
  2105. fp["bg"].opacity += 5 if fp["bg"].opacity < 255*0.5
  2106. pbSEPlay("#{SE_EXTRA_PATH}Fire2",80) if i%12==0 && i <= 96
  2107. pbSEPlay("#{SE_EXTRA_PATH}SMokescreen",120) if i==84
  2108. if i >= 96
  2109. targetsprite.tone.red += 2.4*2 if targetsprite.tone.red < 48*2
  2110. targetsprite.tone.green -= 1.2*2 if targetsprite.tone.green > -24*2
  2111. targetsprite.tone.blue -= 2.4*2 if targetsprite.tone.blue > -48*2
  2112. targetsprite.addOx(shake)
  2113. shake = -2 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  2114. shake = 2 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  2115. targetsprite.still
  2116. end
  2117. @vector.set(DUALVECTOR) if i == 24
  2118. @vector.inc = 0.1 if i == 24
  2119. wait(1,true)
  2120. end
  2121. 20.times do
  2122. targetsprite.tone.red -= 2.4*2
  2123. targetsprite.tone.green += 1.2*2
  2124. targetsprite.tone.blue += 2.4*2
  2125. targetsprite.addOx(shake)
  2126. shake = -2 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  2127. shake = 2 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  2128. targetsprite.still
  2129. fp["bg"].opacity -= 15
  2130. wait(1,true)
  2131. end
  2132. targetsprite.ox = targetsprite.bitmap.width/2
  2133. @vector.set(defaultvector) if !multihit
  2134. @vector.inc = 0.2
  2135. pbDisposeSpriteHash(fp)
  2136. return true
  2137. end
  2138. #-----------------------------------------------------------------------------
  2139. # Blaze Kick
  2140. #-----------------------------------------------------------------------------
  2141. def pbMoveAnimationSpecific137(userindex,targetindex,hitnum=0,multihit=false)
  2142. return pbMoveAnimationSpecific140(userindex,targetindex,hitnum,multihit,true)
  2143. end
  2144. #-----------------------------------------------------------------------------
  2145. # Fire Punch
  2146. #-----------------------------------------------------------------------------
  2147. def pbMoveAnimationSpecific140(userindex,targetindex,hitnum=0,multihit=false,kick=false)
  2148. # inital configuration
  2149. usersprite = @sprites["pokemon#{userindex}"]
  2150. targetsprite = @sprites["pokemon#{targetindex}"]
  2151. player = (targetindex%2==0)
  2152. itself = (userindex==targetindex)
  2153. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  2154. # set up animation
  2155. fp = {}
  2156. rndx = []
  2157. rndy = []
  2158. fp["bg"] = Sprite.new(targetsprite.viewport)
  2159. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  2160. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(130,52,42))
  2161. fp["bg"].opacity = 0
  2162. for i in 0...12
  2163. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  2164. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb136")
  2165. fp["#{i}"].src_rect.set(0,101*rand(3),53,101)
  2166. fp["#{i}"].ox = 26
  2167. fp["#{i}"].oy = 50
  2168. fp["#{i}"].opacity = 0
  2169. fp["#{i}"].z = 50
  2170. fp["#{i}"].zoom_x = (targetsprite.zoom_x)/2
  2171. fp["#{i}"].zoom_y = (targetsprite.zoom_y)/2
  2172. rndx.push(rand(144))
  2173. rndy.push(rand(144))
  2174. end
  2175. fp["punch"] = Sprite.new(targetsprite.viewport)
  2176. fp["punch"].bitmap = pbBitmap("Graphics/Animations/eb#{kick ? 137 : 108}")
  2177. fp["punch"].ox = fp["punch"].bitmap.width/2
  2178. fp["punch"].oy = fp["punch"].bitmap.height/2
  2179. fp["punch"].opacity = 0
  2180. fp["punch"].z = 40
  2181. fp["punch"].angle = 180
  2182. fp["punch"].zoom_x = player ? 6 : 4
  2183. fp["punch"].zoom_y = player ? 6 : 4
  2184. fp["punch"].tone = Tone.new(48,16,6)
  2185. shake = 4
  2186. # start animation
  2187. @vector.set(getRealVector(targetindex,player))
  2188. pbSEPlay("#{SE_EXTRA_PATH}fog2",75)
  2189. for i in 0...72
  2190. cx, cy = getCenter(targetsprite,true)
  2191. fp["punch"].x = cx
  2192. fp["punch"].y = cy
  2193. fp["punch"].angle -= 45 if i < 40
  2194. fp["punch"].zoom_x -= player ? 0.2 : 0.15 if i < 40
  2195. fp["punch"].zoom_y -= player ? 0.2 : 0.15 if i < 40
  2196. fp["punch"].opacity += 8 if i < 40
  2197. if i >= 40
  2198. fp["punch"].tone = Tone.new(255,255,255) if i == 40
  2199. fp["punch"].toneAll(-25.5)
  2200. fp["punch"].opacity -= 25.5
  2201. end
  2202. pbSEPlay("#{SE_EXTRA_PATH}Fire3") if i==40
  2203. for j in 0...12
  2204. next if i < 40
  2205. if fp["#{j}"].opacity == 0 && fp["#{j}"].tone.gray == 0
  2206. fp["#{j}"].x = cx
  2207. fp["#{j}"].y = cy
  2208. end
  2209. x2 = cx - 72*targetsprite.zoom_x + rndx[j]*targetsprite.zoom_x
  2210. y2 = cy - 72*targetsprite.zoom_y + rndy[j]*targetsprite.zoom_y
  2211. x0 = fp["#{j}"].x
  2212. y0 = fp["#{j}"].y
  2213. fp["#{j}"].x += (x2 - x0)*0.2
  2214. fp["#{j}"].y += (y2 - y0)*0.2
  2215. fp["#{j}"].src_rect.x += 53 if i%2==0
  2216. fp["#{j}"].src_rect.x = 0 if fp["#{j}"].src_rect.x >= fp["#{j}"].bitmap.width
  2217. if (x2 - x0)*0.2 < 1 && (y2 - y0)*0.2 < 1
  2218. fp["#{j}"].opacity -= 16
  2219. fp["#{j}"].tone.gray += 16
  2220. fp["#{j}"].tone.red -= 4; fp["#{j}"].tone.green -= 4; fp["#{j}"].tone.blue -= 4
  2221. fp["#{j}"].zoom_x -= 0.005
  2222. fp["#{j}"].zoom_y += 0.01
  2223. else
  2224. fp["#{j}"].opacity += 45
  2225. end
  2226. end
  2227. fp["bg"].opacity += 4 if i < 40
  2228. if i >= 40
  2229. if i >= 56
  2230. targetsprite.tone.red -= 3*2
  2231. targetsprite.tone.green += 1.5*2
  2232. targetsprite.tone.blue += 3*2
  2233. fp["bg"].opacity -= 10
  2234. else
  2235. targetsprite.tone.red += 3*2 if targetsprite.tone.red < 48*2
  2236. targetsprite.tone.green -= 1.5*2 if targetsprite.tone.green > -24*2
  2237. targetsprite.tone.blue -= 3*2 if targetsprite.tone.blue > -48*2
  2238. end
  2239. targetsprite.addOx(shake)
  2240. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  2241. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  2242. targetsprite.still
  2243. end
  2244. wait(1,true)
  2245. end
  2246. targetsprite.ox = targetsprite.bitmap.width/2
  2247. @vector.set(defaultvector) if !multihit
  2248. pbDisposeSpriteHash(fp)
  2249. return true
  2250. end
  2251. #-----------------------------------------------------------------------------
  2252. # Fire Fang
  2253. #-----------------------------------------------------------------------------
  2254. def pbMoveAnimationSpecific142(userindex,targetindex,hitnum=0,multihit=false)
  2255. # inital configuration
  2256. usersprite = @sprites["pokemon#{userindex}"]
  2257. targetsprite = @sprites["pokemon#{targetindex}"]
  2258. player = (targetindex%2==0)
  2259. itself = (userindex==targetindex)
  2260. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  2261. # set up animation
  2262. fp = {}
  2263. rndx = []
  2264. rndy = []
  2265. fp["bg"] = Sprite.new(targetsprite.viewport)
  2266. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  2267. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(130,52,42))
  2268. fp["bg"].opacity = 0
  2269. for i in 0...12
  2270. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  2271. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb136")
  2272. fp["#{i}"].src_rect.set(0,101*rand(3),53,101)
  2273. fp["#{i}"].ox = 26
  2274. fp["#{i}"].oy = 50
  2275. fp["#{i}"].opacity = 0
  2276. fp["#{i}"].z = 50
  2277. fp["#{i}"].zoom_x = (targetsprite.zoom_x)/2
  2278. fp["#{i}"].zoom_y = (targetsprite.zoom_y)/2
  2279. rndx.push(rand(64))
  2280. rndy.push(rand(64))
  2281. end
  2282. fp["fang1"] = Sprite.new(targetsprite.viewport)
  2283. fp["fang1"].bitmap = pbBitmap("Graphics/Animations/eb028")
  2284. fp["fang1"].ox = fp["fang1"].bitmap.width/2
  2285. fp["fang1"].oy = fp["fang1"].bitmap.height - 20
  2286. fp["fang1"].opacity = 0
  2287. fp["fang1"].z = 41
  2288. fp["fang1"].tone = Tone.new(48,16,6)
  2289. fp["fang2"] = Sprite.new(targetsprite.viewport)
  2290. fp["fang2"].bitmap = pbBitmap("Graphics/Animations/eb028")
  2291. fp["fang2"].ox = fp["fang1"].bitmap.width/2
  2292. fp["fang2"].oy = fp["fang1"].bitmap.height - 20
  2293. fp["fang2"].opacity = 0
  2294. fp["fang2"].z = 40
  2295. fp["fang2"].angle = 180
  2296. fp["fang2"].tone = Tone.new(48,16,6)
  2297. shake = 4
  2298. # start animation
  2299. @vector.set(getRealVector(targetindex,player))
  2300. for i in 0...72
  2301. cx, cy = getCenter(targetsprite,true)
  2302. fp["fang1"].x = cx; fp["fang1"].y = cy
  2303. fp["fang1"].zoom_x = targetsprite.zoom_x; fp["fang1"].zoom_y = targetsprite.zoom_y
  2304. fp["fang2"].x = cx; fp["fang2"].y = cy
  2305. fp["fang2"].zoom_x = targetsprite.zoom_x; fp["fang2"].zoom_y = targetsprite.zoom_y
  2306. if i.between?(20,29)
  2307. fp["fang1"].opacity += 5
  2308. fp["fang1"].oy += 2
  2309. fp["fang2"].opacity += 5
  2310. fp["fang2"].oy += 2
  2311. elsif i.between?(30,40)
  2312. fp["fang1"].opacity += 25.5
  2313. fp["fang1"].oy -= 4
  2314. fp["fang2"].opacity += 25.5
  2315. fp["fang2"].oy -= 4
  2316. else i > 40
  2317. fp["fang1"].opacity -= 26
  2318. fp["fang1"].oy += 2
  2319. fp["fang2"].opacity -= 26
  2320. fp["fang2"].oy += 2
  2321. end
  2322. if i==32
  2323. pbSEPlay("#{SE_EXTRA_PATH}Super Fang")
  2324. pbSEPlay("#{SE_EXTRA_PATH}Fire2",75)
  2325. end
  2326. for j in 0...12
  2327. next if i < 40
  2328. if fp["#{j}"].opacity == 0 && fp["#{j}"].tone.gray == 0
  2329. fp["#{j}"].x = cx
  2330. fp["#{j}"].y = cy
  2331. end
  2332. x2 = cx - 32*targetsprite.zoom_x + rndx[j]*targetsprite.zoom_x
  2333. y2 = cy - 32*targetsprite.zoom_y + rndy[j]*targetsprite.zoom_y
  2334. x0 = fp["#{j}"].x
  2335. y0 = fp["#{j}"].y
  2336. fp["#{j}"].x += (x2 - x0)*0.2
  2337. fp["#{j}"].y += (y2 - y0)*0.2
  2338. fp["#{j}"].src_rect.x += 53 if i%2==0
  2339. fp["#{j}"].src_rect.x = 0 if fp["#{j}"].src_rect.x >= fp["#{j}"].bitmap.width
  2340. if (x2 - x0)*0.2 < 1 && (y2 - y0)*0.2 < 1
  2341. fp["#{j}"].opacity -= 24
  2342. fp["#{j}"].tone.gray += 24
  2343. fp["#{j}"].tone.red -= 8; fp["#{j}"].tone.green -= 8; fp["#{j}"].tone.blue -= 8
  2344. fp["#{j}"].zoom_x -= 0.01
  2345. fp["#{j}"].zoom_y += 0.02
  2346. else
  2347. fp["#{j}"].opacity += 45
  2348. end
  2349. end
  2350. fp["bg"].opacity += 4 if i < 40
  2351. if i >= 40
  2352. if i >= 56
  2353. targetsprite.tone.red -= 3*2
  2354. targetsprite.tone.green += 1.5*2
  2355. targetsprite.tone.blue += 3*2
  2356. fp["bg"].opacity -= 10
  2357. else
  2358. targetsprite.tone.red += 3*2 if targetsprite.tone.red < 48*2
  2359. targetsprite.tone.green -= 1.5*2 if targetsprite.tone.green > -24*2
  2360. targetsprite.tone.blue -= 3*2 if targetsprite.tone.blue > -48*2
  2361. end
  2362. targetsprite.addOx(shake)
  2363. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  2364. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  2365. targetsprite.still
  2366. end
  2367. wait(1,true)
  2368. end
  2369. targetsprite.ox = targetsprite.bitmap.width/2
  2370. @vector.set(defaultvector) if !multihit
  2371. pbDisposeSpriteHash(fp)
  2372. return true
  2373. end
  2374. #-----------------------------------------------------------------------------
  2375. # Fly
  2376. #-----------------------------------------------------------------------------
  2377. def pbMoveAnimationSpecific156(userindex,targetindex,hitnum=0,multihit=false)
  2378. if hitnum == 1
  2379. return moveAnimationFlyUp(userindex,targetindex)
  2380. elsif hitnum == 0
  2381. return moveAnimationFlyDown(userindex,targetindex)
  2382. end
  2383. end
  2384.  
  2385. def moveAnimationFlyUp(userindex,targetindex)
  2386. # inital configuration
  2387. usersprite = @sprites["pokemon#{userindex}"]
  2388. targetsprite = @sprites["pokemon#{targetindex}"]
  2389. player = (userindex%2==0)
  2390. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  2391. vector = getRealVector(userindex,player)
  2392. factor = player ? 2 : 1.5
  2393. # set up animation
  2394. fp = {}
  2395. fp["fly"] = Sprite.new(usersprite.viewport)
  2396. fp["fly"].bitmap = pbBitmap("Graphics/Animations/eb156")
  2397. fp["fly"].ox = fp["fly"].bitmap.width/2
  2398. fp["fly"].oy = fp["fly"].bitmap.height/2
  2399. fp["fly"].z = 50
  2400. fp["fly"].x, fp["fly"].y = getCenter(usersprite)
  2401. fp["fly"].opacity = 0
  2402. fp["fly"].zoom_x = factor*1.4
  2403. fp["fly"].zoom_y = factor*1.4
  2404. fp["dnt"] = Sprite.new(usersprite.viewport)
  2405. fp["dnt"].bitmap = pbBitmap("Graphics/Animations/eb156_2")
  2406. fp["dnt"].ox = fp["dnt"].bitmap.width/2
  2407. fp["dnt"].oy = fp["dnt"].bitmap.height/2
  2408. fp["dnt"].z = 50
  2409. fp["dnt"].opacity = 0
  2410. # start animation
  2411. @vector.set(vector)
  2412. wait(20,true)
  2413. pbSEPlay("#{SE_EXTRA_PATH}Refresh")
  2414. for i in 0...20
  2415. cx, cy = getCenter(usersprite)
  2416. fp["fly"].x = cx
  2417. fp["fly"].y = cy
  2418. fp["fly"].zoom_x -= factor*0.4/10
  2419. fp["fly"].zoom_y -= factor*0.4/10
  2420. fp["fly"].opacity += 51
  2421. fp["dnt"].x = cx
  2422. fp["dnt"].y = cy
  2423. fp["dnt"].zoom_x = fp["fly"].zoom_x
  2424. fp["dnt"].zoom_y = fp["fly"].zoom_y
  2425. fp["dnt"].opacity += 25.5
  2426. fp["dnt"].angle -= 16
  2427. usersprite.visible = false if i == 6
  2428. usersprite.hidden = true if i == 6
  2429. wait(1,true)
  2430. end
  2431. 10.times do
  2432. fp["fly"].zoom_x += factor*0.4/10
  2433. fp["fly"].zoom_y += factor*0.4/10
  2434. fp["dnt"].zoom_x = fp["fly"].zoom_x
  2435. fp["dnt"].zoom_y = fp["fly"].zoom_y
  2436. fp["dnt"].opacity -= 25.5
  2437. fp["dnt"].angle -= 16
  2438. wait(1,true)
  2439. end
  2440. @vector.set(vector[0],vector[1]+196,vector[2],vector[3],vector[4],vector[5])
  2441. for i in 0...20
  2442. wait(1,true)
  2443. cx, cy = getCenter(usersprite)
  2444. if i < 10
  2445. fp["fly"].zoom_y -= factor*0.02
  2446. elsif
  2447. fp["fly"].zoom_x -= factor*0.02
  2448. fp["fly"].zoom_y += factor*0.04
  2449. end
  2450. fp["fly"].x = cx
  2451. fp["fly"].y = cy
  2452. fp["fly"].y -= 32*(i-10) if i >= 10
  2453. pbSEPlay("eb_flying2") if i == 10
  2454. end
  2455. for i in 0...20
  2456. fp["fly"].y -= 32
  2457. fp["fly"].opacity -= 25.5 if i >= 10
  2458. wait(1,true)
  2459. end
  2460. pbDisposeSpriteHash(fp)
  2461. @vector.set(defaultvector)
  2462. wait(20,true)
  2463. return true
  2464. end
  2465.  
  2466. def moveAnimationFlyDown(userindex,targetindex)
  2467. # inital configuration
  2468. usersprite = @sprites["pokemon#{userindex}"]
  2469. targetsprite = @sprites["pokemon#{targetindex}"]
  2470. player = (targetindex%2==0)
  2471. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  2472. vector = getRealVector(targetindex,player)
  2473. factor = player ? 2 : 1.5
  2474. # set up animation
  2475. fp = {}
  2476. fp["bg"] = Sprite.new(targetsprite.viewport)
  2477. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  2478. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(0,0,0))
  2479. fp["bg"].opacity = 0
  2480. fp["drop"] = Sprite.new(targetsprite.viewport)
  2481. fp["drop"].bitmap = pbBitmap("Graphics/Animations/eb156_3")
  2482. fp["drop"].ox = fp["drop"].bitmap.width/2
  2483. fp["drop"].oy = fp["drop"].bitmap.height/2
  2484. fp["drop"].y = 0
  2485. fp["drop"].z = 50
  2486. fp["drop"].visible = false
  2487. # start animation
  2488. @vector.set(defaultvector[0],defaultvector[1]+128,defaultvector[2],defaultvector[3],defaultvector[4],defaultvector[5])
  2489. 32.times do
  2490. fp["bg"].opacity += 2
  2491. wait(1,true)
  2492. end
  2493. @vector.set(vector)
  2494. maxy = ((player ? @vector.y : @vector.y2)*0.1).ceil*10 - 80
  2495. fp["drop"].y = -((maxy-(player ? @vector.y-80 : @vector.y2-80))*0.1).ceil*10
  2496. fp["drop"].x = targetsprite.x
  2497. pbSEPlay("#{SE_EXTRA_PATH}Wind1")
  2498. for i in 0...20
  2499. wait(1,true)
  2500. if i >= 10
  2501. fp["drop"].visible = true
  2502. fp["drop"].x = targetsprite.x
  2503. fp["drop"].y += maxy/10
  2504. fp["drop"].zoom_x = targetsprite.zoom_x
  2505. fp["drop"].zoom_y = targetsprite.zoom_y*1.4
  2506. end
  2507. fp["bg"].opacity -= 51 if i >= 15
  2508. end
  2509. usersprite.hidden = false
  2510. usersprite.visible = true
  2511. pbDisposeSpriteHash(fp)
  2512. return pbMoveAnimationSpecific303(userindex,targetindex,0,false,false,true)
  2513. end
  2514. #-----------------------------------------------------------------------------
  2515. # Air Slash
  2516. #-----------------------------------------------------------------------------
  2517. def pbMoveAnimationSpecific159(userindex,targetindex,hitnum=0,multihit=false)
  2518. # inital configuration
  2519. usersprite = @sprites["pokemon#{userindex}"]
  2520. targetsprite = @sprites["pokemon#{targetindex}"]
  2521. player = (targetindex%2==0)
  2522. itself = (userindex==targetindex)
  2523. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  2524. pbSEPlay("eb_flying1",80)
  2525. @vector.set(getRealVector(targetindex,player))
  2526. wait(16,true)
  2527. factor = targetsprite.zoom_x
  2528. # set up animation
  2529. fp = {}
  2530. cx, cy = getCenter(targetsprite,true)
  2531. da = []
  2532. dx = []
  2533. dy = []
  2534. doj = []
  2535. for i in 0...32
  2536. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  2537. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb159_2")
  2538. fp["#{i}"].ox = 12
  2539. fp["#{i}"].oy = 1
  2540. fp["#{i}"].opacity = 0
  2541. fp["#{i}"].z = targetsprite.z + 1
  2542. r = 128*factor
  2543. z = [1,1.25,0.75,1.5][rand(4)]
  2544. fp["#{i}"].zoom_x = z
  2545. #fp["#{i}"].zoom_y = factor
  2546. fp["#{i}"].x = cx
  2547. fp["#{i}"].y = cy
  2548. fp["#{i}"].tone = Tone.new(255,255,255)
  2549. da.push(rand(2)==0 ? 1 : -1)
  2550. dx.push(cx - r + rand(r*2))
  2551. dy.push(cy - r + rand(r*2))
  2552. doj.push(rand(4)+1)
  2553. end
  2554. fp["slash"] = Sprite.new(targetsprite.viewport)
  2555. fp["slash"].bitmap = pbBitmap("Graphics/Animations/eb159")
  2556. fp["slash"].ox = fp["slash"].bitmap.width/2
  2557. fp["slash"].oy = fp["slash"].bitmap.height/2
  2558. fp["slash"].x = cx
  2559. fp["slash"].y = cy
  2560. #fp["slash"].zoom_x = factor
  2561. #fp["slash"].zoom_y = factor
  2562. fp["slash"].z = targetsprite.z
  2563. fp["slash"].src_rect.height = 0
  2564. pbSEPlay("eb_normal3",80)
  2565. # start animation
  2566. shake = 2
  2567. for i in 0...48
  2568. fp["slash"].src_rect.height += 48 if i < 8
  2569. for j in 0...32
  2570. fp["#{j}"].angle += 32*da[j]
  2571. fp["#{j}"].tone.red -= 8 if fp["#{j}"].tone.red > 0
  2572. fp["#{j}"].tone.green -= 8 if fp["#{j}"].tone.green > 0
  2573. fp["#{j}"].tone.blue -= 8 if fp["#{j}"].tone.blue > 0
  2574. fp["#{j}"].opacity += 16*(i < 24 ? 4 : -1*doj[j])
  2575. fp["#{j}"].x -= (fp["#{j}"].x - dx[j])*0.05
  2576. fp["#{j}"].y -= (fp["#{j}"].y - dy[j])*0.05
  2577. end
  2578. if i >= 4
  2579. fp["slash"].tone.red += 16 if fp["slash"].tone.red < 255
  2580. fp["slash"].tone.green += 16 if fp["slash"].tone.green < 255
  2581. fp["slash"].tone.blue += 16 if fp["slash"].tone.blue < 255
  2582. fp["slash"].opacity -= 32 if i >= 8
  2583. end
  2584. if i >= 8
  2585. targetsprite.addOx(shake)
  2586. shake = -2 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  2587. shake = 2 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  2588. targetsprite.still
  2589. end
  2590. wait(1)
  2591. end
  2592. targetsprite.ox = targetsprite.bitmap.width/2
  2593. pbDisposeSpriteHash(fp)
  2594. @vector.set(defaultvector) if !multihit
  2595. return true
  2596. end
  2597. #-----------------------------------------------------------------------------
  2598. # Wing Attack
  2599. #-----------------------------------------------------------------------------
  2600. def pbMoveAnimationSpecific164(userindex,targetindex,hitnum=0,multihit=false)
  2601. # inital configuration
  2602. usersprite = @sprites["pokemon#{userindex}"]
  2603. targetsprite = @sprites["pokemon#{targetindex}"]
  2604. player = (targetindex%2==0)
  2605. itself = (userindex==targetindex)
  2606. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  2607. pbSEPlay("eb_flying1",80)
  2608. @vector.set(getRealVector(targetindex,player))
  2609. wait(16,true)
  2610. factor = targetsprite.zoom_x
  2611. # set up animation
  2612. fp = {}
  2613. rndx = []
  2614. rndy = []
  2615. cx, cy = getCenter(targetsprite,true)
  2616. for i in 0...12
  2617. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  2618. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb303_2")
  2619. fp["#{i}"].ox = 10
  2620. fp["#{i}"].oy = 10
  2621. fp["#{i}"].opacity = 0
  2622. fp["#{i}"].z = 51
  2623. r = rand(3)
  2624. fp["#{i}"].zoom_x = (factor-0.5)*(r==0 ? 1 : 0.5)
  2625. fp["#{i}"].zoom_y = (factor-0.5)*(r==0 ? 1 : 0.5)
  2626. fp["#{i}"].tone = Tone.new(60,60,60)
  2627. rndx.push(rand(128))
  2628. rndy.push(rand(64))
  2629. end
  2630. wait = []
  2631. for m in 0...8
  2632. fp["w#{m}"] = Sprite.new(targetsprite.viewport)
  2633. fp["w#{m}"].bitmap = pbBitmap("Graphics/Animations/eb164")
  2634. fp["w#{m}"].ox = 20
  2635. fp["w#{m}"].oy = 16
  2636. fp["w#{m}"].opacity = 0
  2637. fp["w#{m}"].z = 50
  2638. fp["w#{m}"].angle = rand(360)
  2639. fp["w#{m}"].zoom_x = factor - 0.5
  2640. fp["w#{m}"].zoom_y = factor - 0.5
  2641. fp["w#{m}"].x = cx - 32*factor + rand(64*factor)
  2642. fp["w#{m}"].y = cy - 112*factor + rand(112*factor)
  2643. wait.push(0)
  2644. end
  2645. pbSEPlay("eb_normal1",80)
  2646. frame = Sprite.new(targetsprite.viewport)
  2647. frame.z = 51
  2648. frame.bitmap = pbBitmap("Graphics/Animations/eb303")
  2649. frame.src_rect.set(0,0,64,64)
  2650. frame.ox = 32
  2651. frame.oy = 32
  2652. frame.zoom_x = 0.5*factor
  2653. frame.zoom_y = 0.5*factor
  2654. frame.x, frame.y = getCenter(targetsprite,true)
  2655. frame.opacity = 0
  2656. frame.tone = Tone.new(255,255,255)
  2657. frame.y -= 32*targetsprite.zoom_y
  2658. # start animation
  2659. for i in 1..30
  2660. if i.between?(1,5)
  2661. targetsprite.still
  2662. targetsprite.zoom_y-=0.05*factor
  2663. targetsprite.toneAll(-12.8)
  2664. frame.zoom_x += 0.1*factor
  2665. frame.zoom_y += 0.1*factor
  2666. frame.opacity += 51
  2667. end
  2668. frame.tone = Tone.new(0,0,0) if i == 6
  2669. if i.between?(6,10)
  2670. targetsprite.still
  2671. targetsprite.zoom_y+=0.05*factor
  2672. targetsprite.toneAll(+12.8)
  2673. frame.angle += 2
  2674. end
  2675. frame.src_rect.x = 64 if i == 10
  2676. if i >= 10
  2677. frame.opacity -= 25.5
  2678. frame.zoom_x += 0.1*factor
  2679. frame.zoom_y += 0.1*factor
  2680. frame.angle += 2
  2681. end
  2682. for m in 0...8
  2683. next if m>(i/2)
  2684. fp["w#{m}"].angle += 2
  2685. fp["w#{m}"].opacity += 32*(wait[m] < 8 ? 1 : -0.25)
  2686. wait[m] += 1
  2687. end
  2688. for j in 0...12
  2689. cx = frame.x; cy = frame.y
  2690. if fp["#{j}"].opacity == 0 && fp["#{j}"].visible
  2691. fp["#{j}"].x = cx
  2692. fp["#{j}"].y = cy
  2693. end
  2694. x2 = cx - 64*targetsprite.zoom_x + rndx[j]*targetsprite.zoom_x
  2695. y2 = cy - 64*targetsprite.zoom_y + rndy[j]*targetsprite.zoom_y
  2696. x0 = fp["#{j}"].x
  2697. y0 = fp["#{j}"].y
  2698. fp["#{j}"].x += (x2 - x0)*0.2
  2699. fp["#{j}"].y += (y2 - y0)*0.2
  2700. fp["#{j}"].zoom_x += 0.01
  2701. fp["#{j}"].zoom_y += 0.01
  2702. if i < 20
  2703. fp["#{j}"].tone.red -= 6; fp["#{j}"].tone.blue -= 6; fp["#{j}"].tone.green -= 6
  2704. end
  2705. if (x2 - x0)*0.2 < 1 && (y2 - y0)*0.2 < 1
  2706. fp["#{j}"].opacity -= 51
  2707. else
  2708. fp["#{j}"].opacity += 51
  2709. end
  2710. fp["#{j}"].visible = false if fp["#{j}"].opacity <= 0
  2711. end
  2712. wait(1)
  2713. end
  2714. frame.dispose
  2715. pbDisposeSpriteHash(fp)
  2716. @vector.set(defaultvector) if !multihit
  2717. return true
  2718. end
  2719. #-----------------------------------------------------------------------------
  2720. # Shadow Ball
  2721. #-----------------------------------------------------------------------------
  2722. def pbMoveAnimationSpecific175(userindex,targetindex,hitnum=0,multihit=false)
  2723. usersprite = @sprites["pokemon#{userindex}"]
  2724. targetsprite = @sprites["pokemon#{targetindex}"]
  2725. player = (targetindex%2==0)
  2726. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  2727. x1, y1 = getCenter(targetsprite,true)
  2728. x2, y2 = getCenter(usersprite,true)
  2729. if player
  2730. cx = x1 + (x2 - x1)*0.65
  2731. cy = y1 - (y1 - y2)*0.65
  2732. else
  2733. cx = x2 + (x1 - x2)*0.5
  2734. cy = y2 - (y2 - y1)*0.5
  2735. end
  2736. fp = {}
  2737. for j in 0...16
  2738. fp["p#{j}"] = Sprite.new(targetsprite.viewport)
  2739. fp["p#{j}"].bitmap = pbBitmap("Graphics/Animations/eb175_2")
  2740. fp["p#{j}"].oy = fp["p#{j}"].bitmap.height/2
  2741. fp["p#{j}"].x = cx
  2742. fp["p#{j}"].y = cy
  2743. fp["p#{j}"].opacity = 0
  2744. fp["p#{j}"].z = 20
  2745. end
  2746. coords = []
  2747. percent = 0
  2748. for j in 0...32
  2749. fp["c#{j}"] = Sprite.new(targetsprite.viewport)
  2750. fp["c#{j}"].bitmap = pbBitmap("Graphics/Animations/eb175_1")
  2751. fp["c#{j}"].opacity = 0
  2752. fp["c#{j}"].angle = rand(360)
  2753. fp["c#{j}"].ox = 12
  2754. fp["c#{j}"].oy = 18 + rand(24)
  2755. fp["c#{j}"].x = cx
  2756. fp["c#{j}"].y = cy
  2757. fp["c#{j}"].z = 20
  2758. fp["c#{j}"].color = Color.new(123,64,89,0)
  2759. fp["c#{j}"].toggle = 1
  2760. end
  2761. fp["circle"] = Sprite.new(targetsprite.viewport)
  2762. fp["circle"].bitmap = pbBitmap("Graphics/Animations/eb175")
  2763. fp["circle"].center
  2764. fp["circle"].x = cx
  2765. fp["circle"].y = cy
  2766. fp["circle"].zoom_x = 0
  2767. fp["circle"].zoom_y = 0
  2768. fp["circle"].z = 20
  2769. pbSEPlay("#{SE_EXTRA_PATH}Heal4")
  2770. for i in 0...64
  2771. fp["circle"].zoom_x += 0.125 if fp["circle"].zoom_x < 1
  2772. fp["circle"].zoom_y += 0.125 if fp["circle"].zoom_y < 1
  2773. fp["circle"].angle += 8
  2774. for j in 0...16
  2775. next if j > i/4
  2776. if fp["p#{j}"].ox >= -16
  2777. fp["p#{j}"].ox = -128
  2778. fp["p#{j}"].angle = rand(360)
  2779. fp["p#{j}"].opacity = 0
  2780. end
  2781. fp["p#{j}"].opacity += 32
  2782. fp["p#{j}"].ox += 16
  2783. end
  2784. for j in 0...32
  2785. fp["c#{j}"].toggle *= -1 if i%4==0
  2786. next if j > i/2
  2787. fp["c#{j}"].opacity += 16
  2788. fp["c#{j}"].color.alpha = 255*fp["c#{j}"].toggle
  2789. end
  2790. wait(1)
  2791. end
  2792. for key in fp.keys
  2793. next if key == "circle"
  2794. fp[key].dispose
  2795. fp.delete(key)
  2796. end
  2797. fp["circle2"] = Sprite.new(targetsprite.viewport)
  2798. fp["circle2"].bitmap = pbBitmap("Graphics/Animations/eb175_3")
  2799. fp["circle2"].center
  2800. fp["circle2"].x = cx
  2801. fp["circle2"].y = cy
  2802. fp["circle2"].z = fp["circle"].z - 1
  2803. @vector.set(getRealVector(targetindex,player))
  2804. 16.times do
  2805. fp["circle2"].zoom_x = @vector.zoom1
  2806. fp["circle2"].zoom_y = @vector.zoom1
  2807. fp["circle"].zoom_x = @vector.zoom1
  2808. fp["circle"].zoom_y = @vector.zoom1
  2809. x1, y1 = getCenter(targetsprite,true)
  2810. x2, y2 = getCenter(usersprite,true)
  2811. if player
  2812. cx = x1 + (x2 - x1)*0.65
  2813. cy = y1 - (y1 - y2)*0.65
  2814. else
  2815. cx = x2 + (x1 - x2)*0.5
  2816. cy = y2 - (y2 - y1)*0.5
  2817. end
  2818. fp["circle2"].x = cx
  2819. fp["circle2"].y = cy
  2820. fp["circle"].x = cx
  2821. fp["circle"].y = cy
  2822. fp["circle"].angle += 8
  2823. wait(1,true)
  2824. end
  2825. fp["circle"].visible = false
  2826. fp["circle2"].z = targetsprite.z + 1
  2827. pbSEPlay("#{SE_EXTRA_PATH}Flash")
  2828. 8.times do
  2829. fp["circle2"].x += (x1 - fp["circle2"].x)*0.5
  2830. fp["circle2"].y -= (fp["circle2"].y - y1)*0.5
  2831. wait(1)
  2832. end
  2833. fp["circle2"].visible = false
  2834. targetsprite.anim = true
  2835. targetsprite.color = Color.new(122,71,109)
  2836. 2.times do
  2837. targetsprite.anim = true
  2838. wait(1)
  2839. end
  2840. for j in 0...16
  2841. fp["i#{j}"] = Sprite.new(targetsprite.viewport)
  2842. fp["i#{j}"].bitmap = pbBitmap("Graphics/Animations/eb175_4")
  2843. fp["i#{j}"].ox = fp["i#{j}"].bitmap.width/2
  2844. fp["i#{j}"].oy = fp["i#{j}"].bitmap.height
  2845. fp["i#{j}"].angle = rand(360)
  2846. fp["i#{j}"].z = targetsprite.z + 1
  2847. fp["i#{j}"].x = x1
  2848. fp["i#{j}"].y = y1
  2849. end
  2850. for i in 0...32
  2851. for j in 0...16
  2852. next if j > i
  2853. fp["i#{j}"].opacity -= 16
  2854. fp["i#{j}"].oy += 8
  2855. end
  2856. targetsprite.color.alpha -= 16
  2857. targetsprite.anim = true
  2858. wait(1)
  2859. end
  2860. pbDisposeSpriteHash(fp)
  2861. @vector.set(defaultvector)
  2862. return true
  2863. end
  2864. #-----------------------------------------------------------------------------
  2865. # Shadow Claw
  2866. #-----------------------------------------------------------------------------
  2867. def pbMoveAnimationSpecific176(userindex,targetindex,hitnum=0,multihit=false)
  2868. # inital configuration
  2869. usersprite = @sprites["pokemon#{userindex}"]
  2870. targetsprite = @sprites["pokemon#{targetindex}"]
  2871. player = (targetindex%2==0)
  2872. itself = (userindex==targetindex)
  2873. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  2874. factor = targetsprite.zoom_x
  2875. @vector.set(getRealVector(targetindex,player))
  2876. wait(16,true)
  2877. factor = targetsprite.zoom_x
  2878. cx, cy = getCenter(targetsprite,true)
  2879. # set up animation
  2880. fp = {}
  2881. fp["claw"] = Sprite.new(targetsprite.viewport)
  2882. fp["claw"].bitmap = pbBitmap("Graphics/Animations/eb176")
  2883. fp["claw"].ox = fp["claw"].bitmap.width/2
  2884. fp["claw"].oy = fp["claw"].bitmap.height/2
  2885. fp["claw"].x = cx
  2886. fp["claw"].y = cy
  2887. fp["claw"].zoom_x = factor
  2888. fp["claw"].zoom_y = factor
  2889. fp["claw"].src_rect.height = 0
  2890. fp["claw"].z = targetsprite.z + 1
  2891. for j in 0...12
  2892. fp["s#{j}"] = Sprite.new(targetsprite.viewport)
  2893. fp["s#{j}"].bitmap = pbBitmap("Graphics/Animations/eb176_3")
  2894. fp["s#{j}"].ox = fp["s#{j}"].bitmap.width/2
  2895. fp["s#{j}"].oy = fp["s#{j}"].bitmap.height/2
  2896. r = 32*factor
  2897. fp["s#{j}"].x = cx - r + rand(r*2)
  2898. fp["s#{j}"].y = cy - r + rand(r*2)
  2899. fp["s#{j}"].opacity = 0
  2900. fp["s#{j}"].z = targetsprite.z
  2901. fp["s#{j}"].angle = rand(360)
  2902. end
  2903. for j in 0...12
  2904. fp["p#{j}"] = Sprite.new(targetsprite.viewport)
  2905. fp["p#{j}"].bitmap = pbBitmap("Graphics/Animations/eb176_2")
  2906. fp["p#{j}"].ox = fp["p#{j}"].bitmap.width/2
  2907. fp["p#{j}"].oy = fp["p#{j}"].bitmap.height/2
  2908. r = 48*factor
  2909. fp["p#{j}"].x = cx - r + rand(r*2)
  2910. fp["p#{j}"].y = cy - r + rand(r)
  2911. fp["p#{j}"].opacity = 0
  2912. fp["p#{j}"].z = targetsprite.z + 1
  2913. fp["p#{j}"].color = Color.new(0,0,0,0)
  2914. end
  2915. pbSEPlay("eb_ground1",75)
  2916. for i in 0...64
  2917. pbSEPlay("eb_normal3",85) if i == 4
  2918. fp["claw"].src_rect.height += 16
  2919. for j in 0...12
  2920. next if i < 8
  2921. fp["s#{j}"].opacity += 16*((i-8) < 24 ? 1 : -2)
  2922. fp["s#{j}"].angle += 2
  2923. fp["s#{j}"].zoom_x -= 0.01 if i >= 12 if fp["s#{j}"].zoom_x > 0
  2924. fp["s#{j}"].zoom_y -= 0.01 if i >= 12 if fp["s#{j}"].zoom_y > 0
  2925. #fp["s#{j}"].x += 2*((fp["s#{j}"].x > targetsprite.x) ? 1 : -1)
  2926. #fp["s#{j}"].y += 2*((fp["s#{j}"].x > targetsprite.x) ? 1 : -1)
  2927. end
  2928. for j in 0...12
  2929. next if i < 8
  2930. next if j>(i-8)
  2931. fp["p#{j}"].opacity += 32*((i-8) < 24 ? 1 : -1)
  2932. fp["p#{j}"].color.alpha += 8
  2933. fp["p#{j}"].zoom_x -= 0.05 if i >= 24 if fp["p#{j}"].zoom_x > 0
  2934. fp["p#{j}"].zoom_y -= 0.05 if i >= 24 if fp["p#{j}"].zoom_y > 0
  2935. #fp["p#{j}"].x += 2*((fp["p#{j}"].x > targetsprite.x) ? 1 : -1)
  2936. #fp["p#{j}"].y -= 2
  2937. end
  2938. fp["claw"].opacity -= 32 if i >= 16
  2939. wait(1,true)
  2940. end
  2941. pbDisposeSpriteHash(fp)
  2942. @vector.set(defaultvector) if !multihit
  2943. return true
  2944. end
  2945. #-----------------------------------------------------------------------------
  2946. # Night Shade
  2947. #-----------------------------------------------------------------------------
  2948. def pbMoveAnimationSpecific183(userindex,targetindex,hitnum=0,multihit=false)
  2949. # inital configuration
  2950. usersprite = @sprites["pokemon#{userindex}"]
  2951. targetsprite = @sprites["pokemon#{targetindex}"]
  2952. player = (targetindex%2==0)
  2953. itself = (userindex==targetindex)
  2954. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  2955. # set up animation
  2956. fp = {}
  2957. fp["bg"] = Sprite.new(targetsprite.viewport)
  2958. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  2959. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(0,0,0))
  2960. fp["bg"].opacity = 0
  2961. factor = usersprite.zoom_x
  2962. shake = 2
  2963. # play animation
  2964. pbSEPlay("#{SE_EXTRA_PATH}fog2",80)
  2965. 16.times do
  2966. fp["bg"].opacity += 8
  2967. usersprite.still
  2968. wait(1,true)
  2969. end
  2970. for i in 0...24
  2971. if i < 16
  2972. usersprite.zoom_x += 0.2*factor/8.0 if usersprite.zoom_x < 1.2*factor
  2973. usersprite.zoom_y += 0.2*factor/8.0 if usersprite.zoom_y < 1.2*factor
  2974. usersprite.tone.red += 8
  2975. usersprite.tone.green += 8
  2976. usersprite.tone.blue += 8
  2977. end
  2978. usersprite.still
  2979. wait(1)
  2980. end
  2981. for i in 0...24
  2982. if i < 24
  2983. targetsprite.addOx(shake)
  2984. shake = -2 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  2985. shake = 2 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  2986. targetsprite.still
  2987. end
  2988. targetsprite.tone.red -= 16 if i < 16
  2989. targetsprite.tone.green -= 16 if i < 16
  2990. targetsprite.tone.blue -= 16 if i < 16
  2991. targetsprite.still if i >= 12
  2992. usersprite.still
  2993. wait(1)
  2994. end
  2995. 8.times do
  2996. usersprite.zoom_x -= 0.2*factor/8.0
  2997. usersprite.zoom_y -= 0.2*factor/8.0
  2998. usersprite.tone.red -= 16
  2999. usersprite.tone.green -= 16
  3000. usersprite.tone.blue -= 16
  3001. usersprite.still
  3002. targetsprite.still
  3003. wait(1)
  3004. end
  3005. 16.times do
  3006. targetsprite.tone.red += 16
  3007. targetsprite.tone.green += 16
  3008. targetsprite.tone.blue += 16
  3009. fp["bg"].opacity -= 8
  3010. usersprite.still
  3011. wait(1)
  3012. end
  3013. targetsprite.ox = targetsprite.bitmap.width/2
  3014. @vector.set(defaultvector) if !multihit
  3015. pbDisposeSpriteHash(fp)
  3016. return true
  3017. end
  3018. #-----------------------------------------------------------------------------
  3019. # Leaf Storm
  3020. #-----------------------------------------------------------------------------
  3021. def pbMoveAnimationSpecific191(userindex,targetindex,hitnum=0,multihit=false)
  3022. # inital configuration
  3023. usersprite = @sprites["pokemon#{userindex}"]
  3024. targetsprite = @sprites["pokemon#{targetindex}"]
  3025. player = (targetindex%2==0)
  3026. player2 = (userindex%2==0)
  3027. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  3028. vector = getRealVector(targetindex,player)
  3029. vector2 = getRealVector(userindex,player2)
  3030. factor = player2 ? 2 : 1
  3031. # set up animation
  3032. fp = {}
  3033. rndx = []; prndx = []
  3034. rndy = []; prndy = []
  3035. rangl = []
  3036. dx = []
  3037. dy = []
  3038. fp["bg"] = ScrollingSprite.new(targetsprite.viewport)
  3039. fp["bg"].speed = 64
  3040. fp["bg"].setBitmap("Graphics/Animations/eb191_bg")
  3041. fp["bg"].color = Color.new(0,0,0,255)
  3042. fp["bg"].opacity = 0
  3043. for i in 0...128
  3044. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  3045. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb191_2")
  3046. fp["#{i}"].ox = fp["#{i}"].bitmap.width/2
  3047. fp["#{i}"].oy = fp["#{i}"].bitmap.height/2
  3048. fp["#{i}"].visible = false
  3049. fp["#{i}"].z = 50
  3050. rndx.push(rand(256)); prndx.push(rand(72))
  3051. rndy.push(rand(256)); prndy.push(rand(72))
  3052. rangl.push(rand(9))
  3053. dx.push(0)
  3054. dy.push(0)
  3055. end
  3056. fp["cir"] = Sprite.new(targetsprite.viewport)
  3057. fp["cir"].bitmap = pbBitmap("Graphics/Animations/eb191")
  3058. fp["cir"].ox = fp["cir"].bitmap.width/2
  3059. fp["cir"].oy = fp["cir"].bitmap.height/2
  3060. fp["cir"].z = 50
  3061. fp["cir"].mirror = player2
  3062. fp["cir"].zoom_x = (player ? 1 : 1.5)*0.5
  3063. fp["cir"].zoom_y = (player ? 1 : 1.5)*0.5
  3064. fp["cir"].opacity = 0
  3065. for i in 0...8
  3066. fp["#{i}s"] = Sprite.new(targetsprite.viewport)
  3067. fp["#{i}s"].bitmap = pbBitmap("Graphics/Animations/eb191_3")
  3068. fp["#{i}s"].ox = fp["#{i}s"].bitmap.width/2
  3069. fp["#{i}s"].oy = fp["#{i}s"].bitmap.height + 8*factor
  3070. fp["#{i}s"].angle = rand(360)
  3071. r = rand(2)
  3072. fp["#{i}s"].zoom_x = (r==0 ? 0.5 : 1)*factor
  3073. fp["#{i}s"].zoom_y = (r==0 ? 0.5 : 1)*factor
  3074. fp["#{i}s"].visible = false
  3075. fp["#{i}s"].opacity = 255 - rand(101)
  3076. fp["#{i}s"].z = 50
  3077. end
  3078. shake = 4
  3079. k = 0
  3080. # start animation
  3081. @vector.set(vector2)
  3082. for i in 0...30
  3083. if i < 10
  3084. fp["bg"].opacity += 25.5
  3085. elsif i < 20
  3086. fp["bg"].color.alpha -= 25.5
  3087. else
  3088. fp["cir"].x, fp["cir"].y = getCenter(usersprite)
  3089. fp["cir"].angle += 16*(player2 ? -1 : 1)
  3090. fp["cir"].opacity += 25.5
  3091. fp["cir"].zoom_x += (player ? 1 : 1.5)*0.05
  3092. fp["cir"].zoom_y += (player ? 1 : 1.5)*0.05
  3093. k += 1 if i%4==0; k = 0 if k > 1
  3094. fp["cir"].tone = [Tone.new(0,0,0),Tone.new(155,155,155)][k]
  3095. end
  3096. pbSEPlay("eb_grass2") if i == 20
  3097. fp["bg"].update
  3098. wait(1,true)
  3099. end
  3100. pbSEPlay("eb_wind1",90)
  3101. for i in 0...96
  3102. pbSEPlay("eb_grass1",60) if i%3==0 && i < 64
  3103. for j in 0...128
  3104. next if j>(i*2)
  3105. if !fp["#{j}"].visible
  3106. cx, cy = getCenter(usersprite)
  3107. dx[j] = cx - 46*usersprite.zoom_x*0.5 + prndx[j]*usersprite.zoom_x*0.5
  3108. dy[j] = cy - 46*usersprite.zoom_y*0.5 + prndy[j]*usersprite.zoom_y*0.5
  3109. fp["#{j}"].x = dx[j]
  3110. fp["#{j}"].y = dy[j]
  3111. fp["#{j}"].visible = true
  3112. end
  3113. cx, cy = getCenter(usersprite)
  3114. x0 = cx - 46*usersprite.zoom_x*0.5 + prndx[j]*usersprite.zoom_x*0.5
  3115. y0 = cy - 46*usersprite.zoom_y*0.5 + prndy[j]*usersprite.zoom_y*0.5
  3116. cx, cy = getCenter(targetsprite,true)
  3117. x2 = cx - 128*targetsprite.zoom_x*0.5 + rndx[j]*targetsprite.zoom_x*0.5
  3118. y2 = cy - 128*targetsprite.zoom_y*0.5 + rndy[j]*targetsprite.zoom_y*0.5
  3119. fp["#{j}"].x += (x2 - x0)*0.1
  3120. fp["#{j}"].y += (y2 - y0)*0.1
  3121. fp["#{j}"].angle += rangl[j]*2
  3122. nextx = fp["#{j}"].x# + (x2 - x0)*0.1
  3123. nexty = fp["#{j}"].y# + (y2 - y0)*0.1
  3124. if !player
  3125. fp["#{j}"].opacity -= 51 if nextx > cx && nexty < cy
  3126. else
  3127. fp["#{j}"].opacity -= 51 if nextx < cx && nexty > cy
  3128. end
  3129. end
  3130. fp["cir"].x, fp["cir"].y = getCenter(usersprite)
  3131. fp["cir"].angle += 16*(player2 ? -1 : 1)
  3132. fp["cir"].opacity -= (i>=72) ? 51 : 2
  3133. k += 1 if i%4==0; k = 0 if k > 1
  3134. fp["cir"].tone = [Tone.new(0,0,0),Tone.new(155,155,155)][k]
  3135. if i >= 64
  3136. targetsprite.addOx(shake)
  3137. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  3138. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  3139. targetsprite.still
  3140. end
  3141. for m in 0...8
  3142. fp["#{m}s"].visible = true
  3143. fp["#{m}s"].opacity -= 12
  3144. fp["#{m}s"].oy +=6*factor if fp["#{m}s"].opacity > 0
  3145. fp["#{m}s"].x, fp["#{m}s"].y = getCenter(usersprite)
  3146. end
  3147. #pbSEPlay("#{SE_EXTRA_PATH}Comet Punch") if i == 64
  3148. fp["bg"].update
  3149. @vector.set(vector) if i == 32
  3150. @vector.inc = 0.1 if i == 32
  3151. wait(1,true)
  3152. end
  3153. targetsprite.ox = targetsprite.bitmap.width/2
  3154. for i in 0...20
  3155. targetsprite.still
  3156. if i < 10
  3157. fp["bg"].color.alpha += 25.5
  3158. else
  3159. fp["bg"].opacity -= 25.5
  3160. end
  3161. fp["bg"].update
  3162. wait(1,true)
  3163. end
  3164. @vector.set(defaultvector) if !multihit
  3165. @vector.inc = 0.2
  3166. pbDisposeSpriteHash(fp)
  3167. return true
  3168. end
  3169. #-----------------------------------------------------------------------------
  3170. # Solar Beam
  3171. #-----------------------------------------------------------------------------
  3172. def pbMoveAnimationSpecific195(userindex,targetindex,hitnum=0,multihit=false)
  3173. if hitnum == 1
  3174. return moveAnimationSolarCharge(userindex,targetindex)
  3175. elsif hitnum == 0
  3176. return moveAnimationSolarBeam(userindex,targetindex)
  3177. end
  3178. end
  3179.  
  3180. def moveAnimationSolarCharge(userindex,targetindex)
  3181. # inital configuration
  3182. usersprite = @sprites["pokemon#{userindex}"]
  3183. targetsprite = @sprites["pokemon#{targetindex}"]
  3184. player = (userindex%2==0)
  3185. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  3186. vector = getRealVector(userindex,player)
  3187. factor = player ? 2 : 1
  3188. # set up animation
  3189. fp = {}
  3190. fp["bg"] = Sprite.new(targetsprite.viewport)
  3191. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  3192. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(0,0,0))
  3193. fp["bg"].opacity = 0
  3194. rndx = []
  3195. rndy = []
  3196. for i in 0...12
  3197. fp["#{i}"] = Sprite.new(usersprite.viewport)
  3198. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb195")
  3199. fp["#{i}"].ox = fp["#{i}"].bitmap.width/2
  3200. fp["#{i}"].oy = fp["#{i}"].bitmap.height/2
  3201. fp["#{i}"].opacity = 0
  3202. fp["#{i}"].z = 50
  3203. end
  3204. k = 0
  3205. c = [Tone.new(211,186,3),Tone.new(0,0,0)]
  3206. # start animation
  3207. @vector.set(vector)
  3208. for i in 0...128
  3209. cx, cy = getCenter(usersprite)
  3210. for j in 0...12
  3211. if fp["#{j}"].opacity == 0
  3212. r = rand(2)
  3213. fp["#{j}"].zoom_x = factor*(r==0 ? 1 : 0.5)
  3214. fp["#{j}"].zoom_y = factor*(r==0 ? 1 : 0.5)
  3215. x, y = randCircleCord(64*factor)
  3216. fp["#{j}"].x = cx - 64*factor*usersprite.zoom_x + x*usersprite.zoom_x
  3217. fp["#{j}"].y = cy - 64*factor*usersprite.zoom_y + y*usersprite.zoom_y
  3218. end
  3219. next if j>(i/4)
  3220. x2 = cx
  3221. y2 = cy
  3222. x0 = fp["#{j}"].x
  3223. y0 = fp["#{j}"].y
  3224. fp["#{j}"].x += (x2 - x0)*0.1
  3225. fp["#{j}"].y += (y2 - y0)*0.1
  3226. fp["#{j}"].zoom_x -= fp["#{j}"].zoom_x*0.1
  3227. fp["#{j}"].zoom_y -= fp["#{j}"].zoom_y*0.1
  3228. if i >= 96
  3229. fp["#{j}"].opacity -= 35
  3230. elsif (x2 - x0)*0.1 < 1 && (y2 - y0)*0.1 < 1
  3231. fp["#{j}"].opacity = 0
  3232. else
  3233. fp["#{j}"].opacity += 35
  3234. end
  3235. end
  3236. if i < 96
  3237. fp["bg"].opacity += 5 if fp["bg"].opacity < 255*0.6
  3238. else
  3239. fp["bg"].opacity -= 5
  3240. end
  3241. if i < 112
  3242. if i%16 == 0
  3243. k += 1
  3244. k = 0 if k > 1
  3245. end
  3246. usersprite.tone.red += (c[k].red - usersprite.tone.red)*0.2
  3247. usersprite.tone.green += (c[k].green - usersprite.tone.green)*0.2
  3248. usersprite.tone.blue += (c[k].blue - usersprite.tone.blue)*0.2
  3249. end
  3250. pbSEPlay("#{SE_EXTRA_PATH}Absorb2",100) if i == 16
  3251. pbSEPlay("#{SE_EXTRA_PATH}Saint8",70) if i == 16
  3252. wait(1,true)
  3253. end
  3254. usersprite.tone = Tone.new(0,0,0)
  3255. @vector.set(defaultvector)
  3256. pbDisposeSpriteHash(fp)
  3257. return true
  3258. end
  3259.  
  3260. def moveAnimationSolarBeam(userindex,targetindex)
  3261. # inital configuration
  3262. usersprite = @sprites["pokemon#{userindex}"]
  3263. targetsprite = @sprites["pokemon#{targetindex}"]
  3264. player = (targetindex%2==0)
  3265. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  3266. vector = getRealVector(targetindex,player)
  3267. factor = player ? 2 : 1.5
  3268. # set up animation
  3269. fp = {}
  3270. rndx = []
  3271. rndy = []
  3272. dx = []
  3273. dy = []
  3274. fp["bg"] = Sprite.new(targetsprite.viewport)
  3275. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  3276. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(0,0,0))
  3277. fp["bg"].opacity = 0
  3278. for i in 0...72
  3279. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  3280. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb195")
  3281. fp["#{i}"].ox = fp["#{i}"].bitmap.width/2
  3282. fp["#{i}"].oy = fp["#{i}"].bitmap.height/2
  3283. fp["#{i}"].opacity = 0
  3284. fp["#{i}"].z = 19
  3285. rndx.push(rand(64))
  3286. rndy.push(rand(64))
  3287. dx.push(0)
  3288. dy.push(0)
  3289. end
  3290. shake = 4
  3291. # start animation
  3292. pbSEPlay("#{SE_EXTRA_PATH}Refresh",150)
  3293. for i in 0...96
  3294. pbSEPlay("#{SE_EXTRA_PATH}Psych Up",80) if i == 48
  3295. for j in 0...72
  3296. if fp["#{j}"].opacity == 0 && fp["#{j}"].tone.gray == 0
  3297. cx, cy = getCenter(usersprite)
  3298. dx[j] = cx - 32*usersprite.zoom_x*0.5 + rndx[j]*usersprite.zoom_x*0.5
  3299. dy[j] = cy - 32*usersprite.zoom_y*0.5 + rndy[j]*usersprite.zoom_y*0.5
  3300. fp["#{j}"].x = dx[j]
  3301. fp["#{j}"].y = dy[j]
  3302. end
  3303. cx, cy = getCenter(targetsprite,true)
  3304. next if j>(i)
  3305. x2 = cx - 32*targetsprite.zoom_x + rndx[j]*targetsprite.zoom_x
  3306. y2 = cy - 32*targetsprite.zoom_y + rndy[j]*targetsprite.zoom_y
  3307. x0 = dx[j]
  3308. y0 = dy[j]
  3309. fp["#{j}"].x += (x2 - x0)*0.1
  3310. fp["#{j}"].y += (y2 - y0)*0.1
  3311. fp["#{j}"].opacity += 32
  3312. nextx = fp["#{j}"].x + (x2 - x0)*0.1
  3313. nexty = fp["#{j}"].y + (y2 - y0)*0.1
  3314. if !player
  3315. fp["#{j}"].z = targetsprite.z - 1 if nextx > cx && nexty < cy
  3316. else
  3317. fp["#{j}"].z = targetsprite.z + 1 if nextx < cx && nexty > cy
  3318. end
  3319. end
  3320. fp["bg"].opacity += 10 if fp["bg"].opacity < 255*0.75
  3321. if i >= 32
  3322. cx, cy = getCenter(targetsprite,true)
  3323. targetsprite.tone.red += 5.4 if targetsprite.tone.red < 194.4
  3324. targetsprite.tone.green += 3.4 if targetsprite.tone.green < 122.4
  3325. targetsprite.tone.blue += 0.15 if targetsprite.tone.blue < 5.4
  3326. targetsprite.addOx(shake)
  3327. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  3328. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  3329. targetsprite.still
  3330. end
  3331. @vector.set(DUALVECTOR) if i == 24
  3332. @vector.inc = 0.1 if i == 24
  3333. wait(1,true)
  3334. end
  3335. 20.times do
  3336. cx, cy = getCenter(targetsprite,true)
  3337. targetsprite.tone.red -= 9.7
  3338. targetsprite.tone.green -= 6.1
  3339. targetsprite.tone.blue -= 0.27
  3340. targetsprite.addOx(shake)
  3341. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  3342. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  3343. targetsprite.still
  3344. fp["bg"].opacity -= 15
  3345. wait(1,true)
  3346. end
  3347. targetsprite.ox = targetsprite.bitmap.width/2
  3348. targetsprite.tone = Tone.new(0,0,0)
  3349. @vector.set(defaultvector)
  3350. @vector.inc = 0.2
  3351. pbDisposeSpriteHash(fp)
  3352. return true
  3353. end
  3354. #-----------------------------------------------------------------------------
  3355. # Giga Drain
  3356. #-----------------------------------------------------------------------------
  3357. def pbMoveAnimationSpecific200(userindex,targetindex,hitnum=0,multihit=false)
  3358. return pbMoveAnimationSpecific210(userindex,targetindex,hitnum,multihit,"giga")
  3359. end
  3360. #-----------------------------------------------------------------------------
  3361. # Mega Drain
  3362. #-----------------------------------------------------------------------------
  3363. def pbMoveAnimationSpecific207(userindex,targetindex,hitnum=0,multihit=false)
  3364. return pbMoveAnimationSpecific210(userindex,targetindex,hitnum,multihit,"mega")
  3365. end
  3366. #-----------------------------------------------------------------------------
  3367. # Vine Whip
  3368. #-----------------------------------------------------------------------------
  3369. def pbMoveAnimationSpecific208(userindex,targetindex,hitnum=0,multihit=false)
  3370. # inital configuration
  3371. usersprite = @sprites["pokemon#{userindex}"]
  3372. targetsprite = @sprites["pokemon#{targetindex}"]
  3373. player = (targetindex%2==0)
  3374. itself = (userindex==targetindex)
  3375. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  3376. vector = getRealVector(targetindex,player)
  3377. # set up animation
  3378. @vector.set(vector)
  3379. wait(16,true)
  3380. cx, cy = getCenter(targetsprite,true)
  3381. fp = {}
  3382. fp["whip"] = Sprite.new(targetsprite.viewport)
  3383. fp["whip"].bitmap = pbBitmap("Graphics/Animations/eb208")
  3384. fp["whip"].ox = fp["whip"].bitmap.width*0.75
  3385. fp["whip"].oy = fp["whip"].bitmap.height*0.5
  3386. fp["whip"].angle = 315
  3387. fp["whip"].zoom_x = targetsprite.zoom_x*1.5
  3388. fp["whip"].zoom_y = targetsprite.zoom_y*1.5
  3389. fp["whip"].color = Color.new(255,255,255,0)
  3390. fp["whip"].opacity = 0
  3391. fp["whip"].x = cx + 32*targetsprite.zoom_x
  3392. fp["whip"].y = cy - 48*targetsprite.zoom_y
  3393. fp["whip"].z = player ? 29 : 19
  3394.  
  3395. fp["imp"] = Sprite.new(targetsprite.viewport)
  3396. fp["imp"].bitmap = pbBitmap("Graphics/Animations/eb244_2")
  3397. fp["imp"].ox = fp["imp"].bitmap.width/2
  3398. fp["imp"].oy = fp["imp"].bitmap.height/2
  3399. fp["imp"].zoom_x = targetsprite.zoom_x*2
  3400. fp["imp"].zoom_y = targetsprite.zoom_y*2
  3401. fp["imp"].visible = false
  3402. fp["imp"].x = cx
  3403. fp["imp"].y = cy - 48*targetsprite.zoom_y
  3404. fp["imp"].z = player ? 29 : 19
  3405.  
  3406. posx = []
  3407. posy = []
  3408. angl = []
  3409. zoom = []
  3410. for j in 0...12
  3411. fp["#{j}"] = Sprite.new(targetsprite.viewport)
  3412. fp["#{j}"].bitmap = pbBitmap("Graphics/Animations/eb208_2")
  3413. fp["#{j}"].ox = fp["#{j}"].bitmap.width/2
  3414. fp["#{j}"].oy = fp["#{j}"].bitmap.height/2
  3415. fp["#{j}"].z = player ? 29 : 19
  3416. fp["#{j}"].visible = false
  3417. z = [1,1.25,0.75,0.5][rand(4)]
  3418. fp["#{j}"].zoom_x = targetsprite.zoom_x*z
  3419. fp["#{j}"].zoom_y = targetsprite.zoom_y*z
  3420. fp["#{j}"].angle = rand(360)
  3421. posx.push(rand(128))
  3422. posy.push(rand(64))
  3423. angl.push((rand(2)==0 ? 1 : -1))
  3424. zoom.push(z)
  3425. fp["#{j}"].opacity = (155+rand(100))
  3426. end
  3427. # start animation
  3428. k = 1
  3429. for i in 0...32
  3430. pbSEPlay("eb_normal4",80) if i == 4
  3431. if i < 16
  3432. fp["whip"].opacity += 128 if i < 4
  3433. fp["whip"].angle += 16
  3434. fp["whip"].color.alpha += 16 if i >= 8
  3435. fp["whip"].zoom_x -= 0.2 if i >= 8
  3436. fp["whip"].zoom_y -= 0.16 if i >= 4
  3437. fp["whip"].opacity -= 64 if i >= 12
  3438. fp["imp"].visible = true if i == 3
  3439. if i >= 4
  3440. fp["imp"].angle += 4
  3441. fp["imp"].zoom_x -= 0.02
  3442. fp["imp"].zoom_x -= 0.02
  3443. fp["imp"].opacity -= 32
  3444. end
  3445. targetsprite.zoom_y -= 0.04*k
  3446. targetsprite.zoom_x += 0.02*k
  3447. targetsprite.tone = Tone.new(255,255,255) if i == 4
  3448. targetsprite.tone.red -= 51 if targetsprite.tone.red > 0
  3449. targetsprite.tone.green -= 51 if targetsprite.tone.green > 0
  3450. targetsprite.tone.blue -= 51 if targetsprite.tone.blue > 0
  3451. k *= -1 if (i-4)%6==0
  3452. end
  3453. cx, cy = getCenter(targetsprite,true)
  3454. for j in 0...12
  3455. next if i < 4
  3456. next if j>(i-4)
  3457. fp["#{j}"].visible = true
  3458. fp["#{j}"].x = cx - 64*targetsprite.zoom_x*zoom[j] + posx[j]*targetsprite.zoom_x*zoom[j]
  3459. fp["#{j}"].y = cy - posy[j]*targetsprite.zoom_y*zoom[j] - 48*targetsprite.zoom_y*zoom[j]# - (i-4)*2*targetsprite.zoom_y
  3460. fp["#{j}"].angle += angl[j]
  3461. end
  3462. wait(1)
  3463. end
  3464. @vector.set(defaultvector) if !multihit
  3465. for i in 0...16
  3466. wait(1,true)
  3467. cx, cy = getCenter(targetsprite,true)
  3468. k = 20 - i
  3469. for j in 0...12
  3470. fp["#{j}"].x = cx - 64*targetsprite.zoom_x*zoom[j] + posx[j]*targetsprite.zoom_x*zoom[j]
  3471. fp["#{j}"].y = cy - posy[j]*targetsprite.zoom_y*zoom[j] - 48*targetsprite.zoom_y*zoom[j]# - (k)*2*targetsprite.zoom_y
  3472. fp["#{j}"].opacity -= 16
  3473. fp["#{j}"].angle += angl[j]
  3474. fp["#{j}"].zoom_x = targetsprite.zoom_x
  3475. fp["#{j}"].zoom_y = targetsprite.zoom_y
  3476. end
  3477. end
  3478. pbDisposeSpriteHash(fp)
  3479. return true
  3480. end
  3481. #-----------------------------------------------------------------------------
  3482. # Absorb
  3483. #-----------------------------------------------------------------------------
  3484. def pbMoveAnimationSpecific210(userindex,targetindex,hitnum=0,multihit=false,type="absorb")
  3485. # inital configuration
  3486. usersprite = @sprites["pokemon#{userindex}"]
  3487. targetsprite = @sprites["pokemon#{targetindex}"]
  3488. player = (targetindex%2==0)
  3489. # set up animation
  3490. fp = {}
  3491. fp["bg"] = Sprite.new(targetsprite.viewport)
  3492. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  3493. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(0,0,0))
  3494. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(100,166,94)) if type == "mega"
  3495. fp["bg"].opacity = 0
  3496.  
  3497. ext = ["eb210","eb210_2"]
  3498. ext = ["eb210","eb207"] if type == "mega"
  3499. ext = ["eb200"] if type == "giga"
  3500. cxT, cyT = getCenter(targetsprite,true)
  3501. cxP, cyP = getCenter(usersprite,true)
  3502.  
  3503. mx = !player ? (cxT-cxP)/2 : (cxP-cxT)/2
  3504. mx += player ? cxT : cxP
  3505. my = !player ? (cyP-cyT)/2 : (cyT-cyP)/2
  3506. my += player ? cyP : cyT
  3507.  
  3508. curves = []
  3509. zoom = []
  3510. frames = ["giga","mega"].include?(type) ? 32 : 16
  3511. factor = (type == "giga" ? 2 : 1)
  3512. pbSEPlay("#{SE_EXTRA_PATH}Absorb2",factor==2 ? 100 : 80)
  3513. for j in 0...frames
  3514. fp["#{j}"] = Sprite.new(targetsprite.viewport)
  3515. fp["#{j}"].bitmap = pbBitmap("Graphics/Animations/"+ext[rand(ext.length)])
  3516. fp["#{j}"].ox = fp["#{j}"].bitmap.width/2
  3517. fp["#{j}"].oy = fp["#{j}"].bitmap.height/2
  3518. fp["#{j}"].x = cxT
  3519. fp["#{j}"].y = cyT
  3520. z = [1,0.75,0.5,0.25][rand(4)]
  3521. fp["#{j}"].zoom_x = z*usersprite.zoom_x
  3522. fp["#{j}"].zoom_y = z*usersprite.zoom_y
  3523. v = type == "mega" ? 1 : 0
  3524. ox = -16*factor + rand(32*factor) - 32*v + rand(64*v)
  3525. oy = -16*factor + rand(32*factor) - 32*v + rand(64*v)
  3526. vert = rand(96)*(rand(2)==0 ? 1 : -1)*(factor**2)
  3527. fp["#{j}"].z = 50
  3528. fp["#{j}"].opacity = 0
  3529. curve = calculateCurve(cxT+ox,cyT+oy,mx,my+vert+oy,cxP+ox,cyP+oy,32)
  3530. curves.push(curve)
  3531. zoom.push(z)
  3532. end
  3533. max = type == "giga" ? 16 : 8
  3534. for j in 0...max
  3535. fp["s#{j}"] = Sprite.new(usersprite.viewport)
  3536. fp["s#{j}"].bitmap = pbBitmap("Graphics/Animations/ebHealing")
  3537. fp["s#{j}"].ox = fp["s#{j}"].bitmap.width/2
  3538. fp["s#{j}"].oy = fp["s#{j}"].bitmap.height/2
  3539. fp["s#{j}"].zoom_x = usersprite.zoom_x
  3540. fp["s#{j}"].zoom_y = usersprite.zoom_x
  3541. cx, cy = getCenter(usersprite,true)
  3542. fp["s#{j}"].x = cx - 48*usersprite.zoom_x + rand(96)*usersprite.zoom_x
  3543. fp["s#{j}"].y = cy - 48*usersprite.zoom_y + rand(96)*usersprite.zoom_y
  3544. fp["s#{j}"].visible = false
  3545. fp["s#{j}"].z = 51
  3546. end
  3547. for i in 0...64
  3548. fp["bg"].opacity += 16 if fp["bg"].opacity < 128
  3549. for j in 0...frames
  3550. next if j>i/(32/frames)
  3551. k = i - j*(32/frames)
  3552. fp["#{j}"].visible = false if k >= frames
  3553. k = frames - 1 if k >= frames
  3554. k = 0 if k < 0
  3555. if type == "giga"
  3556. fp["#{j}"].tone.red += 4
  3557. fp["#{j}"].tone.blue += 4
  3558. fp["#{j}"].tone.green += 4
  3559. end
  3560. fp["#{j}"].x = curves[j][k][0]
  3561. fp["#{j}"].y = curves[j][k][1]
  3562. fp["#{j}"].opacity += (k < 16) ? 64 : -16
  3563. fp["#{j}"].zoom_x -= (fp["#{j}"].zoom_x - targetsprite.zoom_x*zoom[j])*0.1
  3564. fp["#{j}"].zoom_y -= (fp["#{j}"].zoom_y - targetsprite.zoom_y*zoom[j])*0.1
  3565. end
  3566. for k in 0...max
  3567. next if type == "absorb"
  3568. next if i < frames/2
  3569. next if k>(i-frames/2)/(16/max)
  3570. fp["s#{k}"].visible = true
  3571. fp["s#{k}"].opacity -= 16
  3572. fp["s#{k}"].y -= 2
  3573. end
  3574. if type == "giga"
  3575. usersprite.tone.red += 8 if usersprite.tone.red < 128
  3576. usersprite.tone.green += 8 if usersprite.tone.green < 128
  3577. usersprite.tone.blue += 8 if usersprite.tone.blue < 128
  3578. end
  3579. pbSEPlay("#{SE_EXTRA_PATH}Recovery",80) if type != "absorb" && i == (frames/2)
  3580. wait(1,true)
  3581. end
  3582. for i in 0...8
  3583. fp["bg"].opacity -= 16
  3584. if type == "giga"
  3585. usersprite.tone.red -= 16
  3586. usersprite.tone.green -= 16
  3587. usersprite.tone.blue -= 16
  3588. end
  3589. wait(1,true)
  3590. end
  3591. pbDisposeSpriteHash(fp)
  3592. return true
  3593. end
  3594. #-----------------------------------------------------------------------------
  3595. # Earthquake
  3596. #-----------------------------------------------------------------------------
  3597. def pbMoveAnimationSpecific223(userindex,targetindex,hitnum=0,multihit=false)
  3598. # inital configuration
  3599. usersprite = @sprites["pokemon#{userindex}"]
  3600. player = (userindex%2==0)
  3601. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  3602. # set up animation
  3603. fp = {}
  3604. randx = []
  3605. randy = []
  3606. speed = []
  3607. angle = []
  3608. fp["bg"] = Sprite.new(usersprite.viewport)
  3609. fp["bg"].bitmap = Bitmap.new(usersprite.viewport.rect.width,usersprite.viewport.rect.height)
  3610. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(0,0,0))
  3611. fp["bg"].opacity = 0
  3612. for m in 0...4
  3613. randx.push([]); randy.push([]); speed.push([]); angle.push([])
  3614. targetsprite = @sprites["pokemon#{m}"]
  3615. next if !targetsprite || targetsprite.disposed? || targetsprite.fainted || !targetsprite.visible
  3616. next if m == userindex
  3617. for j in 0...32
  3618. fp["#{j}#{m}"] = Sprite.new(usersprite.viewport)
  3619. fp["#{j}#{m}"].bitmap = pbBitmap("Graphics/Animations/eb223")
  3620. fp["#{j}#{m}"].ox = fp["#{j}#{m}"].bitmap.width/2
  3621. fp["#{j}#{m}"].oy = fp["#{j}#{m}"].bitmap.height/2
  3622. fp["#{j}#{m}"].z = 50
  3623. z = [0.5,0.4,0.3,0.7][rand(4)]
  3624. fp["#{j}#{m}"].zoom_x = z
  3625. fp["#{j}#{m}"].zoom_y = z
  3626. fp["#{j}#{m}"].visible = false
  3627. randx[m].push(rand(82)+(rand(2)==0 ? 82 : 0))
  3628. randy[m].push(rand(32)+32)
  3629. speed[m].push(4)
  3630. angle[m].push((rand(8)+1)*(rand(2)==0 ? -1 : 1))
  3631. end
  3632. end
  3633. @vector.set(DUALVECTOR)
  3634. 16.times do
  3635. fp["bg"].opacity += 8
  3636. wait(1,true)
  3637. end
  3638. factor = usersprite.zoom_x
  3639. k = -1
  3640. pbSEPlay("#{SE_EXTRA_PATH}Earth4")
  3641. for i in 0...92
  3642. for m in 0...4
  3643. targetsprite = @sprites["pokemon#{m}"]
  3644. next if !targetsprite || targetsprite.disposed? || targetsprite.fainted || !targetsprite.visible
  3645. next if m == userindex
  3646. cx, cy = getCenter(targetsprite,true)
  3647. for j in 0...32
  3648. next if j>(i/2)
  3649. if !fp["#{j}#{m}"].visible
  3650. fp["#{j}#{m}"].visible = true
  3651. fp["#{j}#{m}"].x = cx - 82*targetsprite.zoom_x + randx[m][j]*targetsprite.zoom_x
  3652. fp["#{j}#{m}"].y = targetsprite.y
  3653. fp["#{j}#{m}"].zoom_x *= targetsprite.zoom_x
  3654. fp["#{j}#{m}"].zoom_y *= targetsprite.zoom_y
  3655. end
  3656. fp["#{j}#{m}"].y -= speed[m][j]*2*targetsprite.zoom_y
  3657. speed[m][j] *= -1 if (fp["#{j}#{m}"].y <= targetsprite.y - randy[m][j]*targetsprite.zoom_y) || (fp["#{j}#{m}"].y >= targetsprite.y)
  3658. fp["#{j}#{m}"].opacity -= 35 if speed[m][j] < 0
  3659. fp["#{j}#{m}"].angle += angle[m][j]
  3660. end
  3661. end
  3662. usersprite.zoom_x -= 0.2/6 if usersprite.zoom_x > factor
  3663. usersprite.zoom_y += 0.2/6 if usersprite.zoom_y < factor
  3664.  
  3665. moveEntireScene(k*8,0,true,true)
  3666. k *= -1 if i%3==0
  3667. if i%32==0
  3668. pbSEPlay("#{SE_EXTRA_PATH}Earth4",60)
  3669. usersprite.zoom_x = factor*1.2
  3670. usersprite.zoom_y = factor*0.8
  3671. end
  3672. fp["bg"].opacity -= 12 if i >= 72
  3673. wait(1,false)
  3674. end
  3675. @vector.set(defaultvector) if !multihit
  3676. pbDisposeSpriteHash(fp)
  3677. return true
  3678. end
  3679. #-----------------------------------------------------------------------------
  3680. # Earth Power
  3681. #-----------------------------------------------------------------------------
  3682. def pbMoveAnimationSpecific224(userindex,targetindex,hitnum=0,multihit=false)
  3683. # inital configuration
  3684. usersprite = @sprites["pokemon#{userindex}"]
  3685. targetsprite = @sprites["pokemon#{targetindex}"]
  3686. player = (targetindex%2==0)
  3687. itself = (userindex==targetindex)
  3688. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  3689. fp = {}
  3690. fp["bg"] = Sprite.new(targetsprite.viewport)
  3691. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  3692. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(0,0,0))
  3693. fp["bg"].opacity = 0
  3694. @vector.set(getRealVector(targetindex,player))
  3695. 16.times do
  3696. fp["bg"].opacity += 8
  3697. wait(1,true)
  3698. end
  3699. # set up animation
  3700. factor = targetsprite.zoom_x
  3701. cx, cy = getCenter(targetsprite,true)
  3702. y0 = targetsprite.y
  3703. x = [cx - 64*factor, cx + 64*factor, cx]
  3704. y = [y0, y0, y0 + 24*factor]
  3705. dx = []
  3706. for k in 0...3
  3707. fp["f#{k}"] = Sprite.new(targetsprite.viewport)
  3708. fp["f#{k}"].bitmap = pbBitmap("Graphics/Animations/eb224")
  3709. fp["f#{k}"].ox = fp["f#{k}"].bitmap.width/2
  3710. fp["f#{k}"].oy = fp["f#{k}"].bitmap.height
  3711. fp["f#{k}"].zoom_x = factor + 0.25
  3712. fp["f#{k}"].zoom_y = 0
  3713. fp["f#{k}"].x = x[k]
  3714. fp["f#{k}"].y = y[k]
  3715. fp["f#{k}"].z = targetsprite.z
  3716.  
  3717. for m in 0...16
  3718. fp["p#{k}#{m}"] = Sprite.new(targetsprite.viewport)
  3719. fp["p#{k}#{m}"].bitmap = Bitmap.new(8,8)
  3720. fp["p#{k}#{m}"].ox = 4
  3721. fp["p#{k}#{m}"].oy = 4
  3722. c = [Color.new(139,7,7),Color.new(239,90,1)][rand(2)]
  3723. fp["p#{k}#{m}"].bitmap.drawCircle(c)
  3724. fp["p#{k}#{m}"].visible = false
  3725. z = [1,0.5,0.75,0.25][rand(4)]
  3726. fp["p#{k}#{m}"].zoom_x = z
  3727. fp["p#{k}#{m}"].zoom_y = z
  3728. fp["p#{k}#{m}"].x = x[k] - 16 + rand(32)
  3729. fp["p#{k}#{m}"].y = y[k] - rand(32)
  3730. fp["p#{k}#{m}"].z = targetsprite.z + 1
  3731. dx.push((rand(2)==0 ? 1 : -1)*2)
  3732. end
  3733. end
  3734. # start animation
  3735. for k in 0...3
  3736. wait(8,true)
  3737. j = -1
  3738. l = 6
  3739. pbSEPlay("eb_rock1",80)
  3740. pbSEPlay("#{SE_EXTRA_PATH}Earth4",50,50)
  3741. for i in 0...24
  3742. j *= -1 if i%4==0
  3743. l -= 2 if i%8==0
  3744. fp["f#{k}"].zoom_x -= 0.1 if fp["f#{k}"].zoom_x > 0
  3745. fp["f#{k}"].zoom_y += 0.3
  3746. fp["f#{k}"].opacity -= 24
  3747. moveEntireScene(0,j*l,true,true) if i < 16
  3748. for m in 0...16
  3749. next if m>(i*2)
  3750. fp["p#{k}#{m}"].visible = true
  3751. fp["p#{k}#{m}"].y -= 16
  3752. fp["p#{k}#{m}"].x += dx[m]
  3753. fp["p#{k}#{m}"].opacity -= 16
  3754. end
  3755. wait(1)
  3756. end
  3757. end
  3758. 16.times do
  3759. fp["bg"].opacity -= 8
  3760. wait(1,true)
  3761. end
  3762. pbDisposeSpriteHash(fp)
  3763. @vector.set(defaultvector) if !multihit
  3764. return true
  3765. end
  3766. #-----------------------------------------------------------------------------
  3767. # Ice Punch
  3768. #-----------------------------------------------------------------------------
  3769. def pbMoveAnimationSpecific245(userindex,targetindex,hitnum=0,multihit=false)
  3770. # inital configuration
  3771. usersprite = @sprites["pokemon#{userindex}"]
  3772. targetsprite = @sprites["pokemon#{targetindex}"]
  3773. player = (targetindex%2==0)
  3774. itself = (userindex==targetindex)
  3775. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  3776. # set up animation
  3777. fp = {}
  3778. rndx = []
  3779. rndy = []
  3780. angl = []
  3781. fp["bg"] = Sprite.new(targetsprite.viewport)
  3782. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  3783. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(100,128,142))
  3784. fp["bg"].opacity = 0
  3785. for i in 0...12
  3786. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  3787. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb248")
  3788. fp["#{i}"].src_rect.set(rand(2)*26,0,26,42)
  3789. fp["#{i}"].ox = 13
  3790. fp["#{i}"].oy = 21
  3791. fp["#{i}"].opacity = 0
  3792. fp["#{i}"].z = (player ? 29 : 19)
  3793. r = rand(101)
  3794. fp["#{i}"].zoom_x = (targetsprite.zoom_x - r*0.0075*targetsprite.zoom_x)
  3795. fp["#{i}"].zoom_y = (targetsprite.zoom_y - r*0.0075*targetsprite.zoom_y)
  3796. rndx.push(rand(196))
  3797. rndy.push(rand(196))
  3798. angl.push((1+rand(3))*4*(rand(2)==0 ? 1 : -1))
  3799. end
  3800. fp["punch"] = Sprite.new(targetsprite.viewport)
  3801. fp["punch"].bitmap = pbBitmap("Graphics/Animations/eb108")
  3802. fp["punch"].ox = fp["punch"].bitmap.width/2
  3803. fp["punch"].oy = fp["punch"].bitmap.height/2
  3804. fp["punch"].opacity = 0
  3805. fp["punch"].z = 40
  3806. fp["punch"].angle = 180
  3807. fp["punch"].zoom_x = player ? 6 : 4
  3808. fp["punch"].zoom_y = player ? 6 : 4
  3809. fp["punch"].tone = Tone.new(6,16,48)
  3810. shake = 4
  3811. # start animation
  3812. @vector.set(getRealVector(targetindex,player))
  3813. pbSEPlay("#{SE_EXTRA_PATH}fog2",75)
  3814. for i in 0...72
  3815. cx, cy = getCenter(targetsprite,true)
  3816. fp["punch"].x = cx
  3817. fp["punch"].y = cy
  3818. fp["punch"].angle -= 45 if i < 40
  3819. fp["punch"].zoom_x -= player ? 0.2 : 0.15 if i < 40
  3820. fp["punch"].zoom_y -= player ? 0.2 : 0.15 if i < 40
  3821. fp["punch"].opacity += 8 if i < 40
  3822. if i >= 40
  3823. fp["punch"].tone = Tone.new(255,255,255) if i == 40
  3824. fp["punch"].toneAll(-25.5)
  3825. fp["punch"].opacity -= 25.5
  3826. end
  3827. pbSEPlay("#{SE_EXTRA_PATH}Ice2") if i==40
  3828. pbSEPlay("eb_ice1",75) if i==40
  3829. for j in 0...12
  3830. next if i < 40
  3831. if fp["#{j}"].opacity == 0
  3832. fp["#{j}"].x = cx
  3833. fp["#{j}"].y = cy
  3834. end
  3835. x2 = cx - 98*targetsprite.zoom_x + rndx[j]*targetsprite.zoom_x
  3836. y2 = cy - 98*targetsprite.zoom_y + rndy[j]*targetsprite.zoom_y
  3837. x0 = fp["#{j}"].x
  3838. y0 = fp["#{j}"].y
  3839. fp["#{j}"].x += (x2 - x0)*0.2
  3840. fp["#{j}"].y += (y2 - y0)*0.2
  3841. fp["#{j}"].angle += angl[j]
  3842. fp["#{j}"].opacity += 32
  3843. end
  3844. fp["bg"].opacity += 4 if i < 40
  3845. if i >= 40
  3846. if i >= 56
  3847. targetsprite.tone.red -= 8
  3848. targetsprite.tone.green -= 8
  3849. targetsprite.tone.blue -= 8
  3850. fp["bg"].opacity -= 10
  3851. else
  3852. targetsprite.tone.red += 8
  3853. targetsprite.tone.green += 8
  3854. targetsprite.tone.blue += 8
  3855. end
  3856. targetsprite.addOx(shake)
  3857. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  3858. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  3859. targetsprite.still
  3860. end
  3861. wait(1,true)
  3862. end
  3863. targetsprite.ox = targetsprite.bitmap.width/2
  3864. @vector.set(defaultvector) if !multihit
  3865. 20.times do
  3866. cx, cy = getCenter(targetsprite,true)
  3867. for j in 0...12
  3868. fp["#{j}"].x = cx - 98*targetsprite.zoom_x + rndx[j]*targetsprite.zoom_x
  3869. fp["#{j}"].y = cy - 98*targetsprite.zoom_y + rndy[j]*targetsprite.zoom_y
  3870. fp["#{j}"].angle += angl[j]
  3871. fp["#{j}"].opacity -= 13
  3872. end
  3873. wait(1,true)
  3874. end
  3875. pbDisposeSpriteHash(fp)
  3876. return true
  3877. end
  3878. #-----------------------------------------------------------------------------
  3879. # Ice Beam
  3880. #-----------------------------------------------------------------------------
  3881. def pbMoveAnimationSpecific243(userindex,targetindex,hitnum=0,multihit=false)
  3882. # inital configuration
  3883. usersprite = @sprites["pokemon#{userindex}"]
  3884. targetsprite = @sprites["pokemon#{targetindex}"]
  3885. player = (targetindex%2==0)
  3886. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  3887. vector = getRealVector(targetindex,player)
  3888. factor = player ? 2 : 1
  3889. targetsprite.viewport.color = Color.new(255,255,255,155)
  3890. # set up animation
  3891. fp = {}
  3892. rndx = []
  3893. rndy = []
  3894. crndx = []
  3895. crndy = []
  3896. dx = []
  3897. dy = []
  3898. fp["bg"] = Sprite.new(targetsprite.viewport)
  3899. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  3900. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(100,128,142))
  3901. fp["bg"].opacity = 0
  3902. for i in 0...16
  3903. fp["c#{i}"] = Sprite.new(targetsprite.viewport)
  3904. fp["c#{i}"].bitmap = pbBitmap("Graphics/Animations/eb250")
  3905. fp["c#{i}"].ox = fp["c#{i}"].bitmap.width/2
  3906. fp["c#{i}"].oy = fp["c#{i}"].bitmap.height/2
  3907. fp["c#{i}"].opacity = 0
  3908. fp["c#{i}"].z = 19
  3909. crndx.push(rand(64))
  3910. crndy.push(rand(64))
  3911. end
  3912. for i in 0...72
  3913. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  3914. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb243")
  3915. fp["#{i}"].ox = fp["#{i}"].bitmap.width/2
  3916. fp["#{i}"].oy = fp["#{i}"].bitmap.height/2
  3917. fp["#{i}"].opacity = 0
  3918. fp["#{i}"].z = 19
  3919. rndx.push(rand(16))
  3920. rndy.push(rand(16))
  3921. dx.push(0)
  3922. dy.push(0)
  3923. end
  3924. # start animation
  3925. for i in 0...96
  3926. pbSEPlay("#{SE_EXTRA_PATH}Ice8") if i == 12
  3927. for j in 0...72
  3928. if fp["#{j}"].opacity == 0 && fp["#{j}"].tone.gray == 0
  3929. cx, cy = getCenter(usersprite)
  3930. dx[j] = cx - 8*usersprite.zoom_x*0.5 + rndx[j]*usersprite.zoom_x*0.5
  3931. dy[j] = cy - 8*usersprite.zoom_y*0.5 + rndy[j]*usersprite.zoom_y*0.5
  3932. fp["#{j}"].x = dx[j]
  3933. fp["#{j}"].y = dy[j]
  3934. end
  3935. cx, cy = getCenter(targetsprite,true)
  3936. next if j>(i)
  3937. x2 = cx - 8*targetsprite.zoom_x*0.5 + rndx[j]*targetsprite.zoom_x*0.5
  3938. y2 = cy - 8*targetsprite.zoom_y*0.5 + rndy[j]*targetsprite.zoom_y*0.5
  3939. x0 = dx[j]
  3940. y0 = dy[j]
  3941. fp["#{j}"].x += (x2 - x0)*0.05
  3942. fp["#{j}"].y += (y2 - y0)*0.05
  3943. fp["#{j}"].zoom_x = player ? usersprite.zoom_x : targetsprite.zoom_x
  3944. fp["#{j}"].zoom_y = player ? usersprite.zoom_y : targetsprite.zoom_y
  3945. fp["#{j}"].opacity += 32
  3946. fp["#{j}"].angle = -Math.atan(1.0*(y2-y0)/(x2-x0))*180/Math::PI + (rand(4)==0 ? 180 : 0)
  3947. nextx = fp["#{j}"].x + (x2 - x0)*0.05
  3948. nexty = fp["#{j}"].y + (y2 - y0)*0.05
  3949. if !player
  3950. fp["#{j}"].z = targetsprite.z - 1 if nextx > cx && nexty < cy
  3951. fp["#{j}"].visible = false if nextx > cx && nexty < cy
  3952. else
  3953. fp["#{j}"].visible = false if nextx < cx && nexty > cy
  3954.  
  3955. end
  3956. end
  3957. pbSEPlay("#{SE_EXTRA_PATH}Ice1") if i>32 && (i-32)%4==0
  3958. for j in 0...16
  3959. cx, cy = getCenter(targetsprite,true)
  3960. if fp["c#{j}"].opacity == 0 && fp["c#{j}"].tone.gray == 0
  3961. fp["c#{j}"].zoom_x = factor*targetsprite.zoom_x
  3962. fp["c#{j}"].zoom_y = factor*targetsprite.zoom_x
  3963. fp["c#{j}"].x = cx
  3964. fp["c#{j}"].y = cy
  3965. end
  3966. next if j>((i-12)/4)
  3967. next if i<12
  3968. x2 = cx - 32*targetsprite.zoom_x + crndx[j]*targetsprite.zoom_x
  3969. y2 = cy - 32*targetsprite.zoom_y + crndy[j]*targetsprite.zoom_y
  3970. x0 = fp["c#{j}"].x
  3971. y0 = fp["c#{j}"].y
  3972. fp["c#{j}"].x += (x2 - x0)*0.2
  3973. fp["c#{j}"].y += (y2 - y0)*0.2
  3974. fp["c#{j}"].angle += 2
  3975. if (x2 - x0)*0.2 < 1 && (y2 - y0)*0.2 < 1
  3976. fp["c#{j}"].opacity -= 24
  3977. fp["c#{j}"].tone.gray += 8
  3978. fp["c#{j}"].angle += 2
  3979. else
  3980. fp["c#{j}"].opacity += 35
  3981. end
  3982. end
  3983. fp["bg"].opacity += 5 if fp["bg"].opacity < 255*0.5
  3984. if i >= 32
  3985. cx, cy = getCenter(targetsprite,true)
  3986. targetsprite.tone.red += 5.4 if targetsprite.tone.red < 108
  3987. targetsprite.tone.green += 6.4 if targetsprite.tone.green < 128
  3988. targetsprite.tone.blue += 8 if targetsprite.tone.blue < 160
  3989. targetsprite.still
  3990. end
  3991. @vector.set(vector) if i == 24
  3992. @vector.inc = 0.1 if i == 24
  3993. targetsprite.viewport.color.alpha -= 5 if targetsprite.viewport.color.alpha > 0
  3994. wait(1,true)
  3995. end
  3996. 20.times do
  3997. cx, cy = getCenter(targetsprite,true)
  3998. targetsprite.tone.red -= 5.4
  3999. targetsprite.tone.green -= 6.4
  4000. targetsprite.tone.blue -= 8
  4001. targetsprite.still
  4002. fp["bg"].opacity -= 15
  4003. wait(1,true)
  4004. end
  4005. targetsprite.ox = targetsprite.bitmap.width/2
  4006. targetsprite.tone = Tone.new(0,0,0)
  4007. @vector.set(defaultvector) if !multihit
  4008. @vector.inc = 0.2
  4009. pbDisposeSpriteHash(fp)
  4010. return true
  4011. end
  4012. #-----------------------------------------------------------------------------
  4013. # Icicle Crash
  4014. #-----------------------------------------------------------------------------
  4015. def pbMoveAnimationSpecific244(userindex,targetindex,hitnum=0,multihit=false)
  4016. # inital configuration
  4017. usersprite = @sprites["pokemon#{userindex}"]
  4018. targetsprite = @sprites["pokemon#{targetindex}"]
  4019. player = (targetindex%2==0)
  4020. itself = (userindex==targetindex)
  4021. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  4022. vector = getRealVector(targetindex,player)
  4023. # set up animation
  4024. @vector.set(vector)
  4025. wait(16,true)
  4026. fp = {}
  4027. for j in 0...16
  4028. fp["i#{j}"] = Sprite.new(targetsprite.viewport)
  4029. fp["i#{j}"].bitmap = pbBitmap("Graphics/Animations/eb250")
  4030. fp["i#{j}"].ox = fp["i#{j}"].bitmap.width/2
  4031. fp["i#{j}"].oy = fp["i#{j}"].bitmap.height/2
  4032. fp["i#{j}"].opacity = 0
  4033. fp["i#{j}"].zoom_x = targetsprite.zoom_x
  4034. fp["i#{j}"].zoom_y = targetsprite.zoom_y
  4035. fp["i#{j}"].z = player ? 29 : 19
  4036. fp["i#{j}"].x = targetsprite.x + rand(32)*targetsprite.zoom_x*(rand(2)==0 ? 1 : -1)
  4037. fp["i#{j}"].y = targetsprite.y - 8*targetsprite.zoom_y + rand(16)*targetsprite.zoom_y
  4038. end
  4039. for j in 0...5
  4040. fp["s#{j}"] = Sprite.new(targetsprite.viewport)
  4041. fp["s#{j}"].bitmap = pbBitmap("Graphics/Animations/eb244")
  4042. fp["s#{j}"].ox = fp["s#{j}"].bitmap.width/2
  4043. fp["s#{j}"].oy = fp["s#{j}"].bitmap.height
  4044. fp["s#{j}"].opacity = 0
  4045. fp["s#{j}"].zoom_x = targetsprite.zoom_x
  4046. fp["s#{j}"].zoom_y = targetsprite.zoom_y
  4047. fp["s#{j}"].z = player ? 29 : 19
  4048. fp["s#{j}"].x = targetsprite.x - 48*targetsprite.zoom_x + rand(96)*targetsprite.zoom_x
  4049. fp["s#{j}"].y = targetsprite.y - 192*targetsprite.zoom_y
  4050.  
  4051. fp["p#{j}"] = Sprite.new(targetsprite.viewport)
  4052. fp["p#{j}"].bitmap = pbBitmap("Graphics/Animations/eb244_2")
  4053. fp["p#{j}"].ox = fp["p#{j}"].bitmap.width/2
  4054. fp["p#{j}"].oy = fp["p#{j}"].bitmap.height/2
  4055. fp["p#{j}"].visible = false
  4056. fp["p#{j}"].zoom_x = 2
  4057. fp["p#{j}"].zoom_y = 2
  4058. fp["p#{j}"].z = player ? 29 : 19
  4059. fp["p#{j}"].x = fp["s#{j}"].x
  4060. fp["p#{j}"].y = fp["s#{j}"].y + 192*targetsprite.zoom_y
  4061. end
  4062. k = -2
  4063. for i in 0...64
  4064. k *= -1 if i%4==0 && i >= 8
  4065. pbSEPlay("eb_rock1",70) if i%8==0 && i >0 && i < 48
  4066. for j in 0...5
  4067. next if j>(i/6)
  4068. fp["s#{j}"].opacity += 64
  4069. fp["s#{j}"].y += 24*targetsprite.zoom_y if fp["s#{j}"].y < targetsprite.y
  4070. fp["s#{j}"].zoom_y -= 0.2*targetsprite.zoom_y if fp["s#{j}"].y >= targetsprite.y
  4071. fp["s#{j}"].visible = false if fp["s#{j}"].zoom_y <= 0.4*targetsprite.zoom_y
  4072. end
  4073. for j in 0...5
  4074. next if i < 8
  4075. next if j>(i-8)/8
  4076. fp["p#{j}"].visible = true
  4077. fp["p#{j}"].opacity -= 32
  4078. fp["p#{j}"].zoom_x += 0.02
  4079. fp["p#{j}"].zoom_y += 0.02
  4080. fp["p#{j}"].angle += 8
  4081. end
  4082. for j in 0...16
  4083. next if i < 8
  4084. next if j>(i-8)/2
  4085. fp["i#{j}"].opacity += 32*(fp["i#{j}"].zoom_x <= 0.5*targetsprite.zoom_x ? -1 : 1)
  4086. fp["i#{j}"].zoom_x -= 0.02*targetsprite.zoom_x
  4087. fp["i#{j}"].zoom_y -= 0.02*targetsprite.zoom_y
  4088. fp["i#{j}"].x += 2*targetsprite.zoom_x*(fp["i#{j}"].x >= targetsprite.x ? 1 : -1)
  4089. fp["i#{j}"].angle += 4*(fp["i#{j}"].x >= targetsprite.x ? 1 : -1)
  4090. end
  4091. moveEntireScene(0,k,true,true) if i >= 8 && i < 48
  4092. wait(1)
  4093. end
  4094. @vector.set(defaultvector) if !multihit
  4095. pbDisposeSpriteHash(fp)
  4096. return true
  4097. end
  4098. #-----------------------------------------------------------------------------
  4099. # Aurora Beam
  4100. #-----------------------------------------------------------------------------
  4101. def pbMoveAnimationSpecific246(userindex,targetindex,hitnum=0,multihit=false)
  4102. # inital configuration
  4103. usersprite = @sprites["pokemon#{userindex}"]
  4104. targetsprite = @sprites["pokemon#{targetindex}"]
  4105. player = (targetindex%2==0)
  4106. itself = (userindex==targetindex)
  4107. indexes = player ? [0,2] : [1,3]
  4108. vector = getRealVector(targetindex,player)
  4109. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  4110. # set up animation
  4111. fp = {}
  4112. rndx = []
  4113. rndy = []
  4114. fp["bg"] = Sprite.new(targetsprite.viewport)
  4115. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  4116. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(0,0,0))
  4117. fp["bg"].opacity = 0
  4118. for i in 0...36
  4119. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  4120. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb246")
  4121. fp["#{i}"].src_rect.set(44*rand(4),0,44,44)
  4122. fp["#{i}"].ox = fp["#{i}"].bitmap.width/8
  4123. fp["#{i}"].oy = fp["#{i}"].bitmap.height/2
  4124. fp["#{i}"].opacity = 0
  4125. fp["#{i}"].z = (player ? 29 : 19)
  4126. rndx.push(rand(8))
  4127. rndy.push(rand(8))
  4128. end
  4129. shake = 2
  4130. # start animation
  4131. pbSEPlay("#{SE_EXTRA_PATH}Psych Up")
  4132. for i in 0...128
  4133. pbSEPlay("#{SE_EXTRA_PATH}Ice1",75) if i%8==0
  4134. for j in 0...36
  4135. if fp["#{j}"].opacity == 0 && fp["#{j}"].tone.gray == 0
  4136. fp["#{j}"].zoom_x = usersprite.zoom_x
  4137. fp["#{j}"].zoom_y = usersprite.zoom_y
  4138. cx, cy = getCenter(usersprite)
  4139. fp["#{j}"].x = cx
  4140. fp["#{j}"].y = cy
  4141. end
  4142. cx, cy = getCenter(targetsprite,true)
  4143. next if j>(i/2)
  4144. x2 = cx - 4*targetsprite.zoom_x + rndx[j]*targetsprite.zoom_x
  4145. y2 = cy - 4*targetsprite.zoom_y + rndy[j]*targetsprite.zoom_y
  4146. x0 = fp["#{j}"].x
  4147. y0 = fp["#{j}"].y
  4148. fp["#{j}"].x += (x2 - x0)*0.1
  4149. fp["#{j}"].y += (y2 - y0)*0.1
  4150. fp["#{j}"].zoom_x -= (fp["#{j}"].zoom_x - targetsprite.zoom_x)*0.1
  4151. fp["#{j}"].zoom_y -= (fp["#{j}"].zoom_y - targetsprite.zoom_y)*0.1
  4152. fp["#{j}"].angle += 2
  4153. if (x2 - x0)*0.1 < 1 && (y2 - y0)*0.1 < 1
  4154. fp["#{j}"].opacity -= 8
  4155. fp["#{j}"].tone.gray += 8
  4156. fp["#{j}"].angle += 2
  4157. else
  4158. fp["#{j}"].opacity += 12
  4159. end
  4160. end
  4161. if i >= 96
  4162. fp["bg"].opacity -= 10
  4163. else
  4164. fp["bg"].opacity += 5 if fp["bg"].opacity < 255*0.7
  4165. end
  4166. if i >= 72
  4167. if i >= 96
  4168. targetsprite.tone.red -= 4.8/2
  4169. targetsprite.tone.green -= 4.8/2
  4170. targetsprite.tone.blue -= 4.8/2
  4171. else
  4172. targetsprite.tone.red += 4.8 if targetsprite.tone.red < 96
  4173. targetsprite.tone.green += 4.8 if targetsprite.tone.green < 96
  4174. targetsprite.tone.blue += 4.8 if targetsprite.tone.blue < 96
  4175. end
  4176. targetsprite.still
  4177. end
  4178. @vector.set(vector) if i == 24
  4179. @vector.inc = 0.1 if i == 24
  4180. wait(1,true)
  4181. end
  4182. targetsprite.ox = targetsprite.bitmap.width/2
  4183. targetsprite.tone = Tone.new(0,0,0,0)
  4184. @vector.set(defaultvector) if !multihit
  4185. @vector.inc = 0.2
  4186. pbDisposeSpriteHash(fp)
  4187. return true
  4188. end
  4189. #-----------------------------------------------------------------------------
  4190. # Ice Fang
  4191. #-----------------------------------------------------------------------------
  4192. def pbMoveAnimationSpecific248(userindex,targetindex,hitnum=0,multihit=false)
  4193. # inital configuration
  4194. usersprite = @sprites["pokemon#{userindex}"]
  4195. targetsprite = @sprites["pokemon#{targetindex}"]
  4196. player = (targetindex%2==0)
  4197. itself = (userindex==targetindex)
  4198. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  4199. # set up animation
  4200. fp = {}
  4201. rndx = []
  4202. rndy = []
  4203. fp["bg"] = Sprite.new(targetsprite.viewport)
  4204. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  4205. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(100,128,142))
  4206. fp["bg"].opacity = 0
  4207. for i in 0...12
  4208. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  4209. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb248")
  4210. fp["#{i}"].src_rect.set(0,0,26,42)
  4211. fp["#{i}"].ox = 13
  4212. fp["#{i}"].oy = 21
  4213. fp["#{i}"].opacity = 0
  4214. fp["#{i}"].z = (player ? 29 : 19)
  4215. fp["#{i}"].zoom_x = (targetsprite.zoom_x)
  4216. fp["#{i}"].zoom_y = (targetsprite.zoom_y)
  4217. rndx.push(rand(128))
  4218. rndy.push(rand(128))
  4219. end
  4220. fp["fang1"] = Sprite.new(targetsprite.viewport)
  4221. fp["fang1"].bitmap = pbBitmap("Graphics/Animations/eb028")
  4222. fp["fang1"].ox = fp["fang1"].bitmap.width/2
  4223. fp["fang1"].oy = fp["fang1"].bitmap.height - 20
  4224. fp["fang1"].opacity = 0
  4225. fp["fang1"].z = 41
  4226. fp["fang1"].tone = Tone.new(6,16,48)
  4227. fp["fang2"] = Sprite.new(targetsprite.viewport)
  4228. fp["fang2"].bitmap = pbBitmap("Graphics/Animations/eb028")
  4229. fp["fang2"].ox = fp["fang1"].bitmap.width/2
  4230. fp["fang2"].oy = fp["fang1"].bitmap.height - 20
  4231. fp["fang2"].opacity = 0
  4232. fp["fang2"].z = 40
  4233. fp["fang2"].angle = 180
  4234. fp["fang2"].tone = Tone.new(6,16,48)
  4235. shake = 4
  4236. # start animation
  4237. @vector.set(getRealVector(targetindex,player))
  4238. for i in 0...92
  4239. cx, cy = getCenter(targetsprite,true)
  4240. fp["fang1"].x = cx; fp["fang1"].y = cy
  4241. fp["fang1"].zoom_x = targetsprite.zoom_x; fp["fang1"].zoom_y = targetsprite.zoom_y
  4242. fp["fang2"].x = cx; fp["fang2"].y = cy
  4243. fp["fang2"].zoom_x = targetsprite.zoom_x; fp["fang2"].zoom_y = targetsprite.zoom_y
  4244. if i.between?(20,29)
  4245. fp["fang1"].opacity += 5
  4246. fp["fang1"].oy += 2
  4247. fp["fang2"].opacity += 5
  4248. fp["fang2"].oy += 2
  4249. elsif i.between?(30,40)
  4250. fp["fang1"].opacity += 25.5
  4251. fp["fang1"].oy -= 4
  4252. fp["fang2"].opacity += 25.5
  4253. fp["fang2"].oy -= 4
  4254. else i > 40
  4255. fp["fang1"].opacity -= 26
  4256. fp["fang1"].oy += 2
  4257. fp["fang2"].opacity -= 26
  4258. fp["fang2"].oy += 2
  4259. end
  4260. if i==32
  4261. pbSEPlay("#{SE_EXTRA_PATH}Super Fang")
  4262. pbSEPlay("eb_ice1",75)
  4263. end
  4264. for j in 0...12
  4265. next if i < 40
  4266. if fp["#{j}"].opacity == 0 && fp["#{j}"].src_rect.x == 0
  4267. fp["#{j}"].x = cx - 64*targetsprite.zoom_x + rndx[j]*targetsprite.zoom_x
  4268. fp["#{j}"].y = cy - 64*targetsprite.zoom_y + rndy[j]*targetsprite.zoom_y
  4269. end
  4270. fp["#{j}"].src_rect.x += 26 if i%4==0 && fp["#{j}"].opacity >= 255
  4271. fp["#{j}"].src_rect.x = 78 if fp["#{j}"].src_rect.x > 78
  4272. if fp["#{j}"].src_rect.x==78
  4273. fp["#{j}"].opacity -= 24
  4274. fp["#{j}"].zoom_x += 0.02
  4275. fp["#{j}"].zoom_y += 0.02
  4276. elsif fp["#{j}"].opacity >= 255
  4277. fp["#{j}"].opacity -= 24
  4278. else
  4279. fp["#{j}"].opacity += 45 if (i-40)/2 > j
  4280. end
  4281. end
  4282. fp["bg"].opacity += 4 if i < 40
  4283. if i >= 40
  4284. if i >= 56
  4285. targetsprite.tone.red -= 8
  4286. targetsprite.tone.green -= 8
  4287. targetsprite.tone.blue -= 8
  4288. fp["bg"].opacity -= 10
  4289. else
  4290. targetsprite.tone.red += 8
  4291. targetsprite.tone.green += 8
  4292. targetsprite.tone.blue += 8
  4293. end
  4294. targetsprite.addOx(shake)
  4295. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  4296. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  4297. targetsprite.still
  4298. end
  4299. if i == 72
  4300. targetsprite.ox = targetsprite.bitmap.width/2
  4301. @vector.set(defaultvector) if !multihit
  4302. end
  4303. wait(1,true)
  4304. end
  4305. pbDisposeSpriteHash(fp)
  4306. return true
  4307. end
  4308. #-----------------------------------------------------------------------------
  4309. # Icy Wind
  4310. #-----------------------------------------------------------------------------
  4311. def pbMoveAnimationSpecific250(userindex,targetindex,hitnum=0,multihit=false)
  4312. # inital configuration
  4313. usersprite = @sprites["pokemon#{userindex}"]
  4314. targetsprite = @sprites["pokemon#{targetindex}"]
  4315. player = (targetindex%2==0)
  4316. itself = (userindex==targetindex)
  4317. indexes = player ? [0,2] : [1,3]
  4318. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  4319. # set up animation
  4320. fp = {}
  4321. rndx = [[],[]]
  4322. rndy = [[],[]]
  4323. irndx = [[],[]]
  4324. irndy = [[],[]]
  4325. fp["bg"] = Sprite.new(targetsprite.viewport)
  4326. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  4327. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(100,128,142))
  4328. fp["bg"].opacity = 0
  4329. for m in 0...(@battle.doublebattle ? 2 : 1)
  4330. targetsprite = @sprites["pokemon#{indexes[m]}"]
  4331. for i in 0...16
  4332. fp["#{m}#{i}"] = Sprite.new(targetsprite.viewport)
  4333. fp["#{m}#{i}"].bitmap = pbBitmap("Graphics/Animations/eb250")
  4334. fp["#{m}#{i}"].ox = fp["#{m}#{i}"].bitmap.width/2
  4335. fp["#{m}#{i}"].oy = fp["#{m}#{i}"].bitmap.width/2
  4336. fp["#{m}#{i}"].opacity = 0
  4337. fp["#{m}#{i}"].z = (player ? 29 : 19)
  4338. rndx[m].push(rand(64))
  4339. rndy[m].push(rand(64))
  4340. end
  4341. end
  4342. for m in 0...(@battle.doublebattle ? 2 : 1)
  4343. targetsprite = @sprites["pokemon#{indexes[m]}"]
  4344. next if !targetsprite || targetsprite.disposed? || targetsprite.fainted || !targetsprite.visible
  4345. for i in 0...8
  4346. fp["i#{m}#{i}"] = Sprite.new(targetsprite.viewport)
  4347. fp["i#{m}#{i}"].bitmap = pbBitmap("Graphics/Animations/eb248")
  4348. fp["i#{m}#{i}"].src_rect.set(0,0,26,42)
  4349. fp["i#{m}#{i}"].ox = 13
  4350. fp["i#{m}#{i}"].oy = 21
  4351. fp["i#{m}#{i}"].opacity = 0
  4352. fp["i#{m}#{i}"].z = (player ? 29 : 19)
  4353. fp["i#{m}#{i}"].zoom_x = (targetsprite.zoom_x)/2
  4354. fp["i#{m}#{i}"].zoom_y = (targetsprite.zoom_y)/2
  4355. irndx[m].push(rand(128))
  4356. irndy[m].push(rand(128))
  4357. end
  4358. end
  4359. shake = [2,2]
  4360. # start animation
  4361. for i in 0...152
  4362. for m in 0...(@battle.doublebattle ? 2 : 1)
  4363. targetsprite = @sprites["pokemon#{indexes[m]}"]
  4364. next if !targetsprite || targetsprite.disposed? || targetsprite.fainted || !targetsprite.visible
  4365. for j in 0...16
  4366. if fp["#{m}#{j}"].opacity == 0 && fp["#{m}#{j}"].tone.gray == 0
  4367. fp["#{m}#{j}"].zoom_x = usersprite.zoom_x
  4368. fp["#{m}#{j}"].zoom_y = usersprite.zoom_y
  4369. cx, cy = getCenter(usersprite)
  4370. fp["#{m}#{j}"].x = cx
  4371. fp["#{m}#{j}"].y = cy
  4372. end
  4373. cx, cy = getCenter(targetsprite,true)
  4374. next if j>(i/4)
  4375. x2 = cx - 32*targetsprite.zoom_x + rndx[m][j]*targetsprite.zoom_x
  4376. y2 = cy - 32*targetsprite.zoom_y + rndy[m][j]*targetsprite.zoom_y
  4377. x0 = fp["#{m}#{j}"].x
  4378. y0 = fp["#{m}#{j}"].y
  4379. fp["#{m}#{j}"].x += (x2 - x0)*0.1
  4380. fp["#{m}#{j}"].y += (y2 - y0)*0.1
  4381. fp["#{m}#{j}"].zoom_x -= (fp["#{m}#{j}"].zoom_x - targetsprite.zoom_x)*0.1
  4382. fp["#{m}#{j}"].zoom_y -= (fp["#{m}#{j}"].zoom_y - targetsprite.zoom_y)*0.1
  4383. fp["#{m}#{j}"].angle += 2
  4384. if (x2 - x0)*0.1 < 1 && (y2 - y0)*0.1 < 1
  4385. fp["#{m}#{j}"].opacity -= 8
  4386. fp["#{m}#{j}"].tone.gray += 8
  4387. fp["#{m}#{j}"].angle += 2
  4388. else
  4389. fp["#{m}#{j}"].opacity += 12
  4390. end
  4391. end
  4392. end
  4393. if i >= 132
  4394. fp["bg"].opacity -= 7
  4395. else
  4396. fp["bg"].opacity += 2 if fp["bg"].opacity < 255*0.5
  4397. end
  4398. pbSEPlay("#{SE_EXTRA_PATH}Ice7",80) if i==96
  4399. pbSEPlay("#{SE_EXTRA_PATH}Wind8",70) if i==12
  4400. if i >= 96
  4401. for m in 0...(@battle.doublebattle ? 2 : 1)
  4402. targetsprite = @sprites["pokemon#{indexes[m]}"]
  4403. next if !targetsprite || targetsprite.disposed? || targetsprite.fainted || !targetsprite.visible
  4404. cx, cy = getCenter(targetsprite,true)
  4405. if i >= 132
  4406. targetsprite.tone.red -= 4.8
  4407. targetsprite.tone.green -= 4.8
  4408. targetsprite.tone.blue -= 4.8
  4409. else
  4410. targetsprite.tone.red += 4.8 if targetsprite.tone.red < 96
  4411. targetsprite.tone.green += 4.8 if targetsprite.tone.green < 96
  4412. targetsprite.tone.blue += 4.8 if targetsprite.tone.blue < 96
  4413. end
  4414. targetsprite.addOx(shake[m])
  4415. shake[m] = -2 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  4416. shake[m] = 2 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  4417. targetsprite.still
  4418. for k in 0...8
  4419. if fp["i#{m}#{k}"].opacity == 0 && fp["i#{m}#{k}"].src_rect.x == 0
  4420. fp["i#{m}#{k}"].x = cx - 64*targetsprite.zoom_x + irndx[m][k]*targetsprite.zoom_x
  4421. fp["i#{m}#{k}"].y = cy - 64*targetsprite.zoom_y + irndy[m][k]*targetsprite.zoom_y
  4422. end
  4423. fp["i#{m}#{k}"].src_rect.x += 26 if i%4==0 && fp["i#{m}#{k}"].opacity >= 255
  4424. fp["i#{m}#{k}"].src_rect.x = 78 if fp["i#{m}#{k}"].src_rect.x > 78
  4425. if fp["i#{m}#{k}"].src_rect.x==78
  4426. fp["i#{m}#{k}"].opacity -= 24
  4427. fp["i#{m}#{k}"].zoom_x += 0.02
  4428. fp["i#{m}#{k}"].zoom_y += 0.02
  4429. elsif fp["i#{m}#{k}"].opacity >= 255
  4430. fp["i#{m}#{k}"].opacity -= 24
  4431. pbSEPlay("#{SE_EXTRA_PATH}Ice1",50)
  4432. else
  4433. fp["i#{m}#{k}"].opacity += 45 if (i-96)/2 > k
  4434. end
  4435. end
  4436. end
  4437. end
  4438. @vector.set(DUALVECTOR) if i == 24
  4439. @vector.inc = 0.1 if i == 24
  4440. wait(1,true)
  4441. end
  4442. for m in 0...(@battle.doublebattle ? 2 : 1)
  4443. targetsprite = @sprites["pokemon#{indexes[m]}"]
  4444. next if !targetsprite || targetsprite.disposed? || targetsprite.fainted || !targetsprite.visible
  4445. targetsprite.ox = targetsprite.bitmap.width/2
  4446. targetsprite.tone = Tone.new(0,0,0,0)
  4447. end
  4448. @vector.set(defaultvector) if !multihit
  4449. @vector.inc = 0.2
  4450. pbDisposeSpriteHash(fp)
  4451. return true
  4452. end
  4453. #-----------------------------------------------------------------------------
  4454. # Hyper Beam
  4455. #-----------------------------------------------------------------------------
  4456. def pbMoveAnimationSpecific263(userindex,targetindex,hitnum=0,multihit=false)
  4457. # inital configuration
  4458. usersprite = @sprites["pokemon#{userindex}"]
  4459. targetsprite = @sprites["pokemon#{targetindex}"]
  4460. player = (targetindex%2==0)
  4461. player2 = (userindex%2==0)
  4462. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  4463. vector = getRealVector(targetindex,player)
  4464. vector2 = getRealVector(userindex,player2)
  4465. factor = player2 ? 2 : 1
  4466. # set up animation
  4467. fp = {}
  4468. rndx = []
  4469. rndy = []
  4470. dx = []
  4471. dy = []
  4472. fp["bg"] = ScrollingSprite.new(targetsprite.viewport)
  4473. fp["bg"].speed = 64
  4474. fp["bg"].setBitmap("Graphics/Animations/eb263_bg")
  4475. fp["bg"].color = Color.new(0,0,0,255)
  4476. fp["bg"].opacity = 0
  4477. for i in 0...72
  4478. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  4479. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb263_4")
  4480. fp["#{i}"].ox = fp["#{i}"].bitmap.width/2
  4481. fp["#{i}"].oy = fp["#{i}"].bitmap.height/2
  4482. fp["#{i}"].opacity = 0
  4483. fp["#{i}"].z = 19
  4484. rndx.push(rand(16))
  4485. rndy.push(rand(16))
  4486. dx.push(0)
  4487. dy.push(0)
  4488. end
  4489. for i in 0...72
  4490. fp["#{i}2"] = Sprite.new(targetsprite.viewport)
  4491. fp["#{i}2"].bitmap = pbBitmap("Graphics/Animations/eb263_3")
  4492. fp["#{i}2"].ox = fp["#{i}2"].bitmap.width/2
  4493. fp["#{i}2"].oy = fp["#{i}2"].bitmap.height/2
  4494. fp["#{i}2"].opacity = 0
  4495. fp["#{i}2"].z = 19
  4496. end
  4497. fp["cir"] = Sprite.new(targetsprite.viewport)
  4498. fp["cir"].bitmap = pbBitmap("Graphics/Animations/eb263")
  4499. fp["cir"].ox = fp["cir"].bitmap.width/2
  4500. fp["cir"].oy = fp["cir"].bitmap.height/2
  4501. fp["cir"].z = 50
  4502. fp["cir"].zoom_x = player ? 0.5 : 1
  4503. fp["cir"].zoom_y = player ? 0.5 : 1
  4504. fp["cir"].opacity = 0
  4505. for i in 0...8
  4506. fp["#{i}s"] = Sprite.new(targetsprite.viewport)
  4507. fp["#{i}s"].bitmap = pbBitmap("Graphics/Animations/eb263_2")
  4508. fp["#{i}s"].ox = -32 -rand(64)
  4509. fp["#{i}s"].oy = fp["#{i}s"].bitmap.height/2
  4510. fp["#{i}s"].angle = rand(270)
  4511. r = rand(2)
  4512. fp["#{i}s"].zoom_x = (r==0 ? 0.1 : 0.2)*factor
  4513. fp["#{i}s"].zoom_y = (r==0 ? 0.1 : 0.2)*factor
  4514. fp["#{i}s"].visible = false
  4515. fp["#{i}s"].opacity = 255 - rand(101)
  4516. fp["#{i}s"].z = 50
  4517. end
  4518. shake = 4
  4519. # start animation
  4520. @vector.set(vector2)
  4521. for i in 0...20
  4522. if i < 10
  4523. fp["bg"].opacity += 25.5
  4524. else
  4525. fp["bg"].color.alpha -= 25.5
  4526. end
  4527. pbSEPlay("#{SE_EXTRA_PATH}Harden") if i == 4
  4528. fp["bg"].update
  4529. wait(1,true)
  4530. end
  4531. wait(4,true)
  4532. pbSEPlay("#{SE_EXTRA_PATH}Psych Up")
  4533. for i in 0...96
  4534. for j in 0...72
  4535. if fp["#{j}"].opacity == 0 && fp["#{j}"].tone.gray == 0
  4536. cx, cy = getCenter(usersprite)
  4537. dx[j] = cx - 8*usersprite.zoom_x*0.5 + rndx[j]*usersprite.zoom_x*0.5
  4538. dy[j] = cy - 8*usersprite.zoom_y*0.5 + rndy[j]*usersprite.zoom_y*0.5
  4539. fp["#{j}"].x = dx[j]
  4540. fp["#{j}"].y = dy[j]
  4541. end
  4542. applySpriteProperties(fp["#{j}"],fp["#{j}2"])
  4543. next if j>(i)
  4544. cx, cy = getCenter(usersprite)
  4545. x0 = dx[j]
  4546. y0 = dy[j]
  4547. cx, cy = getCenter(targetsprite,true)
  4548. x2 = cx - 8*targetsprite.zoom_x*0.5 + rndx[j]*targetsprite.zoom_x*0.5
  4549. y2 = cy - 8*targetsprite.zoom_y*0.5 + rndy[j]*targetsprite.zoom_y*0.5
  4550. fp["#{j}"].x += (x2 - x0)*0.1
  4551. fp["#{j}"].y += (y2 - y0)*0.1
  4552. fp["#{j}"].opacity += 51
  4553. fp["#{j}"].angle = -Math.atan(1.0*(y2-y0)/(x2-x0))*180/Math::PI + (rand(4)==0 ? 180 : 0)
  4554. nextx = fp["#{j}"].x# + (x2 - x0)*0.1
  4555. nexty = fp["#{j}"].y# + (y2 - y0)*0.1
  4556. if !player
  4557. #fp["#{j}"].visible = false if nextx > cx && nexty < cy
  4558. fp["#{j}"].z = targetsprite.z - 1 if nextx > cx && nexty < cy
  4559. else
  4560. #fp["#{j}"].visible = false if nextx < cx && nexty > cy
  4561. fp["#{j}"].z = targetsprite.z + 1 if nextx < cx && nexty > cy
  4562. end
  4563. applySpriteProperties(fp["#{j}"],fp["#{j}2"])
  4564. end
  4565. if i >= 64
  4566. targetsprite.addOx(shake)
  4567. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  4568. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  4569. targetsprite.still
  4570. end
  4571. pbSEPlay("#{SE_EXTRA_PATH}Comet Punch") if i == 64
  4572. fp["cir"].x, fp["cir"].y = getCenter(usersprite)
  4573. fp["cir"].angle += 32
  4574. fp["cir"].opacity += (i>72) ? -51 : 255
  4575. fp["bg"].update
  4576. for m in 0...8
  4577. fp["#{m}s"].visible = true
  4578. fp["#{m}s"].opacity -= 12
  4579. fp["#{m}s"].zoom_x += 0.04*factor if fp["#{m}s"].opacity > 0
  4580. fp["#{m}s"].zoom_y += 0.04*factor if fp["#{m}s"].opacity > 0
  4581. fp["#{m}s"].x, fp["#{m}s"].y = getCenter(usersprite)
  4582. end
  4583. @vector.set(vector) if i == 32
  4584. @vector.inc = 0.1 if i == 32
  4585. wait(1,true)
  4586. end
  4587. targetsprite.ox = targetsprite.bitmap.width/2
  4588. fp["cir"].opacity = 0
  4589. for i in 0...20
  4590. targetsprite.still
  4591. if i < 10
  4592. fp["bg"].color.alpha += 25.5
  4593. else
  4594. fp["bg"].opacity -= 25.5
  4595. end
  4596. fp["bg"].update
  4597. wait(1,true)
  4598. end
  4599. @vector.set(defaultvector) if !multihit
  4600. @vector.inc = 0.2
  4601. pbDisposeSpriteHash(fp)
  4602. return true
  4603. end
  4604. #-----------------------------------------------------------------------------
  4605. # Tackle
  4606. #-----------------------------------------------------------------------------
  4607. def pbMoveAnimationSpecific303(userindex,targetindex,hitnum=0,multihit=false,withvector=true,shake=false)
  4608. # inital configuration
  4609. usersprite = @sprites["pokemon#{userindex}"]
  4610. targetsprite = @sprites["pokemon#{targetindex}"]
  4611. player = (targetindex%2==0)
  4612. itself = (userindex==targetindex)
  4613. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  4614. factor = targetsprite.zoom_x
  4615. # set up animation
  4616. fp = {}
  4617. rndx = []
  4618. rndy = []
  4619. for i in 0...12
  4620. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  4621. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb303_2")
  4622. fp["#{i}"].ox = 10
  4623. fp["#{i}"].oy = 10
  4624. fp["#{i}"].opacity = 0
  4625. fp["#{i}"].z = 50
  4626. r = rand(3)
  4627. fp["#{i}"].zoom_x = (targetsprite.zoom_x)*(r==0 ? 1 : 0.5)
  4628. fp["#{i}"].zoom_y = (targetsprite.zoom_y)*(r==0 ? 1 : 0.5)
  4629. fp["#{i}"].tone = Tone.new(60,60,60)
  4630. rndx.push(rand(128))
  4631. rndy.push(rand(64))
  4632. end
  4633. @vector.set(getRealVector(targetindex,player)) if withvector
  4634. wait(20,true) if withvector
  4635. factor = targetsprite.zoom_y
  4636. pbSEPlay("eb_normal1",80)
  4637. frame = Sprite.new(targetsprite.viewport)
  4638. frame.z = 50
  4639. frame.bitmap = pbBitmap("Graphics/Animations/eb303")
  4640. frame.src_rect.set(0,0,64,64)
  4641. frame.ox = 32
  4642. frame.oy = 32
  4643. frame.zoom_x = 0.5*factor
  4644. frame.zoom_y = 0.5*factor
  4645. frame.x, frame.y = getCenter(targetsprite,true)
  4646. frame.opacity = 0
  4647. frame.tone = Tone.new(255,255,255)
  4648. frame.y -= 32*targetsprite.zoom_y
  4649. # start animation
  4650. for i in 1..30
  4651. if i < 8 && shake
  4652. x=(i/4 < 1) ? 2 : -2
  4653. moveEntireScene(0,x*2,true,true)
  4654. end
  4655. if i.between?(1,5)
  4656. targetsprite.still
  4657. targetsprite.zoom_y-=0.05*factor
  4658. targetsprite.toneAll(-12.8)
  4659. frame.zoom_x += 0.1*factor
  4660. frame.zoom_y += 0.1*factor
  4661. frame.opacity += 51
  4662. end
  4663. frame.tone = Tone.new(0,0,0) if i == 6
  4664. if i.between?(6,10)
  4665. targetsprite.still
  4666. targetsprite.zoom_y+=0.05*factor
  4667. targetsprite.toneAll(+12.8)
  4668. frame.angle += 2
  4669. end
  4670. frame.src_rect.x = 64 if i == 10
  4671. if i >= 10
  4672. frame.opacity -= 25.5
  4673. frame.zoom_x += 0.1*factor
  4674. frame.zoom_y += 0.1*factor
  4675. frame.angle += 2
  4676. end
  4677. for j in 0...12
  4678. cx = frame.x; cy = frame.y
  4679. if fp["#{j}"].opacity == 0 && fp["#{j}"].visible
  4680. fp["#{j}"].x = cx
  4681. fp["#{j}"].y = cy
  4682. end
  4683. x2 = cx - 64*targetsprite.zoom_x + rndx[j]*targetsprite.zoom_x
  4684. y2 = cy - 64*targetsprite.zoom_y + rndy[j]*targetsprite.zoom_y
  4685. x0 = fp["#{j}"].x
  4686. y0 = fp["#{j}"].y
  4687. fp["#{j}"].x += (x2 - x0)*0.2
  4688. fp["#{j}"].y += (y2 - y0)*0.2
  4689. fp["#{j}"].zoom_x += 0.01
  4690. fp["#{j}"].zoom_y += 0.01
  4691. if i < 20
  4692. fp["#{j}"].tone.red -= 6; fp["#{j}"].tone.blue -= 6; fp["#{j}"].tone.green -= 6
  4693. end
  4694. if (x2 - x0)*0.2 < 1 && (y2 - y0)*0.2 < 1
  4695. fp["#{j}"].opacity -= 51
  4696. else
  4697. fp["#{j}"].opacity += 51
  4698. end
  4699. fp["#{j}"].visible = false if fp["#{j}"].opacity <= 0
  4700. end
  4701. wait(1)
  4702. end
  4703. frame.dispose
  4704. pbDisposeSpriteHash(fp)
  4705. @vector.set(defaultvector) if !multihit
  4706. return true
  4707. end
  4708. #-----------------------------------------------------------------------------
  4709. # Substitute
  4710. #-----------------------------------------------------------------------------
  4711. def pbMoveAnimationSpecific412(userindex,targetindex,hitnum=0,multihit=false)
  4712. pbSEPlay("#{SE_EXTRA_PATH}Substitute")
  4713. self.setSubstitute(userindex,true)
  4714. return true
  4715. end
  4716. #-----------------------------------------------------------------------------
  4717. # Whirlwind
  4718. #-----------------------------------------------------------------------------
  4719. def pbMoveAnimationSpecific423(userindex,targetindex,hitnum=0,multihit=false)
  4720. # inital configuration
  4721. usersprite = @sprites["pokemon#{userindex}"]
  4722. targetsprite = @sprites["pokemon#{targetindex}"]
  4723. player = (targetindex%2==0)
  4724. player2 = (userindex%2==0)
  4725. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  4726. vector = getRealVector(targetindex,player)
  4727. vector2 = getRealVector(userindex,player2)
  4728. factor = player2 ? 2 : 1
  4729. # set up animation
  4730. fp = {}
  4731. rndx = []; prndx = []
  4732. rndy = []; prndy = []
  4733. rangl = []
  4734. dx = []
  4735. dy = []
  4736. for i in 0...128
  4737. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  4738. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb423")
  4739. fp["#{i}"].ox = fp["#{i}"].bitmap.width/2
  4740. fp["#{i}"].oy = fp["#{i}"].bitmap.height/2
  4741. fp["#{i}"].visible = false
  4742. fp["#{i}"].z = targetsprite.z + 1
  4743. rndx.push(rand(256)); prndx.push(rand(72))
  4744. rndy.push(rand(256)); prndy.push(rand(72))
  4745. rangl.push(rand(9))
  4746. dx.push(0)
  4747. dy.push(0)
  4748. end
  4749. shake = 4
  4750. k = 0
  4751. # start animation
  4752. @vector.set(vector2)
  4753. pbSEPlay("#{SE_EXTRA_PATH}Whirlwind")
  4754. for i in 0...72
  4755. for j in 0...128
  4756. next if j>(i*2)
  4757. if !fp["#{j}"].visible
  4758. cx, cy = getCenter(usersprite)
  4759. dx[j] = cx - 46*usersprite.zoom_x*0.5 + prndx[j]*usersprite.zoom_x*0.5
  4760. dy[j] = cy - 46*usersprite.zoom_y*0.5 + prndy[j]*usersprite.zoom_y*0.5
  4761. fp["#{j}"].x = dx[j]
  4762. fp["#{j}"].y = dy[j]
  4763. fp["#{j}"].visible = true
  4764. end
  4765. cx, cy = getCenter(usersprite)
  4766. x0 = cx - 46*usersprite.zoom_x*0.5 + prndx[j]*usersprite.zoom_x*0.5
  4767. y0 = cy - 46*usersprite.zoom_y*0.5 + prndy[j]*usersprite.zoom_y*0.5
  4768. cx, cy = getCenter(targetsprite,true)
  4769. x2 = cx - 128*targetsprite.zoom_x*0.5 + rndx[j]*targetsprite.zoom_x*0.5
  4770. y2 = cy - 128*targetsprite.zoom_y*0.5 + rndy[j]*targetsprite.zoom_y*0.5
  4771. fp["#{j}"].x += (x2 - x0)*0.1
  4772. fp["#{j}"].y += (y2 - y0)*0.1
  4773. fp["#{j}"].angle += rangl[j]*2
  4774. nextx = fp["#{j}"].x
  4775. nexty = fp["#{j}"].y
  4776. if !player
  4777. fp["#{j}"].opacity -= 51 if nextx > cx && nexty < cy
  4778. else
  4779. fp["#{j}"].opacity -= 51 if nextx < cx && nexty > cy
  4780. end
  4781. end
  4782. if i >= 64
  4783. targetsprite.x += 64*(player ? -1 : 1)
  4784. elsif i >= 52
  4785. targetsprite.addOx(shake)
  4786. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  4787. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  4788. targetsprite.still
  4789. end
  4790. @vector.set(vector) if i == 16
  4791. @vector.inc = 0.1 if i == 16
  4792. wait(1,i < 64)
  4793. end
  4794. targetsprite.visible = false
  4795. targetsprite.hidden = true
  4796. targetsprite.ox = targetsprite.bitmap.width/2
  4797. pbDisposeSpriteHash(fp)
  4798. @vector.set(defaultvector)
  4799. @vector.inc = 0.2
  4800. wait(16,true)
  4801. return true
  4802. end
  4803. #-----------------------------------------------------------------------------
  4804. # Poison Jab
  4805. #-----------------------------------------------------------------------------
  4806. def pbMoveAnimationSpecific430(userindex,targetindex,hitnum=0,multihit=false)
  4807. # inital configuration
  4808. usersprite = @sprites["pokemon#{userindex}"]
  4809. targetsprite = @sprites["pokemon#{targetindex}"]
  4810. player = (targetindex%2==0)
  4811. itself = (userindex==targetindex)
  4812. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  4813. @vector.set(getRealVector(targetindex,player))
  4814. wait(16,true)
  4815. # set up animation
  4816. factor = targetsprite.zoom_x
  4817. cx, cy = getCenter(targetsprite,true)
  4818. fp = {}
  4819. for j in 0...32
  4820. fp["s#{j}"] = Sprite.new(targetsprite.viewport)
  4821. fp["s#{j}"].bitmap = Bitmap.new(8,8)
  4822. fp["s#{j}"].bitmap.drawCircle(Color.new(25,75,183))
  4823. fp["s#{j}"].ox = fp["s#{j}"].bitmap.width/2
  4824. fp["s#{j}"].oy = fp["s#{j}"].bitmap.height
  4825. fp["s#{j}"].x = cx
  4826. fp["s#{j}"].y = cy
  4827. fp["s#{j}"].z = targetsprite.z
  4828. fp["s#{j}"].angle = rand(360)
  4829. fp["s#{j}"].visible = false
  4830. end
  4831. for j in 0...16
  4832. fp["#{j}"] = Sprite.new(targetsprite.viewport)
  4833. fp["#{j}"].bitmap = pbBitmap("Graphics/Animations/eb430")
  4834. fp["#{j}"].oy = fp["#{j}"].bitmap.height/2
  4835. fp["#{j}"].angle = rand(360)
  4836. fp["#{j}"].ox = - 80*factor
  4837. fp["#{j}"].x = cx
  4838. fp["#{j}"].y = cy
  4839. fp["#{j}"].z = targetsprite.z + 1
  4840. fp["#{j}"].opacity = 0
  4841. end
  4842. # play animation
  4843. for i in 0...48
  4844. for j in 0...16
  4845. next if j>i
  4846. fp["#{j}"].opacity += 32
  4847. fp["#{j}"].ox += (80*factor/8).ceil
  4848. fp["#{j}"].visible = false if fp["#{j}"].ox >= 0
  4849. end
  4850. for j in 0...32
  4851. next if j>i*2
  4852. fp["s#{j}"].visible = true
  4853. fp["s#{j}"].opacity -= 32
  4854. fp["s#{j}"].oy += 16
  4855. end
  4856. targetsprite.zoom_y = factor + 0.32 if i%6 == 0 && i < 32
  4857. targetsprite.zoom_y -= 0.08 if targetsprite.zoom_y > factor
  4858. pbSEPlay("#{SE_EXTRA_PATH}hit",80) if i%6==0 && i < 32
  4859. pbSEPlay("eb_poison1",60) if i%4==0 && i < 32
  4860. wait(1)
  4861. end
  4862. @vector.set(defaultvector) if !multihit
  4863. pbDisposeSpriteHash(fp)
  4864. return true
  4865. end
  4866. #-----------------------------------------------------------------------------
  4867. # Psychic
  4868. #-----------------------------------------------------------------------------
  4869. def pbMoveAnimationSpecific452(userindex,targetindex,hitnum=0,multihit=false)
  4870. # inital configuration
  4871. usersprite = @sprites["pokemon#{userindex}"]
  4872. targetsprite = @sprites["pokemon#{targetindex}"]
  4873. player = (targetindex%2==0)
  4874. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  4875. vector = getRealVector(targetindex,player)
  4876. factor = player ? 2 : 1.5
  4877. # set up animation
  4878. fp = {}
  4879. fp["bg"] = ScrollingSprite.new(targetsprite.viewport)
  4880. fp["bg"].speed = 6
  4881. fp["bg"].setBitmap("Graphics/Animations/eb452",true)
  4882. fp["bg"].color = Color.new(0,0,0,255)
  4883. fp["bg"].opacity = 0
  4884. fp["bg"].oy = fp["bg"].src_rect.height/2
  4885. fp["bg"].y = targetsprite.viewport.rect.height/2
  4886. shake = 8
  4887. zoom = -1
  4888. # start animation
  4889. @vector.set(vector)
  4890. for i in 0...72
  4891. pbSEPlay("eb_psychic1",80) if i == 40
  4892. pbSEPlay("eb_psychic2",80) if i == 62
  4893. if i < 10
  4894. fp["bg"].opacity += 25.5
  4895. elsif i < 20
  4896. fp["bg"].color.alpha -= 25.5
  4897. elsif i >= 62
  4898. fp["bg"].color.alpha += 25.5
  4899. targetsprite.tone.red += 18
  4900. targetsprite.tone.green += 18
  4901. targetsprite.tone.blue += 18
  4902. targetsprite.zoom_x += 0.04*factor
  4903. targetsprite.zoom_y += 0.04*factor
  4904. elsif i >= 40
  4905. targetsprite.addOx(shake)
  4906. shake = -8 if targetsprite.ox > targetsprite.bitmap.width/2 + 4
  4907. shake = 8 if targetsprite.ox < targetsprite.bitmap.width/2 - 4
  4908. targetsprite.still
  4909. end
  4910. zoom *= -1 if i%2 == 0
  4911. fp["bg"].update
  4912. fp["bg"].zoom_y += 0.04*zoom
  4913. wait(1,(i<62))
  4914. end
  4915. targetsprite.ox = targetsprite.bitmap.width/2
  4916. 10.times do
  4917. targetsprite.tone.red -= 18
  4918. targetsprite.tone.green -= 18
  4919. targetsprite.tone.blue -= 18
  4920. targetsprite.zoom_x -= 0.04*factor
  4921. targetsprite.zoom_y -= 0.04*factor
  4922. targetsprite.still
  4923. wait(1)
  4924. end
  4925. wait(8)
  4926. @vector.set(defaultvector) if !multihit
  4927. 10.times do
  4928. fp["bg"].opacity -= 25.5
  4929. targetsprite.still
  4930. wait(1,true)
  4931. end
  4932. pbDisposeSpriteHash(fp)
  4933. return true
  4934. end
  4935. #-----------------------------------------------------------------------------
  4936. # Psycho Cut
  4937. #-----------------------------------------------------------------------------
  4938. def pbMoveAnimationSpecific458(userindex,targetindex,hitnum=0,multihit=false)
  4939. # inital configuration
  4940. usersprite = @sprites["pokemon#{userindex}"]
  4941. targetsprite = @sprites["pokemon#{targetindex}"]
  4942. player = (targetindex%2==0)
  4943. player2 = (userindex%2==0)
  4944. itself = (userindex==targetindex)
  4945. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  4946. vector = getRealVector(targetindex,player)
  4947. vector2 = getRealVector(usersprite,player2)
  4948. # extra parameters
  4949. xt,yt = getCenter(targetsprite,true)
  4950. xp,yp = getCenter(usersprite,true)
  4951. distance_x = xt - xp
  4952. distance_y = yp - yt
  4953. @vector.set(vector2)
  4954. wait(16,true)
  4955. # set up animation
  4956. cx, cy = getCenter(usersprite,true)
  4957. factor = usersprite.zoom_x
  4958. fp = {}
  4959. for j in 0...5
  4960. fp["#{j}"] = Sprite.new(targetsprite.viewport)
  4961. fp["#{j}"].bitmap = pbBitmap("Graphics/Animations/eb458_2")
  4962. fp["#{j}"].ox = fp["#{j}"].bitmap.width/2
  4963. fp["#{j}"].oy = fp["#{j}"].bitmap.height + 16
  4964. fp["#{j}"].zoom_x = factor*0.75
  4965. fp["#{j}"].zoom_y = factor*0.75
  4966. fp["#{j}"].opacity = 0
  4967. fp["#{j}"].x = cx
  4968. fp["#{j}"].y = cy
  4969. fp["#{j}"].z = player2 ? 29 : 19
  4970. fp["#{j}"].angle = 60*j + 30
  4971. end
  4972. fp["ring"] = Sprite.new(targetsprite.viewport)
  4973. fp["ring"].bitmap = pbBitmap("Graphics/Animations/eb458")
  4974. fp["ring"].ox = fp["ring"].bitmap.width/2
  4975. fp["ring"].oy = fp["ring"].bitmap.height/2
  4976. fp["ring"].x = cx
  4977. fp["ring"].y = cy
  4978. fp["ring"].zoom_x = 0
  4979. fp["ring"].zoom_y = 0
  4980. fp["ring"].z = player2 ? 29 : 19
  4981. fp["blade"] = Sprite.new(targetsprite.viewport)
  4982. fp["blade"].bitmap = pbBitmap("Graphics/Animations/eb458_3")
  4983. fp["blade"].ox = fp["blade"].bitmap.width/2
  4984. fp["blade"].oy = fp["blade"].bitmap.height/2
  4985. fp["blade"].x = cx
  4986. fp["blade"].y = cy
  4987. fp["blade"].zoom_x = factor
  4988. fp["blade"].zoom_y = factor
  4989. fp["blade"].z = player2 ? 29 : 19
  4990. fp["blade"].opacity = 0
  4991. fp["blade"].color = Color.new(255,255,255,128)
  4992. fp["blade2"] = Sprite.new(targetsprite.viewport)
  4993. fp["blade2"].bitmap = pbBitmap("Graphics/Animations/eb458_3")
  4994. fp["blade2"].ox = fp["blade2"].bitmap.width/2
  4995. fp["blade2"].oy = fp["blade2"].bitmap.height/2
  4996. fp["blade2"].x = cx
  4997. fp["blade2"].y = cy
  4998. fp["blade2"].zoom_x = factor
  4999. fp["blade2"].zoom_y = factor
  5000. fp["blade2"].z = player ? 29 : 19
  5001. fp["blade2"].opacity = 0
  5002. fp["blade2"].color = Color.new(255,255,255,128)
  5003. for i in 0...96
  5004. cx, cy = getCenter(usersprite,true)
  5005. @vector.set(defaultvector) if !multihit && i == 64
  5006. pbSEPlay("eb_normal3",80) if i == 88
  5007. pbSEPlay("eb_normal3",60) if i == 92
  5008. pbSEPlay("eb_ground1",80) if i == 16
  5009. pbSEPlay("#{SE_EXTRA_PATH}fog2",90) if i == 16
  5010. pbSEPlay("eb_psychic3",80) if i == 64
  5011. if i < 16
  5012. fp["ring"].zoom_x += factor/16.0
  5013. fp["ring"].zoom_y += factor/16.0
  5014. elsif i < 64
  5015. for j in 0...5
  5016. fp["#{j}"].zoom_x += 0.05*factor*((i < 24) ? 0.5 : 0.25)
  5017. fp["#{j}"].zoom_y += 0.05*factor*((i < 24) ? 0.5 : 0.25)
  5018. fp["#{j}"].opacity += 32*((i < 24) ? 1 : -1)
  5019. end
  5020. fp["ring"].opacity -= 8
  5021. fp["blade"].opacity += 16
  5022. fp["blade"].angle += 8
  5023. fp["blade"].color.alpha -= 8 if fp["blade"].color.alpha > 0
  5024. else
  5025. fp["blade"].angle += 8
  5026. fp["blade"].opacity -= 16
  5027. fp["blade"].x = cx
  5028. fp["blade"].y = cy
  5029. fp["blade2"].opacity += 32
  5030. fp["blade2"].x = cx + (i-64)*distance_x/24.0
  5031. fp["blade2"].y = cy - (i-64)*distance_y/24.0
  5032. x2, y2 = getCenter(targetsprite,true)
  5033. x0 = fp["blade2"].x
  5034. y0 = fp["blade2"].y
  5035. fp["blade2"].angle = -Math.atan(1.0*(y2-y0)/(x2-x0))*180/Math::PI + 180*(player ? 1 : 0) if i < 88
  5036. fp["blade2"].zoom_x -= (usersprite.zoom_x - targetsprite.zoom_x)/32.0
  5037. fp["blade2"].zoom_y -= (usersprite.zoom_y - targetsprite.zoom_y)/32.0
  5038. if !player
  5039. fp["blade2"].z = targetsprite.z - 1 if x0 > x2 && y0 < y2
  5040. else
  5041. fp["blade2"].z = targetsprite.z + 1 if x0 < x2 && y0 > y2
  5042. end
  5043. end
  5044. wait(1,true)
  5045. end
  5046. pbDisposeSpriteHash(fp)
  5047. return true
  5048. end
  5049. #-----------------------------------------------------------------------------
  5050. # Rockslide
  5051. #-----------------------------------------------------------------------------
  5052. def pbMoveAnimationSpecific504(userindex,targetindex,hitnum=0,multihit=false)
  5053. # inital configuration
  5054. usersprite = @sprites["pokemon#{userindex}"]
  5055. targetsprite = @sprites["pokemon#{targetindex}"]
  5056. player = (targetindex%2==0)
  5057. itself = (userindex==targetindex)
  5058. indexes = player ? [0,2] : [1,3]
  5059. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  5060. v = player ? PLAYERVECTOR : ENEMYVECTOR
  5061. vector = @battle.doublebattle ? v : getRealVector(targetindex,player)
  5062. @vector.set(vector)
  5063. wait(16,true)
  5064. # set up animation
  5065. cx, cy = getCenter(targetsprite,true)
  5066. dy = @vector.y2/12
  5067. fp = {}
  5068. da = []
  5069. factors = []
  5070. for m in 0...(@battle.doublebattle ? 2 : 1)
  5071. targetsprite = @sprites["pokemon#{indexes[m]}"]
  5072. if !targetsprite || targetsprite.disposed? || targetsprite.fainted || !targetsprite.visible
  5073. factors.push(1)
  5074. next
  5075. end
  5076. factors.push(targetsprite.zoom_x)
  5077. end
  5078. for m in 0...(@battle.doublebattle ? 2 : 1)
  5079. targetsprite = @sprites["pokemon#{indexes[m]}"]
  5080. next if !targetsprite || targetsprite.disposed? || targetsprite.fainted || !targetsprite.visible
  5081. for j in 0...96
  5082. fp["r#{m}#{j}"] = Sprite.new(targetsprite.viewport)
  5083. fp["r#{m}#{j}"].bitmap = pbBitmap("Graphics/Animations/eb504")
  5084. fp["r#{m}#{j}"].ox = fp["r#{m}#{j}"].bitmap.width/2
  5085. fp["r#{m}#{j}"].oy = fp["r#{m}#{j}"].bitmap.height/2
  5086. r = 64*factors[m]
  5087. z = [1,0.5,0.75,0.25][rand(4)]
  5088. fp["r#{m}#{j}"].zoom_x = z
  5089. fp["r#{m}#{j}"].zoom_y = z
  5090. fp["r#{m}#{j}"].x = targetsprite.x - r + rand(r*2)
  5091. fp["r#{m}#{j}"].y = rand(32*factors[m])
  5092. fp["r#{m}#{j}"].visible = false
  5093. fp["r#{m}#{j}"].angle = rand(360)
  5094. fp["r#{m}#{j}"].z = targetsprite.z + 1
  5095. da.push(rand(2)==0 ? 1 : -1)
  5096. end
  5097.  
  5098. width = targetsprite.bitmap.width/2 - 16
  5099. max = 16# + (width/16)
  5100. for j in 0...max
  5101. fp["d#{m}#{j}"] = Sprite.new(targetsprite.viewport)
  5102. fp["d#{m}#{j}"].bitmap = pbBitmap("Graphics/Animations/ebDustParticle")
  5103. fp["d#{m}#{j}"].ox = fp["d#{m}#{j}"].bitmap.width/2
  5104. fp["d#{m}#{j}"].oy = fp["d#{m}#{j}"].bitmap.height/2
  5105. fp["d#{m}#{j}"].opacity = 0
  5106. fp["d#{m}#{j}"].angle = rand(360)
  5107. fp["d#{m}#{j}"].x = targetsprite.x - width*factors[m] + rand(width*2*factors[m])
  5108. fp["d#{m}#{j}"].y = targetsprite.y - 16*factors[m] + rand(32*factors[m])
  5109. fp["d#{m}#{j}"].z = targetsprite.z + (fp["d#{m}#{j}"].y < targetsprite.y ? -1 : 1)
  5110. zoom = [1,0.8,0.9,0.7][rand(4)]
  5111. fp["d#{m}#{j}"].zoom_x = zoom*factors[m]
  5112. fp["d#{m}#{j}"].zoom_y = zoom*factors[m]
  5113. end
  5114. end
  5115. k = [-1,-1]
  5116. # start animation
  5117. for i in 0...80
  5118. pbSEPlay("eb_rock2",70) if i%8==0
  5119. for m in 0...(@battle.doublebattle ? 2 : 1)
  5120. targetsprite = @sprites["pokemon#{indexes[m]}"]
  5121. next if !targetsprite || targetsprite.disposed? || targetsprite.fainted || !targetsprite.visible
  5122. for j in 0...96
  5123. next if j>(i*2)
  5124. fp["r#{m}#{j}"].y += dy
  5125. fp["r#{m}#{j}"].visible = fp["r#{m}#{j}"].y < targetsprite.y - 16*factors[m]
  5126. fp["r#{m}#{j}"].angle += 8*da[j]
  5127. end
  5128. for j in 0...max
  5129. next if i < 8
  5130. next if j>(i-8)/2
  5131. fp["d#{m}#{j}"].opacity += 25.5 if i < 18+j*2
  5132. fp["d#{m}#{j}"].opacity -= 25.5 if i >= 22+j*2
  5133. if fp["d#{m}#{j}"].x >= targetsprite.x
  5134. fp["d#{m}#{j}"].angle += 4
  5135. fp["d#{m}#{j}"].x += 2
  5136. else
  5137. fp["d#{m}#{j}"].angle -= 4
  5138. fp["d#{m}#{j}"].x -= 2
  5139. end
  5140. end
  5141. if i >= 8 && i < 64
  5142. k[m] *= -1 if i%4==0
  5143. targetsprite.zoom_y -= 0.04*k[m]*factors[m]
  5144. targetsprite.zoom_x += 0.02*k[m]*factors[m]
  5145. targetsprite.still
  5146. end
  5147. end
  5148. wait(1)
  5149. end
  5150. @vector.set(defaultvector) if !multihit
  5151. pbDisposeSpriteHash(fp)
  5152. return true
  5153. end
  5154. #-----------------------------------------------------------------------------
  5155. # Flash Cannon
  5156. #-----------------------------------------------------------------------------
  5157. def pbMoveAnimationSpecific519(userindex,targetindex,hitnum=0,multihit=false)
  5158. # inital configuration
  5159. usersprite = @sprites["pokemon#{userindex}"]
  5160. targetsprite = @sprites["pokemon#{targetindex}"]
  5161. player = (userindex%2==0)
  5162. player2 = (targetindex%2==0)
  5163. itself = (userindex==targetindex)
  5164. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  5165. @vector.set(getRealVector(userindex,player))
  5166. fp = {}
  5167. fp["bg"] = Sprite.new(usersprite.viewport)
  5168. fp["bg"].drawRect(usersprite.viewport.rect.width,usersprite.viewport.rect.height,Color.new(0,0,0))
  5169. fp["bg"].opacity = 0
  5170. 16.times do
  5171. fp["bg"].opacity += 12
  5172. wait(1,true)
  5173. end
  5174. cx, cy = getCenter(usersprite,true)
  5175. # charging animation
  5176. for j in 0...8
  5177. fp["s#{j}"] = Sprite.new(usersprite.viewport)
  5178. fp["s#{j}"].bitmap = pbBitmap("Graphics/Animations/eb519_2")
  5179. fp["s#{j}"].center
  5180. r = 64*usersprite.zoom_x
  5181. x1, y1 = randCircleCord(r)
  5182. fp["s#{j}"].x = cx - r + x1
  5183. fp["s#{j}"].y = cy - r + y1
  5184. fp["s#{j}"].opacity = 0
  5185. z = [1.1,1,0.9,1.2,0.8][rand(5)]
  5186. fp["s#{j}"].zoom_x = z
  5187. fp["s#{j}"].zoom_y = z
  5188. fp["s#{j}"].z = usersprite.z + 1
  5189. end
  5190. fp["glow"] = Sprite.new(usersprite.viewport)
  5191. fp["glow"].bitmap = pbBitmap("Graphics/Animations/eb519_3")
  5192. fp["glow"].center
  5193. fp["glow"].x = cx
  5194. fp["glow"].y = cy
  5195. fp["glow"].opacity = 0
  5196. fp["glow"].toggle = 1
  5197. for j in 0...2
  5198. fp["c#{j}"] = Sprite.new(usersprite.viewport)
  5199. fp["c#{j}"].bitmap = pbBitmap("Graphics/Animations/eb519_#{5+j}")
  5200. fp["c#{j}"].center
  5201. fp["c#{j}"].toggle = 1
  5202. fp["c#{j}"].x = cx
  5203. fp["c#{j}"].y = cy
  5204. fp["c#{j}"].opacity = 0
  5205. fp["c#{j}"].param = 1
  5206. fp["c#{j}"].zoom_x = usersprite.zoom_x
  5207. fp["c#{j}"].zoom_y = usersprite.zoom_y
  5208. fp["c#{j}"].z = usersprite.z + 1
  5209. end
  5210. for j in 0...8
  5211. fp["t#{j}"] = TrailingSprite.new(usersprite.viewport,pbBitmap("Graphics/Animations/eb519"))
  5212. fp["t#{j}"].z = usersprite.z + 1
  5213. r = usersprite.viewport.rect.width
  5214. x1, y1 = randCircleCord(r)
  5215. fp["t#{j}"].x = cx - r + x1
  5216. fp["t#{j}"].y = cy - r + y1
  5217. fp["t#{j}"].color = Color.new(255,255,255)
  5218. end
  5219. fp["circle"] = Sprite.new(usersprite.viewport)
  5220. fp["circle"].bitmap = pbBitmap("Graphics/Animations/eb519_4")
  5221. fp["circle"].center
  5222. fp["circle"].x = cx
  5223. fp["circle"].y = cy
  5224. fp["circle"].zoom_x = 0
  5225. fp["circle"].zoom_y = 0
  5226. fp["circle"].color = Color.new(192,56,121,0)
  5227. fp["circle"].param = 0
  5228. fp["circle"].z = usersprite.z + 2
  5229. fp["circle"].opacity = 0
  5230.  
  5231. fp["ripples"] = Sprite.new(usersprite.viewport)
  5232. fp["ripples"].bitmap = pbBitmap("Graphics/Animations/eb519_7")
  5233. fp["ripples"].center
  5234. fp["ripples"].x = cx
  5235. fp["ripples"].y = cy
  5236. fp["ripples"].opacity = 0
  5237. fp["ripples"].zoom_x = usersprite.zoom_x
  5238. fp["ripples"].zoom_y = usersprite.zoom_y
  5239. fp["ripples"].color = Color.new(255,255,255,0)
  5240. fp["ripples"].z = usersprite.z + 2
  5241. pbSEPlay("#{SE_EXTRA_PATH}Harden")
  5242. for i in 0...148
  5243. pbSEPlay("#{SE_EXTRA_PATH}Refresh") if i == 16
  5244. pbSEPlay("#{SE_EXTRA_PATH}Saint8") if i == 68
  5245. for j in 0...8
  5246. next if j > i/4
  5247. fp["s#{j}"].opacity += 48
  5248. fp["s#{j}"].zoom_x -= 0.0625 if i > 4 + j*4
  5249. fp["s#{j}"].zoom_y -= 0.0625 if i > 4 + j*4
  5250. fp["s#{j}"].x -= (cx - fp["s#{j}"].x)*0.01
  5251. fp["s#{j}"].y -= (cy - fp["s#{j}"].y)*0.01
  5252. end
  5253. for j in 0...8
  5254. next if i < 16
  5255. next if j > (i-16)/8
  5256. fp["t#{j}"].x -= (fp["t#{j}"].x - cx)*0.1
  5257. fp["t#{j}"].y -= (fp["t#{j}"].y - cy)*0.1
  5258. fp["t#{j}"].color.alpha -= 8
  5259. fp["t#{j}"].update if i < 128
  5260. fp["t#{j}"].visible = false if i == 128
  5261. end
  5262. for j in 0...2
  5263. next if i < 32
  5264. fp["c#{j}"].param -= fp["c#{j}"].toggle*0.0625*(j+1)
  5265. if j == 0
  5266. fp["c#{j}"].zoom_x = fp["c#{j}"].param*usersprite.zoom_x
  5267. else
  5268. fp["c#{j}"].zoom_y = fp["c#{j}"].param*usersprite.zoom_y
  5269. end
  5270. fp["c#{j}"].opacity += i < 132 ? 8 : -32
  5271. fp["c#{j}"].toggle *= -1 if fp["c#{j}"].param <= 0 || fp["c#{j}"].param >= 1
  5272. fp["c#{j}"].x = cx
  5273. fp["c#{j}"].y = cy
  5274. end
  5275. if i >= 32
  5276. fp["circle"].zoom_x += 0.03125 if fp["circle"].zoom_x < 1
  5277. fp["circle"].zoom_y += 0.03125 if fp["circle"].zoom_y < 1
  5278. fp["circle"].param = (fp["circle"].param == 0 ? 255 : 0) if i%12 == 0 || i%12 == 4
  5279. fp["circle"].color.alpha = fp["circle"].param if i < 132
  5280. fp["circle"].opacity += 8
  5281. fp["glow"].opacity += i < 132 ? 4 : -32
  5282. fp["glow"].zoom_x -= 0.02*fp["glow"].toggle
  5283. fp["glow"].zoom_y -= 0.02*fp["glow"].toggle
  5284. fp["glow"].toggle *= -1 if i%4 == 0
  5285. end
  5286. pbSEPlay("eb_move2") if i == 132
  5287. pbSEPlay("eb_normal5",80) if i == 132
  5288. # shooting at the target
  5289. @vector.set(getRealVector(targetindex,player2)) if i == 132
  5290. fp["circle"].z = targetsprite.z + 1 if i == 132
  5291. if i >= 132
  5292. cx, cy = getCenter(usersprite,true)
  5293. x1, y1 = getCenter(targetsprite,true)
  5294. fp["ripples"].opacity += i < 140 ? 32 : - 32
  5295. fp["ripples"].zoom_x += 0.1*usersprite.zoom_x
  5296. fp["ripples"].zoom_y += 0.1*usersprite.zoom_y
  5297. fp["ripples"].color.alpha += 16
  5298. fp["ripples"].x = cx
  5299. fp["ripples"].y = cy
  5300. fp["circle"].color.alpha = 0
  5301. fp["circle"].zoom_x = @vector.zoom1
  5302. fp["circle"].zoom_y = @vector.zoom1
  5303. fp["circle"].x += (x1 - fp["circle"].x)*0.1
  5304. fp["circle"].y -= (fp["circle"].y - y1)*0.1
  5305. fp["circle"].opacity -= 64 if i >= 144
  5306. end
  5307. wait(1,true)
  5308. end
  5309. pbSEPlay("eb_iron4")
  5310. pbSEPlay("eb_iron1")
  5311. # hitting the target
  5312. for j in 0...24
  5313. fp["r2#{j}"] = Sprite.new(targetsprite.viewport)
  5314. fp["r2#{j}"].bitmap = pbBitmap("Graphics/Animations/eb519_10")
  5315. fp["r2#{j}"].center
  5316. fp["r2#{j}"].x = targetsprite.x - targetsprite.ox + rand(targetsprite.bitmap.width)
  5317. fp["r2#{j}"].y = targetsprite.y - targetsprite.oy + rand(targetsprite.bitmap.height)
  5318. fp["r2#{j}"].z = targetsprite.z + 1 + rand(2)
  5319. fp["r2#{j}"].visible = false
  5320. end
  5321. for j in 0...32
  5322. fp["r#{j}"] = Sprite.new(targetsprite.viewport)
  5323. b = rand(2)
  5324. fp["r#{j}"].bitmap = pbBitmap("Graphics/Animations/eb519_#{8+b}")
  5325. fp["r#{j}"].center
  5326. fp["r#{j}"].ox /= 2 if b == 0
  5327. fp["r#{j}"].src_rect.set(rand(2)*fp["r#{j}"].bitmap.width/2,0,fp["r#{j}"].bitmap.width/2,fp["r#{j}"].bitmap.height) if b == 0
  5328. fp["r#{j}"].x = x1
  5329. fp["r#{j}"].y = y1
  5330. r = (48 + rand(49))*targetsprite.zoom_x
  5331. rx, ry = randCircleCord(r)
  5332. fp["r#{j}"].end_x = x1 - r + rx
  5333. fp["r#{j}"].end_y = y1 - r + ry
  5334. fp["r#{j}"].opacity = 0
  5335. fp["r#{j}"].toggle = 2
  5336. fp["r#{j}"].z = targetsprite.z + 1
  5337. fp["r#{j}"].zoom_x = targetsprite.zoom_x
  5338. fp["r#{j}"].zoom_y = targetsprite.zoom_y
  5339. fp["r#{j}"].param = 0
  5340. fp["r#{j}"].speed = rand(15)
  5341. end
  5342. k = 1
  5343. for i in 0...64
  5344. for j in 0...32
  5345. #next if j > i
  5346. fp["r#{j}"].opacity += 16*fp["r#{j}"].toggle
  5347. fp["r#{j}"].toggle = -4 if fp["r#{j}"].param >= 24+fp["r#{j}"].speed
  5348. fp["r#{j}"].x += (fp["r#{j}"].end_x - fp["r#{j}"].x)*0.05
  5349. fp["r#{j}"].y += (fp["r#{j}"].end_y - fp["r#{j}"].y)*0.05
  5350. fp["r#{j}"].zoom_x -= fp["r#{j}"].zoom_x*0.02
  5351. fp["r#{j}"].zoom_y -= fp["r#{j}"].zoom_y*0.02
  5352. fp["r#{j}"].param += 1
  5353. end
  5354. for j in 0...24
  5355. next if i < 8
  5356. next if j > (i-8)/2
  5357. fp["r2#{j}"].visible = true
  5358. fp["r2#{j}"].opacity -= 24
  5359. fp["r2#{j}"].zoom_x -= 0.02
  5360. fp["r2#{j}"].zoom_y -= 0.02
  5361. end
  5362. if i >= 24
  5363. targetsprite.ox += k*2
  5364. k *= -1 if i%2 == 0
  5365. pbSEPlay("eb_normal2",50) if i%4 == 0
  5366. end
  5367. targetsprite.still
  5368. wait(1)
  5369. end
  5370. @vector.set(defaultvector)
  5371. for key in fp.keys
  5372. next if key == "bg"
  5373. fp[key].dispose
  5374. end
  5375. 16.times do
  5376. fp["bg"].opacity -= 16
  5377. wait(1,true)
  5378. end
  5379. fp["bg"].dispose
  5380. fp.clear
  5381. return true
  5382. end
  5383. #-----------------------------------------------------------------------------
  5384. # Iron Head
  5385. #-----------------------------------------------------------------------------
  5386. def pbMoveAnimationSpecific520(userindex,targetindex,hitnum=0,multihit=false)
  5387. # inital configuration
  5388. usersprite = @sprites["pokemon#{userindex}"]
  5389. targetsprite = @sprites["pokemon#{targetindex}"]
  5390. player = (targetindex%2==0)
  5391. itself = (userindex==targetindex)
  5392. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  5393. factor = targetsprite.zoom_x
  5394. # set up animation
  5395. fp = {}
  5396. rndx = []
  5397. rndy = []
  5398. pbSEPlay("eb_iron2",80,80)
  5399. pbSEPlay("eb_ground1",80)
  5400. for i in 0...2
  5401. for k in 0...4
  5402. usersprite.x += 8*(player ? -1 : 1)*(i==0 ? 1 : -1)
  5403. usersprite.x -= 2*(player ? -1 : 1)*(i==0 ? 1 : -1)
  5404. wait(1)
  5405. end
  5406. end
  5407. @vector.set(getRealVector(targetindex,player))
  5408. wait(16,true)
  5409. for i in 0...16
  5410. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  5411. fp["#{i}"].bitmap = pbBitmap("Graphics/Animations/eb024")
  5412. fp["#{i}"].ox = 6
  5413. fp["#{i}"].oy = 6
  5414. fp["#{i}"].opacity = 0
  5415. fp["#{i}"].z = 50
  5416. r = rand(3)
  5417. fp["#{i}"].zoom_x = (targetsprite.zoom_x)*(r==0 ? 1 : 0.5)
  5418. fp["#{i}"].zoom_y = (targetsprite.zoom_y)*(r==0 ? 1 : 0.5)
  5419. fp["#{i}"].tone = Tone.new(60,60,60)
  5420. rndx.push(rand(128))
  5421. rndy.push(rand(128))
  5422. end
  5423. factor = 1
  5424. frame = Sprite.new(targetsprite.viewport)
  5425. frame.z = 50
  5426. frame.bitmap = pbBitmap("Graphics/Animations/eb520")
  5427. frame.src_rect.set(0,0,114,114)
  5428. frame.ox = 57
  5429. frame.oy = 57
  5430. frame.zoom_x = 0.5*factor
  5431. frame.zoom_y = 0.5*factor
  5432. frame.x, frame.y = getCenter(targetsprite,true)
  5433. frame.opacity = 0
  5434. frame.tone = Tone.new(255,255,255)
  5435. # start animation
  5436. for i in 1..30
  5437. if i == 6
  5438. pbSEPlay("eb_iron3",90)
  5439. pbSEPlay("eb_iron1",80)
  5440. end
  5441. if i.between?(1,5)
  5442. targetsprite.still
  5443. targetsprite.zoom_y-=0.05*factor
  5444. targetsprite.toneAll(-12.8)
  5445. frame.zoom_x += 0.1*factor
  5446. frame.zoom_y += 0.1*factor
  5447. frame.opacity += 51
  5448. end
  5449. frame.tone = Tone.new(0,0,0) if i == 6
  5450. if i.between?(6,10)
  5451. targetsprite.still
  5452. targetsprite.zoom_y+=0.05*factor
  5453. targetsprite.toneAll(+12.8)
  5454. frame.angle += 2
  5455. end
  5456. frame.src_rect.x = 114 if i == 10
  5457. if i >= 10
  5458. frame.opacity -= 25.5
  5459. frame.zoom_x += 0.1*factor
  5460. frame.zoom_y += 0.1*factor
  5461. frame.angle += 2
  5462. end
  5463. for j in 0...16
  5464. next if i < 6
  5465. cx = frame.x; cy = frame.y
  5466. if fp["#{j}"].opacity == 0 && fp["#{j}"].visible
  5467. fp["#{j}"].x = cx
  5468. fp["#{j}"].y = cy
  5469. end
  5470. x2 = cx - 64*targetsprite.zoom_x + rndx[j]*targetsprite.zoom_x
  5471. y2 = cy - 64*targetsprite.zoom_y + rndy[j]*targetsprite.zoom_y
  5472. x0 = fp["#{j}"].x
  5473. y0 = fp["#{j}"].y
  5474. fp["#{j}"].x += (x2 - x0)*0.2
  5475. fp["#{j}"].y += (y2 - y0)*0.2
  5476. fp["#{j}"].zoom_x += 0.01
  5477. fp["#{j}"].zoom_y += 0.01
  5478. fp["#{j}"].angle += 2
  5479. if i < 20
  5480. fp["#{j}"].tone.red -= 6; fp["#{j}"].tone.blue -= 6; fp["#{j}"].tone.green -= 6
  5481. end
  5482. if (x2 - x0)*0.2 < 1 && (y2 - y0)*0.2 < 1
  5483. fp["#{j}"].opacity -= 51
  5484. else
  5485. fp["#{j}"].opacity += 51
  5486. end
  5487. fp["#{j}"].visible = false if fp["#{j}"].opacity <= 0
  5488. end
  5489. wait(1)
  5490. end
  5491. frame.dispose
  5492. pbDisposeSpriteHash(fp)
  5493. @vector.set(defaultvector) if !multihit
  5494. return true
  5495. end
  5496. #-----------------------------------------------------------------------------
  5497. # Magnet Bomb
  5498. #-----------------------------------------------------------------------------
  5499. def pbMoveAnimationSpecific523(userindex,targetindex,hitnum=0,multihit=false)
  5500. # inital configuration
  5501. usersprite = @sprites["pokemon#{userindex}"]
  5502. targetsprite = @sprites["pokemon#{targetindex}"]
  5503. player = (targetindex%2==0)
  5504. itself = (userindex==targetindex)
  5505. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  5506. factor = targetsprite.zoom_x
  5507. @vector.set(getRealVector(targetindex,player))
  5508. wait(16,true)
  5509. factor = targetsprite.zoom_x
  5510. # set up animation
  5511. fp = {}
  5512. dx = []
  5513. dy = []
  5514. cx, cy = getCenter(targetsprite,true)
  5515. for j in 0..16
  5516. fp["i#{j}"] = Sprite.new(targetsprite.viewport)
  5517. fp["i#{j}"].bitmap = pbBitmap("Graphics/Animations/eb523")
  5518. fp["i#{j}"].ox = fp["i#{j}"].bitmap.width/2
  5519. fp["i#{j}"].oy = fp["i#{j}"].bitmap.height/2
  5520. r = 72*factor
  5521. x, y = randCircleCord(r)
  5522. fp["i#{j}"].x = cx - r + rand(r*2)
  5523. fp["i#{j}"].y = cy - r*1.5 + rand(r*2)
  5524. fp["i#{j}"].z = targetsprite.z + (rand(2)==0 ? 1 : -1)
  5525. fp["i#{j}"].zoom_x = factor
  5526. fp["i#{j}"].zoom_y = factor
  5527. fp["i#{j}"].opacity = 0
  5528. dx.push(rand(2)==0 ? 1 : -1)
  5529. dy.push(rand(2)==0 ? 1 : -1)
  5530. end
  5531. for m in 0...12
  5532. fp["d#{m}"] = Sprite.new(targetsprite.viewport)
  5533. fp["d#{m}"].bitmap = pbBitmap("Graphics/Animations/eb523_2")
  5534. fp["d#{m}"].src_rect.set(0,0,80,78)
  5535. fp["d#{m}"].ox = fp["d#{m}"].src_rect.width/2
  5536. fp["d#{m}"].oy = fp["d#{m}"].src_rect.height/2
  5537. r = 32*factor
  5538. fp["d#{m}"].x = cx - r + rand(r*2)
  5539. fp["d#{m}"].y = cy - r + rand(r*2)
  5540. fp["d#{m}"].z = targetsprite.z + 1
  5541. fp["d#{m}"].opacity = 0
  5542. fp["d#{m}"].angle = rand(360)
  5543. end
  5544. for m in 0...12
  5545. fp["s#{m}"] = Sprite.new(targetsprite.viewport)
  5546. fp["s#{m}"].bitmap = pbBitmap("Graphics/Animations/eb523_2")
  5547. fp["s#{m}"].src_rect.set(80,0,80,78)
  5548. fp["s#{m}"].ox = fp["s#{m}"].src_rect.width/2
  5549. fp["s#{m}"].oy = fp["s#{m}"].src_rect.height/2
  5550. r = 32*factor
  5551. fp["s#{m}"].x = fp["d#{m}"].x
  5552. fp["s#{m}"].y = fp["d#{m}"].y
  5553. fp["s#{m}"].z = targetsprite.z + 1
  5554. fp["s#{m}"].opacity = 0
  5555. fp["s#{m}"].angle = fp["d#{m}"].angle
  5556. end
  5557. pbSEPlay("eb_iron4",100)
  5558. for i in 0...48
  5559. k = (i-16)/4
  5560. pbSEPlay("eb_psychic4",80-20*k) if i >= 16 && i%4==0 && i < 28
  5561. for j in 0...16
  5562. next if j>(i/2)
  5563. t = fp["i#{j}"].tone.red
  5564. t += 32 if i%4==0
  5565. t = 0 if t > 96
  5566. fp["i#{j}"].tone = Tone.new(t,t,t)
  5567. fp["i#{j}"].opacity += 16
  5568. fp["i#{j}"].angle += dx[j]
  5569. end
  5570. wait(1)
  5571. end
  5572. for i in 0...64
  5573. pbSEPlay("eb_normal1",80) if i >= 2 && i%4==0 && i < 26
  5574. for j in 0...16
  5575. next if j>(i)
  5576. fp["i#{j}"].x += (cx - fp["i#{j}"].x)*0.5
  5577. fp["i#{j}"].y += (cy - fp["i#{j}"].y)*0.5
  5578. fp["i#{j}"].angle += dx[j]
  5579. fp["i#{j}"].visible = (cx - fp["i#{j}"].x)*0.5 >= 1
  5580. end
  5581. for m in 0...12
  5582. next if i < 6
  5583. next if m>(i-6)/2
  5584. fp["d#{m}"].opacity += 32*(fp["d#{m}"].zoom_x < 1.5 ? 1 : -1)
  5585. fp["d#{m}"].zoom_x += 0.05
  5586. fp["d#{m}"].zoom_y += 0.05
  5587. fp["d#{m}"].angle += 4
  5588. fp["s#{m}"].opacity += 32*(fp["s#{m}"].zoom_x < 1.5 ? 1 : -1)
  5589. fp["s#{m}"].zoom_x += 0.05
  5590. fp["s#{m}"].zoom_y += 0.05
  5591. fp["s#{m}"].angle += 4
  5592. end
  5593. targetsprite.still
  5594. wait(1)
  5595. end
  5596. pbDisposeSpriteHash(fp)
  5597. @vector.set(defaultvector) if !multihit
  5598. return true
  5599. end
  5600. #-----------------------------------------------------------------------------
  5601. # Metal Claw
  5602. #-----------------------------------------------------------------------------
  5603. def pbMoveAnimationSpecific525(userindex,targetindex,hitnum=0,multihit=false)
  5604. # inital configuration
  5605. usersprite = @sprites["pokemon#{userindex}"]
  5606. targetsprite = @sprites["pokemon#{targetindex}"]
  5607. player = (targetindex%2==0)
  5608. player2 = (userindex%2==0)
  5609. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  5610. vector = getRealVector(targetindex,player)
  5611. vector2 = getRealVector(userindex,player2)
  5612. # set up animation
  5613. fp = {}
  5614. speed = []
  5615. usersprite.color = Color.new(255,0,0,0)
  5616. # start animation
  5617. @vector.set(vector2)
  5618. @vector.inc = 0.1
  5619. oy = usersprite.oy
  5620. k = -1
  5621. usersprite.oy = oy
  5622. @vector.set(vector)
  5623. @vector.inc = 0.2
  5624. wait(16,true)
  5625. cx, cy = getCenter(targetsprite,true)
  5626. fp["claw1"] = Sprite.new(targetsprite.viewport)
  5627. fp["claw1"].bitmap = pbBitmap("Graphics/Animations/eb057_3")
  5628. fp["claw1"].src_rect.set(-82,0,82,174)
  5629. fp["claw1"].ox = fp["claw1"].src_rect.width
  5630. fp["claw1"].oy = fp["claw1"].src_rect.height/2
  5631. fp["claw1"].x = cx - 32*targetsprite.zoom_x
  5632. fp["claw1"].y = cy
  5633. fp["claw1"].z = player ? 29 : 19
  5634. fp["claw2"] = Sprite.new(targetsprite.viewport)
  5635. fp["claw2"].bitmap = pbBitmap("Graphics/Animations/eb057_3")
  5636. fp["claw2"].src_rect.set(-82,0,82,174)
  5637. fp["claw2"].ox = 0
  5638. fp["claw2"].oy = fp["claw2"].src_rect.height/2
  5639. fp["claw2"].x = cx + 32*targetsprite.zoom_x
  5640. fp["claw2"].y = cy
  5641. fp["claw2"].z = player ? 29 : 19
  5642. fp["claw2"].mirror = true
  5643. shake = 4
  5644. for i in 0...32
  5645. targetsprite.still
  5646. # note: replace SE
  5647. pbSEPlay("eb_iron5") if i == 4 || i == 16
  5648. for j in 1..2
  5649. next if (j-1)>(i/12)
  5650. fp["claw#{j}"].src_rect.x += 82 if fp["claw#{j}"].src_rect.x < 82*3 && i%2==0
  5651. end
  5652. fp["claw1"].visible = false if i == 16
  5653. fp["claw2"].visible = false if i == 32
  5654. if i.between?(4,12) || i.between?(20,28)
  5655. targetsprite.addOx(shake)
  5656. shake = -4 if targetsprite.ox > targetsprite.bitmap.width/2 + 2
  5657. shake = 4 if targetsprite.ox < targetsprite.bitmap.width/2 - 2
  5658. end
  5659. wait(1,true)
  5660. end
  5661. targetsprite.ox = targetsprite.bitmap.width/2
  5662. @vector.set(defaultvector) if !multihit
  5663. pbDisposeSpriteHash(fp)
  5664. return true
  5665. end
  5666. #-----------------------------------------------------------------------------
  5667. # Hydro Pump
  5668. #-----------------------------------------------------------------------------
  5669. def pbMoveAnimationSpecific536(userindex,targetindex,hitnum=0,multihit=false)
  5670. # inital configuration
  5671. usersprite = @sprites["pokemon#{userindex}"]
  5672. targetsprite = @sprites["pokemon#{targetindex}"]
  5673. player = (targetindex%2==0)
  5674. player2 = (userindex%2==0)
  5675. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  5676. vector = getRealVector(targetindex,player)
  5677. vector2 = getRealVector(userindex,player2)
  5678. factor = player ? 2 : 1
  5679. # set up animation
  5680. fp = {}
  5681. rndx = [[],[]]
  5682. rndy = [[],[]]
  5683. dx = [[],[]]
  5684. dy = [[],[]]
  5685. fp["bg"] = ScrollingSprite.new(targetsprite.viewport)
  5686. fp["bg"].speed = 64
  5687. fp["bg"].setBitmap("Graphics/Animations/eb536_bg")
  5688. fp["bg"].color = Color.new(0,0,0,255)
  5689. fp["bg"].opacity = 0
  5690. string = ["eb536_2","eb536"]
  5691. rop = [255,80,40,135]
  5692. px = []
  5693. py = []
  5694. for i in 0...12
  5695. fp["p#{i}"] = Sprite.new(targetsprite.viewport)
  5696. fp["p#{i}"].bitmap = Bitmap.new(16,16)
  5697. fp["p#{i}"].bitmap.drawCircle
  5698. fp["p#{i}"].ox = 8
  5699. fp["p#{i}"].oy = 8
  5700. fp["p#{i}"].opacity = 0
  5701. fp["p#{i}"].z = targetsprite.z
  5702. px.push(0)
  5703. py.push(0)
  5704. end
  5705. for m in 0...2
  5706. for i in 0...20
  5707. fp["#{i}#{m}"] = Sprite.new(targetsprite.viewport)
  5708. bmp = pbBitmap("Graphics/Animations/"+string[m])
  5709. fp["#{i}#{m}"].bitmap = Bitmap.new(bmp.width,bmp.height)
  5710. fp["#{i}#{m}"].bitmap.blt(0,0,bmp,Rect.new(0,0,bmp.width,bmp.height),(m==0 ? rop[rand(4)] : 255))
  5711. fp["#{i}#{m}"].ox = fp["#{i}#{m}"].bitmap.width/2
  5712. fp["#{i}#{m}"].oy = fp["#{i}#{m}"].bitmap.height/2
  5713. fp["#{i}#{m}"].opacity = 0
  5714. fp["#{i}#{m}"].z = player ? 29 : 19
  5715. fp["#{i}#{m}"].zoom_x = [0.5,1][m]
  5716. fp["#{i}#{m}"].zoom_y = [0.5,1][m]
  5717. rndx[m].push(rand(16))
  5718. rndy[m].push(rand(16))
  5719. dx[m].push(0)
  5720. dy[m].push(0)
  5721. end
  5722. end
  5723. k = 1
  5724. # start animation
  5725. for i in 0...20
  5726. if i < 10
  5727. fp["bg"].opacity += 25.5
  5728. else
  5729. fp["bg"].color.alpha -= 25.5
  5730. end
  5731. fp["bg"].update
  5732. wait(1,true)
  5733. end
  5734. pbSEPlay("#{SE_EXTRA_PATH}Water3",80)
  5735. wait(4,true)
  5736. for i in 0...96
  5737. pbSEPlay("#{SE_EXTRA_PATH}Water5") if i == 12
  5738. for m in 0...2
  5739. for j in 0...20
  5740. if fp["#{j}#{m}"].opacity == 0
  5741. cx, cy = getCenter(usersprite)
  5742. dx[m][j] = cx - 8*usersprite.zoom_x*0.5 + rndx[m][j]*usersprite.zoom_x*0.5
  5743. dy[m][j] = cy - 8*usersprite.zoom_y*0.5 + rndy[m][j]*usersprite.zoom_y*0.5
  5744. fp["#{j}#{m}"].x = dx[m][j]
  5745. fp["#{j}#{m}"].y = dy[m][j]
  5746. end
  5747. cx, cy = getCenter(targetsprite,true)
  5748. next if j>(i/4)
  5749. x2 = cx - 8*targetsprite.zoom_x*0.5 + rndx[m][j]*targetsprite.zoom_x*0.5
  5750. y2 = cy - 8*targetsprite.zoom_y*0.5 + rndy[m][j]*targetsprite.zoom_y*0.5
  5751. x0 = dx[m][j]
  5752. y0 = dy[m][j]
  5753. fp["#{j}#{m}"].x += (x2 - x0)*0.04*(m+1)
  5754. fp["#{j}#{m}"].y += (y2 - y0)*0.04*(m+1)
  5755. fp["#{j}#{m}"].zoom_x += (1 - fp["#{j}#{m}"].zoom_x)*0.1
  5756. fp["#{j}#{m}"].zoom_y += (1 - fp["#{j}#{m}"].zoom_y)*0.1
  5757. fp["#{j}#{m}"].opacity += 51
  5758. fp["#{j}#{m}"].angle += 8*(m+1)*j
  5759. nextx = fp["#{j}#{m}"].x# + (x2 - x0)*0.1
  5760. nexty = fp["#{j}#{m}"].y# + (y2 - y0)*0.1
  5761. if !player
  5762. fp["#{j}#{m}"].visible = false if nextx > cx && nexty < cy
  5763. else
  5764. fp["#{j}#{m}"].visible = false if nextx < cx && nexty > cy
  5765. end
  5766. end
  5767. end
  5768. for l in 0...12
  5769. next if i < 12
  5770. next if l>((i-12)/4)
  5771. cx, cy = getCenter(targetsprite,true)
  5772. if fp["p#{l}"].opacity <= 0
  5773. fp["p#{l}"].opacity = 255 - rand(101)
  5774. fp["p#{l}"].x = cx
  5775. fp["p#{l}"].y = cy
  5776. r = rand(2)
  5777. fp["p#{l}"].zoom_x = r==0 ? 1 : 0.5
  5778. fp["p#{l}"].zoom_y = r==0 ? 1 : 0.5
  5779. x, y = randCircleCord(128)
  5780. px[l] = cx - 128*targetsprite.zoom_x + x*targetsprite.zoom_x
  5781. py[l] = cy - 128*targetsprite.zoom_y + y*targetsprite.zoom_y
  5782. end
  5783. x2 = px[l]
  5784. y2 = py[l]
  5785. x0 = fp["p#{l}"].x
  5786. y0 = fp["p#{l}"].y
  5787. fp["p#{l}"].x += (x2 - x0)*0.05
  5788. fp["p#{l}"].y += (y2 - y0)*0.05
  5789. fp["p#{l}"].opacity -= 8
  5790. end
  5791. targetsprite.still if i >= 64
  5792. @vector.set(vector) if i == 64
  5793. @vector.inc = 0.1 if i == 64
  5794. fp["bg"].update
  5795. if i < 64
  5796. k*=-1 if i%4==0
  5797. moveEntireScene(0,k*4,true,true)
  5798. end
  5799. pbSEPlay("#{SE_EXTRA_PATH}Water1") if i == 84
  5800. if i.between?(85,90)
  5801. targetsprite.zoom_x += 0.01
  5802. targetsprite.zoom_y -= 0.04
  5803. elsif i.between?(91,96)
  5804. targetsprite.zoom_x -= 0.01
  5805. targetsprite.zoom_y += 0.04
  5806. end
  5807. wait(1,(i>=64 && i<85))
  5808. end
  5809. for j in 0...20; for m in 0...2; fp["#{j}#{m}"].visible = false; end; end
  5810. for l in 0...12; fp["p#{l}"].visible = false; end
  5811. for i in 0...20
  5812. targetsprite.still
  5813. if i < 10
  5814. fp["bg"].color.alpha += 25.5
  5815. else
  5816. fp["bg"].opacity -= 25.5
  5817. end
  5818. fp["bg"].update
  5819. wait(1)
  5820. end
  5821. @vector.set(defaultvector) if !multihit
  5822. @vector.inc = 0.2
  5823. pbDisposeSpriteHash(fp)
  5824. return true
  5825. end
  5826. #-----------------------------------------------------------------------------
  5827. # Crabhammer
  5828. #-----------------------------------------------------------------------------
  5829. def pbMoveAnimationSpecific540(userindex,targetindex,hitnum=0,multihit=false)
  5830. # inital configuration
  5831. usersprite = @sprites["pokemon#{userindex}"]
  5832. targetsprite = @sprites["pokemon#{targetindex}"]
  5833. player = (targetindex%2==0)
  5834. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  5835. vector = getRealVector(targetindex,player)
  5836. # set up animation
  5837. fp = {}
  5838. fp["bg"] = Sprite.new(targetsprite.viewport)
  5839. fp["bg"].bitmap = Bitmap.new(targetsprite.viewport.rect.width,targetsprite.viewport.rect.height)
  5840. fp["bg"].bitmap.fill_rect(0,0,fp["bg"].bitmap.width,fp["bg"].bitmap.height,Color.new(57,106,173))
  5841. fp["bg"].opacity = 0
  5842. @vector.set(vector)
  5843. 16.times do
  5844. fp["bg"].opacity += 8
  5845. wait(1,true)
  5846. end
  5847. fp["hammer1"] = Sprite.new(targetsprite.viewport)
  5848. fp["hammer1"].bitmap = pbBitmap("Graphics/Animations/eb540_2")
  5849. fp["hammer1"].ox = fp["hammer1"].bitmap.width/2
  5850. fp["hammer1"].oy = fp["hammer1"].bitmap.height
  5851. fp["hammer1"].z = targetsprite.z + 1
  5852. fp["hammer1"].x = targetsprite.x
  5853. fp["hammer2"] = Sprite.new(targetsprite.viewport)
  5854. fp["hammer2"].bitmap = pbBitmap("Graphics/Animations/eb540_3")
  5855. fp["hammer2"].ox = fp["hammer2"].bitmap.width/2
  5856. fp["hammer2"].oy = fp["hammer2"].bitmap.height - 24
  5857. fp["hammer2"].z = targetsprite.z + 1
  5858. fp["hammer2"].x = targetsprite.x
  5859. fp["frame"] = Sprite.new(targetsprite.viewport)
  5860. fp["frame"].z = targetsprite.z + 2
  5861. fp["frame"].bitmap = pbBitmap("Graphics/Animations/eb540")
  5862. fp["frame"].src_rect.set(0,0,64,64)
  5863. fp["frame"].ox = 32
  5864. fp["frame"].oy = 32
  5865. fp["frame"].zoom_x = 0.5*targetsprite.zoom_x
  5866. fp["frame"].zoom_y = 0.5*targetsprite.zoom_y
  5867. fp["frame"].x, fp["frame"].y = getCenter(targetsprite,true)
  5868. fp["frame"].opacity = 0
  5869. fp["frame"].tone = Tone.new(255,255,255)
  5870. px = []
  5871. py = []
  5872. for i in 0...24
  5873. fp["p#{i}"] = Sprite.new(targetsprite.viewport)
  5874. fp["p#{i}"].bitmap = Bitmap.new(16,16)
  5875. fp["p#{i}"].bitmap.drawCircle
  5876. fp["p#{i}"].ox = 8
  5877. fp["p#{i}"].oy = 8
  5878. fp["p#{i}"].opacity = 0
  5879. fp["p#{i}"].z = targetsprite.z
  5880. px.push(0)
  5881. py.push(0)
  5882. end
  5883. pbSEPlay("#{SE_EXTRA_PATH}Water1",80)
  5884. for i in 0...64
  5885. fp["hammer1"].y += targetsprite.y/8.0
  5886. fp["hammer1"].visible = fp["hammer1"].y < targetsprite.y
  5887. if i >= 2
  5888. fp["hammer2"].y += targetsprite.y/8.0
  5889. fp["hammer2"].visible = fp["hammer2"].y < targetsprite.y
  5890. end
  5891. pbSEPlay("eb_normal1",80) if i == 11
  5892. if i.between?(11,15)
  5893. targetsprite.still
  5894. targetsprite.zoom_y-=0.05*targetsprite.zoom_y
  5895. targetsprite.toneAll(-12.8)
  5896. fp["frame"].zoom_x += 0.1*targetsprite.zoom_x
  5897. fp["frame"].zoom_y += 0.1*targetsprite.zoom_y
  5898. fp["frame"].opacity += 51
  5899. end
  5900. fp["frame"].tone = Tone.new(0,0,0) if i == 16
  5901. if i.between?(16,20)
  5902. targetsprite.still
  5903. targetsprite.zoom_y+=0.05*targetsprite.zoom_y
  5904. targetsprite.toneAll(+12.8)
  5905. fp["frame"].angle += 2
  5906. end
  5907. fp["p#{i}"].src_rect.x = 64 if i == 10
  5908. if i >= 20
  5909. fp["frame"].opacity -= 25.5
  5910. fp["frame"].zoom_x += 0.1*targetsprite.zoom_x
  5911. fp["frame"].zoom_y += 0.1*targetsprite.zoom_y
  5912. fp["frame"].angle += 2
  5913. end
  5914. for l in 0...24
  5915. next if i < 10
  5916. next if l>((i-10)*8)
  5917. cx, cy = getCenter(targetsprite,true)
  5918. if fp["p#{l}"].opacity <= 0 && fp["p#{l}"].tone.blue <= 0
  5919. fp["p#{l}"].opacity = 255 - rand(101)
  5920. fp["p#{l}"].x = cx
  5921. fp["p#{l}"].y = cy
  5922. r = rand(2)
  5923. fp["p#{l}"].zoom_x = r==0 ? 1 : 0.5
  5924. fp["p#{l}"].zoom_y = r==0 ? 1 : 0.5
  5925. x = rand(128); y = rand(128)
  5926. px[l] = cx - 64*targetsprite.zoom_x + x*targetsprite.zoom_x
  5927. py[l] = cy - 64*targetsprite.zoom_y + y*targetsprite.zoom_y
  5928. end
  5929. x2 = px[l]
  5930. y2 = py[l]
  5931. x0 = fp["p#{l}"].x
  5932. y0 = fp["p#{l}"].y
  5933. fp["p#{l}"].x += (x2 - x0)*0.1
  5934. fp["p#{l}"].y += (y2 - y0)*0.1
  5935. fp["p#{l}"].opacity -= 8
  5936. fp["p#{l}"].tone.blue = 1 if fp["p#{l}"].opacity <= 0
  5937. end
  5938. fp["bg"].opacity -= 8 if i >= 48
  5939. wait(1)
  5940. end
  5941. @vector.set(defaultvector) if !multihit
  5942. pbDisposeSpriteHash(fp)
  5943. return true
  5944. end
  5945. #-----------------------------------------------------------------------------
  5946. # Water Gun
  5947. #-----------------------------------------------------------------------------
  5948. def pbMoveAnimationSpecific551(userindex,targetindex,hitnum=0,multihit=false)
  5949. # inital configuration
  5950. usersprite = @sprites["pokemon#{userindex}"]
  5951. targetsprite = @sprites["pokemon#{targetindex}"]
  5952. player = (targetindex%2==0)
  5953. player2 = (userindex%2==0)
  5954. defaultvector = @battle.doublebattle ? VECTOR2 : VECTOR1
  5955. vector = getRealVector(targetindex,player)
  5956. factor = player ? 1.2 : 0.8
  5957. # set up animation
  5958. fp = {}
  5959. rndx = []
  5960. rndy = []
  5961. dx = []
  5962. dy = []
  5963. px = []
  5964. py = []
  5965. rangl = []
  5966. for i in 0...12
  5967. fp["p#{i}"] = Sprite.new(targetsprite.viewport)
  5968. fp["p#{i}"].bitmap = Bitmap.new(16,16)
  5969. fp["p#{i}"].bitmap.drawCircle
  5970. fp["p#{i}"].ox = 8
  5971. fp["p#{i}"].oy = 8
  5972. fp["p#{i}"].opacity = 0
  5973. fp["p#{i}"].z = targetsprite.z
  5974. px.push(0)
  5975. py.push(0)
  5976. end
  5977. for k in 0...64
  5978. i = 63-k
  5979. fp["#{i}"] = Sprite.new(targetsprite.viewport)
  5980. bmp = pbBitmap("Graphics/Animations/eb551")
  5981. fp["#{i}"].bitmap = Bitmap.new(bmp.width,bmp.height)
  5982. fp["#{i}"].bitmap.blt(0,0,bmp,Rect.new(0,0,bmp.width,bmp.height))
  5983. fp["#{i}"].ox = fp["#{i}"].bitmap.width/2
  5984. fp["#{i}"].oy = fp["#{i}"].bitmap.height/2
  5985. fp["#{i}"].opacity = 0
  5986. fp["#{i}"].z = player ? 29 : 19
  5987. fp["#{i}"].color = Color.new(248,248,248,200)
  5988. rndx.push(rand(16))
  5989. rndy.push(rand(16))
  5990. rangl.push(rand(2))
  5991. dx.push(0)
  5992. dy.push(0)
  5993. end
  5994. for i in 0...64
  5995. pbSEPlay("eb_water1",60) if i%4==0 && i < 48
  5996. for j in 0...64
  5997. if fp["#{j}"].opacity == 0
  5998. cx, cy = getCenter(usersprite)
  5999. dx[j] = cx - 8*usersprite.zoom_x*0.5 + rndx[j]*usersprite.zoom_x*0.5
  6000. dy[j] = cy - 8*usersprite.zoom_y*0.5 + rndy[j]*usersprite.zoom_y*0.5
  6001. fp["#{j}"].x = dx[j]
  6002. fp["#{j}"].y = dy[j]
  6003. fp["#{j}"].zoom_x = 0.8#(!player ? 1.2 : 0.8)#usersprite.zoom_x
  6004. fp["#{j}"].zoom_y = 0.8#(!player ? 1.2 : 0.8)#usersprite.zoom_y
  6005. fp["#{j}"].opacity = 128 if !(j>i*2)
  6006. end
  6007. cx, cy = getCenter(targetsprite,true)
  6008. next if j>(i*2)
  6009. x2 = cx - 8*targetsprite.zoom_x*0.5 + rndx[j]*targetsprite.zoom_x*0.5
  6010. y2 = cy - 8*targetsprite.zoom_y*0.5 + rndy[j]*targetsprite.zoom_y*0.5
  6011. x0 = dx[j]
  6012. y0 = dy[j]
  6013. fp["#{j}"].x += (x2 - x0)*0.1
  6014. fp["#{j}"].y += (y2 - y0)*0.1
  6015. fp["#{j}"].zoom_x += 0.04#(factor - fp["#{j}"].zoom_x)*0.2
  6016. fp["#{j}"].zoom_y += 0.04#(factor - fp["#{j}"].zoom_y)*0.2
  6017. fp["#{j}"].opacity += 32
  6018. fp["#{j}"].angle += 8*(rangl[j]==0 ? -1 : 1)
  6019. fp["#{j}"].color.alpha -= 5 if fp["#{j}"].color.alpha > 0
  6020. nextx = fp["#{j}"].x# + (x2 - x0)*0.1
  6021. nexty = fp["#{j}"].y# + (y2 - y0)*0.1
  6022. if !player
  6023. fp["#{j}"].visible = false if nextx > cx && nexty < cy
  6024. else
  6025. fp["#{j}"].visible = false if nextx < cx && nexty > cy
  6026. end
  6027. end
  6028. for l in 0...12
  6029. next if i < 2
  6030. next if l>((i-6)/4)
  6031. cx, cy = getCenter(targetsprite,true)
  6032. if fp["p#{l}"].opacity <= 0 && i < 48
  6033. fp["p#{l}"].opacity = 255 - rand(101)
  6034. fp["p#{l}"].x = cx
  6035. fp["p#{l}"].y = cy
  6036. r = rand(2)
  6037. fp["p#{l}"].zoom_x = r==0 ? 1 : 0.5
  6038. fp["p#{l}"].zoom_y = r==0 ? 1 : 0.5
  6039. x, y = randCircleCord(96)
  6040. px[l] = cx - 48*targetsprite.zoom_x + x*targetsprite.zoom_x
  6041. py[l] = cy - 48*targetsprite.zoom_y + y*targetsprite.zoom_y
  6042. end
  6043. x2 = px[l]
  6044. y2 = py[l]
  6045. x0 = fp["p#{l}"].x
  6046. y0 = fp["p#{l}"].y
  6047. fp["p#{l}"].x += (x2 - x0)*0.05
  6048. fp["p#{l}"].y += (y2 - y0)*0.05
  6049. fp["p#{l}"].opacity -= 8
  6050. end
  6051. targetsprite.still if i >= 64
  6052. @vector.set(DUALVECTOR) if i == 0
  6053. @vector.inc = 0.1 if i == 64
  6054. wait(1,true)
  6055. end
  6056. for j in 0...48; fp["#{j}"].visible = false; end
  6057. for l in 0...12; fp["p#{l}"].visible = false; end
  6058. @vector.set(defaultvector) if !multihit
  6059. @vector.inc = 0.2
  6060. pbDisposeSpriteHash(fp)
  6061. return true
  6062. end
  6063. #-----------------------------------------------------------------------------
  6064. end
  6065. #===============================================================================
  6066. # Global move animation selector
  6067. #===============================================================================
  6068. # types = [normal, fighting, flying, poison, ground, rock, bug, ghost, steel, ???, fire, water, grass, electric, psychic, ice, dragon, dark, fairy]
  6069. # Move IDs for global animations
  6070. EBMOVE_PHYS = [303,86,164,430,223,504,8,176,520,"???",129,540,208,64,458,244,57,27,"fairy"]
  6071. EBMOVE_SPEC = [263,93,159,430,224,504,10,175,519,"???",136,551,191,69,452,243,59,27,"fairy"]
  6072. EBMOVE_STAT = ["normal","fighting","flying","poison","ground","rock","bug","ghost","steel","???","fire","water","grass","electric","psychic","ice","dragon","dark","fairy"]
  6073. EBMOVE_AOPP = ["normal","fighting","flying","poison","ground",504,"bug","ghost","steel","???",132,"water","grass","electric","psychic",250,"dragon","dark","fairy"]
  6074. EBMOVE_ANON = ["normal","fighting","flying","poison",223,"rock","bug","ghost","steel","???","fire","water","grass","electric","psychic","ice","dragon","dark","fairy"]
  6075. EBMOVE_MHIT = ["normal","fighting",164,430,"ground","rock",8,176,520,"???",140,540,208,72,"psychic",248,"dragon","dark","fairy"]
  6076. class PokeBattle_Scene
  6077. def playGlobalMoveAnimation(type,userindex,targetindex,multitarget,multihit=false,category=0,hitnum=0)
  6078. anm = "pbMoveAnimationSpecific"+sprintf("%03d",id)
  6079. id = nil
  6080. id = EBMOVE_AOPP[type] if id.nil? && multitarget == PBTargets::AllOpposing
  6081. id = EBMOVE_ANON[type] if id.nil? && multitarget == PBTargets::AllNonUsers
  6082. id = EBMOVE_MHIT[type] if id.nil? && multihit
  6083. id = EBMOVE_PHYS[type] if id.nil? && category == 0
  6084. id = EBMOVE_SPEC[type] if id.nil? && category == 1
  6085. id = EBMOVE_STAT[type] if id.nil? && category == 2
  6086. return false if id.is_a?(String)
  6087. return false if hitnum > 0
  6088. if !id.nil?
  6089. anm = "pbMoveAnimationSpecific"+sprintf("%03d",id)
  6090. if eval("defined?(#{anm})")
  6091. return eval("#{anm}(#{userindex},#{targetindex},0,#{multihit})")
  6092. end
  6093. end
  6094. return false
  6095. end
  6096. end
RAW Paste Data