Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #PField_Field
- # This method causes a lot of lag when the game is encrypted
- def pbGetPlayerCharset(meta,charset,trainer=nil)
- trainer=$Trainer if !trainer
- outfit=trainer ? trainer.outfit : 0
- ret=meta[charset]
- ret=meta[1] if !ret || ret==""
- # if FileTest.image_exist?("Graphics/Characters/"+ret+"_"+outfit.to_s)
- if pbResolveBitmap("Graphics/Characters/"+ret+"_"+outfit.to_s)
- ret=ret+"_"+outfit.to_s
- end
- if (charset == 3) || (charset == 5)# || (charset == 7)
- CreateOverlayBitmap(ret)
- end
- return ret
- end
- def CreateOverlayBitmap(fileString)
- if $Trainer.ridepoke
- filepath = pbPokemonOverworldFiles($Trainer.ridepoke)
- # Safety Copy
- if !File.exists?("Graphics/Characters/"+fileString+"_safetyCopy"+".png")
- safetyCopy=Bitmap.new("Graphics/Characters/"+fileString)
- safetyCopy.saveToPng("Graphics/Characters/"+fileString+"_safetyCopy"+".png")
- end
- trainerlay = Bitmap.new("Graphics/Characters/"+fileString+"_safetyCopy"+".png")
- pokelay = Bitmap.new(filepath)
- pokelay.blt(0,0,trainerlay,Rect.new(0,0,Graphics.width,Graphics.height))
- #pokelay.blt(0,pokelay.height/4,Bitmap.new(filepath),Rect.new(0,pokelay.height/4,pokelay.width,pokelay.height/2)) if trainer.ridepoke.rideOverlay[1]
- for i in 0..$Trainer.ridepoke.rideOverlay.length
- case $Trainer.ridepoke.rideOverlay[i]
- when 1
- pokelay.blt(0,i*pokelay.height/4,Bitmap.new(filepath),Rect.new(0,i*pokelay.height/4,pokelay.width,pokelay.height/8))
- when 2
- pokelay.blt(i*pokelay.height/4,pokelay.height/8,Bitmap.new(filepath),Rect.new(i*pokelay.height/4,pokelay.height/8,pokelay.width,pokelay.height/8))
- when 3
- pokelay.blt(0,i*pokelay.height/4,Bitmap.new(filepath),Rect.new(0,i*pokelay.height/4,pokelay.width/8+pokelay.width/16,pokelay.height/4))
- pokelay.blt(pokelay.width/4,i*pokelay.height/4,Bitmap.new(filepath),Rect.new(pokelay.width/4,i*pokelay.height/4,pokelay.width/8+pokelay.width/16,pokelay.height/4))
- pokelay.blt(2*pokelay.width/4,i*pokelay.height/4,Bitmap.new(filepath),Rect.new(2*pokelay.width/4,i*pokelay.height/4,pokelay.width/8+pokelay.width/16,pokelay.height/4))
- pokelay.blt(3*pokelay.width/4,i*pokelay.height/4,Bitmap.new(filepath),Rect.new(3*pokelay.width/4,i*pokelay.height/4,pokelay.width/8+pokelay.width/16,pokelay.height/4))
- when 4
- pokelay.blt(pokelay.width/8,i*pokelay.height/4,Bitmap.new(filepath),Rect.new(pokelay.width/16,i*pokelay.height/4,pokelay.width/8+pokelay.width/16,pokelay.height/4))
- pokelay.blt(pokelay.width/8+pokelay.width/4,i*pokelay.height/4,Bitmap.new(filepath),Rect.new(pokelay.width/16+pokelay.width/4,i*pokelay.height/4,pokelay.width/8+pokelay.width/16,pokelay.height/4))
- pokelay.blt(pokelay.width/8+(2*pokelay.width/4),i*pokelay.height/4,Bitmap.new(filepath),Rect.new(pokelay.width/16+(2*pokelay.width/4),i*pokelay.height/4,pokelay.width/8+pokelay.width/16,pokelay.height/4))
- pokelay.blt(pokelay.width/8+(3*pokelay.width/4),i*pokelay.height/4,Bitmap.new(filepath),Rect.new(pokelay.width/16+(3*pokelay.width/4),i*pokelay.height/4,pokelay.width/8+pokelay.width/16,pokelay.height/4))
- when 5
- pokelay.blt(0,i*pokelay.height/4,Bitmap.new(filepath),Rect.new(0,i*pokelay.height/4,pokelay.width,pokelay.height/4))
- end
- end
- pokelay.saveToPng("Graphics/Characters/"+fileString+".png")
- end
- end
- #PokeBattle_Pokemon
- # None = 0, Top = 1, Bottom = 2, Left = 3, Right = 4, All = 5
- OVERLAY_INDEX = {
- 78=>[5,2,2,2],
- 130=>[3,3,4,3],
- 131=>[5,3,0,0],
- 567=>[5,5,5,0],
- 581=>[5,5,5,0]
- }
- def rideOverlay
- ret=OVERLAY_INDEX[@species]
- ret2= !ret ? [0,0,0,0] : ret
- return ret2
- end
- #PField_HiddenMoves
- def pbStartSurfing(movefinder=nil)
- if movefinder != nil
- $Trainer.ridepoke = movefinder
- end
- Kernel.pbCancelVehicles
- $PokemonEncounters.clearStepCount
- $PokemonGlobal.surfing=true
- Kernel.pbUpdateVehicle
- Kernel.pbJumpToward
- Kernel.pbUpdateVehicle
- $game_player.check_event_trigger_here([1,2])
- end
- def pbEndSurf(xOffset,yOffset)
- return false if !$PokemonGlobal.surfing
- $Trainer.ridepoke=nil
- x=$game_player.x
- y=$game_player.y
- currentTag=$game_map.terrain_tag(x,y)
- facingTag=Kernel.pbFacingTerrainTag
- if pbIsSurfableTag?(currentTag) && !pbIsSurfableTag?(facingTag)
- if Kernel.pbJumpToward(1,false,true)
- # Kernel.pbCancelVehicles
- $game_map.autoplayAsCue
- $game_player.increase_steps
- result=$game_player.check_event_trigger_here([1,2])
- Kernel.pbOnStepTaken(result)
- end
- return true
- end
- return false
- end
- #Following pokemon
- def Kernel.pbSurf
- if $game_player.pbHasDependentEvents? && !$game_switches[Following_Activated_Switch]
- return false
- end
- if $DEBUG ||
- (HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORSURF : $Trainer.badges[BADGEFORSURF])
- movefinder=Kernel.pbCheckMove(:SURF)
- if movefinder || $DEBUG
- if Kernel.pbConfirmMessage(_INTL("The water is dyed a deep blue... Would you like to surf?"))
- speciesname=!movefinder ? $Trainer.name : movefinder.name
- Kernel.pbMessage(_INTL("{1} used Surf!",speciesname))
- pbHiddenMoveAnimation(movefinder)
- surfbgm=pbGetMetadata(0,MetadataSurfBGM)
- $PokemonTemp.dependentEvents.check_surf(true)
- if surfbgm
- pbCueBGM(surfbgm,0.5)
- end
- pbStartSurfing(movefinder) #edit!!!
- return true
- end
- end
- end
- return false
- end
- alias follow_pbStartSurfing pbStartSurfing
- def pbStartSurfing(movefinder=nil)#edit
- follow_pbStartSurfing(movefinder)#edit
- $PokemonGlobal.surfing=true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement