#Si se usa créditos a FiaPlay y TechSkylander1518
class PokemonSummaryScene
    def drawPageThree(pokemon)
    overlay=@sprites["overlay"].bitmap
    overlay.clear
    @sprites["background"].setBitmap("Graphics/Pictures/summary3")
    imagepos=[]
    if pbPokerus(pokemon)==1 || pokemon.hp==0 || @pokemon.status>0
      status=6 if pbPokerus(pokemon)==1
      status=@pokemon.status-1 if @pokemon.status>0
      status=5 if pokemon.hp==0
      imagepos.push(["Graphics/Pictures/statuses",124,100,0,16*status,44,16])
    end
    if pokemon.isShiny?
      imagepos.push([sprintf("Graphics/Pictures/shiny"),2,134,0,0,-1,-1])
    end
    if pbPokerus(pokemon)==2
      imagepos.push([sprintf("Graphics/Pictures/summaryPokerus"),176,100,0,0,-1,-1])
    end
    ballused=@pokemon.ballused ? @pokemon.ballused : 0
    ballimage=sprintf("Graphics/Pictures/Balls/summaryball%02d",@pokemon.ballused)
    imagepos.push([ballimage,14,60,0,0,-1,-1])
    imagepos.push([pbItemIconFile(@pokemon.item),6,296,0,0,-1,-1]) if @pokemon.hasItem?
    pbDrawImagePositions(overlay,imagepos)
    base=Color.new(248,248,248)
    shadow=Color.new(104,104,104)
    statshadows=[]
    for i in 0...5; statshadows[i]=shadow; end
    if !(pokemon.isShadow? rescue false) || pokemon.heartStage<=3
      natup=(pokemon.nature/5).floor
      natdn=(pokemon.nature%5).floor
      statshadows[natup]=Color.new(136,96,72) if natup!=natdn
      statshadows[natdn]=Color.new(64,120,152) if natup!=natdn
    end
    pbSetSystemFont(overlay)
    abilityname=PBAbilities.getName(pokemon.ability)
    abilitydesc=pbGetMessage(MessageTypes::AbilityDescs,pokemon.ability)
    pokename=@pokemon.name
    textpos=[
       [_INTL("CARACTERÍSTICAS"),26,16,0,base,shadow],
       [pokename,46,62,0,base,shadow],
       [pokemon.level.to_s,46,92,0,Color.new(64,64,64),Color.new(176,176,176)],
       [_INTL("Objeto"),58,316,0,base,shadow],
       [_INTL("PS"),292,76,2,base,shadow],
       [sprintf("%d/%d",@pokemon.hp,@pokemon.totalhp),420,76,1,Color.new(64,64,64),Color.new(176,176,176)],
       [sprintf("%d/%d",@pokemon.iv[0],@pokemon.ev[0]),475,76,1,Color.new(64,64,64),Color.new(176,176,176)],
       [_INTL("Ataque"),248,120,0,base,statshadows[0]],
       [sprintf("%d",@pokemon.attack),400,120,1,Color.new(64,64,64),Color.new(176,176,176)],
       [sprintf("%d/%d",@pokemon.iv[1],@pokemon.ev[1]),475,120,1,Color.new(64,64,64),Color.new(176,176,176)],
       [_INTL("Defensa"),248,152,0,base,statshadows[1]],
       [sprintf("%d",@pokemon.defense),400,152,1,Color.new(64,64,64),Color.new(176,176,176)],
       [sprintf("%d/%d",@pokemon.iv[2],@pokemon.ev[2]),475,152,1,Color.new(64,64,64),Color.new(176,176,176)],
       [_INTL("At. Esp."),248,184,0,base,statshadows[3]],
       [sprintf("%d",@pokemon.spatk),400,184,1,Color.new(64,64,64),Color.new(176,176,176)],
       [sprintf("%d/%d",@pokemon.iv[4],@pokemon.ev[4]),475,184,1,Color.new(64,64,64),Color.new(176,176,176)],
       [_INTL("Def. Esp."),248,216,0,base,statshadows[4]],
       [sprintf("%d",@pokemon.spdef),400,216,1,Color.new(64,64,64),Color.new(176,176,176)],
       [sprintf("%d/%d",@pokemon.iv[5],@pokemon.ev[5]),475,216,1,Color.new(64,64,64),Color.new(176,176,176)],
       [_INTL("Velocidad"),248,248,0,base,statshadows[2]],
       [sprintf("%d",@pokemon.speed),400,248,1,Color.new(64,64,64),Color.new(176,176,176)],
       [sprintf("%d/%d",@pokemon.iv[3],@pokemon.ev[3]),475,248,1,Color.new(64,64,64),Color.new(176,176,176)],
       [_INTL("Habilidad"),214,284,0,base,shadow],
       [PBAbilities.getName(@pokemon.ability),342,284,0,Color.new(64,64,64),Color.new(176,176,176)],

    ]
    if pokemon.hasItem?
      textpos.push([PBItems.getName(pokemon.item),16,352,0,Color.new(64,64,64),Color.new(176,176,176)])
    else
      textpos.push([_INTL("Ninguno"),16,352,0,Color.new(184,184,160),Color.new(208,208,200)])
    end
    if pokemon.isMale?
      textpos.push([_INTL("♂"),178,62,0,Color.new(24,112,216),Color.new(136,168,208)])
    elsif pokemon.isFemale?
      textpos.push([_INTL("♀"),178,62,0,Color.new(248,56,32),Color.new(224,152,144)])
    end
    pbDrawTextPositions(overlay,textpos)
    drawTextEx(overlay,206,316,298,2,abilitydesc,Color.new(64,64,64),Color.new(176,176,176))
    drawMarkings(overlay,60,291,72,20,pokemon.markings)
    if pokemon.hp>0
      hpcolors=[
        Color.new(26,135,166),Color.new(35,194,240),   # Green
        Color.new(141,170,40),Color.new(189,228,52),   # Orange
        Color.new(148,81,27),Color.new(226,124,41)    # Red
      ]
      hpzone=0
      hpzone=1 if pokemon.hp<=(@pokemon.totalhp/2).floor
      hpzone=2 if pokemon.hp<=(@pokemon.totalhp/4).floor
      overlay.fill_rect(360,110,pokemon.hp*96/pokemon.totalhp,2,hpcolors[hpzone*2])
      overlay.fill_rect(360,112,pokemon.hp*96/pokemon.totalhp,4,hpcolors[hpzone*2+1])
    end
  end
end