Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $PlayerBerryScore=0
- $OtherBerryScores=[0,0,0,0,0,0,0,0,0,0]
- class BerryScoreScene
- def update
- pbUpdateSpriteHash(@sprites)
- end
- def initialize
- @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
- @viewport.z=89999
- @textport=Viewport.new(0,0,Graphics.width,Graphics.height)
- @textport.z=99999
- end
- def pbMiddleScene
- loop do
- Graphics.update
- Input.update
- if (Input.trigger?(Input::C) || Input.trigger?(Input::B))
- break
- end
- end
- end
- def pbEndScene ##This ends everything
- $game_map.autoplay
- pbFadeOutAndHide(@sprites) { update }
- pbDisposeSpriteHash(@sprites)
- @viewport.dispose
- $scene = Scene_Map.new
- end
- def pbStartScene
- @sprites={}
- @sprites["bg"]=IconSprite.new(0,0,@viewport)
- @sprites["bg"].setBitmap("Graphics/Pictures/Mixer/BerryScorebg")
- @sprites["textbitmap"]=BitmapSprite.new(Graphics.width,Graphics.height,@textport)
- @textoverlay=@sprites["textbitmap"].bitmap
- scoresarray=[[$OtherBerryScores[0],"Gary"],[$OtherBerryScores[1],"Blue"],[$OtherBerryScores[2],"Steven"],
- [$OtherBerryScores[3],"Freddy"],[$OtherBerryScores[4],"Harold"],[$OtherBerryScores[5],"Paula Deen"],
- [$OtherBerryScores[6],"Greggory"],[$OtherBerryScores[7],"Nard Dog"],[$OtherBerryScores[8],"Billy"],
- [$OtherBerryScores[9],"Ferdinand"],[$PlayerBerryScore,$Trainer.name]]
- scoresarray.sort!{|a,b| a[0] <=> b[0]}
- scoresarray.reverse!
- textpos=[]
- textpos.push([_INTL("Top Berry Mixers"),Graphics.width/2,50,2,Color.new(0,0,0),Color.new(136,168,208)])
- repeatcolor=false
- for i in 0...9 #Draw first 9 scores, leave last off
- if repeatcolor==false && (scoresarray[i][1]==$Trainer.name && scoresarray[i][0]==$PlayerBerryScore)
- repeatcolor=true
- textcolor=($Trainer.gender==1)?Color.new(255,51,255):Color.new(0,0,255)
- else
- textcolor=Color.new(0,0,0)
- end
- textpos.push([_INTL("{1}",scoresarray[i][1]),Graphics.width/3-20,80+30*i,0,textcolor,Color.new(136,168,208)])
- textpos.push([_INTL("{1}",scoresarray[i][0]),Graphics.width/3+140,80+30*i,0,Color.new(0,0,0),Color.new(136,168,208)])
- end
- pbDrawTextPositions(@textoverlay,textpos)
- Graphics.update
- end
- end
- class BerryScoreScreen
- def initialize(scene)
- @scene=scene
- end
- def pbStartScores
- @scene.pbStartScene
- @scene.pbMiddleScene
- @scene.pbEndScene
- end
- end
- def pbBerryScores
- if $Trainer.party.length>0
- newlevel=pbBalancedLevel($Trainer.party)
- else
- newlevel=25
- end
- $OtherBerryScores[0]=newlevel if newlevel>$OtherBerryScores[0]
- $OtherBerryScores[1]=(newlevel+5) if (newlevel+5)>$OtherBerryScores[1]
- $OtherBerryScores[2]=(newlevel+10) if (newlevel+10)>$OtherBerryScores[2]
- $OtherBerryScores[3]=(newlevel-5) if (newlevel-5)>$OtherBerryScores[3]
- $OtherBerryScores[4]=(newlevel-6) if (newlevel-6)>$OtherBerryScores[4]
- $OtherBerryScores[5]=(newlevel-10) if (newlevel-10)>$OtherBerryScores[5]
- $OtherBerryScores[6]=(newlevel-14) if (newlevel-14)>$OtherBerryScores[6]
- $OtherBerryScores[7]=(newlevel-19) if (newlevel-19)>$OtherBerryScores[7]
- $OtherBerryScores[8]=(newlevel-21) if (newlevel-22)>$OtherBerryScores[8]
- $OtherBerryScores[9]=(newlevel-23) if (newlevel-23)>$OtherBerryScores[9]
- scene=BerryScoreScene.new
- screen=BerryScoreScreen.new(scene)
- return screen.pbStartScores
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement