mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 06:04:59 +00:00
Implemented GameData::Metadata and GameData::MapMetadata
This commit is contained in:
@@ -429,7 +429,7 @@ def pbGetPlayerCharset(meta,charset,trainer=nil,force=false)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbUpdateVehicle
|
def pbUpdateVehicle
|
||||||
meta = pbGetMetadata(0,Metadata::PLAYER_A+$PokemonGlobal.playerID)
|
meta = GameData::Metadata.get_player($PokemonGlobal.playerID)
|
||||||
if meta
|
if meta
|
||||||
charset = 1 # Regular graphic
|
charset = 1 # Regular graphic
|
||||||
if $PokemonGlobal.diving; charset = 5 # Diving graphic
|
if $PokemonGlobal.diving; charset = 5 # Diving graphic
|
||||||
@@ -448,10 +448,10 @@ def pbCancelVehicles(destination=nil)
|
|||||||
pbUpdateVehicle
|
pbUpdateVehicle
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbCanUseBike?(mapid)
|
def pbCanUseBike?(map_id)
|
||||||
return true if pbGetMetadata(mapid,MapMetadata::BICYCLE_ALWAYS)
|
return true if GameData::MapMetadata.get(map_id).always_bicycle
|
||||||
val = pbGetMetadata(mapid,MapMetadata::BICYCLE)
|
val = GameData::MapMetadata.get(map_id).can_bicycle
|
||||||
val = pbGetMetadata(mapid,MapMetadata::OUTDOOR) if val==nil
|
val = GameData::MapMetadata.get(map_id).outdoor_map if val.nil?
|
||||||
return (val) ? true : false
|
return (val) ? true : false
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -459,8 +459,8 @@ def pbMountBike
|
|||||||
return if $PokemonGlobal.bicycle
|
return if $PokemonGlobal.bicycle
|
||||||
$PokemonGlobal.bicycle = true
|
$PokemonGlobal.bicycle = true
|
||||||
pbUpdateVehicle
|
pbUpdateVehicle
|
||||||
bikebgm = pbGetMetadata(0,Metadata::BICYCLE_BGM)
|
bike_bgm = GameData::Metadata.get.bicycle_BGM
|
||||||
pbCueBGM(bikebgm,0.5) if bikebgm
|
pbCueBGM(bike_bgm, 0.5) if bike_bgm
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbDismountBike
|
def pbDismountBike
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class Game_Player < Game_Character
|
|||||||
@defaultCharacterName = "" if !@defaultCharacterName
|
@defaultCharacterName = "" if !@defaultCharacterName
|
||||||
return @defaultCharacterName if @defaultCharacterName!=""
|
return @defaultCharacterName if @defaultCharacterName!=""
|
||||||
if !@move_route_forcing && $PokemonGlobal.playerID>=0
|
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
|
if meta && !$PokemonGlobal.bicycle && !$PokemonGlobal.diving && !$PokemonGlobal.surfing
|
||||||
charset = 1 # Display normal character sprite
|
charset = 1 # Display normal character sprite
|
||||||
if pbCanRun? && (moving? || @wasmoving) && Input.dir4!=0 && meta[4] && meta[4]!=""
|
if pbCanRun? && (moving? || @wasmoving) && Input.dir4!=0 && meta[4] && meta[4]!=""
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ class Game_Map
|
|||||||
|
|
||||||
def display_x=(value)
|
def display_x=(value)
|
||||||
@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
|
max_x = (self.width - Graphics.width*1.0/TILE_WIDTH) * REAL_RES_X
|
||||||
@display_x = [0, [@display_x, max_x].min].max
|
@display_x = [0, [@display_x, max_x].min].max
|
||||||
end
|
end
|
||||||
@@ -327,7 +327,7 @@ class Game_Map
|
|||||||
|
|
||||||
def display_y=(value)
|
def display_y=(value)
|
||||||
@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
|
max_y = (self.height - Graphics.height*1.0/TILE_HEIGHT) * REAL_RES_Y
|
||||||
@display_y = [0, [@display_y, max_y].min].max
|
@display_y = [0, [@display_y, max_y].min].max
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -869,7 +869,7 @@ class PokemonEntryScene
|
|||||||
addBackgroundPlane(@sprites,"background","Naming/bg_2",@viewport)
|
addBackgroundPlane(@sprites,"background","Naming/bg_2",@viewport)
|
||||||
case subject
|
case subject
|
||||||
when 1 # Player
|
when 1 # Player
|
||||||
meta=pbGetMetadata(0,Metadata::PLAYER_A+$PokemonGlobal.playerID)
|
meta=GameData::Metadata.get_player($PokemonGlobal.playerID)
|
||||||
if meta
|
if meta
|
||||||
@sprites["shadow"]=IconSprite.new(0,0,@viewport)
|
@sprites["shadow"]=IconSprite.new(0,0,@viewport)
|
||||||
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow")
|
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow")
|
||||||
@@ -1147,7 +1147,7 @@ class PokemonEntryScene2
|
|||||||
@sprites["bg"].setBitmap("Graphics/Pictures/Naming/bg")
|
@sprites["bg"].setBitmap("Graphics/Pictures/Naming/bg")
|
||||||
case subject
|
case subject
|
||||||
when 1 # Player
|
when 1 # Player
|
||||||
meta=pbGetMetadata(0,Metadata::PLAYER_A+$PokemonGlobal.playerID)
|
meta=GameData::Metadata.get_player($PokemonGlobal.playerID)
|
||||||
if meta
|
if meta
|
||||||
@sprites["shadow"]=IconSprite.new(0,0,@viewport)
|
@sprites["shadow"]=IconSprite.new(0,0,@viewport)
|
||||||
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow")
|
@sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow")
|
||||||
|
|||||||
@@ -49,23 +49,6 @@ def pbClearData
|
|||||||
end
|
end
|
||||||
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.
|
# Method to get Town Map data.
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ module GameData
|
|||||||
# A mixin module for data classes which provides common class methods (called
|
# A mixin module for data classes which provides common class methods (called
|
||||||
# by GameData::Thing.method) that provide access to data held within.
|
# 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.
|
# 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
|
module ClassMethods
|
||||||
# @param other [Symbol, self, String, Integer]
|
# @param other [Symbol, self, String, Integer]
|
||||||
# @return [Boolean] whether the given other is defined as a self
|
# @return [Boolean] whether the given other is defined as a self
|
||||||
@@ -39,9 +40,51 @@ module GameData
|
|||||||
|
|
||||||
def each
|
def each
|
||||||
keys = self::DATA.keys.sort { |a, b| self::DATA[a].id_number <=> self::DATA[b].id_number }
|
keys = self::DATA.keys.sort { |a, b| self::DATA[a].id_number <=> self::DATA[b].id_number }
|
||||||
keys.each do |key|
|
keys.each { |key| yield self::DATA[key] if key.is_a?(Symbol) }
|
||||||
yield self::DATA[key] if key.is_a?(Symbol)
|
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
def load
|
def load
|
||||||
229
Data/Scripts/011_Data/001_Game data/005_Metadata.rb
Normal file
229
Data/Scripts/011_Data/001_Game data/005_Metadata.rb
Normal file
@@ -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
|
||||||
130
Data/Scripts/011_Data/001_Game data/006_Map metadata.rb
Normal file
130
Data/Scripts/011_Data/001_Game data/006_Map metadata.rb
Normal file
@@ -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
|
||||||
@@ -30,96 +30,6 @@ module PhoneMsgType
|
|||||||
BattleRequest = 3
|
BattleRequest = 3
|
||||||
end
|
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
|
# Pokémon data
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|||||||
@@ -412,11 +412,11 @@ Events.onMapChanging += proc { |_sender,e|
|
|||||||
newMapID = e[0]
|
newMapID = e[0]
|
||||||
if newMapID>0
|
if newMapID>0
|
||||||
mapinfos = ($RPGVX) ? load_data("Data/MapInfos.rvdata") : load_data("Data/MapInfos.rxdata")
|
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
|
if $game_map.name!=mapinfos[newMapID].name
|
||||||
$game_screen.weather(0,0,0) if oldWeather
|
$game_screen.weather(0,0,0) if oldWeather
|
||||||
else
|
else
|
||||||
newWeather = pbGetMetadata(newMapID,MapMetadata::WEATHER)
|
newWeather = GameData::MapMetadata.get(newMapID).weather
|
||||||
$game_screen.weather(0,0,0) if oldWeather && !newWeather
|
$game_screen.weather(0,0,0) if oldWeather && !newWeather
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -424,19 +424,19 @@ Events.onMapChanging += proc { |_sender,e|
|
|||||||
|
|
||||||
# Set up various data related to the new map
|
# Set up various data related to the new map
|
||||||
Events.onMapChange += proc { |_sender,e|
|
Events.onMapChange += proc { |_sender,e|
|
||||||
oldid = e[0] # previous map ID, 0 if no map ID
|
oldid = e[0] # previous map ID, is 0 if no map ID
|
||||||
healing = pbGetMetadata($game_map.map_id,MapMetadata::HEALING_SPOT)
|
healing = GameData::MapMetadata.get($game_map.map_id).teleport_destination
|
||||||
$PokemonGlobal.healingSpot = healing if healing
|
$PokemonGlobal.healingSpot = healing if healing
|
||||||
$PokemonMap.clear if $PokemonMap
|
$PokemonMap.clear if $PokemonMap
|
||||||
$PokemonEncounters.setup($game_map.map_id) if $PokemonEncounters
|
$PokemonEncounters.setup($game_map.map_id) if $PokemonEncounters
|
||||||
$PokemonGlobal.visitedMaps[$game_map.map_id] = true
|
$PokemonGlobal.visitedMaps[$game_map.map_id] = true
|
||||||
if oldid!=0 && oldid!=$game_map.map_id
|
if oldid!=0 && oldid!=$game_map.map_id
|
||||||
mapinfos = ($RPGVX) ? load_data("Data/MapInfos.rvdata") : load_data("Data/MapInfos.rxdata")
|
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
|
if $game_map.name!=mapinfos[oldid].name
|
||||||
$game_screen.weather(weather[0],8,20) if weather && rand(100)<weather[1]
|
$game_screen.weather(weather[0],8,20) if weather && rand(100)<weather[1]
|
||||||
else
|
else
|
||||||
oldweather = pbGetMetadata(oldid,MapMetadata::WEATHER)
|
oldweather = GameData::MapMetadata.get(oldid).weather
|
||||||
$game_screen.weather(weather[0],8,20) if weather && !oldweather && rand(100)<weather[1]
|
$game_screen.weather(weather[0],8,20) if weather && !oldweather && rand(100)<weather[1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -457,7 +457,7 @@ Events.onMapSceneChange += proc { |_sender,e|
|
|||||||
$PokemonGlobal.mapTrail[0] = $game_map.map_id
|
$PokemonGlobal.mapTrail[0] = $game_map.map_id
|
||||||
end
|
end
|
||||||
# Display darkness circle on dark maps
|
# Display darkness circle on dark maps
|
||||||
darkmap = pbGetMetadata($game_map.map_id,MapMetadata::DARK_MAP)
|
darkmap = GameData::MapMetadata.get($game_map.map_id).dark_map
|
||||||
if darkmap
|
if darkmap
|
||||||
if $PokemonGlobal.flashUsed
|
if $PokemonGlobal.flashUsed
|
||||||
$PokemonTemp.darknessSprite = DarknessSprite.new
|
$PokemonTemp.darknessSprite = DarknessSprite.new
|
||||||
@@ -477,7 +477,7 @@ Events.onMapSceneChange += proc { |_sender,e|
|
|||||||
end
|
end
|
||||||
# Show location signpost
|
# Show location signpost
|
||||||
if mapChanged
|
if mapChanged
|
||||||
if pbGetMetadata($game_map.map_id,MapMetadata::SHOW_AREA)
|
if GameData::MapMetadata.get($game_map.map_id).announce_location
|
||||||
nosignpost = false
|
nosignpost = false
|
||||||
if $PokemonGlobal.mapTrail[1]
|
if $PokemonGlobal.mapTrail[1]
|
||||||
for i in 0...NO_SIGNPOSTS.length/2
|
for i in 0...NO_SIGNPOSTS.length/2
|
||||||
@@ -493,7 +493,7 @@ Events.onMapSceneChange += proc { |_sender,e|
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Force cycling/walking
|
# Force cycling/walking
|
||||||
if pbGetMetadata($game_map.map_id,MapMetadata::BICYCLE_ALWAYS)
|
if GameData::MapMetadata.get($game_map.map_id).always_bicycle
|
||||||
pbMountBike
|
pbMountBike
|
||||||
elsif !pbCanUseBike?($game_map.map_id)
|
elsif !pbCanUseBike?($game_map.map_id)
|
||||||
pbDismountBike
|
pbDismountBike
|
||||||
@@ -830,7 +830,7 @@ def pbCueBGM(bgm,seconds,volume=nil,pitch=nil)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbAutoplayOnTransition
|
def pbAutoplayOnTransition
|
||||||
surfbgm = pbGetMetadata(0,Metadata::SURF_BGM)
|
surfbgm = GameData::Metadata.get.surf_BGM
|
||||||
if $PokemonGlobal.surfing && surfbgm
|
if $PokemonGlobal.surfing && surfbgm
|
||||||
pbBGMPlay(surfbgm)
|
pbBGMPlay(surfbgm)
|
||||||
else
|
else
|
||||||
@@ -839,7 +839,7 @@ def pbAutoplayOnTransition
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbAutoplayOnSave
|
def pbAutoplayOnSave
|
||||||
surfbgm = pbGetMetadata(0,Metadata::SURF_BGM)
|
surfbgm = GameData::Metadata.get.surf_BGM
|
||||||
if $PokemonGlobal.surfing && surfbgm
|
if $PokemonGlobal.surfing && surfbgm
|
||||||
pbBGMPlay(surfbgm)
|
pbBGMPlay(surfbgm)
|
||||||
else
|
else
|
||||||
@@ -1126,7 +1126,7 @@ def pbFishingBegin
|
|||||||
$PokemonGlobal.fishing = true
|
$PokemonGlobal.fishing = true
|
||||||
if !pbCommonEvent(FISHING_BEGIN_COMMON_EVENT)
|
if !pbCommonEvent(FISHING_BEGIN_COMMON_EVENT)
|
||||||
patternb = 2*$game_player.direction - 1
|
patternb = 2*$game_player.direction - 1
|
||||||
meta = pbGetMetadata(0,Metadata::PLAYER_A+$PokemonGlobal.playerID)
|
meta = GameData::Metadata.get_player($PokemonGlobal.playerID)
|
||||||
num = ($PokemonGlobal.surfing) ? 7 : 6
|
num = ($PokemonGlobal.surfing) ? 7 : 6
|
||||||
if meta && meta[num] && meta[num]!=""
|
if meta && meta[num] && meta[num]!=""
|
||||||
charset = pbGetPlayerCharset(meta,num)
|
charset = pbGetPlayerCharset(meta,num)
|
||||||
@@ -1145,7 +1145,7 @@ end
|
|||||||
def pbFishingEnd
|
def pbFishingEnd
|
||||||
if !pbCommonEvent(FISHING_END_COMMON_EVENT)
|
if !pbCommonEvent(FISHING_END_COMMON_EVENT)
|
||||||
patternb = 2*($game_player.direction - 2)
|
patternb = 2*($game_player.direction - 2)
|
||||||
meta = pbGetMetadata(0,Metadata::PLAYER_A+$PokemonGlobal.playerID)
|
meta = GameData::Metadata.get_player($PokemonGlobal.playerID)
|
||||||
num = ($PokemonGlobal.surfing) ? 7 : 6
|
num = ($PokemonGlobal.surfing) ? 7 : 6
|
||||||
if meta && meta[num] && meta[num]!=""
|
if meta && meta[num] && meta[num]!=""
|
||||||
charset = pbGetPlayerCharset(meta,num)
|
charset = pbGetPlayerCharset(meta,num)
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ def pbBattleAnimation(bgm=nil,battletype=0,foe=nil)
|
|||||||
location = 3
|
location = 3
|
||||||
elsif $PokemonEncounters.isCave?
|
elsif $PokemonEncounters.isCave?
|
||||||
location = 2
|
location = 2
|
||||||
elsif !pbGetMetadata($game_map.map_id,MapMetadata::OUTDOOR)
|
elsif !GameData::MapMetadata.get($game_map.map_id).outdoor_map
|
||||||
location = 1
|
location = 1
|
||||||
end
|
end
|
||||||
anim = ""
|
anim = ""
|
||||||
@@ -654,7 +654,7 @@ def pbStartOver(gameover=false)
|
|||||||
$scene.transfer_player if $scene.is_a?(Scene_Map)
|
$scene.transfer_player if $scene.is_a?(Scene_Map)
|
||||||
$game_map.refresh
|
$game_map.refresh
|
||||||
else
|
else
|
||||||
homedata = pbGetMetadata(0,Metadata::HOME)
|
homedata = GameData::Metadata.get.home
|
||||||
if homedata && !pbRxdataExists?(sprintf("Data/Map%03d",homedata[0]))
|
if homedata && !pbRxdataExists?(sprintf("Data/Map%03d",homedata[0]))
|
||||||
if $DEBUG
|
if $DEBUG
|
||||||
pbMessage(_ISPRINTF("Can't find the map 'Map{1:03d}' in the Data folder. The game will resume at the player's position.",homedata[0]))
|
pbMessage(_ISPRINTF("Can't find the map 'Map{1:03d}' in the Data folder. The game will resume at the player's position.",homedata[0]))
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ def pbPrepareBattle(battle)
|
|||||||
elsif $PokemonGlobal.surfing
|
elsif $PokemonGlobal.surfing
|
||||||
backdrop = "water" # This applies wherever you are, including in caves
|
backdrop = "water" # This applies wherever you are, including in caves
|
||||||
else
|
else
|
||||||
back = pbGetMetadata($game_map.map_id,MapMetadata::BATTLE_BACK)
|
back = GameData::MapMetadata.get($game_map.map_id).battle_background
|
||||||
backdrop = back if back && back!=""
|
backdrop = back if back && back!=""
|
||||||
end
|
end
|
||||||
backdrop = "indoor1" if !backdrop
|
backdrop = "indoor1" if !backdrop
|
||||||
@@ -152,7 +152,7 @@ def pbPrepareBattle(battle)
|
|||||||
end
|
end
|
||||||
battle.backdropBase = base if base
|
battle.backdropBase = base if base
|
||||||
# Time of day
|
# Time of day
|
||||||
if pbGetMetadata($game_map.map_id,MapMetadata::ENVIRONMENT)==PBEnvironment::Cave
|
if GameData::MapMetadata.get($game_map.map_id).battle_environment == PBEnvironment::Cave
|
||||||
battle.time = 2 # This makes Dusk Balls work properly in caves
|
battle.time = 2 # This makes Dusk Balls work properly in caves
|
||||||
elsif TIME_SHADING
|
elsif TIME_SHADING
|
||||||
timeNow = pbGetTimeNow
|
timeNow = pbGetTimeNow
|
||||||
@@ -166,7 +166,7 @@ end
|
|||||||
# Used to determine the environment in battle, and also the form of Burmy/
|
# Used to determine the environment in battle, and also the form of Burmy/
|
||||||
# Wormadam.
|
# Wormadam.
|
||||||
def pbGetEnvironment
|
def pbGetEnvironment
|
||||||
ret = pbGetMetadata($game_map.map_id,MapMetadata::ENVIRONMENT)
|
ret = GameData::MapMetadata.get($game_map.map_id).battle_environment
|
||||||
ret = PBEnvironment::None if !ret
|
ret = PBEnvironment::None if !ret
|
||||||
if $PokemonTemp.encounterType==EncounterTypes::OldRod ||
|
if $PokemonTemp.encounterType==EncounterTypes::OldRod ||
|
||||||
$PokemonTemp.encounterType==EncounterTypes::GoodRod ||
|
$PokemonTemp.encounterType==EncounterTypes::GoodRod ||
|
||||||
|
|||||||
@@ -183,7 +183,8 @@ EncounterModifier.register(proc { |encounter|
|
|||||||
# are in the same region
|
# are in the same region
|
||||||
if roamerMap!=$game_map.map_id
|
if roamerMap!=$game_map.map_id
|
||||||
currentRegion = pbGetCurrentRegion
|
currentRegion = pbGetCurrentRegion
|
||||||
next if pbGetMetadata(roamerMap,MapMetadata::MAP_POSITION)[0]!=currentRegion
|
map_position = GameData::MapMetadata.get(roamerMap).town_map_position
|
||||||
|
next if !map_position || map_position[0] != currentRegion
|
||||||
currentMapName = pbGetMessage(MessageTypes::MapNames,$game_map.map_id)
|
currentMapName = pbGetMessage(MessageTypes::MapNames,$game_map.map_id)
|
||||||
next if pbGetMessage(MessageTypes::MapNames,roamerMap)!=currentMapName
|
next if pbGetMessage(MessageTypes::MapNames,roamerMap)!=currentMapName
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -555,7 +555,7 @@ end
|
|||||||
Events.onMapCreate += proc { |_sender, e|
|
Events.onMapCreate += proc { |_sender, e|
|
||||||
mapID=e[0]
|
mapID=e[0]
|
||||||
map=e[1]
|
map=e[1]
|
||||||
if pbGetMetadata(mapID,MapMetadata::DUNGEON)
|
if GameData::MapMetadata.get(mapID).random_dungeon
|
||||||
# this map is a randomly generated dungeon
|
# this map is a randomly generated dungeon
|
||||||
dungeon=Dungeon.new(map.width,map.height)
|
dungeon=Dungeon.new(map.width,map.height)
|
||||||
dungeon.generate
|
dungeon.generate
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ HiddenMoveHandlers::UseMove.add(:DIG,proc { |move,pokemon|
|
|||||||
# Dive
|
# Dive
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbDive
|
def pbDive
|
||||||
divemap = pbGetMetadata($game_map.map_id,MapMetadata::DIVE_MAP)
|
divemap = GameData::MapMetadata.get($game_map.map_id).dive_map_id
|
||||||
return false if !divemap
|
return false if !divemap
|
||||||
move = getID(PBMoves,:DIVE)
|
move = getID(PBMoves,:DIVE)
|
||||||
movefinder = pbCheckMove(move)
|
movefinder = pbCheckMove(move)
|
||||||
@@ -333,14 +333,13 @@ end
|
|||||||
|
|
||||||
def pbSurfacing
|
def pbSurfacing
|
||||||
return if !$PokemonGlobal.diving
|
return if !$PokemonGlobal.diving
|
||||||
divemap = nil
|
surface_map_id = nil
|
||||||
meta = pbLoadMetadata
|
GameData::MapMetadata.each do |map_data|
|
||||||
for i in 0...meta.length
|
next if !map_data.dive_map_id || map_data.dive_map_id != $game_map.map_id
|
||||||
if meta[i] && meta[i][MapMetadata::DIVE_MAP] && meta[i][MapMetadata::DIVE_MAP]==$game_map.map_id
|
surface_map_id = map_data.id
|
||||||
divemap = i; break
|
break
|
||||||
end
|
end
|
||||||
end
|
return if !surface_map_id
|
||||||
return if !divemap
|
|
||||||
move = getID(PBMoves,:DIVE)
|
move = getID(PBMoves,:DIVE)
|
||||||
movefinder = pbCheckMove(move)
|
movefinder = pbCheckMove(move)
|
||||||
if !pbCheckHiddenMoveBadge(BADGE_FOR_DIVE,false) || (!$DEBUG && !movefinder)
|
if !pbCheckHiddenMoveBadge(BADGE_FOR_DIVE,false) || (!$DEBUG && !movefinder)
|
||||||
@@ -352,7 +351,7 @@ def pbSurfacing
|
|||||||
pbMessage(_INTL("{1} used {2}!",speciesname,PBMoves.getName(move)))
|
pbMessage(_INTL("{1} used {2}!",speciesname,PBMoves.getName(move)))
|
||||||
pbHiddenMoveAnimation(movefinder)
|
pbHiddenMoveAnimation(movefinder)
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
$game_temp.player_new_map_id = divemap
|
$game_temp.player_new_map_id = surface_map_id
|
||||||
$game_temp.player_new_x = $game_player.x
|
$game_temp.player_new_x = $game_player.x
|
||||||
$game_temp.player_new_y = $game_player.y
|
$game_temp.player_new_y = $game_player.y
|
||||||
$game_temp.player_new_direction = $game_player.direction
|
$game_temp.player_new_direction = $game_player.direction
|
||||||
@@ -360,7 +359,7 @@ def pbSurfacing
|
|||||||
$PokemonGlobal.diving = false
|
$PokemonGlobal.diving = false
|
||||||
pbUpdateVehicle
|
pbUpdateVehicle
|
||||||
$scene.transfer_player(false)
|
$scene.transfer_player(false)
|
||||||
surfbgm = pbGetMetadata(0,Metadata::SURF_BGM)
|
surfbgm = GameData::Metadata.get.surf_BGM
|
||||||
(surfbgm) ? pbBGMPlay(surfbgm) : $game_map.autoplayAsCue
|
(surfbgm) ? pbBGMPlay(surfbgm) : $game_map.autoplayAsCue
|
||||||
$game_map.refresh
|
$game_map.refresh
|
||||||
}
|
}
|
||||||
@@ -381,19 +380,19 @@ def pbTransferUnderwater(mapid,x,y,direction=$game_player.direction)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
Events.onAction += proc { |_sender,_e|
|
Events.onAction += proc { |_sender, _e|
|
||||||
if $PokemonGlobal.diving
|
if $PokemonGlobal.diving
|
||||||
if DIVING_SURFACE_ANYWHERE
|
if DIVING_SURFACE_ANYWHERE
|
||||||
pbSurfacing
|
pbSurfacing
|
||||||
else
|
else
|
||||||
divemap = nil
|
surface_map_id = nil
|
||||||
meta = pbLoadMetadata
|
GameData::MapMetadata.each do |map_data|
|
||||||
for i in 0...meta.length
|
next if !map_data.dive_map_id || map_data.dive_map_id != $game_map.map_id
|
||||||
if meta[i] && meta[i][MapMetadata::DIVE_MAP] && meta[i][MapMetadata::DIVE_MAP]==$game_map.map_id
|
surface_map_id = map_data.id
|
||||||
divemap = i; break
|
break
|
||||||
end
|
end
|
||||||
end
|
if surface_map_id &&
|
||||||
if divemap && PBTerrain.isDeepWater?($MapFactory.getTerrainTag(divemap,$game_player.x,$game_player.y))
|
PBTerrain.isDeepWater?($MapFactory.getTerrainTag(surface_map_id, $game_player.x, $game_player.y))
|
||||||
pbSurfacing
|
pbSurfacing
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -406,19 +405,19 @@ HiddenMoveHandlers::CanUseMove.add(:DIVE,proc { |move,pkmn,showmsg|
|
|||||||
next false if !pbCheckHiddenMoveBadge(BADGE_FOR_DIVE,showmsg)
|
next false if !pbCheckHiddenMoveBadge(BADGE_FOR_DIVE,showmsg)
|
||||||
if $PokemonGlobal.diving
|
if $PokemonGlobal.diving
|
||||||
next true if DIVING_SURFACE_ANYWHERE
|
next true if DIVING_SURFACE_ANYWHERE
|
||||||
divemap = nil
|
surface_map_id = nil
|
||||||
meta = pbLoadMetadata
|
GameData::MapMetadata.each do |map_data|
|
||||||
for i in 0...meta.length
|
next if !map_data.dive_map_id || map_data.dive_map_id != $game_map.map_id
|
||||||
if meta[i] && meta[i][MapMetadata::DIVE_MAP] && meta[i][MapMetadata::DIVE_MAP]==$game_map.map_id
|
surface_map_id = map_data.id
|
||||||
divemap = i; break
|
break
|
||||||
end
|
end
|
||||||
end
|
if !surface_map_id ||
|
||||||
if !PBTerrain.isDeepWater?($MapFactory.getTerrainTag(divemap,$game_player.x,$game_player.y))
|
!PBTerrain.isDeepWater?($MapFactory.getTerrainTag(surface_map_id, $game_player.x, $game_player.y))
|
||||||
pbMessage(_INTL("Can't use that here.")) if showmsg
|
pbMessage(_INTL("Can't use that here.")) if showmsg
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if !pbGetMetadata($game_map.map_id,MapMetadata::DIVE_MAP)
|
if !GameData::MapMetadata.get($game_map.map_id).dive_map_id
|
||||||
pbMessage(_INTL("Can't use that here.")) if showmsg
|
pbMessage(_INTL("Can't use that here.")) if showmsg
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -433,22 +432,21 @@ HiddenMoveHandlers::CanUseMove.add(:DIVE,proc { |move,pkmn,showmsg|
|
|||||||
HiddenMoveHandlers::UseMove.add(:DIVE,proc { |move,pokemon|
|
HiddenMoveHandlers::UseMove.add(:DIVE,proc { |move,pokemon|
|
||||||
wasdiving = $PokemonGlobal.diving
|
wasdiving = $PokemonGlobal.diving
|
||||||
if $PokemonGlobal.diving
|
if $PokemonGlobal.diving
|
||||||
divemap = nil
|
dive_map_id = nil
|
||||||
meta = pbLoadMetadata
|
GameData::MapMetadata.each do |map_data|
|
||||||
for i in 0...meta.length
|
next if !map_data.dive_map_id || map_data.dive_map_id != $game_map.map_id
|
||||||
if meta[i] && meta[i][MapMetadata::DIVE_MAP] && meta[i][MapMetadata::DIVE_MAP]==$game_map.map_id
|
dive_map_id = map_data.id
|
||||||
divemap = i; break
|
break
|
||||||
end
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
divemap = pbGetMetadata($game_map.map_id,MapMetadata::DIVE_MAP)
|
dive_map_id = GameData::MapMetadata.get($game_map.map_id).dive_map_id
|
||||||
end
|
end
|
||||||
next false if !divemap
|
next false if !dive_map_id
|
||||||
if !pbHiddenMoveAnimation(pokemon)
|
if !pbHiddenMoveAnimation(pokemon)
|
||||||
pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
|
pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
|
||||||
end
|
end
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
$game_temp.player_new_map_id = divemap
|
$game_temp.player_new_map_id = dive_map_id
|
||||||
$game_temp.player_new_x = $game_player.x
|
$game_temp.player_new_x = $game_player.x
|
||||||
$game_temp.player_new_y = $game_player.y
|
$game_temp.player_new_y = $game_player.y
|
||||||
$game_temp.player_new_direction = $game_player.direction
|
$game_temp.player_new_direction = $game_player.direction
|
||||||
@@ -469,7 +467,7 @@ HiddenMoveHandlers::UseMove.add(:DIVE,proc { |move,pokemon|
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
HiddenMoveHandlers::CanUseMove.add(:FLASH,proc { |move,pkmn,showmsg|
|
HiddenMoveHandlers::CanUseMove.add(:FLASH,proc { |move,pkmn,showmsg|
|
||||||
next false if !pbCheckHiddenMoveBadge(BADGE_FOR_FLASH,showmsg)
|
next false if !pbCheckHiddenMoveBadge(BADGE_FOR_FLASH,showmsg)
|
||||||
if !pbGetMetadata($game_map.map_id,MapMetadata::DARK_MAP)
|
if !GameData::MapMetadata.get($game_map.map_id).dark_map
|
||||||
pbMessage(_INTL("Can't use that here.")) if showmsg
|
pbMessage(_INTL("Can't use that here.")) if showmsg
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -509,7 +507,7 @@ HiddenMoveHandlers::CanUseMove.add(:FLY,proc { |move,pkmn,showmsg|
|
|||||||
pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
|
pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
if !pbGetMetadata($game_map.map_id,MapMetadata::OUTDOOR)
|
if !GameData::MapMetadata.get($game_map.map_id).outdoor_map
|
||||||
pbMessage(_INTL("Can't use that here.")) if showmsg
|
pbMessage(_INTL("Can't use that here.")) if showmsg
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -715,7 +713,7 @@ def pbSurf
|
|||||||
pbMessage(_INTL("{1} used {2}!",speciesname,PBMoves.getName(move)))
|
pbMessage(_INTL("{1} used {2}!",speciesname,PBMoves.getName(move)))
|
||||||
pbCancelVehicles
|
pbCancelVehicles
|
||||||
pbHiddenMoveAnimation(movefinder)
|
pbHiddenMoveAnimation(movefinder)
|
||||||
surfbgm = pbGetMetadata(0,Metadata::SURF_BGM)
|
surfbgm = GameData::Metadata.get.surf_BGM
|
||||||
pbCueBGM(surfbgm,0.5) if surfbgm
|
pbCueBGM(surfbgm,0.5) if surfbgm
|
||||||
pbStartSurfing
|
pbStartSurfing
|
||||||
return true
|
return true
|
||||||
@@ -768,7 +766,7 @@ end
|
|||||||
|
|
||||||
Events.onAction += proc { |_sender,_e|
|
Events.onAction += proc { |_sender,_e|
|
||||||
next if $PokemonGlobal.surfing
|
next if $PokemonGlobal.surfing
|
||||||
next if pbGetMetadata($game_map.map_id,MapMetadata::BICYCLE_ALWAYS)
|
next if GameData::MapMetadata.get($game_map.map_id).always_bicycle
|
||||||
next if !PBTerrain.isSurfable?(pbFacingTerrainTag)
|
next if !PBTerrain.isSurfable?(pbFacingTerrainTag)
|
||||||
next if !$game_map.passable?($game_player.x,$game_player.y,$game_player.direction,$game_player)
|
next if !$game_map.passable?($game_player.x,$game_player.y,$game_player.direction,$game_player)
|
||||||
pbSurf
|
pbSurf
|
||||||
@@ -784,7 +782,7 @@ HiddenMoveHandlers::CanUseMove.add(:SURF,proc { |move,pkmn,showmsg|
|
|||||||
pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
|
pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
if pbGetMetadata($game_map.map_id,MapMetadata::BICYCLE_ALWAYS)
|
if GameData::MapMetadata.get($game_map.map_id).always_bicycle
|
||||||
pbMessage(_INTL("Let's enjoy cycling!")) if showmsg
|
pbMessage(_INTL("Let's enjoy cycling!")) if showmsg
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -802,7 +800,7 @@ HiddenMoveHandlers::UseMove.add(:SURF,proc { |move,pokemon|
|
|||||||
if !pbHiddenMoveAnimation(pokemon)
|
if !pbHiddenMoveAnimation(pokemon)
|
||||||
pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
|
pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
|
||||||
end
|
end
|
||||||
surfbgm = pbGetMetadata(0,Metadata::SURF_BGM)
|
surfbgm = GameData::Metadata.get.surf_BGM
|
||||||
pbCueBGM(surfbgm,0.5) if surfbgm
|
pbCueBGM(surfbgm,0.5) if surfbgm
|
||||||
pbStartSurfing
|
pbStartSurfing
|
||||||
next true
|
next true
|
||||||
@@ -865,12 +863,12 @@ HiddenMoveHandlers::UseMove.add(:SWEETSCENT,proc { |move,pokemon|
|
|||||||
# Teleport
|
# Teleport
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
HiddenMoveHandlers::CanUseMove.add(:TELEPORT,proc { |move,pkmn,showmsg|
|
HiddenMoveHandlers::CanUseMove.add(:TELEPORT,proc { |move,pkmn,showmsg|
|
||||||
if !pbGetMetadata($game_map.map_id,MapMetadata::OUTDOOR)
|
if !GameData::MapMetadata.get($game_map.map_id).outdoor_map
|
||||||
pbMessage(_INTL("Can't use that here.")) if showmsg
|
pbMessage(_INTL("Can't use that here.")) if showmsg
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
healing = $PokemonGlobal.healingSpot
|
healing = $PokemonGlobal.healingSpot
|
||||||
healing = pbGetMetadata(0,Metadata::HOME) if !healing # Home
|
healing = GameData::Metadata.get.home if !healing # Home
|
||||||
if !healing
|
if !healing
|
||||||
pbMessage(_INTL("Can't use that here.")) if showmsg
|
pbMessage(_INTL("Can't use that here.")) if showmsg
|
||||||
next false
|
next false
|
||||||
@@ -884,7 +882,7 @@ HiddenMoveHandlers::CanUseMove.add(:TELEPORT,proc { |move,pkmn,showmsg|
|
|||||||
|
|
||||||
HiddenMoveHandlers::ConfirmUseMove.add(:TELEPORT,proc { |move,pkmn|
|
HiddenMoveHandlers::ConfirmUseMove.add(:TELEPORT,proc { |move,pkmn|
|
||||||
healing = $PokemonGlobal.healingSpot
|
healing = $PokemonGlobal.healingSpot
|
||||||
healing = pbGetMetadata(0,Metadata::HOME) if !healing # Home
|
healing = GameData::Metadata.get.home if !healing # Home
|
||||||
next false if !healing
|
next false if !healing
|
||||||
mapname = pbGetMapNameFromId(healing[0])
|
mapname = pbGetMapNameFromId(healing[0])
|
||||||
next pbConfirmMessage(_INTL("Want to return to the healing spot used last in {1}?",mapname))
|
next pbConfirmMessage(_INTL("Want to return to the healing spot used last in {1}?",mapname))
|
||||||
@@ -892,7 +890,7 @@ HiddenMoveHandlers::ConfirmUseMove.add(:TELEPORT,proc { |move,pkmn|
|
|||||||
|
|
||||||
HiddenMoveHandlers::UseMove.add(:TELEPORT,proc { |move,pokemon|
|
HiddenMoveHandlers::UseMove.add(:TELEPORT,proc { |move,pokemon|
|
||||||
healing = $PokemonGlobal.healingSpot
|
healing = $PokemonGlobal.healingSpot
|
||||||
healing = pbGetMetadata(0,Metadata::HOME) if !healing # Home
|
healing = GameData::Metadata.get.home if !healing # Home
|
||||||
next false if !healing
|
next false if !healing
|
||||||
if !pbHiddenMoveAnimation(pokemon)
|
if !pbHiddenMoveAnimation(pokemon)
|
||||||
pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
|
pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ end
|
|||||||
|
|
||||||
def pbDayNightTint(object)
|
def pbDayNightTint(object)
|
||||||
return if !$scene.is_a?(Scene_Map)
|
return if !$scene.is_a?(Scene_Map)
|
||||||
if TIME_SHADING && pbGetMetadata($game_map.map_id,MapMetadata::OUTDOOR)
|
if TIME_SHADING && GameData::MapMetadata.get($game_map.map_id).outdoor_map
|
||||||
tone = PBDayNight.getTone
|
tone = PBDayNight.getTone
|
||||||
object.tone.set(tone.red,tone.green,tone.blue,tone.gray)
|
object.tone.set(tone.red,tone.green,tone.blue,tone.gray)
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -361,14 +361,14 @@ def pbBikeCheck
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if $PokemonGlobal.bicycle
|
if $PokemonGlobal.bicycle
|
||||||
if pbGetMetadata($game_map.map_id,MapMetadata::BICYCLE_ALWAYS)
|
if GameData::MapMetadata.get($game_map.map_id).always_bicycle
|
||||||
pbMessage(_INTL("You can't dismount your Bike here."))
|
pbMessage(_INTL("You can't dismount your Bike here."))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
val = pbGetMetadata($game_map.map_id,MapMetadata::BICYCLE)
|
val = GameData::MapMetadata.get($game_map.map_id).can_bicycle
|
||||||
val = pbGetMetadata($game_map.map_id,MapMetadata::OUTDOOR) if val==nil
|
val = GameData::MapMetadata.get($game_map.map_id).outdoor_map if val.nil?
|
||||||
if !val
|
if !val
|
||||||
pbMessage(_INTL("Can't use that here."))
|
pbMessage(_INTL("Can't use that here."))
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -66,13 +66,14 @@ end
|
|||||||
def pbRandomPhoneTrainer
|
def pbRandomPhoneTrainer
|
||||||
$PokemonGlobal.phoneNumbers = [] if !$PokemonGlobal.phoneNumbers
|
$PokemonGlobal.phoneNumbers = [] if !$PokemonGlobal.phoneNumbers
|
||||||
temparray = []
|
temparray = []
|
||||||
currentRegion = pbGetMetadata($game_map.map_id,MapMetadata::MAP_POSITION)
|
currentRegion = GameData::MapMetadata.get($game_map.map_id).town_map_position
|
||||||
|
return nil if !currentRegion
|
||||||
for num in $PokemonGlobal.phoneNumbers
|
for num in $PokemonGlobal.phoneNumbers
|
||||||
next if !num[0] || num.length!=8 # if not visible or not a trainer
|
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
|
next if $game_map.map_id==num[6] # Can't call if on same map
|
||||||
callerRegion = pbGetMetadata(num[6],MapMetadata::MAP_POSITION)
|
callerRegion = GameData::MapMetadata.get(num[6]).town_map_position
|
||||||
# Can't call if in different region
|
# Can't call if in different region
|
||||||
next if callerRegion && currentRegion && callerRegion[0]!=currentRegion[0]
|
next if !callerRegion || callerRegion[0] != currentRegion[0]
|
||||||
temparray.push(num)
|
temparray.push(num)
|
||||||
end
|
end
|
||||||
return nil if temparray.length==0
|
return nil if temparray.length==0
|
||||||
@@ -193,9 +194,9 @@ def pbCallTrainer(trtype,trname)
|
|||||||
pbMessage(_INTL("The Trainer is close by.\nTalk to the Trainer in person!"))
|
pbMessage(_INTL("The Trainer is close by.\nTalk to the Trainer in person!"))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
callerregion = pbGetMetadata(trainer[6],MapMetadata::MAP_POSITION)
|
callerregion = GameData::MapMetadata.get(trainer[6]).town_map_position
|
||||||
currentregion = pbGetMetadata($game_map.map_id,MapMetadata::MAP_POSITION)
|
currentregion = GameData::MapMetadata.get($game_map.map_id).town_map_position
|
||||||
if callerregion && currentregion && callerregion[0]!=currentregion[0]
|
if !callerregion || !currentregion || callerregion[0] != currentregion[0]
|
||||||
pbMessage(_INTL("The Trainer is out of range."))
|
pbMessage(_INTL("The Trainer is out of range."))
|
||||||
return # Can't call if in different region
|
return # Can't call if in different region
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -667,13 +667,13 @@ MultipleForms.register(:NECROZMA,{
|
|||||||
|
|
||||||
# These species don't have visually different Alolan forms, but they need to
|
# These species don't have visually different Alolan forms, but they need to
|
||||||
# evolve into different forms depending on the location where they evolved.
|
# evolve into different forms depending on the location where they evolved.
|
||||||
MultipleForms.register(:PIKACHU,{
|
MultipleForms.register(:PIKACHU, {
|
||||||
"getForm" => proc { |pkmn|
|
"getForm" => proc { |pkmn|
|
||||||
next if pkmn.formSimple>=2
|
next if pkmn.formSimple >= 2
|
||||||
mapPos = pbGetMetadata($game_map.map_id,MapMetadata::MAP_POSITION)
|
mapPos = GameData::MapMetadata.get($game_map.map_id).town_map_position
|
||||||
next 1 if mapPos && mapPos[0]==1 # Tiall region
|
next 1 if mapPos && mapPos[0] == 1 # Tiall region
|
||||||
next 0
|
next 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
MultipleForms.copy(:PIKACHU,:EXEGGCUTE,:CUBONE)
|
MultipleForms.copy(:PIKACHU, :EXEGGCUTE, :CUBONE)
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ PBEvolution.register(:LevelDiving, {
|
|||||||
|
|
||||||
PBEvolution.register(:LevelDarkness, {
|
PBEvolution.register(:LevelDarkness, {
|
||||||
"levelUpCheck" => proc { |pkmn, parameter|
|
"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, {
|
PBEvolution.register(:Region, {
|
||||||
"minimumLevel" => 1, # Needs any level up
|
"minimumLevel" => 1, # Needs any level up
|
||||||
"levelUpCheck" => proc { |pkmn, parameter|
|
"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
|
next mapPos && mapPos[0] == parameter
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class PokemonPokedexInfo_Scene
|
|||||||
@sprites["infosprite"].x = 104
|
@sprites["infosprite"].x = 104
|
||||||
@sprites["infosprite"].y = 136
|
@sprites["infosprite"].y = 136
|
||||||
@mapdata = pbLoadTownMapData
|
@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
|
if @region<0 # Use player's current region
|
||||||
@region = (mappos) ? mappos[0] : 0 # Region 0 default
|
@region = (mappos) ? mappos[0] : 0 # Region 0 default
|
||||||
end
|
end
|
||||||
@@ -311,7 +311,7 @@ class PokemonPokedexInfo_Scene
|
|||||||
for enc in encdata.keys
|
for enc in encdata.keys
|
||||||
enctypes = encdata[enc][1]
|
enctypes = encdata[enc][1]
|
||||||
if pbFindEncounter(enctypes,@species)
|
if pbFindEncounter(enctypes,@species)
|
||||||
mappos = pbGetMetadata(enc,MapMetadata::MAP_POSITION)
|
mappos = GameData::MapMetadata.get(enc).town_map_position
|
||||||
if mappos && mappos[0]==@region
|
if mappos && mappos[0]==@region
|
||||||
showpoint = true
|
showpoint = true
|
||||||
for loc in @mapdata[@region][2]
|
for loc in @mapdata[@region][2]
|
||||||
@@ -319,7 +319,7 @@ class PokemonPokedexInfo_Scene
|
|||||||
loc[7] && !$game_switches[loc[7]]
|
loc[7] && !$game_switches[loc[7]]
|
||||||
end
|
end
|
||||||
if showpoint
|
if showpoint
|
||||||
mapsize = pbGetMetadata(enc,MapMetadata::MAP_SIZE)
|
mapsize = GameData::MapMetadata.get(enc).town_map_size
|
||||||
if mapsize && mapsize[0] && mapsize[0]>0
|
if mapsize && mapsize[0] && mapsize[0]>0
|
||||||
sqwidth = mapsize[0]
|
sqwidth = mapsize[0]
|
||||||
sqheight = (mapsize[1].length*1.0/mapsize[0]).ceil
|
sqheight = (mapsize[1].length*1.0/mapsize[0]).ceil
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class PokemonRegionMap_Scene
|
|||||||
@viewport.z = 99999
|
@viewport.z = 99999
|
||||||
@sprites = {}
|
@sprites = {}
|
||||||
@mapdata = pbLoadTownMapData
|
@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
|
if !playerpos
|
||||||
mapindex = 0
|
mapindex = 0
|
||||||
@map = @mapdata[0]
|
@map = @mapdata[0]
|
||||||
@@ -93,7 +93,7 @@ class PokemonRegionMap_Scene
|
|||||||
@map = @mapdata[playerpos[0]]
|
@map = @mapdata[playerpos[0]]
|
||||||
@mapX = playerpos[1]
|
@mapX = playerpos[1]
|
||||||
@mapY = playerpos[2]
|
@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
|
if mapsize && mapsize[0] && mapsize[0]>0
|
||||||
sqwidth = mapsize[0]
|
sqwidth = mapsize[0]
|
||||||
sqheight = (mapsize[1].length*1.0/mapsize[0]).ceil
|
sqheight = (mapsize[1].length*1.0/mapsize[0]).ceil
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ class PokemonLoad_Scene
|
|||||||
|
|
||||||
def pbSetParty(trainer)
|
def pbSetParty(trainer)
|
||||||
return if !trainer || !trainer.party
|
return if !trainer || !trainer.party
|
||||||
meta = pbGetMetadata(0,Metadata::PLAYER_A+trainer.metaID)
|
meta = GameData::Metadata.get_player(trainer.metaID)
|
||||||
if meta
|
if meta
|
||||||
filename = pbGetPlayerCharset(meta,1,trainer,true)
|
filename = pbGetPlayerCharset(meta,1,trainer,true)
|
||||||
@sprites["player"] = TrainerWalkingCharSprite.new(filename,@viewport)
|
@sprites["player"] = TrainerWalkingCharSprite.new(filename,@viewport)
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ def pbInSafari?
|
|||||||
# map can be outdoors, with its own grassy patches.
|
# map can be outdoors, with its own grassy patches.
|
||||||
reception = pbSafariState.pbReceptionMap
|
reception = pbSafariState.pbReceptionMap
|
||||||
return true if $game_map.map_id==reception
|
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
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ def pbSetUpSystem
|
|||||||
GameData::Ability.load
|
GameData::Ability.load
|
||||||
GameData::Item.load
|
GameData::Item.load
|
||||||
GameData::BerryPlant.load
|
GameData::BerryPlant.load
|
||||||
|
GameData::Metadata.load
|
||||||
|
GameData::MapMetadata.load
|
||||||
rescue
|
rescue
|
||||||
consts = []
|
consts = []
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -532,13 +532,13 @@ def pbGetWildBattleBGM(_wildParty) # wildParty is an array of Pokémon objects
|
|||||||
end
|
end
|
||||||
ret = nil
|
ret = nil
|
||||||
if !ret
|
if !ret
|
||||||
# Check map-specific metadata
|
# Check map metadata
|
||||||
music = pbGetMetadata($game_map.map_id,MapMetadata::WILD_BATTLE_BGM)
|
music = GameData::MapMetadata.get($game_map.map_id).wild_battle_BGM
|
||||||
ret = pbStringToAudioFile(music) if music && music!=""
|
ret = pbStringToAudioFile(music) if music && music!=""
|
||||||
end
|
end
|
||||||
if !ret
|
if !ret
|
||||||
# Check global metadata
|
# Check global metadata
|
||||||
music = pbGetMetadata(0,Metadata::WILD_BATTLE_BGM)
|
music = GameData::Metadata.get.wild_battle_BGM
|
||||||
ret = pbStringToAudioFile(music) if music && music!=""
|
ret = pbStringToAudioFile(music) if music && music!=""
|
||||||
end
|
end
|
||||||
ret = pbStringToAudioFile("Battle wild") if !ret
|
ret = pbStringToAudioFile("Battle wild") if !ret
|
||||||
@@ -551,13 +551,13 @@ def pbGetWildVictoryME
|
|||||||
end
|
end
|
||||||
ret = nil
|
ret = nil
|
||||||
if !ret
|
if !ret
|
||||||
# Check map-specific metadata
|
# Check map metadata
|
||||||
music = pbGetMetadata($game_map.map_id,MapMetadata::WILD_VICTORY_ME)
|
music = GameData::MapMetadata.get($game_map.map_id).wild_victory_ME
|
||||||
ret = pbStringToAudioFile(music) if music && music!=""
|
ret = pbStringToAudioFile(music) if music && music!=""
|
||||||
end
|
end
|
||||||
if !ret
|
if !ret
|
||||||
# Check global metadata
|
# Check global metadata
|
||||||
music = pbGetMetadata(0,Metadata::WILD_VICTORY_ME)
|
music = GameData::Metadata.get.wild_victory_ME
|
||||||
ret = pbStringToAudioFile(music) if music && music!=""
|
ret = pbStringToAudioFile(music) if music && music!=""
|
||||||
end
|
end
|
||||||
ret = pbStringToAudioFile("Battle victory") if !ret
|
ret = pbStringToAudioFile("Battle victory") if !ret
|
||||||
@@ -571,13 +571,13 @@ def pbGetWildCaptureME
|
|||||||
end
|
end
|
||||||
ret = nil
|
ret = nil
|
||||||
if !ret
|
if !ret
|
||||||
# Check map-specific metadata
|
# Check map metadata
|
||||||
music = pbGetMetadata($game_map.map_id,MapMetadata::WILD_CAPTURE_ME)
|
music = GameData::MapMetadata.get($game_map.map_id).wild_capture_ME
|
||||||
ret = pbStringToAudioFile(music) if music && music!=""
|
ret = pbStringToAudioFile(music) if music && music!=""
|
||||||
end
|
end
|
||||||
if !ret
|
if !ret
|
||||||
# Check global metadata
|
# Check global metadata
|
||||||
music = pbGetMetadata(0,Metadata::WILD_CAPTURE_ME)
|
music = GameData::Metadata.get.wild_capture_ME
|
||||||
ret = pbStringToAudioFile(music) if music && music!=""
|
ret = pbStringToAudioFile(music) if music && music!=""
|
||||||
end
|
end
|
||||||
ret = pbStringToAudioFile("Battle capture success") if !ret
|
ret = pbStringToAudioFile("Battle capture success") if !ret
|
||||||
@@ -611,15 +611,15 @@ def pbGetTrainerBattleBGM(trainer) # can be a PokeBattle_Trainer or an array o
|
|||||||
end
|
end
|
||||||
ret = pbStringToAudioFile(music) if music && music!=""
|
ret = pbStringToAudioFile(music) if music && music!=""
|
||||||
if !ret
|
if !ret
|
||||||
# Check map-specific metadata
|
# Check map metadata
|
||||||
music = pbGetMetadata($game_map.map_id,MapMetadata::TRAINER_BATTLE_BGM)
|
music = GameData::MapMetadata.get($game_map.map_id).trainer_battle_BGM
|
||||||
if music && music!=""
|
if music && music!=""
|
||||||
ret = pbStringToAudioFile(music)
|
ret = pbStringToAudioFile(music)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if !ret
|
if !ret
|
||||||
# Check global metadata
|
# Check global metadata
|
||||||
music = pbGetMetadata(0,Metadata::TRAINER_BATTLE_BGM)
|
music = GameData::Metadata.get.trainer_battle_BGM
|
||||||
if music && music!=""
|
if music && music!=""
|
||||||
ret = pbStringToAudioFile(music)
|
ret = pbStringToAudioFile(music)
|
||||||
end
|
end
|
||||||
@@ -635,13 +635,13 @@ def pbGetTrainerBattleBGMFromType(trainertype)
|
|||||||
data = pbGetTrainerTypeData(trainertype)
|
data = pbGetTrainerTypeData(trainertype)
|
||||||
ret = pbStringToAudioFile(data[4]) if data && data[4]
|
ret = pbStringToAudioFile(data[4]) if data && data[4]
|
||||||
if !ret
|
if !ret
|
||||||
# Check map-specific metadata
|
# Check map metadata
|
||||||
music = pbGetMetadata($game_map.map_id,MapMetadata::TRAINER_BATTLE_BGM)
|
music = GameData::MapMetadata.get($game_map.map_id).trainer_battle_BGM
|
||||||
ret = pbStringToAudioFile(music) if music && music!=""
|
ret = pbStringToAudioFile(music) if music && music!=""
|
||||||
end
|
end
|
||||||
if !ret
|
if !ret
|
||||||
# Check global metadata
|
# Check global metadata
|
||||||
music = pbGetMetadata(0,Metadata::TRAINER_BATTLE_BGM)
|
music = GameData::Metadata.get.trainer_battle_BGM
|
||||||
ret = pbStringToAudioFile(music) if music && music!=""
|
ret = pbStringToAudioFile(music) if music && music!=""
|
||||||
end
|
end
|
||||||
ret = pbStringToAudioFile("Battle trainer") if !ret
|
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)
|
ret = pbStringToAudioFile(music)
|
||||||
end
|
end
|
||||||
if !ret
|
if !ret
|
||||||
# Check map-specific metadata
|
# Check map metadata
|
||||||
music = pbGetMetadata($game_map.map_id,MapMetadata::TRAINER_VICTORY_ME)
|
music = GameData::MapMetadata.get($game_map.map_id).trainer_victory_ME
|
||||||
if music && music!=""
|
if music && music!=""
|
||||||
ret = pbStringToAudioFile(music)
|
ret = pbStringToAudioFile(music)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if !ret
|
if !ret
|
||||||
# Check global metadata
|
# Check global metadata
|
||||||
music = pbGetMetadata(0,Metadata::TRAINER_VICTORY_ME)
|
music = GameData::Metadata.get.trainer_victory_ME
|
||||||
if music && music!=""
|
if music && music!=""
|
||||||
ret = pbStringToAudioFile(music)
|
ret = pbStringToAudioFile(music)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -666,7 +666,7 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbChangePlayer(id)
|
def pbChangePlayer(id)
|
||||||
return false if id<0 || id>=8
|
return false if id<0 || id>=8
|
||||||
meta = pbGetMetadata(0,Metadata::PLAYER_A+id)
|
meta = GameData::Metadata.get_player(id)
|
||||||
return false if !meta
|
return false if !meta
|
||||||
$Trainer.trainertype = meta[0] if $Trainer
|
$Trainer.trainertype = meta[0] if $Trainer
|
||||||
$game_player.character_name = meta[1]
|
$game_player.character_name = meta[1]
|
||||||
@@ -678,7 +678,7 @@ end
|
|||||||
def pbGetPlayerGraphic
|
def pbGetPlayerGraphic
|
||||||
id = $PokemonGlobal.playerID
|
id = $PokemonGlobal.playerID
|
||||||
return "" if id<0 || id>=8
|
return "" if id<0 || id>=8
|
||||||
meta = pbGetMetadata(0,Metadata::PLAYER_A+id)
|
meta = GameData::Metadata.get_player(id)
|
||||||
return "" if !meta
|
return "" if !meta
|
||||||
return pbPlayerSpriteFile(meta[0])
|
return pbPlayerSpriteFile(meta[0])
|
||||||
end
|
end
|
||||||
@@ -686,7 +686,7 @@ end
|
|||||||
def pbGetPlayerTrainerType
|
def pbGetPlayerTrainerType
|
||||||
id = $PokemonGlobal.playerID
|
id = $PokemonGlobal.playerID
|
||||||
return 0 if id<0 || id>=8
|
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 0 if !meta
|
||||||
return meta[0]
|
return meta[0]
|
||||||
end
|
end
|
||||||
@@ -868,7 +868,7 @@ end
|
|||||||
# no region was defined in the game's metadata. The ID numbers returned by
|
# no region was defined in the game's metadata. The ID numbers returned by
|
||||||
# this function depend on the current map's position metadata.
|
# this function depend on the current map's position metadata.
|
||||||
def pbGetCurrentRegion(defaultRegion=-1)
|
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
|
return (mappos) ? mappos[0] : defaultRegion
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ def pbDebugMenuCommands(showall=true)
|
|||||||
commands.add("main","editorsmenu",_INTL("Information editors..."),
|
commands.add("main","editorsmenu",_INTL("Information editors..."),
|
||||||
_INTL("Edit information in the PBS files, terrain tags, battle animations, etc."))
|
_INTL("Edit information in the PBS files, terrain tags, battle animations, etc."))
|
||||||
commands.add("editorsmenu","setmetadata",_INTL("Edit Metadata"),
|
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"),
|
commands.add("editorsmenu","mapconnections",_INTL("Edit Map Connections"),
|
||||||
_INTL("Connect maps using a visual interface. Can also edit map encounters/metadata."))
|
_INTL("Connect maps using a visual interface. Can also edit map encounters/metadata."))
|
||||||
commands.add("editorsmenu","terraintags",_INTL("Edit Terrain Tags"),
|
commands.add("editorsmenu","terraintags",_INTL("Edit Terrain Tags"),
|
||||||
@@ -679,7 +679,7 @@ def pbDebugMenuActions(cmd="",sprites=nil,viewport=nil)
|
|||||||
when "setplayer"
|
when "setplayer"
|
||||||
limit = 0
|
limit = 0
|
||||||
for i in 0...8
|
for i in 0...8
|
||||||
meta = pbGetMetadata(0,Metadata::PLAYER_A+i)
|
meta = GameData::Metadata.get_player(i)
|
||||||
if !meta
|
if !meta
|
||||||
limit = i; break
|
limit = i; break
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -553,27 +553,85 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Metadata editor
|
# Metadata editor
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbMetadataScreen(defaultMapId=nil)
|
def pbMetadataScreen(map_id = 0)
|
||||||
metadata = nil
|
|
||||||
mapinfos = pbLoadRxData("Data/MapInfos")
|
|
||||||
metadata = pbLoadMetadata
|
|
||||||
map = defaultMapId ? defaultMapId : 0
|
|
||||||
loop do
|
loop do
|
||||||
map = pbListScreen(_INTL("SET METADATA"),MapLister.new(map,true))
|
map_id = pbListScreen(_INTL("SET METADATA"), MapLister.new(map_id, true))
|
||||||
break if map<0
|
break if map_id < 0
|
||||||
mapname = (map==0) ? _INTL("Global Metadata") : mapinfos[map].name
|
pbEditMetadata(map_id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def pbEditMetadata(map_id = 0)
|
||||||
|
mapinfos = pbLoadRxData("Data/MapInfos")
|
||||||
data = []
|
data = []
|
||||||
properties = (map==0) ? MapScreenScene::GLOBALMETADATA : MapScreenScene::LOCALMAPS
|
if map_id == 0 # Global metadata
|
||||||
for i in 0...properties.length
|
map_name = _INTL("Global Metadata")
|
||||||
data.push((metadata[map]) ? metadata[map][i+1] : nil)
|
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
|
end
|
||||||
pbPropertyList(mapname,data,properties)
|
properties.each do |property|
|
||||||
for i in 0...properties.length
|
data.push(metadata.property_from_string(property[0]))
|
||||||
metadata[map] = [] if !metadata[map]
|
|
||||||
metadata[map][i+1] = data[i]
|
|
||||||
end
|
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
|
end
|
||||||
pbSerializeMetadata(metadata,mapinfos) if metadata
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -638,8 +696,7 @@ def pbItemEditor
|
|||||||
itm.type,
|
itm.type,
|
||||||
itm.move || 0
|
itm.move || 0
|
||||||
]
|
]
|
||||||
save = pbPropertyList(itm.id.to_s, data, items, true)
|
if pbPropertyList(itm.id.to_s, data, items, true)
|
||||||
if save
|
|
||||||
# Construct item hash
|
# Construct item hash
|
||||||
item_hash = {
|
item_hash = {
|
||||||
:id_number => itm.id_number,
|
:id_number => itm.id_number,
|
||||||
|
|||||||
@@ -184,44 +184,47 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Save metadata data to PBS file
|
# Save metadata data to PBS file
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbSerializeMetadata(metadata,mapinfos)
|
def pbSaveMetadata
|
||||||
save_data(metadata,"Data/metadata.dat")
|
|
||||||
File.open("PBS/metadata.txt","wb") { |f|
|
File.open("PBS/metadata.txt","wb") { |f|
|
||||||
f.write(0xEF.chr)
|
f.write(0xEF.chr)
|
||||||
f.write(0xBB.chr)
|
f.write(0xBB.chr)
|
||||||
f.write(0xBF.chr)
|
f.write(0xBF.chr)
|
||||||
f.write("\# "+_INTL("See the documentation on the wiki to learn how to edit this file."))
|
f.write("\# "+_INTL("See the documentation on the wiki to learn how to edit this file."))
|
||||||
f.write("\r\n")
|
f.write("\r\n")
|
||||||
for i in 0...metadata.length
|
# Write global metadata
|
||||||
next if !metadata[i]
|
|
||||||
f.write("\#-------------------------------\r\n")
|
f.write("\#-------------------------------\r\n")
|
||||||
f.write(sprintf("[%03d]\r\n",i))
|
f.write("[000]\r\n")
|
||||||
if i==0
|
metadata = GameData::Metadata.get
|
||||||
types = Metadata::SCHEMA
|
schema = GameData::Metadata::SCHEMA
|
||||||
else
|
keys = schema.keys.sort {|a, b| schema[a][0] <=> schema[b][0] }
|
||||||
if mapinfos && mapinfos[i]
|
for key in keys
|
||||||
f.write(sprintf("# %s\r\n",mapinfos[i].name))
|
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
|
end
|
||||||
types = MapMetadata::SCHEMA
|
# 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", map_data.id))
|
||||||
|
if map_infos && map_infos[map_data.id]
|
||||||
|
f.write(sprintf("# %s\r\n", map_infos[map_data.id].name))
|
||||||
end
|
end
|
||||||
for key in types.keys
|
for key in keys
|
||||||
schema = types[key]
|
record = map_data.property_from_string(key)
|
||||||
record = metadata[i][schema[0]]
|
next if record.nil?
|
||||||
next if record==nil
|
f.write(sprintf("%s = ", key))
|
||||||
f.write(sprintf("%s = ",key))
|
pbWriteCsvRecord(record, f, schema[key])
|
||||||
pbWriteCsvRecord(record,f,schema)
|
|
||||||
f.write("\r\n")
|
f.write("\r\n")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbSaveMetadata
|
|
||||||
data = load_data("Data/metadata.dat") rescue nil
|
|
||||||
return if !data
|
|
||||||
pbSerializeMetadata(data,pbLoadRxData("Data/MapInfos"))
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|||||||
@@ -240,83 +240,6 @@ end
|
|||||||
# Visual Editor (map connections)
|
# Visual Editor (map connections)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class MapScreenScene
|
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)
|
def getMapSprite(id)
|
||||||
if !@mapsprites[id]
|
if !@mapsprites[id]
|
||||||
@mapsprites[id]=Sprite.new(@viewport)
|
@mapsprites[id]=Sprite.new(@viewport)
|
||||||
@@ -405,7 +328,7 @@ class MapScreenScene
|
|||||||
ret.compact!
|
ret.compact!
|
||||||
end
|
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)
|
def getDirectConnections(keys,map)
|
||||||
thissprite=getMapSprite(map)
|
thissprite=getMapSprite(map)
|
||||||
thisdims=MapFactoryHelper.getMapDims(map)
|
thisdims=MapFactoryHelper.getMapDims(map)
|
||||||
@@ -520,7 +443,6 @@ class MapScreenScene
|
|||||||
for c in conns
|
for c in conns
|
||||||
@mapconns.push(c.clone)
|
@mapconns.push(c.clone)
|
||||||
end
|
end
|
||||||
@metadata=pbLoadMetadata
|
|
||||||
if $game_map
|
if $game_map
|
||||||
@currentmap=$game_map.map_id
|
@currentmap=$game_map.map_id
|
||||||
else
|
else
|
||||||
@@ -532,26 +454,9 @@ class MapScreenScene
|
|||||||
|
|
||||||
def setTopSprite(id)
|
def setTopSprite(id)
|
||||||
for i in @mapsprites.keys
|
for i in @mapsprites.keys
|
||||||
if i==id
|
@mapsprites[i].z = (i == id) ? 1 : 0
|
||||||
@mapsprites[i].z=1
|
|
||||||
else
|
|
||||||
@mapsprites[i].z=0
|
|
||||||
end
|
end
|
||||||
end
|
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
|
def helpWindow
|
||||||
helptext=_INTL("A: Add map to canvas\r\n")
|
helptext=_INTL("A: Add map to canvas\r\n")
|
||||||
@@ -578,19 +483,6 @@ class MapScreenScene
|
|||||||
title.dispose
|
title.dispose
|
||||||
end
|
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)
|
def getMapRect(mapid)
|
||||||
sprite=getMapSprite(mapid)
|
sprite=getMapSprite(mapid)
|
||||||
if sprite
|
if sprite
|
||||||
@@ -605,16 +497,12 @@ class MapScreenScene
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def onDoubleClick(mapid)
|
def onDoubleClick(map_id)
|
||||||
if mapid>=0
|
pbEditMetadata(map_id)
|
||||||
propertyList(mapid,LOCALMAPS)
|
|
||||||
else
|
|
||||||
propertyList(0,GLOBALMETADATA)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def onClick(mapid,x,y)
|
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)
|
onDoubleClick(mapid)
|
||||||
@lastclick=-1
|
@lastclick=-1
|
||||||
else
|
else
|
||||||
@@ -718,7 +606,7 @@ class MapScreenScene
|
|||||||
onMouseOver(hitmap,mousepos[0],mousepos[1])
|
onMouseOver(hitmap,mousepos[0],mousepos[1])
|
||||||
@lasthitmap=hitmap
|
@lasthitmap=hitmap
|
||||||
end
|
end
|
||||||
if @oldmousex!=mousepos[0]||@oldmousey!=mousepos[1]
|
if @oldmousex!=mousepos[0] || @oldmousey!=mousepos[1]
|
||||||
onMouseMove(hitmap,mousepos[0],mousepos[1])
|
onMouseMove(hitmap,mousepos[0],mousepos[1])
|
||||||
@oldmousex=mousepos[0]
|
@oldmousex=mousepos[0]
|
||||||
@oldmousey=mousepos[1]
|
@oldmousey=mousepos[1]
|
||||||
@@ -727,26 +615,22 @@ class MapScreenScene
|
|||||||
end
|
end
|
||||||
if Input.press?(Input::UP)
|
if Input.press?(Input::UP)
|
||||||
for i in @mapsprites
|
for i in @mapsprites
|
||||||
next if !i
|
i[1].y += 4 if i
|
||||||
i[1].y+=4
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if Input.press?(Input::DOWN)
|
if Input.press?(Input::DOWN)
|
||||||
for i in @mapsprites
|
for i in @mapsprites
|
||||||
next if !i
|
i[1].y -= 4 if i
|
||||||
i[1].y-=4
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if Input.press?(Input::LEFT)
|
if Input.press?(Input::LEFT)
|
||||||
for i in @mapsprites
|
for i in @mapsprites
|
||||||
next if !i
|
i[1].x += 4 if i
|
||||||
i[1].x+=4
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if Input.press?(Input::RIGHT)
|
if Input.press?(Input::RIGHT)
|
||||||
for i in @mapsprites
|
for i in @mapsprites
|
||||||
next if !i
|
i[1].x -= 4 if i
|
||||||
i[1].x-=4
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if Input.triggerex?("A"[0])
|
if Input.triggerex?("A"[0])
|
||||||
@@ -791,9 +675,8 @@ class MapScreenScene
|
|||||||
if Input.trigger?(Input::B)
|
if Input.trigger?(Input::B)
|
||||||
if pbConfirmMessage(_INTL("Save changes?"))
|
if pbConfirmMessage(_INTL("Save changes?"))
|
||||||
serializeConnectionData
|
serializeConnectionData
|
||||||
serializeMetadata
|
|
||||||
save_data(@encdata,"Data/encounters.dat")
|
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
|
pbClearData
|
||||||
pbSaveEncounterData
|
pbSaveEncounterData
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,45 +7,89 @@ module Compiler
|
|||||||
# Compile metadata
|
# Compile metadata
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
def compile_metadata
|
def compile_metadata
|
||||||
sections = []
|
GameData::Metadata::DATA.clear
|
||||||
currentmap = -1
|
GameData::MapMetadata::DATA.clear
|
||||||
pbCompilerEachCommentedLine("PBS/metadata.txt") { |line,lineno|
|
# Read from PBS file
|
||||||
if line[/^\s*\[\s*(\d+)\s*\]\s*$/]
|
File.open("PBS/metadata.txt", "rb") { |f|
|
||||||
sectionname = $~[1]
|
FileLineData.file = "PBS/metadata.txt" # For error reporting
|
||||||
if currentmap==0
|
# Read a whole section's lines at once, then run through this code.
|
||||||
if sections[currentmap][Metadata::HOME]==nil
|
# contents is a hash containing all the XXX=YYY lines in that section, where
|
||||||
raise _INTL("The entry Home is required in metadata.txt section [{1}].",sectionname)
|
# the keys are the XXX and the values are the YYY (as unprocessed strings).
|
||||||
elsif sections[currentmap][Metadata::PLAYER_A]==nil
|
pbEachFileSection(f) { |contents, map_id|
|
||||||
raise _INTL("The entry PlayerA is required in metadata.txt section [{1}].",sectionname)
|
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
|
end
|
||||||
|
next
|
||||||
end
|
end
|
||||||
currentmap = sectionname.to_i
|
# Compile value for key
|
||||||
if sections[currentmap]
|
value = pbGetCsvRecord(contents[key], key, schema[key])
|
||||||
raise _INTL("Section [{1}] is defined twice in metadata.txt.\r\n{2}",currentmap,FileLineData.linereport)
|
value = nil if value.is_a?(Array) && value.length == 0
|
||||||
end
|
contents[key] = value
|
||||||
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
|
||||||
|
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
|
end
|
||||||
}
|
}
|
||||||
save_data(sections,"Data/metadata.dat")
|
}
|
||||||
|
# Save all data
|
||||||
|
GameData::Metadata.save
|
||||||
|
GameData::MapMetadata.save
|
||||||
|
Graphics.update
|
||||||
end
|
end
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
@@ -166,27 +210,6 @@ module Compiler
|
|||||||
Graphics.update
|
Graphics.update
|
||||||
end
|
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
|
# Compile phone messages
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|||||||
152
PBS/metadata.txt
152
PBS/metadata.txt
@@ -1,42 +1,42 @@
|
|||||||
# See the documentation on the wiki to learn how to edit this file.
|
# See the documentation on the wiki to learn how to edit this file.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[000]
|
[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
|
Home = 3,7,5,8
|
||||||
WildBattleBGM = Battle wild.mid
|
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]
|
[001]
|
||||||
# Intro
|
# Intro
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[002]
|
[002]
|
||||||
# Lappet Town
|
# Lappet Town
|
||||||
BattleBack = field
|
|
||||||
MapPosition = 0,13,12
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
MapPosition = 0,13,12
|
||||||
|
BattleBack = field
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[003]
|
[003]
|
||||||
# \PN's house
|
# \PN's house
|
||||||
MapPosition = 0,13,12
|
|
||||||
HealingSpot = 2,8,8
|
HealingSpot = 2,8,8
|
||||||
|
MapPosition = 0,13,12
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[004]
|
[004]
|
||||||
# Pokémon Lab
|
# Pokémon Lab
|
||||||
MapPosition = 0,13,12
|
|
||||||
ShowArea = false
|
ShowArea = false
|
||||||
|
MapPosition = 0,13,12
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[005]
|
[005]
|
||||||
# Route 1
|
# Route 1
|
||||||
BattleBack = field
|
|
||||||
MapPosition = 0,13,11
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
MapPosition = 0,13,11
|
||||||
|
BattleBack = field
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[006]
|
[006]
|
||||||
# Kurt's house
|
# Kurt's house
|
||||||
@@ -44,10 +44,10 @@ MapPosition = 0,13,11
|
|||||||
#-------------------------------
|
#-------------------------------
|
||||||
[007]
|
[007]
|
||||||
# Cedolan City
|
# Cedolan City
|
||||||
MapSize = 2,11
|
|
||||||
MapPosition = 0,13,10
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
MapPosition = 0,13,10
|
||||||
|
MapSize = 2,11
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[008]
|
[008]
|
||||||
# Daisy's house
|
# Daisy's house
|
||||||
@@ -55,13 +55,13 @@ MapPosition = 0,13,12
|
|||||||
#-------------------------------
|
#-------------------------------
|
||||||
[009]
|
[009]
|
||||||
# Cedolan City Poké Center
|
# Cedolan City Poké Center
|
||||||
MapPosition = 0,14,10
|
|
||||||
HealingSpot = 8,17,11
|
HealingSpot = 8,17,11
|
||||||
|
MapPosition = 0,14,10
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[010]
|
[010]
|
||||||
# Cedolan Gym
|
# Cedolan Gym
|
||||||
BattleBack = indoor3
|
|
||||||
MapPosition = 0,13,10
|
MapPosition = 0,13,10
|
||||||
|
BattleBack = indoor3
|
||||||
Environment = Rock
|
Environment = Rock
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[011]
|
[011]
|
||||||
@@ -106,23 +106,23 @@ MapPosition = 0,13,10
|
|||||||
#-------------------------------
|
#-------------------------------
|
||||||
[021]
|
[021]
|
||||||
# Route 2
|
# Route 2
|
||||||
MapSize = 1,11
|
|
||||||
BattleBack = field
|
|
||||||
Weather = Rain,100
|
|
||||||
MapPosition = 0,14,8
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
Weather = Rain,100
|
||||||
|
MapPosition = 0,14,8
|
||||||
|
BattleBack = field
|
||||||
|
MapSize = 1,11
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[023]
|
[023]
|
||||||
# Lerucean Town
|
# Lerucean Town
|
||||||
MapPosition = 0,15,8
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
MapPosition = 0,15,8
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[024]
|
[024]
|
||||||
# Lerucean Town Poké Center
|
# Lerucean Town Poké Center
|
||||||
MapPosition = 0,15,8
|
|
||||||
HealingSpot = 23,11,15
|
HealingSpot = 23,11,15
|
||||||
|
MapPosition = 0,15,8
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[025]
|
[025]
|
||||||
# Lerucean Town Mart
|
# Lerucean Town Mart
|
||||||
@@ -138,10 +138,10 @@ MapPosition = 0,15,8
|
|||||||
#-------------------------------
|
#-------------------------------
|
||||||
[028]
|
[028]
|
||||||
# Natural Park
|
# Natural Park
|
||||||
BattleBack = field
|
|
||||||
MapPosition = 0,16,8
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
MapPosition = 0,16,8
|
||||||
|
BattleBack = field
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[029]
|
[029]
|
||||||
# Natural Park Entrance
|
# Natural Park Entrance
|
||||||
@@ -154,34 +154,34 @@ MapPosition = 0,16,8
|
|||||||
#-------------------------------
|
#-------------------------------
|
||||||
[031]
|
[031]
|
||||||
# Route 3
|
# Route 3
|
||||||
MapSize = 2,1101
|
|
||||||
BattleBack = field
|
|
||||||
MapPosition = 0,14,6
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
MapPosition = 0,14,6
|
||||||
|
BattleBack = field
|
||||||
|
MapSize = 2,1101
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[034]
|
[034]
|
||||||
# Ice Cave
|
# Ice Cave
|
||||||
BattleBack = cave1
|
|
||||||
Bicycle = true
|
Bicycle = true
|
||||||
MapPosition = 0,15,6
|
MapPosition = 0,15,6
|
||||||
|
BattleBack = cave1
|
||||||
Environment = Cave
|
Environment = Cave
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[035]
|
[035]
|
||||||
# Ingido Plateau
|
# Ingido Plateau
|
||||||
MapPosition = 0,13,6
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
MapPosition = 0,13,6
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[036]
|
[036]
|
||||||
# Pokémon League
|
# Pokémon League
|
||||||
MapPosition = 0,13,6
|
|
||||||
HealingSpot = 35,17,7
|
HealingSpot = 35,17,7
|
||||||
|
MapPosition = 0,13,6
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[037]
|
[037]
|
||||||
# Pokémon League
|
# Pokémon League
|
||||||
BattleBack = elite1
|
|
||||||
MapPosition = 0,13,6
|
MapPosition = 0,13,6
|
||||||
|
BattleBack = elite1
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[038]
|
[038]
|
||||||
# Hall of Fame
|
# Hall of Fame
|
||||||
@@ -189,41 +189,41 @@ MapPosition = 0,13,6
|
|||||||
#-------------------------------
|
#-------------------------------
|
||||||
[039]
|
[039]
|
||||||
# Route 4
|
# Route 4
|
||||||
MapSize = 2,11
|
|
||||||
BattleBack = field
|
|
||||||
MapPosition = 0,11,6
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
MapPosition = 0,11,6
|
||||||
|
BattleBack = field
|
||||||
|
MapSize = 2,11
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[040]
|
[040]
|
||||||
# Route 4
|
# Route 4
|
||||||
MapPosition = 0,11,6
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
BicycleAlways = true
|
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
BicycleAlways = true
|
||||||
|
MapPosition = 0,11,6
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[041]
|
[041]
|
||||||
# Route 5
|
# Route 5
|
||||||
MapSize = 1,111
|
|
||||||
MapPosition = 0,11,7
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
BicycleAlways = true
|
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
BicycleAlways = true
|
||||||
|
MapPosition = 0,11,7
|
||||||
|
MapSize = 1,111
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[044]
|
[044]
|
||||||
# Route 6
|
# Route 6
|
||||||
MapSize = 2,11
|
|
||||||
BattleBack = field
|
|
||||||
MapPosition = 0,11,10
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
MapPosition = 0,11,10
|
||||||
|
BattleBack = field
|
||||||
|
MapSize = 2,11
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[045]
|
[045]
|
||||||
# Route 6
|
# Route 6
|
||||||
MapPosition = 0,11,10
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
BicycleAlways = true
|
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
BicycleAlways = true
|
||||||
|
MapPosition = 0,11,10
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[046]
|
[046]
|
||||||
# Cycling Road gate
|
# Cycling Road gate
|
||||||
@@ -232,47 +232,47 @@ MapPosition = 0,12,6
|
|||||||
#-------------------------------
|
#-------------------------------
|
||||||
[047]
|
[047]
|
||||||
# Route 7
|
# Route 7
|
||||||
MapSize = 2,11
|
Outdoor = true
|
||||||
BattleBack = rocky
|
ShowArea = true
|
||||||
Weather = Rain,0
|
Weather = Rain,0
|
||||||
MapPosition = 0,15,10
|
MapPosition = 0,15,10
|
||||||
Outdoor = true
|
BattleBack = rocky
|
||||||
|
MapSize = 2,11
|
||||||
Environment = Rock
|
Environment = Rock
|
||||||
ShowArea = true
|
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[049]
|
[049]
|
||||||
# Rock Cave
|
# Rock Cave
|
||||||
BattleBack = cave1
|
|
||||||
Bicycle = true
|
Bicycle = true
|
||||||
MapPosition = 0,16,10
|
MapPosition = 0,16,10
|
||||||
|
BattleBack = cave1
|
||||||
Environment = Cave
|
Environment = Cave
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[050]
|
[050]
|
||||||
# Rock Cave
|
# Rock Cave
|
||||||
BattleBack = cave3
|
|
||||||
Bicycle = true
|
Bicycle = true
|
||||||
MapPosition = 0,16,10
|
MapPosition = 0,16,10
|
||||||
DarkMap = true
|
DarkMap = true
|
||||||
|
BattleBack = cave3
|
||||||
Environment = Cave
|
Environment = Cave
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[051]
|
[051]
|
||||||
# Dungeon
|
# Dungeon
|
||||||
BattleBack = cave2
|
|
||||||
Bicycle = true
|
Bicycle = true
|
||||||
Dungeon = true
|
|
||||||
MapPosition = 0,16,10
|
MapPosition = 0,16,10
|
||||||
|
Dungeon = true
|
||||||
|
BattleBack = cave2
|
||||||
Environment = Cave
|
Environment = Cave
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[052]
|
[052]
|
||||||
# Battle Frontier
|
# Battle Frontier
|
||||||
MapPosition = 0,17,10
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
MapPosition = 0,17,10
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[053]
|
[053]
|
||||||
# Battle Frontier Poké Center
|
# Battle Frontier Poké Center
|
||||||
MapPosition = 0,17,10
|
|
||||||
HealingSpot = 52,17,14
|
HealingSpot = 52,17,14
|
||||||
|
MapPosition = 0,17,10
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[054]
|
[054]
|
||||||
# Battle Frontier Mart
|
# Battle Frontier Mart
|
||||||
@@ -280,13 +280,13 @@ MapPosition = 0,17,10
|
|||||||
#-------------------------------
|
#-------------------------------
|
||||||
[055]
|
[055]
|
||||||
# Battle Tower
|
# Battle Tower
|
||||||
MapPosition = 0,17,10
|
|
||||||
HealingSpot = 52,30,10
|
HealingSpot = 52,30,10
|
||||||
|
MapPosition = 0,17,10
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[056]
|
[056]
|
||||||
# Battle Tower arena
|
# Battle Tower arena
|
||||||
BattleBack = indoor1
|
|
||||||
MapPosition = 0,17,10
|
MapPosition = 0,17,10
|
||||||
|
BattleBack = indoor1
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[057]
|
[057]
|
||||||
# Stadium Cup lobby
|
# Stadium Cup lobby
|
||||||
@@ -298,8 +298,8 @@ MapPosition = 0,17,10
|
|||||||
#-------------------------------
|
#-------------------------------
|
||||||
[059]
|
[059]
|
||||||
# Battle Palace arena
|
# Battle Palace arena
|
||||||
BattleBack = indoor1
|
|
||||||
MapPosition = 0,17,10
|
MapPosition = 0,17,10
|
||||||
|
BattleBack = indoor1
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[060]
|
[060]
|
||||||
# Battle Arena
|
# Battle Arena
|
||||||
@@ -307,8 +307,8 @@ MapPosition = 0,17,10
|
|||||||
#-------------------------------
|
#-------------------------------
|
||||||
[061]
|
[061]
|
||||||
# Battle Arena arena
|
# Battle Arena arena
|
||||||
BattleBack = indoor1
|
|
||||||
MapPosition = 0,17,10
|
MapPosition = 0,17,10
|
||||||
|
BattleBack = indoor1
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[062]
|
[062]
|
||||||
# Battle Factory
|
# Battle Factory
|
||||||
@@ -320,8 +320,8 @@ MapPosition = 0,17,10
|
|||||||
#-------------------------------
|
#-------------------------------
|
||||||
[064]
|
[064]
|
||||||
# Battle Factory arena
|
# Battle Factory arena
|
||||||
BattleBack = indoor1
|
|
||||||
MapPosition = 0,17,10
|
MapPosition = 0,17,10
|
||||||
|
BattleBack = indoor1
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[065]
|
[065]
|
||||||
# Battle Factory corridor
|
# Battle Factory corridor
|
||||||
@@ -329,10 +329,10 @@ MapPosition = 0,17,10
|
|||||||
#-------------------------------
|
#-------------------------------
|
||||||
[066]
|
[066]
|
||||||
# Safari Zone
|
# Safari Zone
|
||||||
BattleBack = field
|
|
||||||
MapPosition = 0,12,12
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
MapPosition = 0,12,12
|
||||||
|
BattleBack = field
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[067]
|
[067]
|
||||||
# Safari Zone gate
|
# Safari Zone gate
|
||||||
@@ -340,25 +340,25 @@ MapPosition = 0,12,12
|
|||||||
#-------------------------------
|
#-------------------------------
|
||||||
[068]
|
[068]
|
||||||
# Safari Zone
|
# Safari Zone
|
||||||
BattleBack = forest
|
Outdoor = true
|
||||||
|
ShowArea = true
|
||||||
MapPosition = 0,12,12
|
MapPosition = 0,12,12
|
||||||
SafariMap = true
|
SafariMap = true
|
||||||
Outdoor = true
|
BattleBack = forest
|
||||||
Environment = Forest
|
Environment = Forest
|
||||||
ShowArea = true
|
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[069]
|
[069]
|
||||||
# Route 8
|
# Route 8
|
||||||
DiveMap = 70
|
|
||||||
BattleBack = field
|
|
||||||
MapPosition = 0,13,13
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
MapPosition = 0,13,13
|
||||||
|
DiveMap = 70
|
||||||
|
BattleBack = field
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[070]
|
[070]
|
||||||
# Underwater
|
# Underwater
|
||||||
BattleBack = underwater
|
|
||||||
MapPosition = 0,13,13
|
MapPosition = 0,13,13
|
||||||
|
BattleBack = underwater
|
||||||
Environment = Underwater
|
Environment = Underwater
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[071]
|
[071]
|
||||||
@@ -367,18 +367,18 @@ MapPosition = 0,13,13
|
|||||||
#-------------------------------
|
#-------------------------------
|
||||||
[072]
|
[072]
|
||||||
# Berth Island
|
# Berth Island
|
||||||
BattleBack = field
|
|
||||||
Weather = Storm,50
|
|
||||||
MapPosition = 0,18,17
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
Weather = Storm,50
|
||||||
|
MapPosition = 0,18,17
|
||||||
|
BattleBack = field
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[073]
|
[073]
|
||||||
# Faraday Island
|
# Faraday Island
|
||||||
BattleBack = field
|
|
||||||
MapPosition = 0,22,16
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
ShowArea = true
|
ShowArea = true
|
||||||
|
MapPosition = 0,22,16
|
||||||
|
BattleBack = field
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[074]
|
[074]
|
||||||
# Cycling Road gate
|
# Cycling Road gate
|
||||||
@@ -387,6 +387,6 @@ MapPosition = 0,12,10
|
|||||||
#-------------------------------
|
#-------------------------------
|
||||||
[075]
|
[075]
|
||||||
# Tiall Region
|
# Tiall Region
|
||||||
BattleBack = city
|
|
||||||
MapPosition = 1,13,16
|
|
||||||
Outdoor = true
|
Outdoor = true
|
||||||
|
MapPosition = 1,13,16
|
||||||
|
BattleBack = city
|
||||||
|
|||||||
Reference in New Issue
Block a user