def drawRoamingPosition(mapindex)
mapindex = $game_map ? pbGetMetadata($game_map.map_id, MetadataMapPosition) : nil
for roamPos in $PokemonGlobal.roamPosition
roamingData = RoamingSpecies[roamPos[0]]
active = $game_switches[roamingData[2]] && (
$PokemonGlobal.roamPokemon.size <= roamPos[0] ||
$PokemonGlobal.roamPokemon[roamPos[0]]!=true
)
next if !active
species=getID(PBSpecies,roamingData[0])
next if !species || species<=0
pokepos = $game_map ? pbGetMetadata(roamPos[1],MetadataMapPosition) : nil
next if mapindex[0]!=pokepos[0]
x = pokepos[1]
y = pokepos[2]
sqwidth = PokemonRegionMap_Scene::SQUAREWIDTH
sqheight = PokemonRegionMap_Scene::SQUAREHEIGHT
@sprites["roaming#{species}"] = IconSprite.new(0,0,@viewport)
@sprites["roaming#{species}"].setBitmap(getRoamingIcon(species))
@sprites["roaming#{species}"].x = -sqwidth/2+(x*sqwidth)+ 240
@sprites["roaming#{species}"].y = -sqheight/2+(y*sqheight)+ 187.5
end
end
def getRoamingIcon(species)
return nil if !species
fileName = sprintf("Graphics/Pictures/mapPokemon%03d", species)
ret = pbResolveBitmap(fileName)
if !ret
fileName = "Graphics/Pictures/mapPokemon000"
ret = pbResolveBitmap(fileName)
end
return ret
end