Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.60 KB | None | 0 0
  1. class MoveSelectionSprite < SpriteWrapper
  2. attr_reader :preselected
  3. attr_reader :index
  4.  
  5. def initialize(viewport=nil,fifthmove=false)
  6. super(viewport)
  7. @movesel=AnimatedBitmap.new("Graphics/Pictures/summarymovesel")
  8. @frame=0
  9. @index=0
  10. @fifthmove=fifthmove
  11. @preselected=false
  12. @updating=false
  13. @spriteVisible=true
  14. refresh
  15. end
  16.  
  17. def dispose
  18. @movesel.dispose
  19. super
  20. end
  21.  
  22. def index=(value)
  23. @index=value
  24. refresh
  25. end
  26.  
  27. def preselected=(value)
  28. @preselected=value
  29. refresh
  30. end
  31.  
  32. def visible=(value)
  33. super
  34. @spriteVisible=value if !@updating
  35. end
  36.  
  37. def refresh
  38. w=@movesel.width
  39. h=@movesel.height/2
  40. self.x=240
  41. self.y=92+(self.index*64)
  42. self.y-=76 if @fifthmove
  43. self.y+=20 if @fifthmove && self.index==4
  44. self.bitmap=@movesel.bitmap
  45. if self.preselected
  46. self.src_rect.set(0,h,w,h)
  47. else
  48. self.src_rect.set(0,0,w,h)
  49. end
  50. end
  51.  
  52. def update
  53. @updating=true
  54. super
  55. @movesel.update
  56. @updating=false
  57. refresh
  58. end
  59. end
  60.  
  61.  
  62.  
  63. class PokemonSummaryScene
  64. def pbPokerus(pkmn)
  65. return pkmn.pokerusStage
  66. end
  67.  
  68. def pbUpdate
  69. pbUpdateSpriteHash(@sprites)
  70. end
  71.  
  72. def pbStartScene(party,partyindex)
  73. @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
  74. @viewport.z=99999
  75. @party=party
  76. @partyindex=partyindex
  77. @pokemon=@party[@partyindex]
  78. @sprites={}
  79. @typebitmap=AnimatedBitmap.new(_INTL("Graphics/Pictures/types"))
  80. @sprites["background"]=IconSprite.new(0,0,@viewport)
  81. @sprites["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
  82. @sprites["pokemon"]=PokemonSprite.new(@viewport)
  83. @sprites["pokemon"].setPokemonBitmap(@pokemon)
  84. @sprites["pokemon"].mirror=true
  85. @sprites["pokemon"].color=Color.new(0,0,0,0)
  86. pbPositionPokemonSprite(@sprites["pokemon"],22,90)
  87. @sprites["pokeicon"]=PokemonBoxIcon.new(@pokemon,@viewport)
  88. @sprites["pokeicon"].x=14
  89. @sprites["pokeicon"].y=52
  90. @sprites["pokeicon"].mirror=false
  91. @sprites["pokeicon"].visible=false
  92. @sprites["movepresel"]=MoveSelectionSprite.new(@viewport)
  93. @sprites["movepresel"].visible=false
  94. @sprites["movepresel"].preselected=true
  95. @sprites["movesel"]=MoveSelectionSprite.new(@viewport)
  96. @sprites["movesel"].visible=false
  97. @page=0
  98. drawPageOne(@pokemon)
  99. pbFadeInAndShow(@sprites) { pbUpdate }
  100. end
  101.  
  102. def pbStartForgetScene(party,partyindex,moveToLearn)
  103. @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
  104. @viewport.z=99999
  105. @party=party
  106. @partyindex=partyindex
  107. @pokemon=@party[@partyindex]
  108. @sprites={}
  109. @page=3
  110. @typebitmap=AnimatedBitmap.new(_INTL("Graphics/Pictures/types"))
  111. @sprites["background"]=IconSprite.new(0,0,@viewport)
  112. @sprites["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
  113. @sprites["pokeicon"]=PokemonBoxIcon.new(@pokemon,@viewport)
  114. @sprites["pokeicon"].x=14
  115. @sprites["pokeicon"].y=52
  116. @sprites["pokeicon"].mirror=false
  117. @sprites["movesel"]=MoveSelectionSprite.new(@viewport,moveToLearn>0)
  118. @sprites["movesel"].visible=false
  119. @sprites["movesel"].visible=true
  120. @sprites["movesel"].index=0
  121. drawSelectedMove(@pokemon,moveToLearn,@pokemon.moves[0].id)
  122. pbFadeInAndShow(@sprites)
  123. end
  124.  
  125. def pbEndScene
  126. pbFadeOutAndHide(@sprites) { pbUpdate }
  127. pbDisposeSpriteHash(@sprites)
  128. @typebitmap.dispose
  129. @viewport.dispose
  130. end
  131.  
  132. def drawMarkings(bitmap,x,y,width,height,markings)
  133. totaltext=""
  134. oldfontname=bitmap.font.name
  135. oldfontsize=bitmap.font.size
  136. oldfontcolor=bitmap.font.color
  137. bitmap.font.size=24
  138. bitmap.font.name="Arial"
  139. PokemonStorage::MARKINGCHARS.each{|item| totaltext+=item }
  140. totalsize=bitmap.text_size(totaltext)
  141. realX=x+(width/2)-(totalsize.width/2)
  142. realY=y+(height/2)-(totalsize.height/2)
  143. i=0
  144. PokemonStorage::MARKINGCHARS.each{|item|
  145. marked=(markings&(1<<i))!=0
  146. bitmap.font.color=(marked) ? Color.new(72,64,56) : Color.new(184,184,160)
  147. itemwidth=bitmap.text_size(item).width
  148. bitmap.draw_text(realX,realY,itemwidth+2,totalsize.height,item)
  149. realX+=itemwidth
  150. i+=1
  151. }
  152. bitmap.font.name=oldfontname
  153. bitmap.font.size=oldfontsize
  154. bitmap.font.color=oldfontcolor
  155. end
  156.  
  157. def drawPageOne(pokemon)
  158. if pokemon.isEgg?
  159. drawPageOneEgg(pokemon)
  160. return
  161. end
  162. overlay=@sprites["overlay"].bitmap
  163. overlay.clear
  164. @sprites["background"].setBitmap("Graphics/Pictures/BrassSummary1")
  165. imagepos=[]
  166. if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
  167. status=6 if pbPokerus(pokemon)==1
  168. status=@pokemon.status-1 if @pokemon.status>0
  169. status=5 if pokemon.hp==0
  170. imagepos.push(["Graphics/Pictures/statuses",120,230,0,16*status,44,16])
  171. end
  172. if pokemon.isShiny?
  173. imagepos.push([sprintf("Graphics/Pictures/shiny"),6,76,0,0,-1,-1])
  174. end
  175. if pbPokerus(pokemon)==2
  176. imagepos.push([sprintf("Graphics/Pictures/summaryPokerus"),414,6,0,0,-1,-1])
  177. end
  178. ballused=@pokemon.ballused ? @pokemon.ballused : 0
  179. ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
  180. imagepos.push([ballimage,36,286,0,0,-1,-1])
  181. pbDrawImagePositions(overlay,imagepos)
  182. base=Color.new(0,0,0)
  183. shadow=Color.new(104,104,104)
  184. white=Color.new(248,248,248)
  185. green=Color.new(173,255,255) #its not green anymore
  186. pbSetSystemFont(overlay)
  187. # TO BE CHANGED IN THE FUTURE, currently affects nothing
  188. # (replaced with the colours above)
  189. numberbase=(pokemon.isShiny?) ? Color.new(248,56,32) : Color.new(64,64,64)
  190. numbershadow=(pokemon.isShiny?) ? Color.new(224,152,144) : Color.new(176,176,176)
  191. #
  192. publicID=pokemon.publicID
  193. speciesname=PBSpecies.getName(pokemon.species)
  194. growthrate=pokemon.growthrate
  195. startexp=PBExperience.pbGetStartExperience(pokemon.level,growthrate)
  196. endexp=PBExperience.pbGetStartExperience(pokemon.level+1,growthrate)
  197. pokename=@pokemon.name
  198. # Left side of the Summary Screen
  199. # Colours are base, white
  200. # To center text on this side, make sure X is 84 and the third numb is 2
  201. textpos=[
  202. [_INTL("INFO"),84,2,2,base,white],
  203. [pokename,84,34,2,base,white],
  204. [_INTL("Lv {1}",pokemon.level.to_s),74,286,0,base,white]]
  205. if pokemon.hasItem?
  206. textpos.push([PBItems.getName(pokemon.item),84,254,2,base,white])
  207. else
  208. textpos.push([_INTL("NONE"),62,254,0,base,white])
  209. end
  210. if pokemon.isMale?
  211. textpos.push([_INTL("♂"),6,222,0,Color.new(120,96,240),Color.new(248,248,248)])
  212. elsif pokemon.isFemale?
  213. textpos.push([_INTL("♀"),6,222,0,Color.new(248,56,8),Color.new(248,248,248)])
  214. end
  215. pbDrawTextPositions(overlay,textpos)
  216. # Rest of page one
  217. # Colours are base, green
  218. textpos=[
  219. [_ISPRINTF("Dex No."),228,36,2,base,green],
  220. [sprintf("%03d",pokemon.species),400,36,2,base,green],
  221. [_INTL("Species"),228,70,2,base,green],
  222. [speciesname,400,70,2,base,green],
  223. [_INTL("Type"),228,104,2,base,green],
  224. [_INTL("OT"),228,138,2,base,green],
  225. [_INTL("ID No."),228,170,2,base,green],
  226. ]
  227. textpos.push([_INTL("EXP."),228,254,2,base,green])
  228. textpos.push([sprintf("%d",pokemon.exp),400,254,2,base,green])
  229. textpos.push([_INTL("TO NEXT"),228,288,2,base,green])
  230. textpos.push([sprintf("%d",endexp-pokemon.exp),400,288,2,base,green])
  231. idno=(pokemon.ot=="") ? "?????" : sprintf("%05d",publicID)
  232. textpos.push([idno,402,170,2,base,green])
  233. if pokemon.ot==""
  234. textpos.push([_INTL("RENTAL"),402,138,2,Color.new(64,64,64),Color.new(176,176,176)])
  235. else
  236. textpos.push([pokemon.ot,402,138,2,base,green])
  237. end
  238. pbDrawTextPositions(overlay,textpos)
  239. drawMarkings(overlay,440,4,72,20,pokemon.markings)
  240. type1rect=Rect.new(0,pokemon.type1*28,64,28)
  241. type2rect=Rect.new(0,pokemon.type2*28,64,28)
  242. if pokemon.type1==pokemon.type2
  243. overlay.blt(368,104,@typebitmap.bitmap,type1rect)
  244. else
  245. overlay.blt(336,104,@typebitmap.bitmap,type1rect)
  246. overlay.blt(400,104,@typebitmap.bitmap,type2rect)
  247. end
  248. if pokemon.level<PBExperience::MAXLEVEL
  249. overlay.fill_rect(312,230,(pokemon.exp-startexp)*174/(endexp-startexp),6,Color.new(32,136,248))
  250. end
  251. end
  252.  
  253. def drawPageOneEgg(pokemon)
  254. overlay=@sprites["overlay"].bitmap
  255. overlay.clear
  256. @sprites["background"].setBitmap("Graphics/Pictures/BrassSummary1")
  257. imagepos=[]
  258. if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
  259. status=6 if pbPokerus(pokemon)==1
  260. status=@pokemon.status-1 if @pokemon.status>0
  261. status=5 if pokemon.hp==0
  262. imagepos.push(["Graphics/Pictures/statuses",120,230,0,16*status,44,16])
  263. end
  264. if pokemon.isShiny?
  265. imagepos.push([sprintf("Graphics/Pictures/shiny"),6,76,0,0,-1,-1])
  266. end
  267. if pbPokerus(pokemon)==2
  268. imagepos.push([sprintf("Graphics/Pictures/summaryPokerus"),414,6,0,0,-1,-1])
  269. end
  270. ballused=@pokemon.ballused ? @pokemon.ballused : 0
  271. ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
  272. imagepos.push([ballimage,36,286,0,0,-1,-1])
  273. pbDrawImagePositions(overlay,imagepos)
  274. base=Color.new(0,0,0)
  275. shadow=Color.new(104,104,104)
  276. white=Color.new(248,248,248)
  277. green=Color.new(136,248,104)
  278. pbSetSystemFont(overlay)
  279. textpos=[
  280. [_INTL("INFO"),84,2,2,base,white],
  281. [pokename,84,34,2,base,white],
  282. [_INTL("EGG"),74,286,0,base,white]]
  283. if pokemon.hasItem?
  284. textpos.push([PBItems.getName(pokemon.item),84,254,2,base,white])
  285. else
  286. textpos.push([_INTL(""),62,254,0,base,white])
  287. end
  288. pbDrawTextPositions(overlay,textpos)
  289. memo=""
  290. if pokemon.timeReceived
  291. month=pbGetAbbrevMonthName(pokemon.timeReceived.mon)
  292. date=pokemon.timeReceived.day
  293. year=pokemon.timeReceived.year
  294. memo+=_INTL("<c3=404040,efe4b0>{1} {2}, {3}\n",month,date,year)
  295. end
  296. mapname=pbGetMapNameFromId(pokemon.obtainMap)
  297. if (pokemon.obtainText rescue false) && pokemon.obtainText!=""
  298. mapname=pokemon.obtainText
  299. end
  300. if mapname && mapname!=""
  301. memo+=_INTL("<c3=404040,efe4b0>A mysterious Pokémon Egg received from <c3=F83820,E09890>{1}<c3=404040,B0B0B0>.\n",mapname)
  302. end
  303. memo+="<c3=404040,efe4b0>\n"
  304. memo+=_INTL("<c3=404040,efe4b0>\"The Egg Watch\"\n")
  305. eggstate=_INTL("It looks like this Egg will take a long time to hatch.")
  306. eggstate=_INTL("What will hatch from this? It doesn't seem close to hatching.") if pokemon.eggsteps<10200
  307. eggstate=_INTL("It appears to move occasionally. It may be close to hatching.") if pokemon.eggsteps<2550
  308. eggstate=_INTL("Sounds can be heard coming from inside! It will hatch soon!") if pokemon.eggsteps<1275
  309. memo+=sprintf("<c3=404040,efe4b0>%s\n",eggstate)
  310. drawFormattedTextEx(overlay,232,78,276,memo)
  311. drawMarkings(overlay,440,4,72,20,pokemon.markings)
  312. end
  313.  
  314. def drawPageTwo(pokemon)
  315. overlay=@sprites["overlay"].bitmap
  316. overlay.clear
  317. @sprites["background"].setBitmap("Graphics/Pictures/BrassSummary2")
  318. imagepos=[]
  319. if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
  320. status=6 if pbPokerus(pokemon)==1
  321. status=@pokemon.status-1 if @pokemon.status>0
  322. status=5 if pokemon.hp==0
  323. imagepos.push(["Graphics/Pictures/statuses",120,230,0,16*status,44,16])
  324. end
  325. if pokemon.isShiny?
  326. imagepos.push([sprintf("Graphics/Pictures/shiny"),6,76,0,0,-1,-1])
  327. end
  328. if pbPokerus(pokemon)==2
  329. imagepos.push([sprintf("Graphics/Pictures/summaryPokerus"),414,6,0,0,-1,-1])
  330. end
  331. ballused=@pokemon.ballused ? @pokemon.ballused : 0
  332. ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
  333. imagepos.push([ballimage,36,286,0,0,-1,-1])
  334. pbDrawImagePositions(overlay,imagepos)
  335. base=Color.new(0,0,0)
  336. shadow=Color.new(104,104,104)
  337. white=Color.new(248,248,248)
  338. vanilla=Color.new(255,222,181)
  339. pbSetSystemFont(overlay)
  340. naturename=PBNatures.getName(pokemon.nature)
  341. pokename=@pokemon.name
  342. # Left side of the Summary Screen
  343. # Colours are base, white
  344. # To center text on this side, make sure X is 84 and the third numb is 2
  345. textpos=[
  346. [_INTL("MEMO"),84,2,2,base,white],
  347. [pokename,84,34,2,base,white],
  348. [_INTL("Lv {1}",pokemon.level.to_s),74,286,0,base,white]]
  349. if pokemon.hasItem?
  350. textpos.push([PBItems.getName(pokemon.item),84,254,2,base,white])
  351. else
  352. textpos.push([_INTL("NONE"),62,254,0,base,white])
  353. end
  354. if pokemon.isMale?
  355. textpos.push([_INTL("♂"),6,222,0,Color.new(120,96,240),Color.new(248,248,248)])
  356. elsif pokemon.isFemale?
  357. textpos.push([_INTL("♀"),6,222,0,Color.new(248,56,8),Color.new(248,248,248)])
  358. end
  359. pbDrawTextPositions(overlay,textpos)
  360. ###
  361. # Mess incoming, SORRY
  362. memo=""
  363. shownature=(!(pokemon.isShadow? rescue false)) || pokemon.heartStage<=3
  364. if shownature
  365. textpos=[
  366. [_INTL("{1} nature.",naturename),191,36,0,base,vanilla]]
  367. pbDrawTextPositions(overlay,textpos)
  368. end
  369. if pokemon.timeReceived
  370. month=pbGetAbbrevMonthName(pokemon.timeReceived.mon)
  371. date=pokemon.timeReceived.day
  372. year=pokemon.timeReceived.year
  373. textpos=[
  374. [_INTL("{1} {2}, {3}\n",month,date,year),191,70,0,base,vanilla]]
  375. pbDrawTextPositions(overlay,textpos)
  376. end
  377. mapname=pbGetMapNameFromId(pokemon.obtainMap)
  378. if (pokemon.obtainText rescue false) && pokemon.obtainText!=""
  379. mapname=pokemon.obtainText
  380. end
  381. if mapname && mapname!=""
  382. textpos=[
  383. [_INTL("{1}",mapname),191,104,0,base,vanilla]]
  384. pbDrawTextPositions(overlay,textpos)
  385. else
  386. textpos=[
  387. [_INTL("Faraway place",mapname),191,104,0,base,vanilla]]
  388. pbDrawTextPositions(overlay,textpos)
  389. end
  390. if pokemon.obtainMode
  391. mettext=[_INTL("Met at Lv. {1}.",pokemon.obtainLevel),
  392. _INTL("Egg received."),
  393. _INTL("Traded at Lv. {1}.",pokemon.obtainLevel),
  394. "",
  395. _INTL("Had a fateful encounter at Lv. {1}.",pokemon.obtainLevel)
  396. ][pokemon.obtainMode]
  397. textpos=[
  398. [_INTL("{1}",mettext),191,138,0,base,vanilla]]
  399. pbDrawTextPositions(overlay,textpos)
  400. if pokemon.obtainMode==1 # hatched
  401. if pokemon.timeEggHatched
  402. month=pbGetAbbrevMonthName(pokemon.timeEggHatched.mon)
  403. date=pokemon.timeEggHatched.day
  404. year=pokemon.timeEggHatched.year
  405. textpos=[
  406. [_INTL("Hatched {1} {2}, {3} on",month,date,year),191,206,0,base,vanilla]]
  407. pbDrawTextPositions(overlay,textpos)
  408. end
  409. mapname=pbGetMapNameFromId(pokemon.hatchedMap)
  410. if mapname && mapname!=""
  411. textpos=[
  412. [_INTL("{1}.",mapname),191,240,0,base,vanilla]]
  413. pbDrawTextPositions(overlay,textpos)
  414. else
  415. textpos=[
  416. [_INTL("Faraway Place",mapname),191,240,0,base,vanilla]]
  417. pbDrawTextPositions(overlay,textpos)
  418. end
  419. textpos=[
  420. [_INTL(""),191,274,0,base,vanilla]]
  421. pbDrawTextPositions(overlay,textpos)
  422. else
  423. textpos=[
  424. [_INTL(""),191,240,0,base,vanilla]]
  425. pbDrawTextPositions(overlay,textpos)
  426. end
  427. end
  428. if shownature
  429. bestiv=0
  430. tiebreaker=pokemon.personalID%6
  431. for i in 0...6
  432. if pokemon.iv[i]==pokemon.iv[bestiv]
  433. bestiv=i if i>=tiebreaker && bestiv<tiebreaker
  434. elsif pokemon.iv[i]>pokemon.iv[bestiv]
  435. bestiv=i
  436. end
  437. end
  438. characteristic=[_INTL("Loves to eat."),
  439. _INTL("Often dozes off."),
  440. _INTL("Often scatters things."),
  441. _INTL("Scatters things often."),
  442. _INTL("Likes to relax."),
  443. _INTL("Proud of its power."),
  444. _INTL("Likes to thrash about."),
  445. _INTL("A little quick tempered."),
  446. _INTL("Likes to fight."),
  447. _INTL("Quick tempered."),
  448. _INTL("Sturdy body."),
  449. _INTL("Capable of taking hits."),
  450. _INTL("Highly persistent."),
  451. _INTL("Good endurance."),
  452. _INTL("Good perseverance."),
  453. _INTL("Likes to run."),
  454. _INTL("Alert to sounds."),
  455. _INTL("Impetuous and silly."),
  456. _INTL("Somewhat of a clown."),
  457. _INTL("Quick to flee."),
  458. _INTL("Highly curious."),
  459. _INTL("Mischievous."),
  460. _INTL("Thoroughly cunning."),
  461. _INTL("Often lost in thought."),
  462. _INTL("Very finicky."),
  463. _INTL("Strong willed."),
  464. _INTL("Somewhat vain."),
  465. _INTL("Strongly defiant."),
  466. _INTL("Hates to lose."),
  467. _INTL("Somewhat stubborn.")
  468. ][bestiv*5+pokemon.iv[bestiv]%5]
  469.  
  470. textpos=[
  471. [_INTL("{1}",characteristic),191,172,0,base,vanilla]]
  472. pbDrawTextPositions(overlay,textpos)
  473. end
  474. drawMarkings(overlay,440,4,72,20,pokemon.markings)
  475. end
  476.  
  477. def drawPageThree(pokemon)
  478. overlay=@sprites["overlay"].bitmap
  479. overlay.clear
  480. @sprites["background"].setBitmap("Graphics/Pictures/BrassSummary3")
  481. imagepos=[]
  482. if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
  483. status=6 if pbPokerus(pokemon)==1
  484. status=@pokemon.status-1 if @pokemon.status>0
  485. status=5 if pokemon.hp==0
  486. imagepos.push(["Graphics/Pictures/statuses",120,230,0,16*status,44,16])
  487. end
  488. if pokemon.isShiny?
  489. imagepos.push([sprintf("Graphics/Pictures/shiny"),6,76,0,0,-1,-1])
  490. end
  491. if pbPokerus(pokemon)==2
  492. imagepos.push([sprintf("Graphics/Pictures/summaryPokerus"),414,6,0,0,-1,-1])
  493. end
  494. ballused=@pokemon.ballused ? @pokemon.ballused : 0
  495. ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
  496. imagepos.push([ballimage,36,286,0,0,-1,-1])
  497. pbDrawImagePositions(overlay,imagepos)
  498. base=Color.new(0,0,0)
  499. shadow=Color.new(104,104,104)
  500. white=Color.new(248,248,248)
  501. green=Color.new(214,156,255)
  502. statshadows=[]
  503. for i in 0...5; statshadows[i]=shadow; end
  504. if !(pokemon.isShadow? rescue false) || pokemon.heartStage<=3
  505. natup=(pokemon.nature/5).floor
  506. natdn=(pokemon.nature%5).floor
  507. statshadows[natup]=Color.new(136,96,72) if natup!=natdn
  508. statshadows[natdn]=Color.new(64,120,152) if natup!=natdn
  509. end
  510. pbSetSystemFont(overlay)
  511. naturename=PBNatures.getName(pokemon.nature)
  512. pokename=@pokemon.name
  513. # Left side of the Summary Screen
  514. # Colours are base, white
  515. # To center text on this side, make sure X is 84 and the third numb is 2
  516. textpos=[
  517. [_INTL("SKILLS"),84,2,2,base,white],
  518. [pokename,84,34,2,base,white],
  519. [_INTL("Lv {1}",pokemon.level.to_s),74,286,0,base,white]]
  520. if pokemon.hasItem?
  521. textpos.push([PBItems.getName(pokemon.item),84,254,2,base,white])
  522. else
  523. textpos.push([_INTL("NONE"),62,254,0,base,white])
  524. end
  525. if pokemon.isMale?
  526. textpos.push([_INTL("♂"),6,222,0,Color.new(120,96,240),Color.new(248,248,248)])
  527. elsif pokemon.isFemale?
  528. textpos.push([_INTL("♀"),6,222,0,Color.new(248,56,8),Color.new(248,248,248)])
  529. end
  530. pbDrawTextPositions(overlay,textpos)
  531. ######
  532. pbSetSystemFont(overlay)
  533. abilityname=PBAbilities.getName(pokemon.ability)
  534. abilitydesc=pbGetMessage(MessageTypes::AbilityDescs,pokemon.ability)
  535. pokename=@pokemon.name
  536. textpos=[
  537. [_INTL("HP"),233,36,2,base,green],
  538. [sprintf("%3d / %3d",pokemon.hp,pokemon.totalhp),453,36,2,base,green],
  539. [_INTL("Attack"),233,84,2,base,green],
  540. [sprintf("%d",pokemon.attack),453,84,2,base,green],
  541. [_INTL("Defense"),233,118,2,base,green],
  542. [sprintf("%d",pokemon.defense),453,118,2,base,green],
  543. [_INTL("Sp. Atk"),233,152,2,base,green],
  544. [sprintf("%d",pokemon.spatk),453,152,2,base,green],
  545. [_INTL("Sp. Def"),233,186,2,base,green],
  546. [sprintf("%d",pokemon.spdef),453,186,2,base,green],
  547. [_INTL("Speed"),233,220,2,base,green],
  548. [sprintf("%d",pokemon.speed),453,220,2,base,green],
  549. [_INTL("Ability"),233,254,2,base,green],
  550. [abilityname,404,254,2,base,green],
  551. [_INTL("Press C to read the description!"),341,288,2,base,green]
  552. ]
  553. pbDrawTextPositions(overlay,textpos)
  554. #drawTextEx(overlay,224,316,282,2,abilitydesc,Color.new(64,64,64),Color.new(176,176,176))
  555. drawMarkings(overlay,440,4,72,20,pokemon.markings)
  556. if pokemon.hp>0
  557. hpcolors=[ # Need new colours, currently all RED TAKE THAT DEOPARD
  558. Color.new(237,28,36),Color.new(237,28,36) , # Green
  559. Color.new(237,28,36),Color.new(237,28,36), # Orange
  560. Color.new(237,28,36),Color.new(237,28,36) # Red
  561. ]
  562. hpzone=0
  563. hpzone=1 if pokemon.hp<=(@pokemon.totalhp/2).floor
  564. hpzone=2 if pokemon.hp<=(@pokemon.totalhp/4).floor
  565. overlay.fill_rect(422,72,pokemon.hp*84/pokemon.totalhp,6,hpcolors[hpzone*2+1])
  566. end
  567. end
  568.  
  569. def drawPageThreeDesc(pokemon)
  570. overlay=@sprites["overlay"].bitmap
  571. overlay.clear
  572. @sprites["background"].setBitmap("Graphics/Pictures/BrassSummary3AbilityDesc")
  573. imagepos=[]
  574. if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
  575. status=6 if pbPokerus(pokemon)==1
  576. status=@pokemon.status-1 if @pokemon.status>0
  577. status=5 if pokemon.hp==0
  578. imagepos.push(["Graphics/Pictures/statuses",120,230,0,16*status,44,16])
  579. end
  580. if pokemon.isShiny?
  581. imagepos.push([sprintf("Graphics/Pictures/shiny"),6,76,0,0,-1,-1])
  582. end
  583. if pbPokerus(pokemon)==2
  584. imagepos.push([sprintf("Graphics/Pictures/summaryPokerus"),414,6,0,0,-1,-1])
  585. end
  586. ballused=@pokemon.ballused ? @pokemon.ballused : 0
  587. ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
  588. imagepos.push([ballimage,36,286,0,0,-1,-1])
  589. pbDrawImagePositions(overlay,imagepos)
  590. base=Color.new(0,0,0)
  591. shadow=Color.new(104,104,104)
  592. white=Color.new(248,248,248)
  593. green=Color.new(214,156,255)
  594. statshadows=[]
  595. for i in 0...5; statshadows[i]=shadow; end
  596. if !(pokemon.isShadow? rescue false) || pokemon.heartStage<=3
  597. natup=(pokemon.nature/5).floor
  598. natdn=(pokemon.nature%5).floor
  599. statshadows[natup]=Color.new(136,96,72) if natup!=natdn
  600. statshadows[natdn]=Color.new(64,120,152) if natup!=natdn
  601. end
  602. pbSetSystemFont(overlay)
  603. naturename=PBNatures.getName(pokemon.nature)
  604. pokename=@pokemon.name
  605. # Left side of the Summary Screen
  606. # Colours are base, white
  607. # To center text on this side, make sure X is 84 and the third numb is 2
  608. textpos=[
  609. [_INTL("SKILLS"),84,2,2,base,white],
  610. [pokename,84,34,2,base,white],
  611. [_INTL("Lv {1}",pokemon.level.to_s),74,286,0,base,white]]
  612. if pokemon.hasItem?
  613. textpos.push([PBItems.getName(pokemon.item),84,254,2,base,white])
  614. else
  615. textpos.push([_INTL("NONE"),62,254,0,base,white])
  616. end
  617. if pokemon.isMale?
  618. textpos.push([_INTL("♂"),6,222,0,Color.new(120,96,240),Color.new(248,248,248)])
  619. elsif pokemon.isFemale?
  620. textpos.push([_INTL("♀"),6,222,0,Color.new(248,56,8),Color.new(248,248,248)])
  621. end
  622. pbDrawTextPositions(overlay,textpos)
  623. ######
  624. pbSetSystemFont(overlay)
  625. abilityname=PBAbilities.getName(pokemon.ability)
  626. abilitydesc=pbGetMessage(MessageTypes::AbilityDescs,pokemon.ability)
  627. pokename=@pokemon.name
  628. textpos=[
  629. [_INTL("HP"),233,36,2,base,green],
  630. [sprintf("%3d / %3d",pokemon.hp,pokemon.totalhp),453,36,2,base,green],
  631. [_INTL("Ability"),233,68,2,base,green],
  632. [abilityname,404,68,2,base,green],
  633. [_INTL("Press X to close the description!"),341,288,2,base,green]
  634. ]
  635. pbDrawTextPositions(overlay,textpos)
  636. drawTextEx(overlay,193,102,302,2,abilitydesc,base,green)
  637. drawMarkings(overlay,440,4,72,20,pokemon.markings)
  638. end
  639.  
  640.  
  641. def drawPageFour(pokemon)
  642. overlay=@sprites["overlay"].bitmap
  643. overlay.clear
  644. @sprites["background"].setBitmap("Graphics/Pictures/BrassSummary4")
  645. imagepos=[]
  646. if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
  647. status=6 if pbPokerus(pokemon)==1
  648. status=@pokemon.status-1 if @pokemon.status>0
  649. status=5 if pokemon.hp==0
  650. imagepos.push(["Graphics/Pictures/statuses",120,230,0,16*status,44,16])
  651. end
  652. if pokemon.isShiny?
  653. imagepos.push([sprintf("Graphics/Pictures/shiny"),6,76,0,0,-1,-1])
  654. end
  655. if pbPokerus(pokemon)==2
  656. imagepos.push([sprintf("Graphics/Pictures/summaryPokerus"),414,6,0,0,-1,-1])
  657. end
  658. ballused=@pokemon.ballused ? @pokemon.ballused : 0
  659. ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
  660. imagepos.push([ballimage,36,286,0,0,-1,-1])
  661. pbDrawImagePositions(overlay,imagepos)
  662. base=Color.new(0,0,0)
  663. shadow=Color.new(104,104,104)
  664. white=Color.new(248,248,248)
  665. green=Color.new(136,248,104)
  666. pbSetSystemFont(overlay)
  667. naturename=PBNatures.getName(pokemon.nature)
  668. pokename=@pokemon.name
  669. # Left side of the Summary Screen
  670. # Colours are base, white
  671. # To center text on this side, make sure X is 84 and the third numb is 2
  672. textpos=[
  673. [_INTL("MOVES"),84,2,2,base,white],
  674. [pokename,84,34,2,base,white],
  675. [_INTL("Lv {1}",pokemon.level.to_s),74,286,0,base,white]]
  676. if pokemon.hasItem?
  677. textpos.push([PBItems.getName(pokemon.item),84,254,2,base,white])
  678. else
  679. textpos.push([_INTL("NONE"),62,254,0,base,white])
  680. end
  681. if pokemon.isMale?
  682. textpos.push([_INTL("♂"),6,222,0,Color.new(120,96,240),Color.new(248,248,248)])
  683. elsif pokemon.isFemale?
  684. textpos.push([_INTL("♀"),6,222,0,Color.new(248,56,8),Color.new(248,248,248)])
  685. end
  686. pbDrawTextPositions(overlay,textpos)
  687. imagepos=[]
  688. yPos=98
  689. for i in 0...pokemon.moves.length
  690. if pokemon.moves[i].id>0
  691. imagepos.push(["Graphics/Pictures/types",248,yPos+2,0,
  692. pokemon.moves[i].type*28,64,28])
  693. textpos.push([PBMoves.getName(pokemon.moves[i].id),316,yPos,0,
  694. Color.new(64,64,64),Color.new(176,176,176)])
  695. if pokemon.moves[i].totalpp>0
  696. textpos.push([_ISPRINTF("PP"),342,yPos+32,0,
  697. Color.new(64,64,64),Color.new(176,176,176)])
  698. textpos.push([sprintf("%d/%d",pokemon.moves[i].pp,pokemon.moves[i].totalpp),
  699. 460,yPos+32,1,Color.new(64,64,64),Color.new(176,176,176)])
  700. end
  701. else
  702. textpos.push(["-",316,yPos,0,Color.new(64,64,64),Color.new(176,176,176)])
  703. textpos.push(["--",442,yPos+32,1,Color.new(64,64,64),Color.new(176,176,176)])
  704. end
  705. yPos+=64
  706. end
  707. pbDrawTextPositions(overlay,textpos)
  708. pbDrawImagePositions(overlay,imagepos)
  709. drawMarkings(overlay,440,4,72,20,pokemon.markings)
  710. end
  711.  
  712. def drawSelectedMove(pokemon,moveToLearn,moveid)
  713. overlay=@sprites["overlay"].bitmap
  714. @sprites["pokemon"].visible=false if @sprites["pokemon"]
  715. @sprites["pokeicon"].setBitmap(pbPokemonIconFile(pokemon))
  716. @sprites["pokeicon"].src_rect=Rect.new(0,0,64,64)
  717. @sprites["pokeicon"].visible=true
  718. movedata=PBMoveData.new(moveid)
  719. basedamage=movedata.basedamage
  720. type=movedata.type
  721. category=movedata.category
  722. accuracy=movedata.accuracy
  723. drawMoveSelection(pokemon,moveToLearn)
  724. pbSetSystemFont(overlay)
  725. move=moveid
  726. textpos=[
  727. [basedamage<=1 ? basedamage==1 ? "???" : "---" : sprintf("%d",basedamage),
  728. 216,154,1,Color.new(64,64,64),Color.new(176,176,176)],
  729. [accuracy==0 ? "---" : sprintf("%d",accuracy),
  730. 216,186,1,Color.new(64,64,64),Color.new(176,176,176)]
  731. ]
  732. pbDrawTextPositions(overlay,textpos)
  733. imagepos=[["Graphics/Pictures/category",166,124,0,category*28,64,28]]
  734. pbDrawImagePositions(overlay,imagepos)
  735. drawTextEx(overlay,4,218,238,5,
  736. pbGetMessage(MessageTypes::MoveDescriptions,moveid),
  737. Color.new(64,64,64),Color.new(176,176,176))
  738. end
  739.  
  740. def drawMoveSelection(pokemon,moveToLearn)
  741. overlay=@sprites["overlay"].bitmap
  742. overlay.clear
  743. base=Color.new(248,248,248)
  744. shadow=Color.new(104,104,104)
  745. @sprites["background"].setBitmap("Graphics/Pictures/BrassSummary4Details")
  746. if moveToLearn!=0
  747. @sprites["background"].setBitmap("Graphics/Pictures/BrassSummary4Learning")
  748. end
  749. pbSetSystemFont(overlay)
  750. textpos=[
  751. [_INTL("MOVES"),26,16,0,base,shadow],
  752. [_INTL("CATEGORY"),20,122,0,base,shadow],
  753. [_INTL("POWER"),20,154,0,base,shadow],
  754. [_INTL("ACCURACY"),20,186,0,base,shadow]
  755. ]
  756. type1rect=Rect.new(0,pokemon.type1*28,64,28)
  757. type2rect=Rect.new(0,pokemon.type2*28,64,28)
  758. if pokemon.type1==pokemon.type2
  759. overlay.blt(130,78,@typebitmap.bitmap,type1rect)
  760. else
  761. overlay.blt(96,78,@typebitmap.bitmap,type1rect)
  762. overlay.blt(166,78,@typebitmap.bitmap,type2rect)
  763. end
  764. imagepos=[]
  765. yPos=98
  766. yPos-=76 if moveToLearn!=0
  767. for i in 0...5
  768. moveobject=nil
  769. if i==4
  770. moveobject=PBMove.new(moveToLearn) if moveToLearn!=0
  771. yPos+=20
  772. else
  773. moveobject=pokemon.moves[i]
  774. end
  775. if moveobject
  776. if moveobject.id!=0
  777. imagepos.push(["Graphics/Pictures/types",248,yPos+2,0,
  778. moveobject.type*28,64,28])
  779. textpos.push([PBMoves.getName(moveobject.id),316,yPos,0,
  780. Color.new(64,64,64),Color.new(176,176,176)])
  781. if moveobject.totalpp>0
  782. textpos.push([_ISPRINTF("PP"),342,yPos+32,0,
  783. Color.new(64,64,64),Color.new(176,176,176)])
  784. textpos.push([sprintf("%d/%d",moveobject.pp,moveobject.totalpp),
  785. 460,yPos+32,1,Color.new(64,64,64),Color.new(176,176,176)])
  786. end
  787. else
  788. textpos.push(["-",316,yPos,0,Color.new(64,64,64),Color.new(176,176,176)])
  789. textpos.push(["--",442,yPos+32,1,Color.new(64,64,64),Color.new(176,176,176)])
  790. end
  791. end
  792. yPos+=64
  793. end
  794. pbDrawTextPositions(overlay,textpos)
  795. pbDrawImagePositions(overlay,imagepos)
  796. end
  797.  
  798. def drawPageFive(pokemon)
  799. overlay=@sprites["overlay"].bitmap
  800. overlay.clear
  801. @sprites["background"].setBitmap("Graphics/Pictures/BrassSummary5")
  802. imagepos=[]
  803. if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
  804. status=6 if pbPokerus(pokemon)==1
  805. status=@pokemon.status-1 if @pokemon.status>0
  806. status=5 if pokemon.hp==0
  807. imagepos.push(["Graphics/Pictures/statuses",120,230,0,16*status,44,16])
  808. end
  809. if pokemon.isShiny?
  810. imagepos.push([sprintf("Graphics/Pictures/shiny"),6,76,0,0,-1,-1])
  811. end
  812. if pbPokerus(pokemon)==2
  813. imagepos.push([sprintf("Graphics/Pictures/summaryPokerus"),414,6,0,0,-1,-1])
  814. end
  815. ballused=@pokemon.ballused ? @pokemon.ballused : 0
  816. ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
  817. imagepos.push([ballimage,36,286,0,0,-1,-1])
  818. pbDrawImagePositions(overlay,imagepos)
  819. base=Color.new(0,0,0)
  820. shadow=Color.new(104,104,104)
  821. white=Color.new(248,248,248)
  822. green=Color.new(136,248,104)
  823. pbSetSystemFont(overlay)
  824. naturename=PBNatures.getName(pokemon.nature)
  825. pokename=@pokemon.name
  826. # Left side of the Summary Screen
  827. # Colours are base, white
  828. # To center text on this side, make sure X is 84 and the third numb is 2
  829. textpos=[
  830. [_INTL("RIBBONS"),84,2,2,base,white],
  831. [pokename,84,34,2,base,white],
  832. [_INTL("Lv {1}",pokemon.level.to_s),74,286,0,base,white]]
  833. if pokemon.hasItem?
  834. textpos.push([PBItems.getName(pokemon.item),84,254,2,base,white])
  835. else
  836. textpos.push([_INTL("NONE"),62,254,0,base,white])
  837. end
  838. if pokemon.isMale?
  839. textpos.push([_INTL("♂"),6,222,0,Color.new(120,96,240),Color.new(248,248,248)])
  840. elsif pokemon.isFemale?
  841. textpos.push([_INTL("♀"),6,222,0,Color.new(248,56,8),Color.new(248,248,248)])
  842. end
  843. pbDrawTextPositions(overlay,textpos)
  844. textpos=[
  845. [_INTL("No. of Ribbons:"),234,342,0,Color.new(64,64,64),Color.new(176,176,176)],
  846. [pokemon.ribbonCount.to_s,450,342,1,Color.new(64,64,64),Color.new(176,176,176)],
  847. ]
  848. pbDrawTextPositions(overlay,textpos)
  849. imagepos=[]
  850. coord=0
  851. if pokemon.ribbons
  852. for i in pokemon.ribbons
  853. ribn=i-1
  854. imagepos.push(["Graphics/Pictures/ribbons",236+64*(coord%4),86+80*(coord/4).floor,
  855. 64*(ribn%8),64*(ribn/8).floor,64,64])
  856. coord+=1
  857. break if coord>=12
  858. end
  859. end
  860. pbDrawImagePositions(overlay,imagepos)
  861. drawMarkings(overlay,440,4,72,20,pokemon.markings)
  862. end
  863.  
  864. def pbChooseMoveToForget(moveToLearn)
  865. selmove=0
  866. ret=0
  867. maxmove=(moveToLearn>0) ? 4 : 3
  868. loop do
  869. Graphics.update
  870. Input.update
  871. pbUpdate
  872. if Input.trigger?(Input::B)
  873. ret=4
  874. break
  875. end
  876. if Input.trigger?(Input::C)
  877. break
  878. end
  879. if Input.trigger?(Input::DOWN)
  880. selmove+=1
  881. if selmove<4 && selmove>=@pokemon.numMoves
  882. selmove=(moveToLearn>0) ? maxmove : 0
  883. end
  884. selmove=0 if selmove>maxmove
  885. @sprites["movesel"].index=selmove
  886. newmove=(selmove==4) ? moveToLearn : @pokemon.moves[selmove].id
  887. drawSelectedMove(@pokemon,moveToLearn,newmove)
  888. ret=selmove
  889. end
  890. if Input.trigger?(Input::UP)
  891. selmove-=1
  892. selmove=maxmove if selmove<0
  893. if selmove<4 && selmove>=@pokemon.numMoves
  894. selmove=@pokemon.numMoves-1
  895. end
  896. @sprites["movesel"].index=selmove
  897. newmove=(selmove==4) ? moveToLearn : @pokemon.moves[selmove].id
  898. drawSelectedMove(@pokemon,moveToLearn,newmove)
  899. ret=selmove
  900. end
  901. end
  902. return (ret==4) ? -1 : ret
  903. end
  904.  
  905. def pbMoveSelection
  906. @sprites["movesel"].visible=true
  907. @sprites["movesel"].index=0
  908. selmove=0
  909. oldselmove=0
  910. switching=false
  911. drawSelectedMove(@pokemon,0,@pokemon.moves[selmove].id)
  912. loop do
  913. Graphics.update
  914. Input.update
  915. pbUpdate
  916. if @sprites["movepresel"].index==@sprites["movesel"].index
  917. @sprites["movepresel"].z=@sprites["movesel"].z+1
  918. else
  919. @sprites["movepresel"].z=@sprites["movesel"].z
  920. end
  921. if Input.trigger?(Input::B)
  922. break if !switching
  923. @sprites["movepresel"].visible=false
  924. switching=false
  925. end
  926. if Input.trigger?(Input::C)
  927. if selmove==4
  928. break if !switching
  929. @sprites["movepresel"].visible=false
  930. switching=false
  931. else
  932. if !(@pokemon.isShadow? rescue false)
  933. if !switching
  934. @sprites["movepresel"].index=selmove
  935. oldselmove=selmove
  936. @sprites["movepresel"].visible=true
  937. switching=true
  938. else
  939. tmpmove=@pokemon.moves[oldselmove]
  940. @pokemon.moves[oldselmove]=@pokemon.moves[selmove]
  941. @pokemon.moves[selmove]=tmpmove
  942. @sprites["movepresel"].visible=false
  943. switching=false
  944. drawSelectedMove(@pokemon,0,@pokemon.moves[selmove].id)
  945. end
  946. end
  947. end
  948. end
  949. if Input.trigger?(Input::DOWN)
  950. selmove+=1
  951. selmove=0 if selmove<4 && selmove>=@pokemon.numMoves
  952. selmove=0 if selmove>=4
  953. selmove=4 if selmove<0
  954. @sprites["movesel"].index=selmove
  955. newmove=@pokemon.moves[selmove].id
  956. pbPlayCursorSE()
  957. drawSelectedMove(@pokemon,0,newmove)
  958. end
  959. if Input.trigger?(Input::UP)
  960. selmove-=1
  961. if selmove<4 && selmove>=@pokemon.numMoves
  962. selmove=@pokemon.numMoves-1
  963. end
  964. selmove=0 if selmove>=4
  965. selmove=@pokemon.numMoves-1 if selmove<0
  966. @sprites["movesel"].index=selmove
  967. newmove=@pokemon.moves[selmove].id
  968. pbPlayCursorSE()
  969. drawSelectedMove(@pokemon,0,newmove)
  970. end
  971. end
  972. @sprites["movesel"].visible=false
  973. end
  974.  
  975. def pbGoToPrevious
  976. if @page!=0
  977. newindex=@partyindex
  978. while newindex>0
  979. newindex-=1
  980. if @party[newindex] && !@party[newindex].isEgg?
  981. @partyindex=newindex
  982. break
  983. end
  984. end
  985. else
  986. newindex=@partyindex
  987. while newindex>0
  988. newindex-=1
  989. if @party[newindex]
  990. @partyindex=newindex
  991. break
  992. end
  993. end
  994. end
  995. end
  996.  
  997. def pbGoToNext
  998. if @page!=0
  999. newindex=@partyindex
  1000. while newindex<@party.length-1
  1001. newindex+=1
  1002. if @party[newindex] && !@party[newindex].isEgg?
  1003. @partyindex=newindex
  1004. break
  1005. end
  1006. end
  1007. else
  1008. newindex=@partyindex
  1009. while newindex<@party.length-1
  1010. newindex+=1
  1011. if @party[newindex]
  1012. @partyindex=newindex
  1013. break
  1014. end
  1015. end
  1016. end
  1017. end
  1018.  
  1019.  
  1020. def pbScene
  1021. pbPlayCry(@pokemon)
  1022. loop do
  1023. Graphics.update
  1024. Input.update
  1025. pbUpdate
  1026. if Input.trigger?(Input::B) && descmeme=false
  1027. break
  1028. end
  1029. if Input.trigger?(Input::B) && descmeme=true
  1030. dorefresh=true # Necessary
  1031. descmeme=false
  1032. drawPageThree(@pokemon)
  1033. end
  1034. dorefresh=false
  1035. if Input.trigger?(Input::C)
  1036. if @page==2
  1037. dorefresh=false # Necessary
  1038. descmeme=true
  1039. drawPageThreeDesc(@pokemon)
  1040. elsif @page==3
  1041. pbMoveSelection
  1042. dorefresh=true
  1043. drawPageFour(@pokemon)
  1044. end
  1045. end
  1046. if Input.trigger?(Input::UP) && @partyindex>0
  1047. oldindex=@partyindex
  1048. pbGoToPrevious
  1049. if @partyindex!=oldindex
  1050. @pokemon=@party[@partyindex]
  1051. @sprites["pokemon"].setPokemonBitmap(@pokemon)
  1052. @sprites["pokemon"].color=Color.new(0,0,0,0)
  1053. pbPositionPokemonSprite(@sprites["pokemon"],22,90)
  1054. dorefresh=true
  1055. pbPlayCry(@pokemon)
  1056. end
  1057. end
  1058. if Input.trigger?(Input::DOWN) && @partyindex<@party.length-1
  1059. oldindex=@partyindex
  1060. pbGoToNext
  1061. if @partyindex!=oldindex
  1062. @pokemon=@party[@partyindex]
  1063. @sprites["pokemon"].setPokemonBitmap(@pokemon)
  1064. @sprites["pokemon"].color=Color.new(0,0,0,0)
  1065. pbPositionPokemonSprite(@sprites["pokemon"],22,90)
  1066. dorefresh=true
  1067. pbPlayCry(@pokemon)
  1068. end
  1069. end
  1070. if Input.trigger?(Input::LEFT) && !@pokemon.isEgg?
  1071. oldpage=@page
  1072. @page-=1
  1073. @page=0 if @page<0
  1074. @page=4 if @page>4
  1075. dorefresh=true
  1076. if @page!=oldpage # Move to next page
  1077. pbPlayCursorSE()
  1078. dorefresh=true
  1079. end
  1080. end
  1081. if Input.trigger?(Input::RIGHT) && !@pokemon.isEgg?
  1082. oldpage=@page
  1083. @page+=1
  1084. @page=0 if @page<0
  1085. @page=4 if @page>4
  1086. if @page!=oldpage # Move to next page
  1087. pbPlayCursorSE()
  1088. dorefresh=true
  1089. end
  1090. end
  1091. if dorefresh
  1092. case @page
  1093. when 0
  1094. drawPageOne(@pokemon)
  1095. when 1
  1096. drawPageTwo(@pokemon)
  1097. when 2
  1098. drawPageThree(@pokemon)
  1099. when 3
  1100. drawPageFour(@pokemon)
  1101. when 4
  1102. drawPageFive(@pokemon)
  1103. end
  1104. end
  1105. end
  1106. return @partyindex
  1107. end
  1108. end
  1109.  
  1110.  
  1111.  
  1112. class PokemonSummary
  1113. def initialize(scene)
  1114. @scene=scene
  1115. end
  1116.  
  1117. def pbStartScreen(party,partyindex)
  1118. @scene.pbStartScene(party,partyindex)
  1119. ret=@scene.pbScene
  1120. @scene.pbEndScene
  1121. return ret
  1122. end
  1123.  
  1124. def pbStartForgetScreen(party,partyindex,moveToLearn)
  1125. ret=-1
  1126. @scene.pbStartForgetScene(party,partyindex,moveToLearn)
  1127. loop do
  1128. ret=@scene.pbChooseMoveToForget(moveToLearn)
  1129. if ret>=0 && moveToLearn!=0 && pbIsHiddenMove?(party[partyindex].moves[ret].id) && !$DEBUG
  1130. Kernel.pbMessage(_INTL("HM moves can't be forgotten now.")){ @scene.pbUpdate }
  1131. else
  1132. break
  1133. end
  1134. end
  1135. @scene.pbEndScene
  1136. return ret
  1137. end
  1138.  
  1139. def pbStartChooseMoveScreen(party,partyindex,message)
  1140. ret=-1
  1141. @scene.pbStartForgetScene(party,partyindex,0)
  1142. Kernel.pbMessage(message){ @scene.pbUpdate }
  1143. loop do
  1144. ret=@scene.pbChooseMoveToForget(0)
  1145. if ret<0
  1146. Kernel.pbMessage(_INTL("You must choose a move!")){ @scene.pbUpdate }
  1147. else
  1148. break
  1149. end
  1150. end
  1151. @scene.pbEndScene
  1152. return ret
  1153. end
  1154. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement