for j in 0...2 # Try using the species' internal name and then its ID number
next if trySpecies==0 && j==0
trySpeciesText = (j==0) ? getConstantName(PBSpecies,trySpecies) : sprintf("%03d",trySpecies)
bitmapFileName = sprintf("Graphics/Battlers/%s%s%s%s%s%s",
trySpeciesText,
(tryGender) ? "f" : "",
(tryShiny) ? "s" : "",
(tryBack) ? "b" : "",
(tryForm!=0) ? "_"+tryForm.to_s : "",
(tryShadow) ? "_shadow" : "") rescue nil
ret = pbResolveBitmap(bitmapFileName)
return ret if ret
end
end
return nil
end
def pbLoadPokemonShadowBitmap(pokemon)
bitmapFileName = pbCheckPokemonShadowBitmapFiles(pokemon.species,pokemon.form)
return AnimatedPokemonBitmap.new(pbResolveBitmap(bitmapFileName)) if bitmapFileName
return nil
end
def pbLoadPokemonShadowBitmapSpecies(pokemon,species)
bitmapFileName = pbCheckPokemonShadowBitmapFiles(species,pokemon.form)
return AnimatedPokemonBitmap.new(pbResolveBitmap(bitmapFileName)) if bitmapFileName
return nil
end
def pbCheckPokemonShadowBitmapFiles(species,form,fullmetrics=nil)
if form>0
bitmapFileName = sprintf("Graphics/Battlers/%s_%d_battleshadow",getConstantName(PBSpecies,species),form) rescue nil
ret = pbResolveBitmap(bitmapFileName)
return bitmapFileName if ret
bitmapFileName = sprintf("Graphics/Battlers/%03d_%d_battleshadow",species,form)
ret = pbResolveBitmap(bitmapFileName)
return bitmapFileName if ret
end
bitmapFileName = sprintf("Graphics/Battlers/%s_battleshadow",getConstantName(PBSpecies,species)) rescue nil
ret = pbResolveBitmap(bitmapFileName)
return bitmapFileName if ret
bitmapFileName = sprintf("Graphics/Battlers/%03d_battleshadow",species)
ret = pbResolveBitmap(bitmapFileName)
return bitmapFileName if ret
# Load metrics and use that graphic
fullmetrics = pbLoadSpeciesMetrics if !fullmetrics
size = (fullmetrics[MetricBattlerShadowSize][pbGetFSpeciesFromForm(species,form)] || 2)
bitmapFileName = sprintf("Graphics/Pictures/Battle/battler_shadow_%d",size)
return bitmapFileName if pbResolveBitmap(bitmapFileName)
return nil
end