Moved global/map metadata constants and schema into modules

This commit is contained in:
Maruno17
2020-10-16 22:05:38 +01:00
parent 71a4d09224
commit e82b5409fb
25 changed files with 170 additions and 164 deletions

View File

@@ -66,11 +66,11 @@ end
def pbRandomPhoneTrainer
$PokemonGlobal.phoneNumbers = [] if !$PokemonGlobal.phoneNumbers
temparray = []
currentRegion = pbGetMetadata($game_map.map_id,MetadataMapPosition)
currentRegion = pbGetMetadata($game_map.map_id,MapMetadata::MAP_POSITION)
for num in $PokemonGlobal.phoneNumbers
next if !num[0] || num.length!=8 # if not visible or not a trainer
next if $game_map.map_id==num[6] # Can't call if on same map
callerRegion = pbGetMetadata(num[6],MetadataMapPosition)
callerRegion = pbGetMetadata(num[6],MapMetadata::MAP_POSITION)
# Can't call if in different region
next if callerRegion && currentRegion && callerRegion[0]!=currentRegion[0]
temparray.push(num)
@@ -193,8 +193,8 @@ def pbCallTrainer(trtype,trname)
pbMessage(_INTL("The Trainer is close by.\nTalk to the Trainer in person!"))
return
end
callerregion = pbGetMetadata(trainer[6],MetadataMapPosition)
currentregion = pbGetMetadata($game_map.map_id,MetadataMapPosition)
callerregion = pbGetMetadata(trainer[6],MapMetadata::MAP_POSITION)
currentregion = pbGetMetadata($game_map.map_id,MapMetadata::MAP_POSITION)
if callerregion && currentregion && callerregion[0]!=currentregion[0]
pbMessage(_INTL("The Trainer is out of range."))
return # Can't call if in different region