Fixed code assuming map metadata exists, fixed misplaced species data methods, rewrote class PokeBattle_Pokemon

This commit is contained in:
Maruno17
2021-01-20 20:22:31 +00:00
parent 7f254c6434
commit 736bb9ed10
24 changed files with 283 additions and 198 deletions

View File

@@ -358,16 +358,15 @@ def pbBikeCheck
pbMessage(_INTL("It can't be used when you have someone with you."))
return false
end
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
if $PokemonGlobal.bicycle
if GameData::MapMetadata.get($game_map.map_id).always_bicycle
if map_metadata && map_metadata.always_bicycle
pbMessage(_INTL("You can't dismount your Bike here."))
return false
end
return true
end
val = GameData::MapMetadata.get($game_map.map_id).can_bicycle
val = GameData::MapMetadata.get($game_map.map_id).outdoor_map if val.nil?
if !val
if !map_metadata || (!map_metadata.can_bicycle && !map_metadata.outdoor_map)
pbMessage(_INTL("Can't use that here."))
return false
end