Advertisement
Guest User

Untitled

a guest
Jan 9th, 2018
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 7.05 KB | None | 0 0
  1.   def drawPageTwo(pokemon)
  2.     overlay=@sprites["overlay"].bitmap
  3.     overlay.clear
  4.     @sprites["background"].setBitmap("Graphics/Pictures/summary2")
  5.     imagepos=[]
  6.     if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
  7.       status=6 if pbPokerus(pokemon)==1
  8.       status=@pokemon.status-1 if @pokemon.status>0
  9.       status=5 if pokemon.hp==0
  10.       imagepos.push(["Graphics/Pictures/statuses",124,100,0,16*status,44,16])
  11.     end
  12.     if pokemon.isShiny?
  13.       imagepos.push([sprintf("Graphics/Pictures/shiny"),2,134,0,0,-1,-1])
  14.     end
  15.     if pokemon.isMetallic?
  16.       imagepos.push([sprintf("Graphics/Pictures/metallic"),18,134,0,0,-1,-1])
  17.     end
  18.     if pbPokerus(pokemon)==2
  19.       imagepos.push([sprintf("Graphics/Pictures/summaryPokerus"),176,100,0,0,-1,-1])
  20.     end
  21.     ballused=@pokemon.ballused ? @pokemon.ballused : 0
  22.     ballimage=sprintf("Graphics/Pictures/summaryball%02d",@pokemon.ballused)
  23.     imagepos.push([ballimage,14,60,0,0,-1,-1])
  24.     pbDrawImagePositions(overlay,imagepos)
  25.     base=Color.new(248,248,248)
  26.     shadow=Color.new(104,104,104)
  27.     pbSetSystemFont(overlay)
  28.     naturename=PBNatures.getName(pokemon.nature)
  29.     pokename=@pokemon.name
  30.     textpos=[
  31.        [_INTL("TRAINER MEMO"),26,16,0,base,shadow],
  32.        [pokename,46,62,0,base,shadow],
  33.        [pokemon.level.to_s,46,92,0,Color.new(64,64,64),Color.new(176,176,176)],
  34.        [_INTL("Item"),16,320,0,base,shadow]
  35.     ]
  36.     if pokemon.hasItem?
  37.       textpos.push([PBItems.getName(pokemon.item),16,352,0,Color.new(64,64,64),Color.new(176,176,176)])
  38.     else
  39.       textpos.push([_INTL("None"),16,352,0,Color.new(184,184,160),Color.new(208,208,200)])
  40.     end
  41.     if pokemon.isMale?
  42.       textpos.push([_INTL("♂"),178,62,0,Color.new(24,112,216),Color.new(136,168,208)])
  43.     elsif pokemon.isFemale?
  44.       textpos.push([_INTL("♀"),178,62,0,Color.new(248,56,32),Color.new(224,152,144)])
  45.     end
  46.     pbDrawTextPositions(overlay,textpos)
  47.     memo=""
  48.     shownature=(!(pokemon.isShadow? rescue false)) || pokemon.heartStage<=3
  49.     if shownature
  50.       memo+=_INTL("<c3=F83820,E09890>{1}<c3=404040,B0B0B0> nature.\n",naturename)
  51.     end
  52.     if pokemon.timeReceived
  53.       month=pbGetAbbrevMonthName(pokemon.timeReceived.mon)
  54.       date=pokemon.timeReceived.day
  55.       year=pokemon.timeReceived.year
  56.       memo+=_INTL("<c3=404040,B0B0B0>{1} {2}, {3}\n",month,date,year)
  57.     end
  58.     mapname=pbGetMapNameFromId(pokemon.obtainMap)
  59.     if (pokemon.obtainText rescue false) && pokemon.obtainText!=""
  60.       mapname=pokemon.obtainText
  61.     end
  62.     if mapname && mapname!=""
  63.       memo+=sprintf("<c3=F83820,E09890>%s\n",mapname)
  64.     else
  65.       memo+=_INTL("<c3=F83820,E09890>Faraway place\n")
  66.     end
  67.     if pokemon.obtainMode
  68.       mettext=[_INTL("Met at Lv. {1}.",pokemon.obtainLevel),
  69.                _INTL("Egg received."),
  70.                _INTL("Traded at Lv. {1}.",pokemon.obtainLevel),
  71.                "",
  72.                _INTL("Had a fateful encounter at Lv. {1}.",pokemon.obtainLevel)
  73.                ][pokemon.obtainMode]
  74.       memo+=sprintf("<c3=404040,B0B0B0>%s\n",mettext)
  75.       if pokemon.obtainMode==1 # hatched
  76.         if pokemon.timeEggHatched
  77.           month=pbGetAbbrevMonthName(pokemon.timeEggHatched.mon)
  78.           date=pokemon.timeEggHatched.day
  79.           year=pokemon.timeEggHatched.year
  80.           memo+=_INTL("<c3=404040,B0B0B0>{1} {2}, {3}\n",month,date,year)
  81.         end
  82.         mapname=pbGetMapNameFromId(pokemon.hatchedMap)
  83.         if mapname && mapname!=""
  84.           memo+=sprintf("<c3=F83820,E09890>%s\n",mapname)
  85.         else
  86.           memo+=_INTL("<c3=F83820,E09890>Faraway place\n")
  87.         end
  88.         memo+=_INTL("<c3=404040,B0B0B0>Egg hatched.\n")
  89.       else
  90.         memo+="<c3=404040,B0B0B0>\n"
  91.       end
  92.     end
  93.     if shownature
  94.       bestiv=0
  95.       tiebreaker=pokemon.personalID%6
  96.       for i in 0...6
  97.         if pokemon.iv[i]==pokemon.iv[bestiv]
  98.           bestiv=i if i>=tiebreaker && bestiv<tiebreaker
  99.         elsif pokemon.iv[i]>pokemon.iv[bestiv]
  100.           bestiv=i
  101.         end
  102.       end
  103.       characteristic=[_INTL("Loves to eat."),
  104.                       _INTL("Often dozes off."),
  105.                       _INTL("Often scatters things."),
  106.                       _INTL("Scatters things often."),
  107.                       _INTL("Likes to relax."),
  108.                       _INTL("Proud of its power."),
  109.                       _INTL("Likes to thrash about."),
  110.                       _INTL("A little quick tempered."),
  111.                       _INTL("Likes to fight."),
  112.                       _INTL("Quick tempered."),
  113.                       _INTL("Sturdy body."),
  114.                       _INTL("Capable of taking hits."),
  115.                       _INTL("Highly persistent."),
  116.                       _INTL("Good endurance."),
  117.                       _INTL("Good perseverance."),
  118.                       _INTL("Likes to run."),
  119.                       _INTL("Alert to sounds."),
  120.                       _INTL("Impetuous and silly."),
  121.                       _INTL("Somewhat of a clown."),
  122.                       _INTL("Quick to flee."),
  123.                       _INTL("Highly curious."),
  124.                       _INTL("Mischievous."),
  125.                       _INTL("Thoroughly cunning."),
  126.                       _INTL("Often lost in thought."),
  127.                       _INTL("Very finicky."),
  128.                       _INTL("Strong willed."),
  129.                       _INTL("Somewhat vain."),
  130.                       _INTL("Strongly defiant."),
  131.                       _INTL("Hates to lose."),
  132.                       _INTL("Somewhat stubborn.")
  133.                       ][bestiv*5+pokemon.iv[bestiv]%5]
  134.       memo+=sprintf("<c3=404040,B0B0B0>%s\n",characteristic)
  135.     end
  136.     drawFormattedTextEx(overlay,232,78,276,memo)
  137.     #=============================================================================
  138.   # Egg Groups - Shows Pokemon's Egg Groups on Page 2 (Memo)
  139.   #=============================================================================
  140.   def pbDisplayEggGroups
  141.       if !@pokemon.egg?
  142.         dexdata=pbOpenDexData
  143.         pbDexDataOffset(dexdata,@pokemon.species,31)
  144.         compat10=dexdata.fgetb
  145.         compat11=dexdata.fgetb
  146.         noGender=(@pokemon.isGenderless? && !isConst?(@pokemon.species,PBSpecies,:DITTO))
  147.         eggGroupbitmap=AnimatedBitmap.new(_INTL("Graphics/Pictures/typesEgg"))
  148.         eggGroup0rect=Rect.new(0,420,64,28)
  149.         eggGroup1rect=Rect.new(0,compat10*28,64,28)
  150.         eggGroup2rect=Rect.new(0,compat11*28,64,28)
  151.         overlay = @sprites["overlay"].bitmap
  152.         if noGender && compat10!=0
  153.           overlay.blt(364,336,eggGroupbitmap.bitmap,eggGroup0rect)
  154.         elsif compat10==compat11
  155.           overlay.blt(364,336,eggGroupbitmap.bitmap,eggGroup1rect)
  156.         else
  157.           overlay.blt(364,336,eggGroupbitmap.bitmap,eggGroup1rect)
  158.           overlay.blt(432,336,eggGroupbitmap.bitmap,eggGroup2rect)
  159.         end
  160.         dexdata.close
  161.       end
  162.       textpos=[[_INTL("Egg Groups:"),234,334,0,Color.new(64,64,64),Color.new(176,176,176)]]
  163.       pbDrawTextPositions(overlay,textpos)
  164.     end
  165.     drawMarkings(overlay,15,291,72,20,pokemon.markings)
  166.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement