Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Fill the array "points" with all squares of the region map in which the
- # species can be found
- points = []
- mapwidth = 1+PokemonRegionMap_Scene::RIGHT-PokemonRegionMap_Scene::LEFT
- encdata = load_data("Data/encounters.dat")
- for enc in encdata.keys
- enctypes = encdata[enc][1]
- j=-1
- for i in 0...RoamingSpecies.length
- s=getID(PBSpecies,RoamingSpecies[i][0])
- if s==@species
- j=i
- break
- end
- end
- if pbFindEncounter(enctypes,@species) || (j>-1 && enc==$PokemonGlobal.roamPosition[j])
- mappos = pbGetMetadata(enc,MetadataMapPosition)
- if mappos && mappos[0]==@region
- showpoint = true
- for loc in @mapdata[@region][2]
- showpoint = false if loc[0]==mappos[1] && loc[1]==mappos[2] &&
- loc[7] && !$game_switches[loc[7]]
- end
- if showpoint
- mapsize = pbGetMetadata(enc,MetadataMapSize)
- if mapsize && mapsize[0] && mapsize[0]>0
- sqwidth = mapsize[0]
- sqheight = (mapsize[1].length*1.0/mapsize[0]).ceil
- for i in 0...sqwidth
- for j in 0...sqheight
- if mapsize[1][i+j*sqwidth,1].to_i>0
- points[mappos[1]+i+(mappos[2]+j)*mapwidth] = true
- end
- end
- end
- else
- points[mappos[1]+mappos[2]*mapwidth] = true
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement