Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # * Auto Hue Pokémon - by Vendily
- #===============================================================================
- # It allows you to color forms' sprites and icons. I made it for shadow pokémon
- # originally. (For the curious the color is (67,0,255,113) for shadow pokémon)
- # Put it above Main (It's because it aliases methods in PSystem_Utilities/EBS
- # and Pokemon_Sprites)
- #===============================================================================
- # If you want to use it, you can create a Multiple forms property called
- # "bitmapColor", which returns a color object (Color.new)
- # MultipleForms.register(:EEVEE,{
- # "bitmapColor"=>proc{|pokemon|
- # next if pokemon.form==0
- # next Color.new(67,0,255)
- # }
- # })
- # You can also use it for shadow pokémon, thanks to conditional registration.
- # MultipleForms.registerIf(proc{|species| true},{
- # "bitmapColor"=>proc{|pokemon|
- # next Color.new(67,0,255) if (pokemon.isShadow? rescue false)
- # next
- # }
- # })
- #===============================================================================
- def drawShadowPoke(bitmap,color=nil)
- blankcolor=bitmap.get_pixel(0,0)
- shadowcolor=(color ? color : blankcolor)
- colorlayer=Bitmap.new(bitmap.width,bitmap.height)
- colorlayer.fill_rect(colorlayer.rect, shadowcolor)
- bitmap.blt(0,0,colorlayer,colorlayer.rect,113)
- shadowcolor=bitmap.get_pixel(0,0)
- for x in 0...bitmap.width
- for y in 0...bitmap.height
- if bitmap.get_pixel(x,y)==shadowcolor
- bitmap.set_pixel(x,y,blankcolor)
- end
- end
- end
- end
- alias _shadow_pbLoadPokemonBitmapSpecies pbLoadPokemonBitmapSpecies
- if defined?(EBUISTYLE)
- def pbLoadPokemonBitmapSpecies(pokemon, species, back=false,scale=POKEMONSPRITESCALE)
- ret=_shadow_pbLoadPokemonBitmapSpecies(pokemon, species, back,scale)
- if ret
- color=(MultipleForms.call("bitmapColor",pokemon))
- ret.prepareStrip
- for i in 0...ret.totalFrames
- drawShadowPoke(ret.alterBitmap(i),color)
- end
- ret.compileStrip
- end
- return ret
- end
- else
- def pbLoadPokemonBitmapSpecies(pokemon, species, back=false)
- ret=_shadow_pbLoadPokemonBitmapSpecies(pokemon, species, back)
- if ret
- color=(MultipleForms.call("bitmapColor",pokemon))
- animatedBitmap=ret
- copiedBitmap=animatedBitmap.copy
- animatedBitmap.dispose
- copiedBitmap.each {|bitmap|
- drawShadowPoke(bitmap,color)
- }
- ret=copiedBitmap
- end
- return ret
- end
- end
- class PokemonIconSprite
- alias _shadow_pokemon= pokemon=
- def pokemon=(value)
- self._shadow_pokemon=value
- if pokemon
- color=(MultipleForms.call("bitmapColor",pokemon))
- drawShadowPoke(self.bitmap,color)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement