Advertisement
Guest User

Untitled

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