diff --git a/Data/Scripts/003_Game classes/007_Game_Player.rb b/Data/Scripts/003_Game classes/007_Game_Player.rb index 52725e98a..7c8cc2df4 100644 --- a/Data/Scripts/003_Game classes/007_Game_Player.rb +++ b/Data/Scripts/003_Game classes/007_Game_Player.rb @@ -429,7 +429,7 @@ def pbGetPlayerCharset(meta,charset,trainer=nil,force=false) end def pbUpdateVehicle - meta = pbGetMetadata(0,Metadata::PLAYER_A+$PokemonGlobal.playerID) + meta = GameData::Metadata.get_player($PokemonGlobal.playerID) if meta charset = 1 # Regular graphic if $PokemonGlobal.diving; charset = 5 # Diving graphic @@ -448,10 +448,10 @@ def pbCancelVehicles(destination=nil) pbUpdateVehicle end -def pbCanUseBike?(mapid) - return true if pbGetMetadata(mapid,MapMetadata::BICYCLE_ALWAYS) - val = pbGetMetadata(mapid,MapMetadata::BICYCLE) - val = pbGetMetadata(mapid,MapMetadata::OUTDOOR) if val==nil +def pbCanUseBike?(map_id) + return true if GameData::MapMetadata.get(map_id).always_bicycle + val = GameData::MapMetadata.get(map_id).can_bicycle + val = GameData::MapMetadata.get(map_id).outdoor_map if val.nil? return (val) ? true : false end @@ -459,8 +459,8 @@ def pbMountBike return if $PokemonGlobal.bicycle $PokemonGlobal.bicycle = true pbUpdateVehicle - bikebgm = pbGetMetadata(0,Metadata::BICYCLE_BGM) - pbCueBGM(bikebgm,0.5) if bikebgm + bike_bgm = GameData::Metadata.get.bicycle_BGM + pbCueBGM(bike_bgm, 0.5) if bike_bgm end def pbDismountBike diff --git a/Data/Scripts/003_Game classes/008_Game_Player_Visuals.rb b/Data/Scripts/003_Game classes/008_Game_Player_Visuals.rb index 79332ed2e..f0bcd28b4 100644 --- a/Data/Scripts/003_Game classes/008_Game_Player_Visuals.rb +++ b/Data/Scripts/003_Game classes/008_Game_Player_Visuals.rb @@ -38,7 +38,7 @@ class Game_Player < Game_Character @defaultCharacterName = "" if !@defaultCharacterName return @defaultCharacterName if @defaultCharacterName!="" if !@move_route_forcing && $PokemonGlobal.playerID>=0 - meta = pbGetMetadata(0,Metadata::PLAYER_A+$PokemonGlobal.playerID) + meta = GameData::Metadata.get_player($PokemonGlobal.playerID) if meta && !$PokemonGlobal.bicycle && !$PokemonGlobal.diving && !$PokemonGlobal.surfing charset = 1 # Display normal character sprite if pbCanRun? && (moving? || @wasmoving) && Input.dir4!=0 && meta[4] && meta[4]!="" diff --git a/Data/Scripts/003_Game classes/009_Game_Map.rb b/Data/Scripts/003_Game classes/009_Game_Map.rb index 201dd9ebf..7c7c1d248 100644 --- a/Data/Scripts/003_Game classes/009_Game_Map.rb +++ b/Data/Scripts/003_Game classes/009_Game_Map.rb @@ -318,7 +318,7 @@ class Game_Map def display_x=(value) @display_x = value - if pbGetMetadata(self.map_id,MapMetadata::SNAP_EDGES) + if GameData::MapMetadata.get(self.map_id).snap_edges max_x = (self.width - Graphics.width*1.0/TILE_WIDTH) * REAL_RES_X @display_x = [0, [@display_x, max_x].min].max end @@ -327,7 +327,7 @@ class Game_Map def display_y=(value) @display_y = value - if pbGetMetadata(self.map_id,MapMetadata::SNAP_EDGES) + if GameData::MapMetadata.get(self.map_id).snap_edges max_y = (self.height - Graphics.height*1.0/TILE_HEIGHT) * REAL_RES_Y @display_y = [0, [@display_y, max_y].min].max end diff --git a/Data/Scripts/009_Objects and windows/012_TextEntry.rb b/Data/Scripts/009_Objects and windows/012_TextEntry.rb index ae8800fae..ffadd5ea8 100644 --- a/Data/Scripts/009_Objects and windows/012_TextEntry.rb +++ b/Data/Scripts/009_Objects and windows/012_TextEntry.rb @@ -869,7 +869,7 @@ class PokemonEntryScene addBackgroundPlane(@sprites,"background","Naming/bg_2",@viewport) case subject when 1 # Player - meta=pbGetMetadata(0,Metadata::PLAYER_A+$PokemonGlobal.playerID) + meta=GameData::Metadata.get_player($PokemonGlobal.playerID) if meta @sprites["shadow"]=IconSprite.new(0,0,@viewport) @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") @@ -1147,7 +1147,7 @@ class PokemonEntryScene2 @sprites["bg"].setBitmap("Graphics/Pictures/Naming/bg") case subject when 1 # Player - meta=pbGetMetadata(0,Metadata::PLAYER_A+$PokemonGlobal.playerID) + meta=GameData::Metadata.get_player($PokemonGlobal.playerID) if meta @sprites["shadow"]=IconSprite.new(0,0,@viewport) @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") diff --git a/Data/Scripts/011_Data/001_Data_Cache.rb b/Data/Scripts/011_Data/001_Data_Cache.rb index cd5738d8f..c027655bc 100644 --- a/Data/Scripts/011_Data/001_Data_Cache.rb +++ b/Data/Scripts/011_Data/001_Data_Cache.rb @@ -49,23 +49,6 @@ def pbClearData end end -#=============================================================================== -# Methods to get metadata. -#=============================================================================== -def pbLoadMetadata - $PokemonTemp = PokemonTemp.new if !$PokemonTemp - if !$PokemonTemp.metadata - $PokemonTemp.metadata = load_data("Data/metadata.dat") || [] - end - return $PokemonTemp.metadata -end - -def pbGetMetadata(map_id, metadata_type) - meta = pbLoadMetadata - return meta[map_id][metadata_type] if meta[map_id] - return nil -end - #=============================================================================== # Method to get Town Map data. #=============================================================================== diff --git a/Data/Scripts/011_Data/014_Data.rb b/Data/Scripts/011_Data/001_Game data/001_Game data.rb similarity index 62% rename from Data/Scripts/011_Data/014_Data.rb rename to Data/Scripts/011_Data/001_Game data/001_Game data.rb index a568166e5..b96d8af0c 100644 --- a/Data/Scripts/011_Data/014_Data.rb +++ b/Data/Scripts/011_Data/001_Game data/001_Game data.rb @@ -2,6 +2,7 @@ module GameData # A mixin module for data classes which provides common class methods (called # by GameData::Thing.method) that provide access to data held within. # Assumes the data class's data is stored in a class constant hash called DATA. + # For data that is known by a symbol or an ID number. module ClassMethods # @param other [Symbol, self, String, Integer] # @return [Boolean] whether the given other is defined as a self @@ -39,9 +40,51 @@ module GameData def each keys = self::DATA.keys.sort { |a, b| self::DATA[a].id_number <=> self::DATA[b].id_number } - keys.each do |key| - yield self::DATA[key] if key.is_a?(Symbol) - end + keys.each { |key| yield self::DATA[key] if key.is_a?(Symbol) } + end + + def load + const_set(:DATA, load_data("Data/#{self::DATA_FILENAME}")) + end + + def save + save_data(self::DATA, "Data/#{self::DATA_FILENAME}") + end + end + + # A mixin module for data classes which provides common class methods (called + # by GameData::Thing.method) that provide access to data held within. + # Assumes the data class's data is stored in a class constant hash called DATA. + # For data that is only known by an ID number. + module ClassMethodsIDNumbers + # @param other [self, Integer] + # @return [Boolean] whether the given other is defined as a self + def exists?(other) + return false if other.nil? + validate other => [self, Integer] + other = other.id if other.is_a?(self) + return !self::DATA[other].nil? + end + + # @param other [self, Integer] + # @return [self] + def get(other) + validate other => [self, Integer] + return other if other.is_a?(self) + raise "Unknown ID #{other}." unless self::DATA.has_key?(other) + return self::DATA[other] + end + + def try_get(other) + return nil if other.nil? + validate other => [self, Integer] + return other if other.is_a?(self) + return (self::DATA.has_key?(other)) ? self::DATA[other] : nil + end + + def each + keys = self::DATA.keys.sort + keys.each { |key| yield self::DATA[key] } end def load diff --git a/Data/Scripts/011_Data/016_Ability_Data.rb b/Data/Scripts/011_Data/001_Game data/002_Ability.rb similarity index 100% rename from Data/Scripts/011_Data/016_Ability_Data.rb rename to Data/Scripts/011_Data/001_Game data/002_Ability.rb diff --git a/Data/Scripts/011_Data/015_Item_Data.rb b/Data/Scripts/011_Data/001_Game data/003_Item.rb similarity index 100% rename from Data/Scripts/011_Data/015_Item_Data.rb rename to Data/Scripts/011_Data/001_Game data/003_Item.rb diff --git a/Data/Scripts/011_Data/017_Berry_Plant_Data.rb b/Data/Scripts/011_Data/001_Game data/004_Berry plant.rb similarity index 100% rename from Data/Scripts/011_Data/017_Berry_Plant_Data.rb rename to Data/Scripts/011_Data/001_Game data/004_Berry plant.rb diff --git a/Data/Scripts/011_Data/001_Game data/005_Metadata.rb b/Data/Scripts/011_Data/001_Game data/005_Metadata.rb new file mode 100644 index 000000000..acdab800f --- /dev/null +++ b/Data/Scripts/011_Data/001_Game data/005_Metadata.rb @@ -0,0 +1,229 @@ +module GameData + class Metadata + attr_reader :id + attr_reader :home + attr_reader :wild_battle_BGM + attr_reader :trainer_battle_BGM + attr_reader :wild_victory_ME + attr_reader :trainer_victory_ME + attr_reader :wild_capture_ME + attr_reader :surf_BGM + attr_reader :bicycle_BGM + attr_reader :player_A + attr_reader :player_B + attr_reader :player_C + attr_reader :player_D + attr_reader :player_E + attr_reader :player_F + attr_reader :player_G + attr_reader :player_H + + DATA = {} + DATA_FILENAME = "metadata.dat" + + SCHEMA = { + "Home" => [1, "vuuu"], + "WildBattleBGM" => [2, "s"], + "TrainerBattleBGM" => [3, "s"], + "WildVictoryME" => [4, "s"], + "TrainerVictoryME" => [5, "s"], + "WildCaptureME" => [6, "s"], + "SurfBGM" => [7, "s"], + "BicycleBGM" => [8, "s"], + "PlayerA" => [9, "esssssss", :PBTrainers], + "PlayerB" => [10, "esssssss", :PBTrainers], + "PlayerC" => [11, "esssssss", :PBTrainers], + "PlayerD" => [12, "esssssss", :PBTrainers], + "PlayerE" => [13, "esssssss", :PBTrainers], + "PlayerF" => [14, "esssssss", :PBTrainers], + "PlayerG" => [15, "esssssss", :PBTrainers], + "PlayerH" => [16, "esssssss", :PBTrainers] + } + + extend ClassMethodsIDNumbers + include InstanceMethods + + def self.editor_properties + return [ + ["Home", MapCoordsFacingProperty, _INTL("Map ID and X and Y coordinates of where the player goes if no Pokémon Center was entered after a loss.")], + ["WildBattleBGM", BGMProperty, _INTL("Default BGM for wild Pokémon battles.")], + ["TrainerBattleBGM", BGMProperty, _INTL("Default BGM for Trainer battles.")], + ["WildVictoryME", MEProperty, _INTL("Default ME played after winning a wild Pokémon battle.")], + ["TrainerVictoryME", MEProperty, _INTL("Default ME played after winning a Trainer battle.")], + ["WildCaptureME", MEProperty, _INTL("Default ME played after catching a Pokémon.")], + ["SurfBGM", BGMProperty, _INTL("BGM played while surfing.")], + ["BicycleBGM", BGMProperty, _INTL("BGM played while on a bicycle.")], + ["PlayerA", PlayerProperty, _INTL("Specifies player A.")], + ["PlayerB", PlayerProperty, _INTL("Specifies player B.")], + ["PlayerC", PlayerProperty, _INTL("Specifies player C.")], + ["PlayerD", PlayerProperty, _INTL("Specifies player D.")], + ["PlayerE", PlayerProperty, _INTL("Specifies player E.")], + ["PlayerF", PlayerProperty, _INTL("Specifies player F.")], + ["PlayerG", PlayerProperty, _INTL("Specifies player G.")], + ["PlayerH", PlayerProperty, _INTL("Specifies player H.")] + ] + end + + def self.get + return DATA[0] + end + + def self.get_player(id) + case id + when 0 then return self.get.player_A + when 1 then return self.get.player_B + when 2 then return self.get.player_C + when 3 then return self.get.player_D + when 4 then return self.get.player_E + when 5 then return self.get.player_F + when 6 then return self.get.player_G + when 7 then return self.get.player_H + end + return nil + end + + def initialize(hash) + validate hash => Hash, hash[:id] => Integer + @id = hash[:id] + @home = hash[:home] + @wild_battle_BGM = hash[:wild_battle_BGM] + @trainer_battle_BGM = hash[:trainer_battle_BGM] + @wild_victory_ME = hash[:wild_victory_ME] + @trainer_victory_ME = hash[:trainer_victory_ME] + @wild_capture_ME = hash[:wild_capture_ME] + @surf_BGM = hash[:surf_BGM] + @bicycle_BGM = hash[:bicycle_BGM] + @player_A = hash[:player_A] + @player_B = hash[:player_B] + @player_C = hash[:player_C] + @player_D = hash[:player_D] + @player_E = hash[:player_E] + @player_F = hash[:player_F] + @player_G = hash[:player_G] + @player_H = hash[:player_H] + end + + def property_from_string(str) + case str + when "Home" then return @home + when "WildBattleBGM" then return @wild_battle_BGM + when "TrainerBattleBGM" then return @trainer_battle_BGM + when "WildVictoryME" then return @wild_victory_ME + when "TrainerVictoryME" then return @trainer_victory_ME + when "WildCaptureME" then return @wild_capture_ME + when "SurfBGM" then return @surf_BGM + when "BicycleBGM" then return @bicycle_BGM + when "PlayerA" then return @player_A + when "PlayerB" then return @player_B + when "PlayerC" then return @player_C + when "PlayerD" then return @player_D + when "PlayerE" then return @player_E + when "PlayerF" then return @player_F + when "PlayerG" then return @player_G + when "PlayerH" then return @player_H + end + return nil + end + end +end + +#=============================================================================== +# Deprecated methods +#=============================================================================== +def pbLoadMetadata + Deprecation.warn_method('pbLoadMetadata', 'v20', 'GameData::Metadata.get or GameData::MapMetadata.get(map_id)') + return nil +end + +def pbGetMetadata(map_id, metadata_type) + if map_id == 0 # Global metadata + Deprecation.warn_method('pbGetMetadata', 'v20', 'GameData::Metadata.get.something') + ret = GameData::Metadata.get + case metadata_type + when Metadata::HOME then return ret.home + when Metadata::WILD_BATTLE_BGM then return ret.wild_battle_BGM + when Metadata::TRAINER_BATTLE_BGM then return ret.trainer_battle_BGM + when Metadata::WILD_VICTORY_ME then return ret.wild_victory_ME + when Metadata::TRAINER_VICTORY_ME then return ret.trainer_victory_ME + when Metadata::WILD_CAPTURE_ME then return ret.wild_capture_ME + when Metadata::SURF_BGM then return ret.surf_BGM + when Metadata::BICYCLE_BGM then return ret.bicycle_BGM + when Metadata::PLAYER_A then return ret.player_A + when Metadata::PLAYER_B then return ret.player_B + when Metadata::PLAYER_C then return ret.player_C + when Metadata::PLAYER_D then return ret.player_D + when Metadata::PLAYER_E then return ret.player_E + when Metadata::PLAYER_F then return ret.player_F + when Metadata::PLAYER_G then return ret.player_G + when Metadata::PLAYER_H then return ret.player_H + end + else # Map metadata + Deprecation.warn_method('pbGetMetadata', 'v20', 'GameData::MapMetadata.get(map_id).something') + ret = GameData::MapMetadata.get(map_id) + case metadata_type + when MapMetadata::OUTDOOR then return ret.outdoor_map + when MapMetadata::SHOW_AREA then return ret.announce_location + when MapMetadata::BICYCLE then return ret.can_bicycle + when MapMetadata::BICYCLE_ALWAYS then return ret.always_bicycle + when MapMetadata::HEALING_SPOT then return ret.teleport_destination + when MapMetadata::WEATHER then return ret.weather + when MapMetadata::MAP_POSITION then return ret.town_map_position + when MapMetadata::DIVE_MAP then return ret.dive_map_id + when MapMetadata::DARK_MAP then return ret.dark_map + when MapMetadata::SAFARI_MAP then return ret.safari_map + when MapMetadata::SNAP_EDGES then return ret.snap_edges + when MapMetadata::DUNGEON then return ret.random_dungeon + when MapMetadata::BATTLE_BACK then return ret.battle_background + when MapMetadata::WILD_BATTLE_BGM then return ret.wild_battle_BGM + when MapMetadata::TRAINER_BATTLE_BGM then return ret.trainer_battle_BGM + when MapMetadata::WILD_VICTORY_ME then return ret.wild_victory_ME + when MapMetadata::TRAINER_VICTORY_ME then return ret.trainer_victory_ME + when MapMetadata::WILD_CAPTURE_ME then return ret.wild_capture_ME + when MapMetadata::MAP_SIZE then return ret.town_map_size + when MapMetadata::ENVIRONMENT then return ret.battle_environment + end + end + return nil +end + +module Metadata + HOME = 1 + WILD_BATTLE_BGM = 2 + TRAINER_BATTLE_BGM = 3 + WILD_VICTORY_ME = 4 + TRAINER_VICTORY_ME = 5 + WILD_CAPTURE_ME = 6 + SURF_BGM = 7 + BICYCLE_BGM = 8 + PLAYER_A = 9 + PLAYER_B = 10 + PLAYER_C = 11 + PLAYER_D = 12 + PLAYER_E = 13 + PLAYER_F = 14 + PLAYER_G = 15 + PLAYER_H = 16 +end + +module MapMetadata + OUTDOOR = 1 + SHOW_AREA = 2 + BICYCLE = 3 + BICYCLE_ALWAYS = 4 + HEALING_SPOT = 5 + WEATHER = 6 + MAP_POSITION = 7 + DIVE_MAP = 8 + DARK_MAP = 9 + SAFARI_MAP = 10 + SNAP_EDGES = 11 + DUNGEON = 12 + BATTLE_BACK = 13 + WILD_BATTLE_BGM = 14 + TRAINER_BATTLE_BGM = 15 + WILD_VICTORY_ME = 16 + TRAINER_VICTORY_ME = 17 + WILD_CAPTURE_ME = 18 + MAP_SIZE = 19 + ENVIRONMENT = 20 +end diff --git a/Data/Scripts/011_Data/001_Game data/006_Map metadata.rb b/Data/Scripts/011_Data/001_Game data/006_Map metadata.rb new file mode 100644 index 000000000..6102f03e2 --- /dev/null +++ b/Data/Scripts/011_Data/001_Game data/006_Map metadata.rb @@ -0,0 +1,130 @@ +module GameData + class MapMetadata + attr_reader :id + attr_reader :outdoor_map + attr_reader :announce_location + attr_reader :can_bicycle + attr_reader :always_bicycle + attr_reader :teleport_destination + attr_reader :weather + attr_reader :town_map_position + attr_reader :dive_map_id + attr_reader :dark_map + attr_reader :safari_map + attr_reader :snap_edges + attr_reader :random_dungeon + attr_reader :battle_background + attr_reader :wild_battle_BGM + attr_reader :trainer_battle_BGM + attr_reader :wild_victory_ME + attr_reader :trainer_victory_ME + attr_reader :wild_capture_ME + attr_reader :town_map_size + attr_reader :battle_environment + + DATA = {} + DATA_FILENAME = "map_metadata.dat" + + SCHEMA = { + "Outdoor" => [1, "b"], + "ShowArea" => [2, "b"], + "Bicycle" => [3, "b"], + "BicycleAlways" => [4, "b"], + "HealingSpot" => [5, "vuu"], + "Weather" => [6, "eu", :PBFieldWeather], + "MapPosition" => [7, "uuu"], + "DiveMap" => [8, "v"], + "DarkMap" => [9, "b"], + "SafariMap" => [10, "b"], + "SnapEdges" => [11, "b"], + "Dungeon" => [12, "b"], + "BattleBack" => [13, "s"], + "WildBattleBGM" => [14, "s"], + "TrainerBattleBGM" => [15, "s"], + "WildVictoryME" => [16, "s"], + "TrainerVictoryME" => [17, "s"], + "WildCaptureME" => [18, "s"], + "MapSize" => [19, "us"], + "Environment" => [20, "e", :PBEnvironment] + } + + extend ClassMethodsIDNumbers + include InstanceMethods + + def self.editor_properties + return [ + ["Outdoor", BooleanProperty, _INTL("If true, this map is an outdoor map and will be tinted according to time of day.")], + ["ShowArea", BooleanProperty, _INTL("If true, the game will display the map's name upon entry.")], + ["Bicycle", BooleanProperty, _INTL("If true, the bicycle can be used on this map.")], + ["BicycleAlways", BooleanProperty, _INTL("If true, the bicycle will be mounted automatically on this map and cannot be dismounted.")], + ["HealingSpot", MapCoordsProperty, _INTL("Map ID of this Pokémon Center's town, and X and Y coordinates of its entrance within that town.")], + ["Weather", WeatherEffectProperty, _INTL("Weather conditions in effect for this map.")], + ["MapPosition", RegionMapCoordsProperty, _INTL("Identifies the point on the regional map for this map.")], + ["DiveMap", MapProperty, _INTL("Specifies the underwater layer of this map. Use only if this map has deep water.")], + ["DarkMap", BooleanProperty, _INTL("If true, this map is dark and a circle of light appears around the player. Flash can be used to expand the circle.")], + ["SafariMap", BooleanProperty, _INTL("If true, this map is part of the Safari Zone (both indoor and outdoor). Not to be used in the reception desk.")], + ["SnapEdges", BooleanProperty, _INTL("If true, when the player goes near this map's edge, the game doesn't center the player as usual.")], + ["Dungeon", BooleanProperty, _INTL("If true, this map has a randomly generated layout. See the wiki for more information.")], + ["BattleBack", StringProperty, _INTL("PNG files named 'XXX_bg', 'XXX_base0', 'XXX_base1', 'XXX_message' in Battlebacks folder, where XXX is this property's value.")], + ["WildBattleBGM", BGMProperty, _INTL("Default BGM for wild Pokémon battles on this map.")], + ["TrainerBattleBGM", BGMProperty, _INTL("Default BGM for trainer battles on this map.")], + ["WildVictoryME", MEProperty, _INTL("Default ME played after winning a wild Pokémon battle on this map.")], + ["TrainerVictoryME", MEProperty, _INTL("Default ME played after winning a Trainer battle on this map.")], + ["WildCaptureME", MEProperty, _INTL("Default ME played after catching a wild Pokémon on this map.")], + ["MapSize", MapSizeProperty, _INTL("The width of the map in Town Map squares, and a string indicating which squares are part of this map.")], + ["Environment", EnvironmentProperty, _INTL("The default battle environment for battles on this map.")] + ] + end + + def initialize(hash) + validate hash => Hash, hash[:id] => Integer + @id = hash[:id] + @outdoor_map = hash[:outdoor_map] + @announce_location = hash[:announce_location] + @can_bicycle = hash[:can_bicycle] + @always_bicycle = hash[:always_bicycle] + @teleport_destination = hash[:teleport_destination] + @weather = hash[:weather] + @town_map_position = hash[:town_map_position] + @dive_map_id = hash[:dive_map_id] + @dark_map = hash[:dark_map] + @safari_map = hash[:safari_map] + @snap_edges = hash[:snap_edges] + @random_dungeon = hash[:random_dungeon] + @battle_background = hash[:battle_background] + @wild_battle_BGM = hash[:wild_battle_BGM] + @trainer_battle_BGM = hash[:trainer_battle_BGM] + @wild_victory_ME = hash[:wild_victory_ME] + @trainer_victory_ME = hash[:trainer_victory_ME] + @wild_capture_ME = hash[:wild_capture_ME] + @town_map_size = hash[:town_map_size] + @battle_environment = hash[:battle_environment] + end + + def property_from_string(str) + case str + when "Outdoor" then return @outdoor_map + when "ShowArea" then return @announce_location + when "Bicycle" then return @can_bicycle + when "BicycleAlways" then return @always_bicycle + when "HealingSpot" then return @teleport_destination + when "Weather" then return @weather + when "MapPosition" then return @town_map_position + when "DiveMap" then return @dive_map_id + when "DarkMap" then return @dark_map + when "SafariMap" then return @safari_map + when "SnapEdges" then return @snap_edges + when "Dungeon" then return @random_dungeon + when "BattleBack" then return @battle_background + when "WildBattleBGM" then return @wild_battle_BGM + when "TrainerBattleBGM" then return @trainer_battle_BGM + when "WildVictoryME" then return @wild_victory_ME + when "TrainerVictoryME" then return @trainer_victory_ME + when "WildCaptureME" then return @wild_capture_ME + when "MapSize" then return @town_map_size + when "Environment" then return @battle_environment + end + return nil + end + end +end diff --git a/Data/Scripts/011_Data/002_Misc_Data.rb b/Data/Scripts/011_Data/002_Misc_Data.rb index da45a2d63..223977f74 100644 --- a/Data/Scripts/011_Data/002_Misc_Data.rb +++ b/Data/Scripts/011_Data/002_Misc_Data.rb @@ -30,96 +30,6 @@ module PhoneMsgType BattleRequest = 3 end -#=============================================================================== -# Global metadata -#=============================================================================== -module Metadata - HOME = 1 - WILD_BATTLE_BGM = 2 - TRAINER_BATTLE_BGM = 3 - WILD_VICTORY_ME = 4 - TRAINER_VICTORY_ME = 5 - WILD_CAPTURE_ME = 6 - SURF_BGM = 7 - BICYCLE_BGM = 8 - PLAYER_A = 9 - PLAYER_B = 10 - PLAYER_C = 11 - PLAYER_D = 12 - PLAYER_E = 13 - PLAYER_F = 14 - PLAYER_G = 15 - PLAYER_H = 16 - - SCHEMA = { - "Home" => [HOME, "uuuu"], - "WildBattleBGM" => [WILD_BATTLE_BGM, "s"], - "TrainerBattleBGM" => [TRAINER_BATTLE_BGM, "s"], - "WildVictoryME" => [WILD_VICTORY_ME, "s"], - "TrainerVictoryME" => [TRAINER_VICTORY_ME, "s"], - "WildCaptureME" => [WILD_CAPTURE_ME, "s"], - "SurfBGM" => [SURF_BGM, "s"], - "BicycleBGM" => [BICYCLE_BGM, "s"], - "PlayerA" => [PLAYER_A, "esssssss", :PBTrainers], - "PlayerB" => [PLAYER_B, "esssssss", :PBTrainers], - "PlayerC" => [PLAYER_C, "esssssss", :PBTrainers], - "PlayerD" => [PLAYER_D, "esssssss", :PBTrainers], - "PlayerE" => [PLAYER_E, "esssssss", :PBTrainers], - "PlayerF" => [PLAYER_F, "esssssss", :PBTrainers], - "PlayerG" => [PLAYER_G, "esssssss", :PBTrainers], - "PlayerH" => [PLAYER_H, "esssssss", :PBTrainers] - } -end - -#=============================================================================== -# Map-specific metadata -#=============================================================================== -module MapMetadata - OUTDOOR = 1 - SHOW_AREA = 2 - BICYCLE = 3 - BICYCLE_ALWAYS = 4 - HEALING_SPOT = 5 - WEATHER = 6 - MAP_POSITION = 7 - DIVE_MAP = 8 - DARK_MAP = 9 - SAFARI_MAP = 10 - SNAP_EDGES = 11 - DUNGEON = 12 - BATTLE_BACK = 13 - WILD_BATTLE_BGM = 14 - TRAINER_BATTLE_BGM = 15 - WILD_VICTORY_ME = 16 - TRAINER_VICTORY_ME = 17 - WILD_CAPTURE_ME = 18 - MAP_SIZE = 19 - ENVIRONMENT = 20 - - SCHEMA = { - "Outdoor" => [OUTDOOR, "b"], - "ShowArea" => [SHOW_AREA, "b"], - "Bicycle" => [BICYCLE, "b"], - "BicycleAlways" => [BICYCLE_ALWAYS, "b"], - "HealingSpot" => [HEALING_SPOT, "uuu"], - "Weather" => [WEATHER, "eu", :PBFieldWeather], - "MapPosition" => [MAP_POSITION, "uuu"], - "DiveMap" => [DIVE_MAP, "u"], - "DarkMap" => [DARK_MAP, "b"], - "SafariMap" => [SAFARI_MAP, "b"], - "SnapEdges" => [SNAP_EDGES, "b"], - "Dungeon" => [DUNGEON, "b"], - "BattleBack" => [BATTLE_BACK, "s"], - "WildBattleBGM" => [WILD_BATTLE_BGM, "s"], - "TrainerBattleBGM" => [TRAINER_BATTLE_BGM, "s"], - "WildVictoryME" => [WILD_VICTORY_ME, "s"], - "TrainerVictoryME" => [TRAINER_VICTORY_ME, "s"], - "WildCaptureME" => [WILD_CAPTURE_ME, "s"], - "MapSize" => [MAP_SIZE, "us"], - "Environment" => [ENVIRONMENT, "e", :PBEnvironment] - } -end - #=============================================================================== # Pokémon data #=============================================================================== diff --git a/Data/Scripts/011_Data/005_PBExperience.rb b/Data/Scripts/011_Data/Hardcoded game data/001_PBExperience.rb similarity index 100% rename from Data/Scripts/011_Data/005_PBExperience.rb rename to Data/Scripts/011_Data/Hardcoded game data/001_PBExperience.rb diff --git a/Data/Scripts/011_Data/006_PBStats.rb b/Data/Scripts/011_Data/Hardcoded game data/002_PBStats.rb similarity index 100% rename from Data/Scripts/011_Data/006_PBStats.rb rename to Data/Scripts/011_Data/Hardcoded game data/002_PBStats.rb diff --git a/Data/Scripts/011_Data/008_PBNatures.rb b/Data/Scripts/011_Data/Hardcoded game data/003_PBNatures.rb similarity index 100% rename from Data/Scripts/011_Data/008_PBNatures.rb rename to Data/Scripts/011_Data/Hardcoded game data/003_PBNatures.rb diff --git a/Data/Scripts/011_Data/009_PBGenderRates.rb b/Data/Scripts/011_Data/Hardcoded game data/004_PBGenderRates.rb similarity index 100% rename from Data/Scripts/011_Data/009_PBGenderRates.rb rename to Data/Scripts/011_Data/Hardcoded game data/004_PBGenderRates.rb diff --git a/Data/Scripts/011_Data/010_PBEggGroups.rb b/Data/Scripts/011_Data/Hardcoded game data/005_PBEggGroups.rb similarity index 100% rename from Data/Scripts/011_Data/010_PBEggGroups.rb rename to Data/Scripts/011_Data/Hardcoded game data/005_PBEggGroups.rb diff --git a/Data/Scripts/011_Data/011_PBColors.rb b/Data/Scripts/011_Data/Hardcoded game data/006_PBColors.rb similarity index 100% rename from Data/Scripts/011_Data/011_PBColors.rb rename to Data/Scripts/011_Data/Hardcoded game data/006_PBColors.rb diff --git a/Data/Scripts/011_Data/012_PBHabitats.rb b/Data/Scripts/011_Data/Hardcoded game data/007_PBHabitats.rb similarity index 100% rename from Data/Scripts/011_Data/012_PBHabitats.rb rename to Data/Scripts/011_Data/Hardcoded game data/007_PBHabitats.rb diff --git a/Data/Scripts/011_Data/007_PBStatuses.rb b/Data/Scripts/011_Data/Hardcoded game data/008_PBStatuses.rb similarity index 100% rename from Data/Scripts/011_Data/007_PBStatuses.rb rename to Data/Scripts/011_Data/Hardcoded game data/008_PBStatuses.rb diff --git a/Data/Scripts/011_Data/013_PBRibbons.rb b/Data/Scripts/011_Data/Hardcoded game data/009_PBRibbons.rb similarity index 100% rename from Data/Scripts/011_Data/013_PBRibbons.rb rename to Data/Scripts/011_Data/Hardcoded game data/009_PBRibbons.rb diff --git a/Data/Scripts/013_Overworld/002_PField_Field.rb b/Data/Scripts/013_Overworld/002_PField_Field.rb index 307674545..99b1f9297 100644 --- a/Data/Scripts/013_Overworld/002_PField_Field.rb +++ b/Data/Scripts/013_Overworld/002_PField_Field.rb @@ -412,11 +412,11 @@ Events.onMapChanging += proc { |_sender,e| newMapID = e[0] if newMapID>0 mapinfos = ($RPGVX) ? load_data("Data/MapInfos.rvdata") : load_data("Data/MapInfos.rxdata") - oldWeather = pbGetMetadata($game_map.map_id,MapMetadata::WEATHER) + oldWeather = GameData::MapMetadata.get($game_map.map_id).weather if $game_map.name!=mapinfos[newMapID].name $game_screen.weather(0,0,0) if oldWeather else - newWeather = pbGetMetadata(newMapID,MapMetadata::WEATHER) + newWeather = GameData::MapMetadata.get(newMapID).weather $game_screen.weather(0,0,0) if oldWeather && !newWeather end end @@ -424,19 +424,19 @@ Events.onMapChanging += proc { |_sender,e| # Set up various data related to the new map Events.onMapChange += proc { |_sender,e| - oldid = e[0] # previous map ID, 0 if no map ID - healing = pbGetMetadata($game_map.map_id,MapMetadata::HEALING_SPOT) + oldid = e[0] # previous map ID, is 0 if no map ID + healing = GameData::MapMetadata.get($game_map.map_id).teleport_destination $PokemonGlobal.healingSpot = healing if healing $PokemonMap.clear if $PokemonMap $PokemonEncounters.setup($game_map.map_id) if $PokemonEncounters $PokemonGlobal.visitedMaps[$game_map.map_id] = true if oldid!=0 && oldid!=$game_map.map_id mapinfos = ($RPGVX) ? load_data("Data/MapInfos.rvdata") : load_data("Data/MapInfos.rxdata") - weather = pbGetMetadata($game_map.map_id,MapMetadata::WEATHER) + weather = GameData::MapMetadata.get($game_map.map_id).weather if $game_map.name!=mapinfos[oldid].name $game_screen.weather(weather[0],8,20) if weather && rand(100) proc { |pkmn| - next if pkmn.formSimple>=2 - mapPos = pbGetMetadata($game_map.map_id,MapMetadata::MAP_POSITION) - next 1 if mapPos && mapPos[0]==1 # Tiall region + next if pkmn.formSimple >= 2 + mapPos = GameData::MapMetadata.get($game_map.map_id).town_map_position + next 1 if mapPos && mapPos[0] == 1 # Tiall region next 0 } }) -MultipleForms.copy(:PIKACHU,:EXEGGCUTE,:CUBONE) +MultipleForms.copy(:PIKACHU, :EXEGGCUTE, :CUBONE) diff --git a/Data/Scripts/016_Pokemon/005_Pokemon_Evolution.rb b/Data/Scripts/016_Pokemon/005_Pokemon_Evolution.rb index f5a697ccc..1d6d46213 100644 --- a/Data/Scripts/016_Pokemon/005_Pokemon_Evolution.rb +++ b/Data/Scripts/016_Pokemon/005_Pokemon_Evolution.rb @@ -392,7 +392,7 @@ PBEvolution.register(:LevelDiving, { PBEvolution.register(:LevelDarkness, { "levelUpCheck" => proc { |pkmn, parameter| - next pkmn.level >= parameter && pbGetMetadata($game_map.map_id, MapMetadata::DARK_MAP) + next pkmn.level >= parameter && GameData::MapMetadata.get($game_map.map_id).dark_map } }) @@ -651,7 +651,7 @@ PBEvolution.register(:Location, { PBEvolution.register(:Region, { "minimumLevel" => 1, # Needs any level up "levelUpCheck" => proc { |pkmn, parameter| - mapPos = pbGetMetadata($game_map.map_id, MapMetadata::MAP_POSITION) + mapPos = GameData::MapMetadata.get($game_map.map_id).town_map_position next mapPos && mapPos[0] == parameter } }) diff --git a/Data/Scripts/017_UI/004_PScreen_PokedexEntry.rb b/Data/Scripts/017_UI/004_PScreen_PokedexEntry.rb index 1a9a3d3e3..3bc5828c2 100644 --- a/Data/Scripts/017_UI/004_PScreen_PokedexEntry.rb +++ b/Data/Scripts/017_UI/004_PScreen_PokedexEntry.rb @@ -27,7 +27,7 @@ class PokemonPokedexInfo_Scene @sprites["infosprite"].x = 104 @sprites["infosprite"].y = 136 @mapdata = pbLoadTownMapData - mappos = ($game_map) ? pbGetMetadata($game_map.map_id,MapMetadata::MAP_POSITION) : nil + mappos = ($game_map) ? GameData::MapMetadata.get($game_map.map_id).town_map_position : nil if @region<0 # Use player's current region @region = (mappos) ? mappos[0] : 0 # Region 0 default end @@ -311,7 +311,7 @@ class PokemonPokedexInfo_Scene for enc in encdata.keys enctypes = encdata[enc][1] if pbFindEncounter(enctypes,@species) - mappos = pbGetMetadata(enc,MapMetadata::MAP_POSITION) + mappos = GameData::MapMetadata.get(enc).town_map_position if mappos && mappos[0]==@region showpoint = true for loc in @mapdata[@region][2] @@ -319,7 +319,7 @@ class PokemonPokedexInfo_Scene loc[7] && !$game_switches[loc[7]] end if showpoint - mapsize = pbGetMetadata(enc,MapMetadata::MAP_SIZE) + mapsize = GameData::MapMetadata.get(enc).town_map_size if mapsize && mapsize[0] && mapsize[0]>0 sqwidth = mapsize[0] sqheight = (mapsize[1].length*1.0/mapsize[0]).ceil diff --git a/Data/Scripts/017_UI/009_PScreen_RegionMap.rb b/Data/Scripts/017_UI/009_PScreen_RegionMap.rb index b03c3acbf..3d1764057 100644 --- a/Data/Scripts/017_UI/009_PScreen_RegionMap.rb +++ b/Data/Scripts/017_UI/009_PScreen_RegionMap.rb @@ -77,7 +77,7 @@ class PokemonRegionMap_Scene @viewport.z = 99999 @sprites = {} @mapdata = pbLoadTownMapData - playerpos = (!$game_map) ? nil : pbGetMetadata($game_map.map_id,MapMetadata::MAP_POSITION) + playerpos = (!$game_map) ? nil : GameData::MapMetadata.get($game_map.map_id).town_map_position if !playerpos mapindex = 0 @map = @mapdata[0] @@ -93,7 +93,7 @@ class PokemonRegionMap_Scene @map = @mapdata[playerpos[0]] @mapX = playerpos[1] @mapY = playerpos[2] - mapsize = (!$game_map) ? nil : pbGetMetadata($game_map.map_id,MapMetadata::MAP_SIZE) + mapsize = (!$game_map) ? nil : GameData::MapMetadata.get($game_map.map_id).town_map_size if mapsize && mapsize[0] && mapsize[0]>0 sqwidth = mapsize[0] sqheight = (mapsize[1].length*1.0/mapsize[0]).ceil diff --git a/Data/Scripts/017_UI/013_PScreen_Load.rb b/Data/Scripts/017_UI/013_PScreen_Load.rb index 121d1152a..20287fcf0 100644 --- a/Data/Scripts/017_UI/013_PScreen_Load.rb +++ b/Data/Scripts/017_UI/013_PScreen_Load.rb @@ -159,7 +159,7 @@ class PokemonLoad_Scene def pbSetParty(trainer) return if !trainer || !trainer.party - meta = pbGetMetadata(0,Metadata::PLAYER_A+trainer.metaID) + meta = GameData::Metadata.get_player(trainer.metaID) if meta filename = pbGetPlayerCharset(meta,1,trainer,true) @sprites["player"] = TrainerWalkingCharSprite.new(filename,@viewport) diff --git a/Data/Scripts/019_Other battles/001_PBattle_Safari.rb b/Data/Scripts/019_Other battles/001_PBattle_Safari.rb index c518660ea..1dc19d316 100644 --- a/Data/Scripts/019_Other battles/001_PBattle_Safari.rb +++ b/Data/Scripts/019_Other battles/001_PBattle_Safari.rb @@ -62,7 +62,7 @@ def pbInSafari? # map can be outdoors, with its own grassy patches. reception = pbSafariState.pbReceptionMap return true if $game_map.map_id==reception - return true if pbGetMetadata($game_map.map_id,MapMetadata::SAFARI_MAP) + return true if GameData::MapMetadata.get($game_map.map_id).safari_map end return false end diff --git a/Data/Scripts/020_System and utilities/002_PSystem_System.rb b/Data/Scripts/020_System and utilities/002_PSystem_System.rb index b301961d3..ac64edd1a 100644 --- a/Data/Scripts/020_System and utilities/002_PSystem_System.rb +++ b/Data/Scripts/020_System and utilities/002_PSystem_System.rb @@ -80,6 +80,8 @@ def pbSetUpSystem GameData::Ability.load GameData::Item.load GameData::BerryPlant.load + GameData::Metadata.load + GameData::MapMetadata.load rescue consts = [] end diff --git a/Data/Scripts/020_System and utilities/003_PSystem_FileUtilities.rb b/Data/Scripts/020_System and utilities/003_PSystem_FileUtilities.rb index b64f00e07..e380e796f 100644 --- a/Data/Scripts/020_System and utilities/003_PSystem_FileUtilities.rb +++ b/Data/Scripts/020_System and utilities/003_PSystem_FileUtilities.rb @@ -532,13 +532,13 @@ def pbGetWildBattleBGM(_wildParty) # wildParty is an array of Pokémon objects end ret = nil if !ret - # Check map-specific metadata - music = pbGetMetadata($game_map.map_id,MapMetadata::WILD_BATTLE_BGM) + # Check map metadata + music = GameData::MapMetadata.get($game_map.map_id).wild_battle_BGM ret = pbStringToAudioFile(music) if music && music!="" end if !ret # Check global metadata - music = pbGetMetadata(0,Metadata::WILD_BATTLE_BGM) + music = GameData::Metadata.get.wild_battle_BGM ret = pbStringToAudioFile(music) if music && music!="" end ret = pbStringToAudioFile("Battle wild") if !ret @@ -551,13 +551,13 @@ def pbGetWildVictoryME end ret = nil if !ret - # Check map-specific metadata - music = pbGetMetadata($game_map.map_id,MapMetadata::WILD_VICTORY_ME) + # Check map metadata + music = GameData::MapMetadata.get($game_map.map_id).wild_victory_ME ret = pbStringToAudioFile(music) if music && music!="" end if !ret # Check global metadata - music = pbGetMetadata(0,Metadata::WILD_VICTORY_ME) + music = GameData::Metadata.get.wild_victory_ME ret = pbStringToAudioFile(music) if music && music!="" end ret = pbStringToAudioFile("Battle victory") if !ret @@ -571,13 +571,13 @@ def pbGetWildCaptureME end ret = nil if !ret - # Check map-specific metadata - music = pbGetMetadata($game_map.map_id,MapMetadata::WILD_CAPTURE_ME) + # Check map metadata + music = GameData::MapMetadata.get($game_map.map_id).wild_capture_ME ret = pbStringToAudioFile(music) if music && music!="" end if !ret # Check global metadata - music = pbGetMetadata(0,Metadata::WILD_CAPTURE_ME) + music = GameData::Metadata.get.wild_capture_ME ret = pbStringToAudioFile(music) if music && music!="" end ret = pbStringToAudioFile("Battle capture success") if !ret @@ -611,15 +611,15 @@ def pbGetTrainerBattleBGM(trainer) # can be a PokeBattle_Trainer or an array o end ret = pbStringToAudioFile(music) if music && music!="" if !ret - # Check map-specific metadata - music = pbGetMetadata($game_map.map_id,MapMetadata::TRAINER_BATTLE_BGM) + # Check map metadata + music = GameData::MapMetadata.get($game_map.map_id).trainer_battle_BGM if music && music!="" ret = pbStringToAudioFile(music) end end if !ret # Check global metadata - music = pbGetMetadata(0,Metadata::TRAINER_BATTLE_BGM) + music = GameData::Metadata.get.trainer_battle_BGM if music && music!="" ret = pbStringToAudioFile(music) end @@ -635,13 +635,13 @@ def pbGetTrainerBattleBGMFromType(trainertype) data = pbGetTrainerTypeData(trainertype) ret = pbStringToAudioFile(data[4]) if data && data[4] if !ret - # Check map-specific metadata - music = pbGetMetadata($game_map.map_id,MapMetadata::TRAINER_BATTLE_BGM) + # Check map metadata + music = GameData::MapMetadata.get($game_map.map_id).trainer_battle_BGM ret = pbStringToAudioFile(music) if music && music!="" end if !ret # Check global metadata - music = pbGetMetadata(0,Metadata::TRAINER_BATTLE_BGM) + music = GameData::Metadata.get.trainer_battle_BGM ret = pbStringToAudioFile(music) if music && music!="" end ret = pbStringToAudioFile("Battle trainer") if !ret @@ -663,15 +663,15 @@ def pbGetTrainerVictoryME(trainer) # can be a PokeBattle_Trainer or an array o ret = pbStringToAudioFile(music) end if !ret - # Check map-specific metadata - music = pbGetMetadata($game_map.map_id,MapMetadata::TRAINER_VICTORY_ME) + # Check map metadata + music = GameData::MapMetadata.get($game_map.map_id).trainer_victory_ME if music && music!="" ret = pbStringToAudioFile(music) end end if !ret # Check global metadata - music = pbGetMetadata(0,Metadata::TRAINER_VICTORY_ME) + music = GameData::Metadata.get.trainer_victory_ME if music && music!="" ret = pbStringToAudioFile(music) end diff --git a/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb b/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb index e7608ddd9..48454a8b6 100644 --- a/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb +++ b/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb @@ -666,7 +666,7 @@ end #=============================================================================== def pbChangePlayer(id) return false if id<0 || id>=8 - meta = pbGetMetadata(0,Metadata::PLAYER_A+id) + meta = GameData::Metadata.get_player(id) return false if !meta $Trainer.trainertype = meta[0] if $Trainer $game_player.character_name = meta[1] @@ -678,7 +678,7 @@ end def pbGetPlayerGraphic id = $PokemonGlobal.playerID return "" if id<0 || id>=8 - meta = pbGetMetadata(0,Metadata::PLAYER_A+id) + meta = GameData::Metadata.get_player(id) return "" if !meta return pbPlayerSpriteFile(meta[0]) end @@ -686,7 +686,7 @@ end def pbGetPlayerTrainerType id = $PokemonGlobal.playerID return 0 if id<0 || id>=8 - meta = pbGetMetadata(0,Metadata::PLAYER_A+id) + meta = GameData::Metadata.get_player(id) return 0 if !meta return meta[0] end @@ -868,7 +868,7 @@ end # no region was defined in the game's metadata. The ID numbers returned by # this function depend on the current map's position metadata. def pbGetCurrentRegion(defaultRegion=-1) - mappos = ($game_map) ? pbGetMetadata($game_map.map_id,MapMetadata::MAP_POSITION) : nil + mappos = ($game_map) ? GameData::MapMetadata.get($game_map.map_id).town_map_position : nil return (mappos) ? mappos[0] : defaultRegion end diff --git a/Data/Scripts/021_Debug/001_Debug_Menu.rb b/Data/Scripts/021_Debug/001_Debug_Menu.rb index 6f902c8fa..b8927371a 100644 --- a/Data/Scripts/021_Debug/001_Debug_Menu.rb +++ b/Data/Scripts/021_Debug/001_Debug_Menu.rb @@ -166,7 +166,7 @@ def pbDebugMenuCommands(showall=true) commands.add("main","editorsmenu",_INTL("Information editors..."), _INTL("Edit information in the PBS files, terrain tags, battle animations, etc.")) commands.add("editorsmenu","setmetadata",_INTL("Edit Metadata"), - _INTL("Edit global and map-specific metadata.")) + _INTL("Edit global and map metadata.")) commands.add("editorsmenu","mapconnections",_INTL("Edit Map Connections"), _INTL("Connect maps using a visual interface. Can also edit map encounters/metadata.")) commands.add("editorsmenu","terraintags",_INTL("Edit Terrain Tags"), @@ -679,7 +679,7 @@ def pbDebugMenuActions(cmd="",sprites=nil,viewport=nil) when "setplayer" limit = 0 for i in 0...8 - meta = pbGetMetadata(0,Metadata::PLAYER_A+i) + meta = GameData::Metadata.get_player(i) if !meta limit = i; break end diff --git a/Data/Scripts/021_Debug/004_Editor_Screens.rb b/Data/Scripts/021_Debug/004_Editor_Screens.rb index 595e8dddc..fbc01c385 100644 --- a/Data/Scripts/021_Debug/004_Editor_Screens.rb +++ b/Data/Scripts/021_Debug/004_Editor_Screens.rb @@ -553,27 +553,85 @@ end #=============================================================================== # Metadata editor #=============================================================================== -def pbMetadataScreen(defaultMapId=nil) - metadata = nil - mapinfos = pbLoadRxData("Data/MapInfos") - metadata = pbLoadMetadata - map = defaultMapId ? defaultMapId : 0 +def pbMetadataScreen(map_id = 0) loop do - map = pbListScreen(_INTL("SET METADATA"),MapLister.new(map,true)) - break if map<0 - mapname = (map==0) ? _INTL("Global Metadata") : mapinfos[map].name - data = [] - properties = (map==0) ? MapScreenScene::GLOBALMETADATA : MapScreenScene::LOCALMAPS - for i in 0...properties.length - data.push((metadata[map]) ? metadata[map][i+1] : nil) - end - pbPropertyList(mapname,data,properties) - for i in 0...properties.length - metadata[map] = [] if !metadata[map] - metadata[map][i+1] = data[i] - end + map_id = pbListScreen(_INTL("SET METADATA"), MapLister.new(map_id, true)) + break if map_id < 0 + pbEditMetadata(map_id) + end +end + +def pbEditMetadata(map_id = 0) + mapinfos = pbLoadRxData("Data/MapInfos") + data = [] + if map_id == 0 # Global metadata + map_name = _INTL("Global Metadata") + metadata = GameData::Metadata.get + properties = GameData::Metadata.editor_properties + else # Map metadata + map_name = mapinfos[map_id].name + metadata = GameData::MapMetadata.get(map_id) + properties = GameData::MapMetadata.editor_properties + end + properties.each do |property| + data.push(metadata.property_from_string(property[0])) + end + if pbPropertyList(map_name, data, properties, true) + if map_id == 0 # Global metadata + # Construct metadata hash + metadata_hash = { + :id => map_id, + :home => data[0], + :wild_battle_BGM => data[1], + :trainer_battle_BGM => data[2], + :wild_victory_ME => data[3], + :trainer_victory_ME => data[4], + :wild_capture_ME => data[5], + :surf_BGM => data[6], + :bicycle_BGM => data[7], + :player_A => data[8], + :player_B => data[9], + :player_C => data[10], + :player_D => data[11], + :player_E => data[12], + :player_F => data[13], + :player_G => data[14], + :player_H => data[15] + } + # Add metadata's data to records + GameData::Metadata::DATA[map_id] = GameData::Metadata.new(metadata_hash) + GameData::Metadata.save + else # Map metadata + # Construct metadata hash + metadata_hash = { + :id => map_id, + :outdoor_map => data[0], + :announce_location => data[1], + :can_bicycle => data[2], + :always_bicycle => data[3], + :teleport_destination => data[4], + :weather => data[5], + :town_map_position => data[6], + :dive_map_id => data[7], + :dark_map => data[8], + :safari_map => data[9], + :snap_edges => data[10], + :random_dungeon => data[11], + :battle_background => data[12], + :wild_battle_BGM => data[13], + :trainer_battle_BGM => data[14], + :wild_victory_ME => data[15], + :trainer_victory_ME => data[16], + :wild_capture_ME => data[17], + :town_map_size => data[18], + :battle_environment => data[19] + } + # Add metadata's data to records + GameData::MapMetadata::DATA[map_id] = GameData::MapMetadata.new(metadata_hash) + GameData::MapMetadata.save + end + pbSaveMetadata end - pbSerializeMetadata(metadata,mapinfos) if metadata end @@ -638,8 +696,7 @@ def pbItemEditor itm.type, itm.move || 0 ] - save = pbPropertyList(itm.id.to_s, data, items, true) - if save + if pbPropertyList(itm.id.to_s, data, items, true) # Construct item hash item_hash = { :id_number => itm.id_number, diff --git a/Data/Scripts/021_Debug/005_Editor_SaveData.rb b/Data/Scripts/021_Debug/005_Editor_SaveData.rb index f1c4eace8..8672685a3 100644 --- a/Data/Scripts/021_Debug/005_Editor_SaveData.rb +++ b/Data/Scripts/021_Debug/005_Editor_SaveData.rb @@ -184,44 +184,47 @@ end #=============================================================================== # Save metadata data to PBS file #=============================================================================== -def pbSerializeMetadata(metadata,mapinfos) - save_data(metadata,"Data/metadata.dat") +def pbSaveMetadata File.open("PBS/metadata.txt","wb") { |f| f.write(0xEF.chr) f.write(0xBB.chr) f.write(0xBF.chr) f.write("\# "+_INTL("See the documentation on the wiki to learn how to edit this file.")) f.write("\r\n") - for i in 0...metadata.length - next if !metadata[i] + # Write global metadata + f.write("\#-------------------------------\r\n") + f.write("[000]\r\n") + metadata = GameData::Metadata.get + schema = GameData::Metadata::SCHEMA + keys = schema.keys.sort {|a, b| schema[a][0] <=> schema[b][0] } + for key in keys + record = metadata.property_from_string(key) + next if record.nil? + f.write(sprintf("%s = ", key)) + pbWriteCsvRecord(record, f, schema[key]) + f.write("\r\n") + end + # Write map metadata + map_infos = pbLoadRxData("Data/MapInfos") + schema = GameData::MapMetadata::SCHEMA + keys = schema.keys.sort {|a, b| schema[a][0] <=> schema[b][0] } + GameData::MapMetadata.each do |map_data| f.write("\#-------------------------------\r\n") - f.write(sprintf("[%03d]\r\n",i)) - if i==0 - types = Metadata::SCHEMA - else - if mapinfos && mapinfos[i] - f.write(sprintf("# %s\r\n",mapinfos[i].name)) - end - types = MapMetadata::SCHEMA + f.write(sprintf("[%03d]\r\n", map_data.id)) + if map_infos && map_infos[map_data.id] + f.write(sprintf("# %s\r\n", map_infos[map_data.id].name)) end - for key in types.keys - schema = types[key] - record = metadata[i][schema[0]] - next if record==nil - f.write(sprintf("%s = ",key)) - pbWriteCsvRecord(record,f,schema) + for key in keys + record = map_data.property_from_string(key) + next if record.nil? + f.write(sprintf("%s = ", key)) + pbWriteCsvRecord(record, f, schema[key]) f.write("\r\n") end end } end -def pbSaveMetadata - data = load_data("Data/metadata.dat") rescue nil - return if !data - pbSerializeMetadata(data,pbLoadRxData("Data/MapInfos")) -end - #=============================================================================== diff --git a/Data/Scripts/021_Debug/011_Editor_MapConnectionEditor.rb b/Data/Scripts/021_Debug/011_Editor_MapConnectionEditor.rb index c7afe51bf..b68ba0b3b 100644 --- a/Data/Scripts/021_Debug/011_Editor_MapConnectionEditor.rb +++ b/Data/Scripts/021_Debug/011_Editor_MapConnectionEditor.rb @@ -240,83 +240,6 @@ end # Visual Editor (map connections) #=============================================================================== class MapScreenScene - GLOBALMETADATA=[ - ["Home",MapCoordsFacingProperty, - _INTL("Map ID and X and Y coordinates of where the player goes if no Pokémon Center was entered after a loss.")], - ["WildBattleBGM",BGMProperty, - _INTL("Default BGM for wild Pokémon battles.")], - ["TrainerBattleBGM",BGMProperty, - _INTL("Default BGM for Trainer battles.")], - ["WildVictoryME",MEProperty, - _INTL("Default ME played after winning a wild Pokémon battle.")], - ["TrainerVictoryME",MEProperty, - _INTL("Default ME played after winning a Trainer battle.")], - ["WildCaptureME",MEProperty, - _INTL("Default ME played after catching a Pokémon.")], - ["SurfBGM",BGMProperty, - _INTL("BGM played while surfing.")], - ["BicycleBGM",BGMProperty, - _INTL("BGM played while on a bicycle.")], - ["PlayerA",PlayerProperty, - _INTL("Specifies player A.")], - ["PlayerB",PlayerProperty, - _INTL("Specifies player B.")], - ["PlayerC",PlayerProperty, - _INTL("Specifies player C.")], - ["PlayerD",PlayerProperty, - _INTL("Specifies player D.")], - ["PlayerE",PlayerProperty, - _INTL("Specifies player E.")], - ["PlayerF",PlayerProperty, - _INTL("Specifies player F.")], - ["PlayerG",PlayerProperty, - _INTL("Specifies player G.")], - ["PlayerH",PlayerProperty, - _INTL("Specifies player H.")] - ] - LOCALMAPS = [ - ["Outdoor",BooleanProperty, - _INTL("If true, this map is an outdoor map and will be tinted according to time of day.")], - ["ShowArea",BooleanProperty, - _INTL("If true, the game will display the map's name upon entry.")], - ["Bicycle",BooleanProperty, - _INTL("If true, the bicycle can be used on this map.")], - ["BicycleAlways",BooleanProperty, - _INTL("If true, the bicycle will be mounted automatically on this map and cannot be dismounted.")], - ["HealingSpot",MapCoordsProperty, - _INTL("Map ID of this Pokémon Center's town, and X and Y coordinates of its entrance within that town.")], - ["Weather",WeatherEffectProperty, - _INTL("Weather conditions in effect for this map.")], - ["MapPosition",RegionMapCoordsProperty, - _INTL("Identifies the point on the regional map for this map.")], - ["DiveMap",MapProperty, - _INTL("Specifies the underwater layer of this map. Use only if this map has deep water.")], - ["DarkMap",BooleanProperty, - _INTL("If true, this map is dark and a circle of light appears around the player. Flash can be used to expand the circle.")], - ["SafariMap",BooleanProperty, - _INTL("If true, this map is part of the Safari Zone (both indoor and outdoor). Not to be used in the reception desk.")], - ["SnapEdges",BooleanProperty, - _INTL("If true, when the player goes near this map's edge, the game doesn't center the player as usual.")], - ["Dungeon",BooleanProperty, - _INTL("If true, this map has a randomly generated layout. See the wiki for more information.")], - ["BattleBack",StringProperty, - _INTL("PNG files named 'XXX_bg', 'XXX_base0', 'XXX_base1', 'XXX_message' in Battlebacks folder, where XXX is this property's value.")], - ["WildBattleBGM",BGMProperty, - _INTL("Default BGM for wild Pokémon battles on this map.")], - ["TrainerBattleBGM",BGMProperty, - _INTL("Default BGM for trainer battles on this map.")], - ["WildVictoryME",MEProperty, - _INTL("Default ME played after winning a wild Pokémon battle on this map.")], - ["TrainerVictoryME",MEProperty, - _INTL("Default ME played after winning a Trainer battle on this map.")], - ["WildCaptureME",MEProperty, - _INTL("Default ME played after catching a wild Pokémon on this map.")], - ["MapSize",MapSizeProperty, - _INTL("The width of the map in Town Map squares, and a string indicating which squares are part of this map.")], - ["Environment",EnvironmentProperty, - _INTL("The default battle environment for battles on this map.")] - ] - def getMapSprite(id) if !@mapsprites[id] @mapsprites[id]=Sprite.new(@viewport) @@ -405,7 +328,7 @@ class MapScreenScene ret.compact! end -# Returns the maps within _keys_ that are directly connected to this map, _map_. + # Returns the maps within _keys_ that are directly connected to this map, _map_. def getDirectConnections(keys,map) thissprite=getMapSprite(map) thisdims=MapFactoryHelper.getMapDims(map) @@ -520,7 +443,6 @@ class MapScreenScene for c in conns @mapconns.push(c.clone) end - @metadata=pbLoadMetadata if $game_map @currentmap=$game_map.map_id else @@ -532,27 +454,10 @@ class MapScreenScene def setTopSprite(id) for i in @mapsprites.keys - if i==id - @mapsprites[i].z=1 - else - @mapsprites[i].z=0 - end + @mapsprites[i].z = (i == id) ? 1 : 0 end end - def getMetadata(mapid,metadataType) - return @metadata[mapid][metadataType] if @metadata[mapid] - end - - def setMetadata(mapid,metadataType,data) - @metadata[mapid]=[] if !@metadata[mapid] - @metadata[mapid][metadataType]=data - end - - def serializeMetadata - pbSerializeMetadata(@metadata,@mapinfos) - end - def helpWindow helptext=_INTL("A: Add map to canvas\r\n") helptext+=_INTL("DEL: Delete map from canvas\r\n") @@ -578,19 +483,6 @@ class MapScreenScene title.dispose end - def propertyList(map,properties) - infos=load_data("Data/MapInfos.rxdata") - mapname=(map==0) ? _INTL("Global Metadata") : infos[map].name - data=[] - for i in 0...properties.length - data.push(getMetadata(map,i+1)) - end - pbPropertyList(mapname,data,properties) - for i in 0...properties.length - setMetadata(map,i+1,data[i]) - end - end - def getMapRect(mapid) sprite=getMapSprite(mapid) if sprite @@ -605,16 +497,12 @@ class MapScreenScene end end - def onDoubleClick(mapid) - if mapid>=0 - propertyList(mapid,LOCALMAPS) - else - propertyList(0,GLOBALMETADATA) - end + def onDoubleClick(map_id) + pbEditMetadata(map_id) end def onClick(mapid,x,y) - if @lastclick>0 && Graphics.frame_count-@lastclick<15 + if @lastclick>0 && Graphics.frame_count - @lastclick < Graphics.frame_rate * 0.5 onDoubleClick(mapid) @lastclick=-1 else @@ -718,7 +606,7 @@ class MapScreenScene onMouseOver(hitmap,mousepos[0],mousepos[1]) @lasthitmap=hitmap end - if @oldmousex!=mousepos[0]||@oldmousey!=mousepos[1] + if @oldmousex!=mousepos[0] || @oldmousey!=mousepos[1] onMouseMove(hitmap,mousepos[0],mousepos[1]) @oldmousex=mousepos[0] @oldmousey=mousepos[1] @@ -727,26 +615,22 @@ class MapScreenScene end if Input.press?(Input::UP) for i in @mapsprites - next if !i - i[1].y+=4 + i[1].y += 4 if i end end if Input.press?(Input::DOWN) for i in @mapsprites - next if !i - i[1].y-=4 + i[1].y -= 4 if i end end if Input.press?(Input::LEFT) for i in @mapsprites - next if !i - i[1].x+=4 + i[1].x += 4 if i end end if Input.press?(Input::RIGHT) for i in @mapsprites - next if !i - i[1].x-=4 + i[1].x -= 4 if i end end if Input.triggerex?("A"[0]) @@ -791,9 +675,8 @@ class MapScreenScene if Input.trigger?(Input::B) if pbConfirmMessage(_INTL("Save changes?")) serializeConnectionData - serializeMetadata save_data(@encdata,"Data/encounters.dat") - # TODO: Only need to reload connections, metadata, encounter data. + # TODO: Only need to reload connections and encounter data. pbClearData pbSaveEncounterData end diff --git a/Data/Scripts/022_Compiler/003_Compiler_PBS.rb b/Data/Scripts/022_Compiler/003_Compiler_PBS.rb index 67da03e92..6e33de98a 100644 --- a/Data/Scripts/022_Compiler/003_Compiler_PBS.rb +++ b/Data/Scripts/022_Compiler/003_Compiler_PBS.rb @@ -7,45 +7,89 @@ module Compiler # Compile metadata #============================================================================= def compile_metadata - sections = [] - currentmap = -1 - pbCompilerEachCommentedLine("PBS/metadata.txt") { |line,lineno| - if line[/^\s*\[\s*(\d+)\s*\]\s*$/] - sectionname = $~[1] - if currentmap==0 - if sections[currentmap][Metadata::HOME]==nil - raise _INTL("The entry Home is required in metadata.txt section [{1}].",sectionname) - elsif sections[currentmap][Metadata::PLAYER_A]==nil - raise _INTL("The entry PlayerA is required in metadata.txt section [{1}].",sectionname) + GameData::Metadata::DATA.clear + GameData::MapMetadata::DATA.clear + # Read from PBS file + File.open("PBS/metadata.txt", "rb") { |f| + FileLineData.file = "PBS/metadata.txt" # For error reporting + # Read a whole section's lines at once, then run through this code. + # contents is a hash containing all the XXX=YYY lines in that section, where + # the keys are the XXX and the values are the YYY (as unprocessed strings). + pbEachFileSection(f) { |contents, map_id| + schema = (map_id == 0) ? GameData::Metadata::SCHEMA : GameData::MapMetadata::SCHEMA + # Go through schema hash of compilable data and compile this section + for key in schema.keys + FileLineData.setSection(map_id, key, contents[key]) # For error reporting + # Skip empty properties, or raise an error if a required property is + # empty + if contents[key].nil? + if map_id == 0 && ["Home", "PlayerA"].include?(key) + raise _INTL("The entry {1} is required in PBS/metadata.txt section 0.", key) + end + next end + # Compile value for key + value = pbGetCsvRecord(contents[key], key, schema[key]) + value = nil if value.is_a?(Array) && value.length == 0 + contents[key] = value end - currentmap = sectionname.to_i - if sections[currentmap] - raise _INTL("Section [{1}] is defined twice in metadata.txt.\r\n{2}",currentmap,FileLineData.linereport) + if map_id == 0 # Global metadata + # Construct metadata hash + metadata_hash = { + :id => map_id, + :home => contents["Home"], + :wild_battle_BGM => contents["WildBattleBGM"], + :trainer_battle_BGM => contents["TrainerBattleBGM"], + :wild_victory_ME => contents["WildVictoryME"], + :trainer_victory_ME => contents["TrainerVictoryME"], + :wild_capture_ME => contents["WildCaptureME"], + :surf_BGM => contents["SurfBGM"], + :bicycle_BGM => contents["BicycleBGM"], + :player_A => contents["PlayerA"], + :player_B => contents["PlayerB"], + :player_C => contents["PlayerC"], + :player_D => contents["PlayerD"], + :player_E => contents["PlayerE"], + :player_F => contents["PlayerF"], + :player_G => contents["PlayerG"], + :player_H => contents["PlayerH"] + } + # Add metadata's data to records + GameData::Metadata::DATA[map_id] = GameData::Metadata.new(metadata_hash) + else # Map metadata + # Construct metadata hash + metadata_hash = { + :id => map_id, + :outdoor_map => contents["Outdoor"], + :announce_location => contents["ShowArea"], + :can_bicycle => contents["Bicycle"], + :always_bicycle => contents["BicycleAlways"], + :teleport_destination => contents["HealingSpot"], + :weather => contents["Weather"], + :town_map_position => contents["MapPosition"], + :dive_map_id => contents["DiveMap"], + :dark_map => contents["DarkMap"], + :safari_map => contents["SafariMap"], + :snap_edges => contents["SnapEdges"], + :random_dungeon => contents["Dungeon"], + :battle_background => contents["BattleBack"], + :wild_battle_BGM => contents["WildBattleBGM"], + :trainer_battle_BGM => contents["TrainerBattleBGM"], + :wild_victory_ME => contents["WildVictoryME"], + :trainer_victory_ME => contents["TrainerVictoryME"], + :wild_capture_ME => contents["WildCaptureME"], + :town_map_size => contents["MapSize"], + :battle_environment => contents["Environment"] + } + # Add metadata's data to records + GameData::MapMetadata::DATA[map_id] = GameData::MapMetadata.new(metadata_hash) end - sections[currentmap] = [] - else - if currentmap<0 - raise _INTL("Expected a section at the beginning of the file.\r\n{1}",FileLineData.linereport) - end - if !line[/^\s*(\w+)\s*=\s*(.*)$/] - raise _INTL("Bad line syntax (expected syntax like XXX=YYY).\r\n{1}",FileLineData.linereport) - end - matchData = $~ - schema = nil - FileLineData.setSection(currentmap,matchData[1],matchData[2]) - if currentmap==0 - schema = Metadata::SCHEMA[matchData[1]] - else - schema = MapMetadata::SCHEMA[matchData[1]] - end - if schema - record = pbGetCsvRecord(matchData[2],lineno,schema) - sections[currentmap][schema[0]] = record - end - end + } } - save_data(sections,"Data/metadata.dat") + # Save all data + GameData::Metadata.save + GameData::MapMetadata.save + Graphics.update end #============================================================================= @@ -166,27 +210,6 @@ module Compiler Graphics.update end - def compile_berry_plants - sections = {} - if File.exists?("PBS/berryplants.txt") - pbCompilerEachCommentedLine("PBS/berryplants.txt") { |line,_lineno| - if line[ /^\s*(\w+)\s*=\s*(.*)$/ ] - key = $1 - value = $2 - value = value.split(",") - for i in 0...value.length - value[i].sub!(/^\s*/,"") - value[i].sub!(/\s*$/,"") - value[i] = value[i].to_i - end - item = parseItem(key) - sections[item] = value - end - } - end - save_data(sections, "Data/berry_plants.dat") - end - #============================================================================= # Compile phone messages #============================================================================= diff --git a/PBS/metadata.txt b/PBS/metadata.txt index f4b742d95..d97c0fa73 100644 --- a/PBS/metadata.txt +++ b/PBS/metadata.txt @@ -1,42 +1,42 @@ # See the documentation on the wiki to learn how to edit this file. #------------------------------- [000] -PlayerA = POKEMONTRAINER_Red,trchar000,boy_bike,boy_surf,boy_run,boy_surf,boy_fish_offset,boy_fish_offset -PlayerB = POKEMONTRAINER_Leaf,trchar001,girl_bike,girl_surf,girl_run,girl_surf,girl_fish_offset,girl_fish_offset -TrainerVictoryME = Battle victory trainer.ogg -WildVictoryME = Battle victory wild.ogg -TrainerBattleBGM = Battle trainer.mid -SurfBGM = Surfing.mid -BicycleBGM = Bicycle.mid Home = 3,7,5,8 WildBattleBGM = Battle wild.mid +TrainerBattleBGM = Battle trainer.mid +WildVictoryME = Battle victory wild.ogg +TrainerVictoryME = Battle victory trainer.ogg +SurfBGM = Surfing.mid +BicycleBGM = Bicycle.mid +PlayerA = POKEMONTRAINER_Red,trchar000,boy_bike,boy_surf,boy_run,boy_surf,boy_fish_offset,boy_fish_offset +PlayerB = POKEMONTRAINER_Leaf,trchar001,girl_bike,girl_surf,girl_run,girl_surf,girl_fish_offset,girl_fish_offset #------------------------------- [001] # Intro #------------------------------- [002] # Lappet Town -BattleBack = field -MapPosition = 0,13,12 Outdoor = true ShowArea = true +MapPosition = 0,13,12 +BattleBack = field #------------------------------- [003] # \PN's house -MapPosition = 0,13,12 HealingSpot = 2,8,8 +MapPosition = 0,13,12 #------------------------------- [004] # Pokémon Lab -MapPosition = 0,13,12 ShowArea = false +MapPosition = 0,13,12 #------------------------------- [005] # Route 1 -BattleBack = field -MapPosition = 0,13,11 Outdoor = true ShowArea = true +MapPosition = 0,13,11 +BattleBack = field #------------------------------- [006] # Kurt's house @@ -44,10 +44,10 @@ MapPosition = 0,13,11 #------------------------------- [007] # Cedolan City -MapSize = 2,11 -MapPosition = 0,13,10 Outdoor = true ShowArea = true +MapPosition = 0,13,10 +MapSize = 2,11 #------------------------------- [008] # Daisy's house @@ -55,13 +55,13 @@ MapPosition = 0,13,12 #------------------------------- [009] # Cedolan City Poké Center -MapPosition = 0,14,10 HealingSpot = 8,17,11 +MapPosition = 0,14,10 #------------------------------- [010] # Cedolan Gym -BattleBack = indoor3 MapPosition = 0,13,10 +BattleBack = indoor3 Environment = Rock #------------------------------- [011] @@ -106,23 +106,23 @@ MapPosition = 0,13,10 #------------------------------- [021] # Route 2 -MapSize = 1,11 -BattleBack = field -Weather = Rain,100 -MapPosition = 0,14,8 Outdoor = true ShowArea = true +Weather = Rain,100 +MapPosition = 0,14,8 +BattleBack = field +MapSize = 1,11 #------------------------------- [023] # Lerucean Town -MapPosition = 0,15,8 Outdoor = true ShowArea = true +MapPosition = 0,15,8 #------------------------------- [024] # Lerucean Town Poké Center -MapPosition = 0,15,8 HealingSpot = 23,11,15 +MapPosition = 0,15,8 #------------------------------- [025] # Lerucean Town Mart @@ -138,10 +138,10 @@ MapPosition = 0,15,8 #------------------------------- [028] # Natural Park -BattleBack = field -MapPosition = 0,16,8 Outdoor = true ShowArea = true +MapPosition = 0,16,8 +BattleBack = field #------------------------------- [029] # Natural Park Entrance @@ -154,34 +154,34 @@ MapPosition = 0,16,8 #------------------------------- [031] # Route 3 -MapSize = 2,1101 -BattleBack = field -MapPosition = 0,14,6 Outdoor = true ShowArea = true +MapPosition = 0,14,6 +BattleBack = field +MapSize = 2,1101 #------------------------------- [034] # Ice Cave -BattleBack = cave1 Bicycle = true MapPosition = 0,15,6 +BattleBack = cave1 Environment = Cave #------------------------------- [035] # Ingido Plateau -MapPosition = 0,13,6 Outdoor = true ShowArea = true +MapPosition = 0,13,6 #------------------------------- [036] # Pokémon League -MapPosition = 0,13,6 HealingSpot = 35,17,7 +MapPosition = 0,13,6 #------------------------------- [037] # Pokémon League -BattleBack = elite1 MapPosition = 0,13,6 +BattleBack = elite1 #------------------------------- [038] # Hall of Fame @@ -189,41 +189,41 @@ MapPosition = 0,13,6 #------------------------------- [039] # Route 4 -MapSize = 2,11 -BattleBack = field -MapPosition = 0,11,6 Outdoor = true ShowArea = true +MapPosition = 0,11,6 +BattleBack = field +MapSize = 2,11 #------------------------------- [040] # Route 4 -MapPosition = 0,11,6 Outdoor = true -BicycleAlways = true ShowArea = true +BicycleAlways = true +MapPosition = 0,11,6 #------------------------------- [041] # Route 5 -MapSize = 1,111 -MapPosition = 0,11,7 Outdoor = true -BicycleAlways = true ShowArea = true +BicycleAlways = true +MapPosition = 0,11,7 +MapSize = 1,111 #------------------------------- [044] # Route 6 -MapSize = 2,11 -BattleBack = field -MapPosition = 0,11,10 Outdoor = true ShowArea = true +MapPosition = 0,11,10 +BattleBack = field +MapSize = 2,11 #------------------------------- [045] # Route 6 -MapPosition = 0,11,10 Outdoor = true -BicycleAlways = true ShowArea = true +BicycleAlways = true +MapPosition = 0,11,10 #------------------------------- [046] # Cycling Road gate @@ -232,47 +232,47 @@ MapPosition = 0,12,6 #------------------------------- [047] # Route 7 -MapSize = 2,11 -BattleBack = rocky +Outdoor = true +ShowArea = true Weather = Rain,0 MapPosition = 0,15,10 -Outdoor = true +BattleBack = rocky +MapSize = 2,11 Environment = Rock -ShowArea = true #------------------------------- [049] # Rock Cave -BattleBack = cave1 Bicycle = true MapPosition = 0,16,10 +BattleBack = cave1 Environment = Cave #------------------------------- [050] # Rock Cave -BattleBack = cave3 Bicycle = true MapPosition = 0,16,10 DarkMap = true +BattleBack = cave3 Environment = Cave #------------------------------- [051] # Dungeon -BattleBack = cave2 Bicycle = true -Dungeon = true MapPosition = 0,16,10 +Dungeon = true +BattleBack = cave2 Environment = Cave #------------------------------- [052] # Battle Frontier -MapPosition = 0,17,10 Outdoor = true ShowArea = true +MapPosition = 0,17,10 #------------------------------- [053] # Battle Frontier Poké Center -MapPosition = 0,17,10 HealingSpot = 52,17,14 +MapPosition = 0,17,10 #------------------------------- [054] # Battle Frontier Mart @@ -280,13 +280,13 @@ MapPosition = 0,17,10 #------------------------------- [055] # Battle Tower -MapPosition = 0,17,10 HealingSpot = 52,30,10 +MapPosition = 0,17,10 #------------------------------- [056] # Battle Tower arena -BattleBack = indoor1 MapPosition = 0,17,10 +BattleBack = indoor1 #------------------------------- [057] # Stadium Cup lobby @@ -298,8 +298,8 @@ MapPosition = 0,17,10 #------------------------------- [059] # Battle Palace arena -BattleBack = indoor1 MapPosition = 0,17,10 +BattleBack = indoor1 #------------------------------- [060] # Battle Arena @@ -307,8 +307,8 @@ MapPosition = 0,17,10 #------------------------------- [061] # Battle Arena arena -BattleBack = indoor1 MapPosition = 0,17,10 +BattleBack = indoor1 #------------------------------- [062] # Battle Factory @@ -320,8 +320,8 @@ MapPosition = 0,17,10 #------------------------------- [064] # Battle Factory arena -BattleBack = indoor1 MapPosition = 0,17,10 +BattleBack = indoor1 #------------------------------- [065] # Battle Factory corridor @@ -329,10 +329,10 @@ MapPosition = 0,17,10 #------------------------------- [066] # Safari Zone -BattleBack = field -MapPosition = 0,12,12 Outdoor = true ShowArea = true +MapPosition = 0,12,12 +BattleBack = field #------------------------------- [067] # Safari Zone gate @@ -340,25 +340,25 @@ MapPosition = 0,12,12 #------------------------------- [068] # Safari Zone -BattleBack = forest +Outdoor = true +ShowArea = true MapPosition = 0,12,12 SafariMap = true -Outdoor = true +BattleBack = forest Environment = Forest -ShowArea = true #------------------------------- [069] # Route 8 -DiveMap = 70 -BattleBack = field -MapPosition = 0,13,13 Outdoor = true ShowArea = true +MapPosition = 0,13,13 +DiveMap = 70 +BattleBack = field #------------------------------- [070] # Underwater -BattleBack = underwater MapPosition = 0,13,13 +BattleBack = underwater Environment = Underwater #------------------------------- [071] @@ -367,18 +367,18 @@ MapPosition = 0,13,13 #------------------------------- [072] # Berth Island -BattleBack = field -Weather = Storm,50 -MapPosition = 0,18,17 Outdoor = true ShowArea = true +Weather = Storm,50 +MapPosition = 0,18,17 +BattleBack = field #------------------------------- [073] # Faraday Island -BattleBack = field -MapPosition = 0,22,16 Outdoor = true ShowArea = true +MapPosition = 0,22,16 +BattleBack = field #------------------------------- [074] # Cycling Road gate @@ -387,6 +387,6 @@ MapPosition = 0,12,10 #------------------------------- [075] # Tiall Region -BattleBack = city -MapPosition = 1,13,16 Outdoor = true +MapPosition = 1,13,16 +BattleBack = city