mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Added Flags property to types, abilities, species and map metadata. Added LocationFlag evolution method.
This commit is contained in:
@@ -101,6 +101,10 @@ class Game_Map
|
|||||||
ret.gsub!(/\\PN/,$Trainer.name) if $Trainer
|
ret.gsub!(/\\PN/,$Trainer.name) if $Trainer
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def metadata
|
||||||
|
return GameData::MapMetadata.try_get(@map_id)
|
||||||
|
end
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# * Autoplays background music
|
# * Autoplays background music
|
||||||
# Plays music called "[normal BGM]_n" if it's night time and it exists
|
# Plays music called "[normal BGM]_n" if it's night time and it exists
|
||||||
@@ -319,7 +323,7 @@ class Game_Map
|
|||||||
def display_x=(value)
|
def display_x=(value)
|
||||||
return if @display_x == value
|
return if @display_x == value
|
||||||
@display_x = value
|
@display_x = value
|
||||||
if GameData::MapMetadata.exists?(self.map_id) && GameData::MapMetadata.get(self.map_id).snap_edges
|
if metadata&.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
|
||||||
@@ -329,7 +333,7 @@ class Game_Map
|
|||||||
def display_y=(value)
|
def display_y=(value)
|
||||||
return if @display_y == value
|
return if @display_y == value
|
||||||
@display_y = value
|
@display_y = value
|
||||||
if GameData::MapMetadata.exists?(self.map_id) && GameData::MapMetadata.get(self.map_id).snap_edges
|
if metadata&.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
|
||||||
|
|||||||
@@ -423,9 +423,7 @@ end
|
|||||||
def pbCanUseBike?(map_id)
|
def pbCanUseBike?(map_id)
|
||||||
map_metadata = GameData::MapMetadata.try_get(map_id)
|
map_metadata = GameData::MapMetadata.try_get(map_id)
|
||||||
return false if !map_metadata
|
return false if !map_metadata
|
||||||
return true if map_metadata.always_bicycle
|
return map_metadata.always_bicycle || map_metadata.can_bicycle || map_metadata.outdoor_map
|
||||||
val = map_metadata.can_bicycle || map_metadata.outdoor_map
|
|
||||||
return (val) ? true : false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbMountBike
|
def pbMountBike
|
||||||
|
|||||||
@@ -200,8 +200,7 @@ GameData::Evolution.register({
|
|||||||
:id => :LevelDarkness,
|
:id => :LevelDarkness,
|
||||||
:parameter => Integer,
|
:parameter => Integer,
|
||||||
:level_up_proc => proc { |pkmn, parameter|
|
:level_up_proc => proc { |pkmn, parameter|
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
next pkmn.level >= parameter && $game_map.metadata&.dark_map
|
||||||
next pkmn.level >= parameter && map_metadata && map_metadata.dark_map
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -489,12 +488,21 @@ GameData::Evolution.register({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
GameData::Evolution.register({
|
||||||
|
:id => :LocationFlag,
|
||||||
|
:parameter => String,
|
||||||
|
:minimum_level => 1, # Needs any level up
|
||||||
|
:level_up_proc => proc { |pkmn, parameter|
|
||||||
|
next $game_map.metadata&.has_flag?(parameter)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
GameData::Evolution.register({
|
GameData::Evolution.register({
|
||||||
:id => :Region,
|
:id => :Region,
|
||||||
:parameter => Integer,
|
:parameter => Integer,
|
||||||
:minimum_level => 1, # Needs any level up
|
:minimum_level => 1, # Needs any level up
|
||||||
:level_up_proc => proc { |pkmn, parameter|
|
:level_up_proc => proc { |pkmn, parameter|
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
map_metadata = $game_map.metadata
|
||||||
next map_metadata && map_metadata.town_map_position &&
|
next map_metadata && map_metadata.town_map_position &&
|
||||||
map_metadata.town_map_position[0] == parameter
|
map_metadata.town_map_position[0] == parameter
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ module GameData
|
|||||||
attr_reader :real_name
|
attr_reader :real_name
|
||||||
attr_reader :special_type
|
attr_reader :special_type
|
||||||
attr_reader :pseudo_type
|
attr_reader :pseudo_type
|
||||||
|
attr_reader :flags
|
||||||
attr_reader :weaknesses
|
attr_reader :weaknesses
|
||||||
attr_reader :resistances
|
attr_reader :resistances
|
||||||
attr_reader :immunities
|
attr_reader :immunities
|
||||||
@@ -13,14 +14,15 @@ module GameData
|
|||||||
DATA_FILENAME = "types.dat"
|
DATA_FILENAME = "types.dat"
|
||||||
|
|
||||||
SCHEMA = {
|
SCHEMA = {
|
||||||
"Name" => [1, "s"],
|
"Name" => [0, "s"],
|
||||||
"InternalName" => [2, "s"],
|
"InternalName" => [0, "s"],
|
||||||
"IsPseudoType" => [3, "b"],
|
"IsSpecialType" => [0, "b"],
|
||||||
"IsSpecialType" => [4, "b"],
|
"IsPseudoType" => [0, "b"],
|
||||||
"Weaknesses" => [5, "*s"],
|
"Flags" => [0, "*s"],
|
||||||
"Resistances" => [6, "*s"],
|
"Weaknesses" => [0, "*s"],
|
||||||
"Immunities" => [7, "*s"],
|
"Resistances" => [0, "*s"],
|
||||||
"IconPosition" => [8, "u"]
|
"Immunities" => [0, "*s"],
|
||||||
|
"IconPosition" => [0, "u"]
|
||||||
}
|
}
|
||||||
|
|
||||||
extend ClassMethodsSymbols
|
extend ClassMethodsSymbols
|
||||||
@@ -29,8 +31,9 @@ module GameData
|
|||||||
def initialize(hash)
|
def initialize(hash)
|
||||||
@id = hash[:id]
|
@id = hash[:id]
|
||||||
@real_name = hash[:name] || "Unnamed"
|
@real_name = hash[:name] || "Unnamed"
|
||||||
@pseudo_type = hash[:pseudo_type] || false
|
|
||||||
@special_type = hash[:special_type] || false
|
@special_type = hash[:special_type] || false
|
||||||
|
@pseudo_type = hash[:pseudo_type] || false
|
||||||
|
@flags = hash[:flags] || []
|
||||||
@weaknesses = hash[:weaknesses] || []
|
@weaknesses = hash[:weaknesses] || []
|
||||||
@weaknesses = [@weaknesses] if !@weaknesses.is_a?(Array)
|
@weaknesses = [@weaknesses] if !@weaknesses.is_a?(Array)
|
||||||
@resistances = hash[:resistances] || []
|
@resistances = hash[:resistances] || []
|
||||||
@@ -48,6 +51,10 @@ module GameData
|
|||||||
def physical?; return !@special_type; end
|
def physical?; return !@special_type; end
|
||||||
def special?; return @special_type; end
|
def special?; return @special_type; end
|
||||||
|
|
||||||
|
def has_flag?(flag)
|
||||||
|
return @flags.any? { |f| f.downcase == flag.downcase }
|
||||||
|
end
|
||||||
|
|
||||||
def effectiveness(other_type)
|
def effectiveness(other_type)
|
||||||
return Effectiveness::NORMAL_EFFECTIVE_ONE if !other_type
|
return Effectiveness::NORMAL_EFFECTIVE_ONE if !other_type
|
||||||
return Effectiveness::SUPER_EFFECTIVE_ONE if @weaknesses.include?(other_type)
|
return Effectiveness::SUPER_EFFECTIVE_ONE if @weaknesses.include?(other_type)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ module GameData
|
|||||||
attr_reader :id
|
attr_reader :id
|
||||||
attr_reader :real_name
|
attr_reader :real_name
|
||||||
attr_reader :real_description
|
attr_reader :real_description
|
||||||
|
attr_reader :flags
|
||||||
|
|
||||||
DATA = {}
|
DATA = {}
|
||||||
DATA_FILENAME = "abilities.dat"
|
DATA_FILENAME = "abilities.dat"
|
||||||
@@ -12,13 +13,15 @@ module GameData
|
|||||||
|
|
||||||
SCHEMA = {
|
SCHEMA = {
|
||||||
"Name" => [:name, "s"],
|
"Name" => [:name, "s"],
|
||||||
"Description" => [:description, "q"]
|
"Description" => [:description, "q"],
|
||||||
|
"Flags" => [:flags, "*s"]
|
||||||
}
|
}
|
||||||
|
|
||||||
def initialize(hash)
|
def initialize(hash)
|
||||||
@id = hash[:id]
|
@id = hash[:id]
|
||||||
@real_name = hash[:name] || "Unnamed"
|
@real_name = hash[:name] || "Unnamed"
|
||||||
@real_description = hash[:description] || "???"
|
@real_description = hash[:description] || "???"
|
||||||
|
@flags = hash[:flags] || []
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [String] the translated name of this ability
|
# @return [String] the translated name of this ability
|
||||||
@@ -30,5 +33,9 @@ module GameData
|
|||||||
def description
|
def description
|
||||||
return pbGetMessageFromHash(MessageTypes::AbilityDescs, @real_description)
|
return pbGetMessageFromHash(MessageTypes::AbilityDescs, @real_description)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def has_flag?(flag)
|
||||||
|
return @flags.any? { |f| f.downcase == flag.downcase }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ module GameData
|
|||||||
attr_reader :field_use
|
attr_reader :field_use
|
||||||
attr_reader :battle_use
|
attr_reader :battle_use
|
||||||
attr_reader :consumable
|
attr_reader :consumable
|
||||||
attr_reader :type
|
attr_reader :flags
|
||||||
attr_reader :move
|
attr_reader :move
|
||||||
|
|
||||||
DATA = {}
|
DATA = {}
|
||||||
@@ -30,10 +30,7 @@ module GameData
|
|||||||
"OnMoveReusable" => 2, "OnBattlerReusable" => 3,
|
"OnMoveReusable" => 2, "OnBattlerReusable" => 3,
|
||||||
"OnFoeReusable" => 4, "DirectReusable" => 5}],
|
"OnFoeReusable" => 4, "DirectReusable" => 5}],
|
||||||
"Consumable" => [:consumable, "b"],
|
"Consumable" => [:consumable, "b"],
|
||||||
"Type" => [:type, "e", {"Mail" => 1, "IconMail" => 2, "SnagBall" => 3,
|
"Flags" => [:flags, "*s"],
|
||||||
"PokeBall" => 4, "Berry" => 5, "KeyItem" => 6,
|
|
||||||
"EvolutionStone" => 7, "Fossil" => 8, "Apricorn" => 9,
|
|
||||||
"TypeGem" => 10, "Mulch" => 11, "MegaStone" => 12}],
|
|
||||||
"Move" => [:move, "e", :Move]
|
"Move" => [:move, "e", :Move]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +92,7 @@ module GameData
|
|||||||
@real_description = hash[:description] || "???"
|
@real_description = hash[:description] || "???"
|
||||||
@field_use = hash[:field_use] || 0
|
@field_use = hash[:field_use] || 0
|
||||||
@battle_use = hash[:battle_use] || 0
|
@battle_use = hash[:battle_use] || 0
|
||||||
@type = hash[:type] || 0
|
@flags = hash[:flags] || []
|
||||||
@consumable = hash[:consumable]
|
@consumable = hash[:consumable]
|
||||||
@consumable = !is_important? if @consumable.nil?
|
@consumable = !is_important? if @consumable.nil?
|
||||||
@move = hash[:move]
|
@move = hash[:move]
|
||||||
@@ -116,22 +113,26 @@ module GameData
|
|||||||
return pbGetMessageFromHash(MessageTypes::ItemDescriptions, @real_description)
|
return pbGetMessageFromHash(MessageTypes::ItemDescriptions, @real_description)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def has_flag?(flag)
|
||||||
|
return @flags.any? { |f| f.downcase == flag.downcase }
|
||||||
|
end
|
||||||
|
|
||||||
def is_TM?; return @field_use == 3; end
|
def is_TM?; return @field_use == 3; end
|
||||||
def is_HM?; return @field_use == 4; end
|
def is_HM?; return @field_use == 4; end
|
||||||
def is_TR?; return @field_use == 6; end
|
def is_TR?; return @field_use == 6; end
|
||||||
def is_machine?; return is_TM? || is_HM? || is_TR?; end
|
def is_machine?; return is_TM? || is_HM? || is_TR?; end
|
||||||
def is_mail?; return @type == 1 || @type == 2; end
|
def is_mail?; return has_flag?("Mail") || has_flag?("IconMail"); end
|
||||||
def is_icon_mail?; return @type == 2; end
|
def is_icon_mail?; return has_flag?("IconMail"); end
|
||||||
def is_poke_ball?; return @type == 3 || @type == 4; end
|
def is_poke_ball?; return has_flag?("PokeBall") || has_flag?("SnagBall"); end
|
||||||
def is_snag_ball?; return @type == 3 || (@type == 4 && $Trainer.has_snag_machine); end
|
def is_snag_ball?; return has_flag?("SnagBall") || (is_poke_ball? && $Trainer.has_snag_machine); end
|
||||||
def is_berry?; return @type == 5; end
|
def is_berry?; return has_flag?("Berry"); end
|
||||||
def is_key_item?; return @type == 6; end
|
def is_key_item?; return has_flag?("KeyItem"); end
|
||||||
def is_evolution_stone?; return @type == 7; end
|
def is_evolution_stone?; return has_flag?("EvolutionStone"); end
|
||||||
def is_fossil?; return @type == 8; end
|
def is_fossil?; return has_flag?("Fossil"); end
|
||||||
def is_apricorn?; return @type == 9; end
|
def is_apricorn?; return has_flag?("Apricorn"); end
|
||||||
def is_gem?; return @type == 10; end
|
def is_gem?; return has_flag?("TypeGem"); end
|
||||||
def is_mulch?; return @type == 11; end
|
def is_mulch?; return has_flag?("Mulch"); end
|
||||||
def is_mega_stone?; return @type == 12; end # Does NOT include Red Orb/Blue Orb
|
def is_mega_stone?; return has_flag?("MegaStone"); end # Does NOT include Red Orb/Blue Orb
|
||||||
|
|
||||||
def is_important?
|
def is_important?
|
||||||
return true if is_key_item? || is_HM? || is_TM?
|
return true if is_key_item? || is_HM? || is_TM?
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ module GameData
|
|||||||
attr_reader :shape
|
attr_reader :shape
|
||||||
attr_reader :habitat
|
attr_reader :habitat
|
||||||
attr_reader :generation
|
attr_reader :generation
|
||||||
|
attr_reader :flags
|
||||||
attr_reader :mega_stone
|
attr_reader :mega_stone
|
||||||
attr_reader :mega_move
|
attr_reader :mega_move
|
||||||
attr_reader :unmega_form
|
attr_reader :unmega_form
|
||||||
@@ -105,6 +106,7 @@ module GameData
|
|||||||
"Shape" => [0, "e", :BodyShape],
|
"Shape" => [0, "e", :BodyShape],
|
||||||
"Habitat" => [0, "e", :Habitat],
|
"Habitat" => [0, "e", :Habitat],
|
||||||
"Generation" => [0, "i"],
|
"Generation" => [0, "i"],
|
||||||
|
"Flags" => [0, "*s"],
|
||||||
"BattlerPlayerX" => [0, "i"],
|
"BattlerPlayerX" => [0, "i"],
|
||||||
"BattlerPlayerY" => [0, "i"],
|
"BattlerPlayerY" => [0, "i"],
|
||||||
"BattlerEnemyX" => [0, "i"],
|
"BattlerEnemyX" => [0, "i"],
|
||||||
@@ -183,6 +185,7 @@ module GameData
|
|||||||
@shape = hash[:shape] || :Head
|
@shape = hash[:shape] || :Head
|
||||||
@habitat = hash[:habitat] || :None
|
@habitat = hash[:habitat] || :None
|
||||||
@generation = hash[:generation] || 0
|
@generation = hash[:generation] || 0
|
||||||
|
@flags = hash[:flags] || []
|
||||||
@mega_stone = hash[:mega_stone]
|
@mega_stone = hash[:mega_stone]
|
||||||
@mega_move = hash[:mega_move]
|
@mega_move = hash[:mega_move]
|
||||||
@unmega_form = hash[:unmega_form] || 0
|
@unmega_form = hash[:unmega_form] || 0
|
||||||
@@ -220,6 +223,10 @@ module GameData
|
|||||||
return GameData::GenderRatio.get(@gender_ratio).single_gendered?
|
return GameData::GenderRatio.get(@gender_ratio).single_gendered?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def has_flag?(flag)
|
||||||
|
return @flags.any? { |f| f.downcase == flag.downcase }
|
||||||
|
end
|
||||||
|
|
||||||
def apply_metrics_to_sprite(sprite, index, shadow = false)
|
def apply_metrics_to_sprite(sprite, index, shadow = false)
|
||||||
if shadow
|
if shadow
|
||||||
if (index & 1) == 1 # Foe Pokémon
|
if (index & 1) == 1 # Foe Pokémon
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ module GameData
|
|||||||
attr_reader :gender
|
attr_reader :gender
|
||||||
attr_reader :base_money
|
attr_reader :base_money
|
||||||
attr_reader :skill_level
|
attr_reader :skill_level
|
||||||
attr_reader :skill_flags
|
attr_reader :flags
|
||||||
attr_reader :intro_ME
|
attr_reader :intro_ME
|
||||||
attr_reader :battle_BGM
|
attr_reader :battle_BGM
|
||||||
attr_reader :victory_ME
|
attr_reader :victory_ME
|
||||||
@@ -21,7 +21,7 @@ module GameData
|
|||||||
"Mixed" => 2, "mixed" => 2, "X" => 2, "x" => 2, "2" => 2}],
|
"Mixed" => 2, "mixed" => 2, "X" => 2, "x" => 2, "2" => 2}],
|
||||||
"BaseMoney" => [:base_money, "u"],
|
"BaseMoney" => [:base_money, "u"],
|
||||||
"SkillLevel" => [:skill_level, "u"],
|
"SkillLevel" => [:skill_level, "u"],
|
||||||
"SkillFlags" => [:skill_flags, "*s"],
|
"Flags" => [:flags, "*s"],
|
||||||
"IntroME" => [:intro_ME, "s"],
|
"IntroME" => [:intro_ME, "s"],
|
||||||
"BattleBGM" => [:battle_BGM, "s"],
|
"BattleBGM" => [:battle_BGM, "s"],
|
||||||
"VictoryME" => [:victory_ME, "s"]
|
"VictoryME" => [:victory_ME, "s"]
|
||||||
@@ -85,7 +85,7 @@ module GameData
|
|||||||
@gender = hash[:gender] || 2
|
@gender = hash[:gender] || 2
|
||||||
@base_money = hash[:base_money] || 30
|
@base_money = hash[:base_money] || 30
|
||||||
@skill_level = hash[:skill_level] || @base_money
|
@skill_level = hash[:skill_level] || @base_money
|
||||||
@skill_flags = hash[:skill_flags] || []
|
@flags = hash[:flags] || []
|
||||||
@intro_ME = hash[:intro_ME]
|
@intro_ME = hash[:intro_ME]
|
||||||
@battle_BGM = hash[:battle_BGM]
|
@battle_BGM = hash[:battle_BGM]
|
||||||
@victory_ME = hash[:victory_ME]
|
@victory_ME = hash[:victory_ME]
|
||||||
@@ -98,5 +98,9 @@ module GameData
|
|||||||
|
|
||||||
def male?; return @gender == 0; end
|
def male?; return @gender == 0; end
|
||||||
def female?; return @gender == 1; end
|
def female?; return @gender == 1; end
|
||||||
|
|
||||||
|
def has_flag?(flag)
|
||||||
|
return @flags.any? { |f| f.downcase == flag.downcase }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ module GameData
|
|||||||
attr_reader :wild_capture_ME
|
attr_reader :wild_capture_ME
|
||||||
attr_reader :town_map_size
|
attr_reader :town_map_size
|
||||||
attr_reader :battle_environment
|
attr_reader :battle_environment
|
||||||
|
attr_reader :flags
|
||||||
|
|
||||||
DATA = {}
|
DATA = {}
|
||||||
DATA_FILENAME = "map_metadata.dat"
|
DATA_FILENAME = "map_metadata.dat"
|
||||||
@@ -45,7 +46,8 @@ module GameData
|
|||||||
"TrainerVictoryME" => [17, "s"],
|
"TrainerVictoryME" => [17, "s"],
|
||||||
"WildCaptureME" => [18, "s"],
|
"WildCaptureME" => [18, "s"],
|
||||||
"MapSize" => [19, "us"],
|
"MapSize" => [19, "us"],
|
||||||
"Environment" => [20, "e", :Environment]
|
"Environment" => [20, "e", :Environment],
|
||||||
|
"Flags" => [21, "*s"]
|
||||||
}
|
}
|
||||||
|
|
||||||
extend ClassMethodsIDNumbers
|
extend ClassMethodsIDNumbers
|
||||||
@@ -72,7 +74,8 @@ module GameData
|
|||||||
["TrainerVictoryME", MEProperty, _INTL("Default ME played after winning a Trainer 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.")],
|
["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.")],
|
["MapSize", MapSizeProperty, _INTL("The width of the map in Town Map squares, and a string indicating which squares are part of this map.")],
|
||||||
["Environment", GameDataProperty.new(:Environment), _INTL("The default battle environment for battles on this map.")]
|
["Environment", GameDataProperty.new(:Environment), _INTL("The default battle environment for battles on this map.")],
|
||||||
|
["Flags", StringListProperty, _INTL("Words/phrases that distinguish this map from others.")]
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -98,6 +101,7 @@ module GameData
|
|||||||
@wild_capture_ME = hash[:wild_capture_ME]
|
@wild_capture_ME = hash[:wild_capture_ME]
|
||||||
@town_map_size = hash[:town_map_size]
|
@town_map_size = hash[:town_map_size]
|
||||||
@battle_environment = hash[:battle_environment]
|
@battle_environment = hash[:battle_environment]
|
||||||
|
@flags = hash[:flags] || []
|
||||||
end
|
end
|
||||||
|
|
||||||
def property_from_string(str)
|
def property_from_string(str)
|
||||||
@@ -122,8 +126,13 @@ module GameData
|
|||||||
when "WildCaptureME" then return @wild_capture_ME
|
when "WildCaptureME" then return @wild_capture_ME
|
||||||
when "MapSize" then return @town_map_size
|
when "MapSize" then return @town_map_size
|
||||||
when "Environment" then return @battle_environment
|
when "Environment" then return @battle_environment
|
||||||
|
when "Flags" then return @flags
|
||||||
end
|
end
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def has_flag?(flag)
|
||||||
|
return @flags.any? { |f| f.downcase == flag.downcase }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ end
|
|||||||
Events.onMapChanging += proc { |_sender, e|
|
Events.onMapChanging += proc { |_sender, e|
|
||||||
new_map_ID = e[0]
|
new_map_ID = e[0]
|
||||||
next if new_map_ID == 0
|
next if new_map_ID == 0
|
||||||
old_map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
old_map_metadata = $game_map.metadata
|
||||||
next if !old_map_metadata || !old_map_metadata.weather
|
next if !old_map_metadata || !old_map_metadata.weather
|
||||||
map_infos = pbLoadMapInfos
|
map_infos = pbLoadMapInfos
|
||||||
if $game_map.name == map_infos[new_map_ID].name
|
if $game_map.name == map_infos[new_map_ID].name
|
||||||
@@ -236,7 +236,7 @@ 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|
|
||||||
old_map_ID = e[0] # previous map ID, is 0 if no map ID
|
old_map_ID = e[0] # previous map ID, is 0 if no map ID
|
||||||
new_map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
new_map_metadata = $game_map.metadata
|
||||||
if new_map_metadata && new_map_metadata.teleport_destination
|
if new_map_metadata && new_map_metadata.teleport_destination
|
||||||
$PokemonGlobal.healingSpot = new_map_metadata.teleport_destination
|
$PokemonGlobal.healingSpot = new_map_metadata.teleport_destination
|
||||||
end
|
end
|
||||||
@@ -267,7 +267,7 @@ Events.onMapSceneChange += proc { |_sender, e|
|
|||||||
$PokemonGlobal.mapTrail = [$game_map.map_id] + $PokemonGlobal.mapTrail
|
$PokemonGlobal.mapTrail = [$game_map.map_id] + $PokemonGlobal.mapTrail
|
||||||
end
|
end
|
||||||
# Display darkness circle on dark maps
|
# Display darkness circle on dark maps
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
map_metadata = $game_map.metadata
|
||||||
if map_metadata && map_metadata.dark_map
|
if map_metadata && map_metadata.dark_map
|
||||||
$PokemonTemp.darknessSprite = DarknessSprite.new
|
$PokemonTemp.darknessSprite = DarknessSprite.new
|
||||||
scene.spriteset.addUserSprite($PokemonTemp.darknessSprite)
|
scene.spriteset.addUserSprite($PokemonTemp.darknessSprite)
|
||||||
|
|||||||
@@ -137,8 +137,8 @@ def pbPrepareBattle(battle)
|
|||||||
backdrop = $PokemonGlobal.nextBattleBack
|
backdrop = $PokemonGlobal.nextBattleBack
|
||||||
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
|
||||||
elsif GameData::MapMetadata.exists?($game_map.map_id)
|
elsif $game_map.metadata
|
||||||
back = GameData::MapMetadata.get($game_map.map_id).battle_background
|
back = $game_map.metadata.battle_background
|
||||||
backdrop = back if back && back != ""
|
backdrop = back if back && back != ""
|
||||||
end
|
end
|
||||||
backdrop = "indoor1" if !backdrop
|
backdrop = "indoor1" if !backdrop
|
||||||
@@ -152,8 +152,7 @@ def pbPrepareBattle(battle)
|
|||||||
end
|
end
|
||||||
battle.backdropBase = base if base
|
battle.backdropBase = base if base
|
||||||
# Time of day
|
# Time of day
|
||||||
if GameData::MapMetadata.exists?($game_map.map_id) &&
|
if $game_map.metadata&.battle_environment == :Cave
|
||||||
GameData::MapMetadata.get($game_map.map_id).battle_environment == :Cave
|
|
||||||
battle.time = 2 # This makes Dusk Balls work properly in caves
|
battle.time = 2 # This makes Dusk Balls work properly in caves
|
||||||
elsif Settings::TIME_SHADING
|
elsif Settings::TIME_SHADING
|
||||||
timeNow = pbGetTimeNow
|
timeNow = pbGetTimeNow
|
||||||
@@ -171,8 +170,8 @@ end
|
|||||||
# Wormadam.
|
# Wormadam.
|
||||||
def pbGetEnvironment
|
def pbGetEnvironment
|
||||||
ret = :None
|
ret = :None
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
map_env = $game_map.metadata&.battle_environment
|
||||||
ret = map_metadata.battle_environment if map_metadata && map_metadata.battle_environment
|
ret = map_env if map_env
|
||||||
if $PokemonTemp.encounterType &&
|
if $PokemonTemp.encounterType &&
|
||||||
GameData::EncounterType.get($PokemonTemp.encounterType).type == :fishing
|
GameData::EncounterType.get($PokemonTemp.encounterType).type == :fishing
|
||||||
terrainTag = $game_player.pbFacingTerrainTag
|
terrainTag = $game_player.pbFacingTerrainTag
|
||||||
|
|||||||
@@ -41,8 +41,7 @@ def pbBattleAnimation(bgm=nil,battletype=0,foe=nil)
|
|||||||
location = 3
|
location = 3
|
||||||
elsif $PokemonEncounters.has_cave_encounters?
|
elsif $PokemonEncounters.has_cave_encounters?
|
||||||
location = 2
|
location = 2
|
||||||
elsif !GameData::MapMetadata.exists?($game_map.map_id) ||
|
elsif !$game_map.metadata&.outdoor_map
|
||||||
!GameData::MapMetadata.get($game_map.map_id).outdoor_map
|
|
||||||
location = 1
|
location = 1
|
||||||
end
|
end
|
||||||
anim = ""
|
anim = ""
|
||||||
|
|||||||
@@ -115,8 +115,7 @@ end
|
|||||||
|
|
||||||
def pbDayNightTint(object)
|
def pbDayNightTint(object)
|
||||||
return if !$scene.is_a?(Scene_Map)
|
return if !$scene.is_a?(Scene_Map)
|
||||||
if Settings::TIME_SHADING && GameData::MapMetadata.exists?($game_map.map_id) &&
|
if Settings::TIME_SHADING && $game_map.metadata&.outdoor_map
|
||||||
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
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ HiddenMoveHandlers::UseMove.add(:DIG,proc { |move,pokemon|
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbDive
|
def pbDive
|
||||||
return false if $game_player.pbFacingEvent
|
return false if $game_player.pbFacingEvent
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
map_metadata = $game_map.metadata
|
||||||
return false if !map_metadata || !map_metadata.dive_map_id
|
return false if !map_metadata || !map_metadata.dive_map_id
|
||||||
move = :DIVE
|
move = :DIVE
|
||||||
movefinder = $Trainer.get_pokemon_with_move(move)
|
movefinder = $Trainer.get_pokemon_with_move(move)
|
||||||
@@ -408,8 +408,7 @@ HiddenMoveHandlers::CanUseMove.add(:DIVE,proc { |move,pkmn,showmsg|
|
|||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if !GameData::MapMetadata.exists?($game_map.map_id) ||
|
if !$game_map.metadata&.dive_map_id
|
||||||
!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
|
||||||
@@ -431,8 +430,7 @@ HiddenMoveHandlers::UseMove.add(:DIVE,proc { |move,pokemon|
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
dive_map_id = $game_map.metadata&.dive_map_id
|
||||||
dive_map_id = map_metadata.dive_map_id if map_metadata
|
|
||||||
end
|
end
|
||||||
next false if !dive_map_id
|
next false if !dive_map_id
|
||||||
if !pbHiddenMoveAnimation(pokemon)
|
if !pbHiddenMoveAnimation(pokemon)
|
||||||
@@ -460,8 +458,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(Settings::BADGE_FOR_FLASH,showmsg)
|
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_FLASH,showmsg)
|
||||||
if !GameData::MapMetadata.exists?($game_map.map_id) ||
|
if !$game_map.metadata&.dark_map
|
||||||
!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
|
||||||
@@ -501,8 +498,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 !GameData::MapMetadata.exists?($game_map.map_id) ||
|
if !$game_map.metadata&.outdoor_map
|
||||||
!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
|
||||||
@@ -762,8 +758,7 @@ end
|
|||||||
|
|
||||||
Events.onAction += proc { |_sender,_e|
|
Events.onAction += proc { |_sender,_e|
|
||||||
next if $PokemonGlobal.surfing
|
next if $PokemonGlobal.surfing
|
||||||
next if GameData::MapMetadata.exists?($game_map.map_id) &&
|
next if $game_map.metadata&.always_bicycle
|
||||||
GameData::MapMetadata.get($game_map.map_id).always_bicycle
|
|
||||||
next if !$game_player.pbFacingTerrainTag.can_surf_freely
|
next if !$game_player.pbFacingTerrainTag.can_surf_freely
|
||||||
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
|
||||||
@@ -779,8 +774,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 GameData::MapMetadata.exists?($game_map.map_id) &&
|
if $game_map.metadata&.always_bicycle
|
||||||
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
|
||||||
@@ -861,8 +855,7 @@ 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 !GameData::MapMetadata.exists?($game_map.map_id) ||
|
if !$game_map.metadata&.outdoor_map
|
||||||
!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
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ def pbDayCareGenerateEgg
|
|||||||
end
|
end
|
||||||
# Inheriting regional form
|
# Inheriting regional form
|
||||||
if [:RATTATA, :SANDSHREW, :VULPIX, :DIGLETT, :MEOWTH, :GEODUDE, :GRIMER,
|
if [:RATTATA, :SANDSHREW, :VULPIX, :DIGLETT, :MEOWTH, :GEODUDE, :GRIMER,
|
||||||
:PONYTA, :SLOWPOKE, :FARFETCHD, :MRMINE, :ARTICUNO, :ZAPDOS, :MOLTRES,
|
:PONYTA, :SLOWPOKE, :FARFETCHD, :MRMIME, :ARTICUNO, :ZAPDOS, :MOLTRES,
|
||||||
:CORSOLA, :ZIGZAGOON, :DARUMAKA, :YAMASK, :STUNFISK].include?(babyspecies)
|
:CORSOLA, :ZIGZAGOON, :DARUMAKA, :YAMASK, :STUNFISK].include?(babyspecies)
|
||||||
if mother.form > 0
|
if mother.form > 0
|
||||||
egg.form = mother.form if mother.hasItem?(:EVERSTONE)
|
egg.form = mother.form if mother.hasItem?(:EVERSTONE)
|
||||||
|
|||||||
@@ -646,8 +646,7 @@ end
|
|||||||
Events.onMapCreate += proc { |_sender, e|
|
Events.onMapCreate += proc { |_sender, e|
|
||||||
mapID = e[0]
|
mapID = e[0]
|
||||||
map = e[1]
|
map = e[1]
|
||||||
next if !GameData::MapMetadata.exists?(mapID) ||
|
next if !GameData::MapMetadata.try_get(mapID)&.random_dungeon
|
||||||
!GameData::MapMetadata.get(mapID).random_dungeon
|
|
||||||
# this map is a randomly generated dungeon
|
# this map is a randomly generated dungeon
|
||||||
dungeon = RandomDungeonGenerator::Dungeon.new(map.width, map.height)
|
dungeon = RandomDungeonGenerator::Dungeon.new(map.width, map.height)
|
||||||
dungeon.generate
|
dungeon.generate
|
||||||
|
|||||||
@@ -439,9 +439,9 @@ def pbBikeCheck
|
|||||||
pbMessage(_INTL("It can't be used when you have someone with you."))
|
pbMessage(_INTL("It can't be used when you have someone with you."))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
map_metadata = $game_map.metadata
|
||||||
if $PokemonGlobal.bicycle
|
if $PokemonGlobal.bicycle
|
||||||
if map_metadata && map_metadata.always_bicycle
|
if map_metadata&.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
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ end
|
|||||||
def pbRandomPhoneTrainer
|
def pbRandomPhoneTrainer
|
||||||
$PokemonGlobal.phoneNumbers = [] if !$PokemonGlobal.phoneNumbers
|
$PokemonGlobal.phoneNumbers = [] if !$PokemonGlobal.phoneNumbers
|
||||||
temparray = []
|
temparray = []
|
||||||
this_map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
this_map_metadata = $game_map.metadata
|
||||||
return nil if !this_map_metadata || !this_map_metadata.town_map_position
|
return nil if !this_map_metadata || !this_map_metadata.town_map_position
|
||||||
currentRegion = this_map_metadata.town_map_position[0]
|
currentRegion = this_map_metadata.town_map_position[0]
|
||||||
for num in $PokemonGlobal.phoneNumbers
|
for num in $PokemonGlobal.phoneNumbers
|
||||||
@@ -192,7 +192,7 @@ def pbCallTrainer(trtype,trname)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
caller_map_metadata = GameData::MapMetadata.try_get(trainer[6])
|
caller_map_metadata = GameData::MapMetadata.try_get(trainer[6])
|
||||||
this_map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
this_map_metadata = $game_map.metadata
|
||||||
if !caller_map_metadata || !caller_map_metadata.town_map_position ||
|
if !caller_map_metadata || !caller_map_metadata.town_map_position ||
|
||||||
!this_map_metadata || !this_map_metadata.town_map_position ||
|
!this_map_metadata || !this_map_metadata.town_map_position ||
|
||||||
caller_map_metadata.town_map_position[0] != this_map_metadata.town_map_position[0]
|
caller_map_metadata.town_map_position[0] != this_map_metadata.town_map_position[0]
|
||||||
|
|||||||
@@ -602,8 +602,7 @@ MultipleForms.copy(:TOXEL, :TOXTRICITY)
|
|||||||
|
|
||||||
MultipleForms.register(:SINISTEA, {
|
MultipleForms.register(:SINISTEA, {
|
||||||
"getFormOnCreation" => proc { |pkmn|
|
"getFormOnCreation" => proc { |pkmn|
|
||||||
next 1 if rand(100) < 50
|
next rand(2)
|
||||||
next 0
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -737,9 +736,8 @@ MultipleForms.register(:PIKACHU, {
|
|||||||
"getForm" => proc { |pkmn|
|
"getForm" => proc { |pkmn|
|
||||||
next if pkmn.form_simple >= 2
|
next if pkmn.form_simple >= 2
|
||||||
if $game_map
|
if $game_map
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
map_pos = $game_map.metadata&.town_map_position
|
||||||
next 1 if map_metadata && map_metadata.town_map_position &&
|
next 1 if map_pos && map_pos[0] == 1 # Tiall region
|
||||||
map_metadata.town_map_position[0] == 1 # Tiall region
|
|
||||||
end
|
end
|
||||||
next 0
|
next 0
|
||||||
}
|
}
|
||||||
@@ -752,9 +750,8 @@ MultipleForms.register(:KOFFING, {
|
|||||||
"getForm" => proc { |pkmn|
|
"getForm" => proc { |pkmn|
|
||||||
next if pkmn.form_simple >= 2
|
next if pkmn.form_simple >= 2
|
||||||
if $game_map
|
if $game_map
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
map_pos = $game_map.metadata&.town_map_position
|
||||||
next 1 if map_metadata && map_metadata.town_map_position &&
|
next 1 if map_pos && map_pos[0] == 2 # Galar region
|
||||||
map_metadata.town_map_position[0] == 2 # Galar region
|
|
||||||
end
|
end
|
||||||
next 0
|
next 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,11 +48,8 @@ class Trainer
|
|||||||
def male?; return GameData::TrainerType.get(self.trainer_type).male?; end
|
def male?; return GameData::TrainerType.get(self.trainer_type).male?; end
|
||||||
def female?; return GameData::TrainerType.get(self.trainer_type).female?; end
|
def female?; return GameData::TrainerType.get(self.trainer_type).female?; end
|
||||||
def skill_level; return GameData::TrainerType.get(self.trainer_type).skill_level; end
|
def skill_level; return GameData::TrainerType.get(self.trainer_type).skill_level; end
|
||||||
def skill_flags; return GameData::TrainerType.get(self.trainer_type).skill_flags; end
|
def flags; return GameData::TrainerType.get(self.trainer_type).flags; end
|
||||||
|
def has_flag?(flag); return GameData::TrainerType.get(self.trainer_type).has_flag?(flag); end
|
||||||
def has_skill_flag?(code)
|
|
||||||
return skill_flags.any? { |c| c.downcase == code.downcase }
|
|
||||||
end
|
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ class PokemonPokedexInfo_Scene
|
|||||||
@sprites["infosprite"].x = 104
|
@sprites["infosprite"].x = 104
|
||||||
@sprites["infosprite"].y = 136
|
@sprites["infosprite"].y = 136
|
||||||
@mapdata = pbLoadTownMapData
|
@mapdata = pbLoadTownMapData
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
mappos = $game_map.metadata&.town_map_position
|
||||||
mappos = (map_metadata) ? map_metadata.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
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class PokemonRegionMap_Scene
|
|||||||
@viewport.z = 99999
|
@viewport.z = 99999
|
||||||
@sprites = {}
|
@sprites = {}
|
||||||
@mapdata = pbLoadTownMapData
|
@mapdata = pbLoadTownMapData
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
map_metadata = $game_map.metadata
|
||||||
playerpos = (map_metadata) ? map_metadata.town_map_position : nil
|
playerpos = (map_metadata) ? map_metadata.town_map_position : nil
|
||||||
if !playerpos
|
if !playerpos
|
||||||
mapindex = 0
|
mapindex = 0
|
||||||
|
|||||||
@@ -62,8 +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
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
return true if $game_map.metadata&.safari_map
|
||||||
return true if map_metadata && map_metadata.safari_map
|
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -355,8 +355,7 @@ end
|
|||||||
# as determined by the current map's metadata.
|
# as determined by the current map's metadata.
|
||||||
def pbGetCurrentRegion(default = -1)
|
def pbGetCurrentRegion(default = -1)
|
||||||
return default if !$game_map
|
return default if !$game_map
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
map_pos = $game_map.metadata&.town_map_position
|
||||||
map_pos = (map_metadata) ? map_metadata.town_map_position : nil
|
|
||||||
return (map_pos) ? map_pos[0] : default
|
return (map_pos) ? map_pos[0] : default
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ def pbGetWildBattleBGM(_wildParty) # wildParty is an array of Pokémon objects
|
|||||||
ret = nil
|
ret = nil
|
||||||
if !ret
|
if !ret
|
||||||
# Check map metadata
|
# Check map metadata
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
music = $game_map.metadata&.wild_battle_BGM
|
||||||
music = (map_metadata) ? map_metadata.wild_battle_BGM : nil
|
|
||||||
ret = pbStringToAudioFile(music) if music && music != ""
|
ret = pbStringToAudioFile(music) if music && music != ""
|
||||||
end
|
end
|
||||||
if !ret
|
if !ret
|
||||||
@@ -28,8 +27,7 @@ def pbGetWildVictoryME
|
|||||||
ret = nil
|
ret = nil
|
||||||
if !ret
|
if !ret
|
||||||
# Check map metadata
|
# Check map metadata
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
music = $game_map.metadata&.wild_victory_ME
|
||||||
music = (map_metadata) ? map_metadata.wild_victory_ME : nil
|
|
||||||
ret = pbStringToAudioFile(music) if music && music != ""
|
ret = pbStringToAudioFile(music) if music && music != ""
|
||||||
end
|
end
|
||||||
if !ret
|
if !ret
|
||||||
@@ -49,8 +47,7 @@ def pbGetWildCaptureME
|
|||||||
ret = nil
|
ret = nil
|
||||||
if !ret
|
if !ret
|
||||||
# Check map metadata
|
# Check map metadata
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
music = $game_map.metadata&.wild_capture_ME
|
||||||
music = (map_metadata) ? map_metadata.wild_capture_ME : nil
|
|
||||||
ret = pbStringToAudioFile(music) if music && music != ""
|
ret = pbStringToAudioFile(music) if music && music != ""
|
||||||
end
|
end
|
||||||
if !ret
|
if !ret
|
||||||
@@ -87,8 +84,7 @@ def pbGetTrainerBattleBGM(trainer) # can be a Player, NPCTrainer or an array o
|
|||||||
ret = pbStringToAudioFile(music) if music && music!=""
|
ret = pbStringToAudioFile(music) if music && music!=""
|
||||||
if !ret
|
if !ret
|
||||||
# Check map metadata
|
# Check map metadata
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
music = $game_map.metadata&.trainer_battle_BGM
|
||||||
music = (map_metadata) ? map_metadata.trainer_battle_BGM : nil
|
|
||||||
ret = pbStringToAudioFile(music) if music && music != ""
|
ret = pbStringToAudioFile(music) if music && music != ""
|
||||||
end
|
end
|
||||||
if !ret
|
if !ret
|
||||||
@@ -110,8 +106,7 @@ def pbGetTrainerBattleBGMFromType(trainertype)
|
|||||||
ret = trainer_type_data.battle_BGM if trainer_type_data.battle_BGM
|
ret = trainer_type_data.battle_BGM if trainer_type_data.battle_BGM
|
||||||
if !ret
|
if !ret
|
||||||
# Check map metadata
|
# Check map metadata
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
music = $game_map.metadata&.trainer_battle_BGM
|
||||||
music = (map_metadata) ? map_metadata.trainer_battle_BGM : nil
|
|
||||||
ret = pbStringToAudioFile(music) if music && music != ""
|
ret = pbStringToAudioFile(music) if music && music != ""
|
||||||
end
|
end
|
||||||
if !ret
|
if !ret
|
||||||
@@ -139,8 +134,7 @@ def pbGetTrainerVictoryME(trainer) # can be a Player, NPCTrainer or an array o
|
|||||||
end
|
end
|
||||||
if !ret
|
if !ret
|
||||||
# Check map metadata
|
# Check map metadata
|
||||||
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
|
music = $game_map.metadata&.trainer_victory_ME
|
||||||
music = (map_metadata) ? map_metadata.trainer_victory_ME : nil
|
|
||||||
ret = pbStringToAudioFile(music) if music && music != ""
|
ret = pbStringToAudioFile(music) if music && music != ""
|
||||||
end
|
end
|
||||||
if !ret
|
if !ret
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ def pbTrainerTypeEditor
|
|||||||
[_INTL("Gender"), EnumProperty.new(gender_array), _INTL("Gender of this Trainer Type.")],
|
[_INTL("Gender"), EnumProperty.new(gender_array), _INTL("Gender of this Trainer Type.")],
|
||||||
[_INTL("BaseMoney"), LimitProperty.new(9999), _INTL("Player earns this much money times the highest level among the trainer's Pokémon.")],
|
[_INTL("BaseMoney"), LimitProperty.new(9999), _INTL("Player earns this much money times the highest level among the trainer's Pokémon.")],
|
||||||
[_INTL("SkillLevel"), LimitProperty.new(9999), _INTL("Skill level of this Trainer Type.")],
|
[_INTL("SkillLevel"), LimitProperty.new(9999), _INTL("Skill level of this Trainer Type.")],
|
||||||
[_INTL("SkillFlags"), StringListProperty, _INTL("Words/phrases representing AI modifications of trainers of this type.")],
|
[_INTL("Flags"), StringListProperty, _INTL("Words/phrases that can be used to make trainers of this type behave differently to others.")],
|
||||||
[_INTL("IntroME"), MEProperty, _INTL("ME played before battles against trainers of this type.")],
|
[_INTL("IntroME"), MEProperty, _INTL("ME played before battles against trainers of this type.")],
|
||||||
[_INTL("BattleBGM"), BGMProperty, _INTL("BGM played in battles against trainers of this type.")],
|
[_INTL("BattleBGM"), BGMProperty, _INTL("BGM played in battles against trainers of this type.")],
|
||||||
[_INTL("VictoryME"), MEProperty, _INTL("ME played when player wins battles against trainers of this type.")]
|
[_INTL("VictoryME"), MEProperty, _INTL("ME played when player wins battles against trainers of this type.")]
|
||||||
@@ -374,7 +374,7 @@ def pbTrainerTypeEditor
|
|||||||
t_data.gender,
|
t_data.gender,
|
||||||
t_data.base_money,
|
t_data.base_money,
|
||||||
t_data.skill_level,
|
t_data.skill_level,
|
||||||
t_data.skill_flags,
|
t_data.flags,
|
||||||
t_data.intro_ME,
|
t_data.intro_ME,
|
||||||
t_data.battle_BGM,
|
t_data.battle_BGM,
|
||||||
t_data.victory_ME
|
t_data.victory_ME
|
||||||
@@ -387,7 +387,7 @@ def pbTrainerTypeEditor
|
|||||||
:gender => data[2],
|
:gender => data[2],
|
||||||
:base_money => data[3],
|
:base_money => data[3],
|
||||||
:skill_level => data[4],
|
:skill_level => data[4],
|
||||||
:skill_flags => data[5],
|
:flags => data[5],
|
||||||
:intro_ME => data[6],
|
:intro_ME => data[6],
|
||||||
:battle_BGM => data[7],
|
:battle_BGM => data[7],
|
||||||
:victory_ME => data[8]
|
:victory_ME => data[8]
|
||||||
@@ -782,7 +782,8 @@ def pbEditMetadata(map_id = 0)
|
|||||||
:trainer_victory_ME => data[16],
|
:trainer_victory_ME => data[16],
|
||||||
:wild_capture_ME => data[17],
|
:wild_capture_ME => data[17],
|
||||||
:town_map_size => data[18],
|
:town_map_size => data[18],
|
||||||
:battle_environment => data[19]
|
:battle_environment => data[19],
|
||||||
|
:flags => data[20]
|
||||||
}
|
}
|
||||||
# Add metadata's data to records
|
# Add metadata's data to records
|
||||||
GameData::MapMetadata.register(metadata_hash)
|
GameData::MapMetadata.register(metadata_hash)
|
||||||
@@ -815,7 +816,7 @@ def pbItemEditor
|
|||||||
[_INTL("FieldUse"), EnumProperty.new(field_use_array), _INTL("How this item can be used outside of battle.")],
|
[_INTL("FieldUse"), EnumProperty.new(field_use_array), _INTL("How this item can be used outside of battle.")],
|
||||||
[_INTL("BattleUse"), EnumProperty.new(battle_use_array), _INTL("How this item can be used within a battle.")],
|
[_INTL("BattleUse"), EnumProperty.new(battle_use_array), _INTL("How this item can be used within a battle.")],
|
||||||
[_INTL("Consumable"), BooleanProperty, _INTL("Whether this item is consumed after use.")],
|
[_INTL("Consumable"), BooleanProperty, _INTL("Whether this item is consumed after use.")],
|
||||||
[_INTL("Type"), EnumProperty.new(type_array), _INTL("For special kinds of items.")],
|
[_INTL("Flags"), StringListProperty, _INTL("Words/phrases that group certain kinds of items.")],
|
||||||
[_INTL("Move"), MoveProperty, _INTL("Move taught by this HM, TM or TR.")]
|
[_INTL("Move"), MoveProperty, _INTL("Move taught by this HM, TM or TR.")]
|
||||||
]
|
]
|
||||||
pbListScreenBlock(_INTL("Items"), ItemLister.new(0, true)) { |button, item|
|
pbListScreenBlock(_INTL("Items"), ItemLister.new(0, true)) { |button, item|
|
||||||
@@ -843,7 +844,7 @@ def pbItemEditor
|
|||||||
itm.field_use,
|
itm.field_use,
|
||||||
itm.battle_use,
|
itm.battle_use,
|
||||||
itm.consumable,
|
itm.consumable,
|
||||||
itm.type,
|
itm.flags,
|
||||||
itm.move
|
itm.move
|
||||||
]
|
]
|
||||||
if pbPropertyList(itm.id.to_s, data, item_properties, true)
|
if pbPropertyList(itm.id.to_s, data, item_properties, true)
|
||||||
@@ -859,7 +860,7 @@ def pbItemEditor
|
|||||||
:field_use => data[7],
|
:field_use => data[7],
|
||||||
:battle_use => data[8],
|
:battle_use => data[8],
|
||||||
:consumable => data[9],
|
:consumable => data[9],
|
||||||
:type => data[10],
|
:flags => data[10],
|
||||||
:move => data[11]
|
:move => data[11]
|
||||||
}
|
}
|
||||||
# Add item's data to records
|
# Add item's data to records
|
||||||
@@ -973,6 +974,7 @@ def pbPokemonEditor
|
|||||||
[_INTL("Shape"), GameDataProperty.new(:BodyShape), _INTL("Body shape of this species.")],
|
[_INTL("Shape"), GameDataProperty.new(:BodyShape), _INTL("Body shape of this species.")],
|
||||||
[_INTL("Habitat"), GameDataProperty.new(:Habitat), _INTL("The habitat of this species.")],
|
[_INTL("Habitat"), GameDataProperty.new(:Habitat), _INTL("The habitat of this species.")],
|
||||||
[_INTL("Generation"), LimitProperty.new(99999), _INTL("The number of the generation the Pokémon debuted in.")],
|
[_INTL("Generation"), LimitProperty.new(99999), _INTL("The number of the generation the Pokémon debuted in.")],
|
||||||
|
[_INTL("Flags"), StringListProperty, _INTL("Words/phrases that distinguish this species from others.")],
|
||||||
[_INTL("BattlerPlayerX"), ReadOnlyProperty, _INTL("Affects positioning of the Pokémon in battle. This is edited elsewhere.")],
|
[_INTL("BattlerPlayerX"), ReadOnlyProperty, _INTL("Affects positioning of the Pokémon in battle. This is edited elsewhere.")],
|
||||||
[_INTL("BattlerPlayerY"), ReadOnlyProperty, _INTL("Affects positioning of the Pokémon in battle. This is edited elsewhere.")],
|
[_INTL("BattlerPlayerY"), ReadOnlyProperty, _INTL("Affects positioning of the Pokémon in battle. This is edited elsewhere.")],
|
||||||
[_INTL("BattlerEnemyX"), ReadOnlyProperty, _INTL("Affects positioning of the Pokémon in battle. This is edited elsewhere.")],
|
[_INTL("BattlerEnemyX"), ReadOnlyProperty, _INTL("Affects positioning of the Pokémon in battle. This is edited elsewhere.")],
|
||||||
@@ -1039,6 +1041,7 @@ def pbPokemonEditor
|
|||||||
spec.shape,
|
spec.shape,
|
||||||
spec.habitat,
|
spec.habitat,
|
||||||
spec.generation,
|
spec.generation,
|
||||||
|
spec.flags.clone,
|
||||||
spec.back_sprite_x,
|
spec.back_sprite_x,
|
||||||
spec.back_sprite_y,
|
spec.back_sprite_y,
|
||||||
spec.front_sprite_x,
|
spec.front_sprite_x,
|
||||||
@@ -1090,13 +1093,14 @@ def pbPokemonEditor
|
|||||||
:shape => data[34],
|
:shape => data[34],
|
||||||
:habitat => data[35],
|
:habitat => data[35],
|
||||||
:generation => data[36],
|
:generation => data[36],
|
||||||
:back_sprite_x => data[37],
|
:flags => data[37],
|
||||||
:back_sprite_y => data[38],
|
:back_sprite_x => data[38],
|
||||||
:front_sprite_x => data[39],
|
:back_sprite_y => data[39],
|
||||||
:front_sprite_y => data[40],
|
:front_sprite_x => data[40],
|
||||||
:front_sprite_altitude => data[41],
|
:front_sprite_y => data[41],
|
||||||
:shadow_x => data[42],
|
:front_sprite_altitude => data[42],
|
||||||
:shadow_size => data[43]
|
:shadow_x => data[43],
|
||||||
|
:shadow_size => data[44]
|
||||||
}
|
}
|
||||||
# Add species' data to records
|
# Add species' data to records
|
||||||
GameData::Species.register(species_hash)
|
GameData::Species.register(species_hash)
|
||||||
|
|||||||
@@ -1271,6 +1271,10 @@ class EvolutionsProperty
|
|||||||
ret = pbChooseTypeList(value)
|
ret = pbChooseTypeList(value)
|
||||||
when :Ability
|
when :Ability
|
||||||
ret = pbChooseAbilityList(value)
|
ret = pbChooseAbilityList(value)
|
||||||
|
when String
|
||||||
|
ret = pbMessageFreeText(_INTL("Enter a value."), ret || "", false, 250, Graphics.width)
|
||||||
|
ret.strip!
|
||||||
|
ret = nil if ret.empty?
|
||||||
else
|
else
|
||||||
params = ChooseNumberParams.new
|
params = ChooseNumberParams.new
|
||||||
params.setRange(0, 65535)
|
params.setRange(0, 65535)
|
||||||
@@ -1309,7 +1313,7 @@ class EvolutionsProperty
|
|||||||
commands.push(_INTL("{1}: {2}",
|
commands.push(_INTL("{1}: {2}",
|
||||||
GameData::Species.get(realcmds[i][0]).name, evo_method_data.real_name))
|
GameData::Species.get(realcmds[i][0]).name, evo_method_data.real_name))
|
||||||
else
|
else
|
||||||
if !GameData.const_defined?(param_type.to_sym) && param_type.is_a?(Symbol)
|
if param_type.is_a?(Symbol) && !GameData.const_defined?(param_type)
|
||||||
level = getConstantName(param_type, level)
|
level = getConstantName(param_type, level)
|
||||||
end
|
end
|
||||||
level = "???" if !level || (level.is_a?(String) && level.empty?)
|
level = "???" if !level || (level.is_a?(String) && level.empty?)
|
||||||
@@ -1469,7 +1473,7 @@ class EvolutionsProperty
|
|||||||
param_type = evo_method_data.parameter
|
param_type = evo_method_data.parameter
|
||||||
if param_type.nil?
|
if param_type.nil?
|
||||||
param = ""
|
param = ""
|
||||||
elsif !GameData.const_defined?(param_type.to_sym) && param_type.is_a?(Symbol)
|
elsif param_type.is_a?(Symbol) && !GameData.const_defined?(param_type)
|
||||||
param = getConstantName(param_type, param)
|
param = getConstantName(param_type, param)
|
||||||
else
|
else
|
||||||
param = param.to_s
|
param = param.to_s
|
||||||
|
|||||||
@@ -400,206 +400,221 @@ module Compiler
|
|||||||
repeat = true
|
repeat = true
|
||||||
start = 1
|
start = 1
|
||||||
end
|
end
|
||||||
|
subarrays = repeat && schema[1].length > 2
|
||||||
begin
|
begin
|
||||||
|
subrecord = []
|
||||||
for i in start...schema[1].length
|
for i in start...schema[1].length
|
||||||
chr = schema[1][i,1]
|
chr = schema[1][i,1]
|
||||||
case chr
|
case chr
|
||||||
when "i" # Integer
|
when "i" # Integer
|
||||||
record.push(csvInt!(rec,lineno))
|
subrecord.push(csvInt!(rec,lineno))
|
||||||
when "I" # Optional integer
|
when "I" # Optional integer
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
if nil_or_empty?(field)
|
if nil_or_empty?(field)
|
||||||
record.push(nil)
|
subrecord.push(nil)
|
||||||
elsif !field[/^\-?\d+$/]
|
elsif !field[/^\-?\d+$/]
|
||||||
raise _INTL("Field {1} is not an integer\r\n{2}",field,FileLineData.linereport)
|
raise _INTL("Field {1} is not an integer\r\n{2}",field,FileLineData.linereport)
|
||||||
else
|
else
|
||||||
record.push(field.to_i)
|
subrecord.push(field.to_i)
|
||||||
end
|
end
|
||||||
when "u" # Positive integer or zero
|
when "u" # Positive integer or zero
|
||||||
record.push(csvPosInt!(rec,lineno))
|
subrecord.push(csvPosInt!(rec,lineno))
|
||||||
when "U" # Optional positive integer or zero
|
when "U" # Optional positive integer or zero
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
if nil_or_empty?(field)
|
if nil_or_empty?(field)
|
||||||
record.push(nil)
|
subrecord.push(nil)
|
||||||
elsif !field[/^\d+$/]
|
elsif !field[/^\d+$/]
|
||||||
raise _INTL("Field '{1}' must be 0 or greater\r\n{2}",field,FileLineData.linereport)
|
raise _INTL("Field '{1}' must be 0 or greater\r\n{2}",field,FileLineData.linereport)
|
||||||
else
|
else
|
||||||
record.push(field.to_i)
|
subrecord.push(field.to_i)
|
||||||
end
|
end
|
||||||
when "v" # Positive integer
|
when "v" # Positive integer
|
||||||
field = csvPosInt!(rec,lineno)
|
field = csvPosInt!(rec,lineno)
|
||||||
raise _INTL("Field '{1}' must be greater than 0\r\n{2}",field,FileLineData.linereport) if field==0
|
raise _INTL("Field '{1}' must be greater than 0\r\n{2}",field,FileLineData.linereport) if field==0
|
||||||
record.push(field)
|
subrecord.push(field)
|
||||||
when "V" # Optional positive integer
|
when "V" # Optional positive integer
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
if nil_or_empty?(field)
|
if nil_or_empty?(field)
|
||||||
record.push(nil)
|
subrecord.push(nil)
|
||||||
elsif !field[/^\d+$/]
|
elsif !field[/^\d+$/]
|
||||||
raise _INTL("Field '{1}' must be greater than 0\r\n{2}",field,FileLineData.linereport)
|
raise _INTL("Field '{1}' must be greater than 0\r\n{2}",field,FileLineData.linereport)
|
||||||
elsif field.to_i==0
|
elsif field.to_i==0
|
||||||
raise _INTL("Field '{1}' must be greater than 0\r\n{2}",field,FileLineData.linereport)
|
raise _INTL("Field '{1}' must be greater than 0\r\n{2}",field,FileLineData.linereport)
|
||||||
else
|
else
|
||||||
record.push(field.to_i)
|
subrecord.push(field.to_i)
|
||||||
end
|
end
|
||||||
when "x" # Hexadecimal number
|
when "x" # Hexadecimal number
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
if !field[/^[A-Fa-f0-9]+$/]
|
if !field[/^[A-Fa-f0-9]+$/]
|
||||||
raise _INTL("Field '{1}' is not a hexadecimal number\r\n{2}",field,FileLineData.linereport)
|
raise _INTL("Field '{1}' is not a hexadecimal number\r\n{2}",field,FileLineData.linereport)
|
||||||
end
|
end
|
||||||
record.push(field.hex)
|
subrecord.push(field.hex)
|
||||||
when "X" # Optional hexadecimal number
|
when "X" # Optional hexadecimal number
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
if nil_or_empty?(field)
|
if nil_or_empty?(field)
|
||||||
record.push(nil)
|
subrecord.push(nil)
|
||||||
elsif !field[/^[A-Fa-f0-9]+$/]
|
elsif !field[/^[A-Fa-f0-9]+$/]
|
||||||
raise _INTL("Field '{1}' is not a hexadecimal number\r\n{2}",field,FileLineData.linereport)
|
raise _INTL("Field '{1}' is not a hexadecimal number\r\n{2}",field,FileLineData.linereport)
|
||||||
else
|
else
|
||||||
record.push(field.hex)
|
subrecord.push(field.hex)
|
||||||
end
|
end
|
||||||
when "f" # Floating point number
|
when "f" # Floating point number
|
||||||
record.push(csvFloat!(rec,lineno))
|
subrecord.push(csvFloat!(rec,lineno))
|
||||||
when "F" # Optional floating point number
|
when "F" # Optional floating point number
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
if nil_or_empty?(field)
|
if nil_or_empty?(field)
|
||||||
record.push(nil)
|
subrecord.push(nil)
|
||||||
elsif !field[/^\-?^\d*\.?\d*$/]
|
elsif !field[/^\-?^\d*\.?\d*$/]
|
||||||
raise _INTL("Field {1} is not a floating point number\r\n{2}",field,FileLineData.linereport)
|
raise _INTL("Field {1} is not a floating point number\r\n{2}",field,FileLineData.linereport)
|
||||||
else
|
else
|
||||||
record.push(field.to_f)
|
subrecord.push(field.to_f)
|
||||||
end
|
end
|
||||||
when "b" # Boolean
|
when "b" # Boolean
|
||||||
record.push(csvBoolean!(rec,lineno))
|
subrecord.push(csvBoolean!(rec,lineno))
|
||||||
when "B" # Optional Boolean
|
when "B" # Optional Boolean
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
if nil_or_empty?(field)
|
if nil_or_empty?(field)
|
||||||
record.push(nil)
|
subrecord.push(nil)
|
||||||
elsif field[/^1|[Tt][Rr][Uu][Ee]|[Yy][Ee][Ss]|[Tt]|[Yy]$/]
|
elsif field[/^1|[Tt][Rr][Uu][Ee]|[Yy][Ee][Ss]|[Tt]|[Yy]$/]
|
||||||
record.push(true)
|
subrecord.push(true)
|
||||||
else
|
else
|
||||||
record.push(false)
|
subrecord.push(false)
|
||||||
end
|
end
|
||||||
when "n" # Name
|
when "n" # Name
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
if !field[/^(?![0-9])\w+$/]
|
if !field[/^(?![0-9])\w+$/]
|
||||||
raise _INTL("Field '{1}' must contain only letters, digits, and\r\nunderscores and can't begin with a number.\r\n{2}",field,FileLineData.linereport)
|
raise _INTL("Field '{1}' must contain only letters, digits, and\r\nunderscores and can't begin with a number.\r\n{2}",field,FileLineData.linereport)
|
||||||
end
|
end
|
||||||
record.push(field)
|
subrecord.push(field)
|
||||||
when "N" # Optional name
|
when "N" # Optional name
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
if nil_or_empty?(field)
|
if nil_or_empty?(field)
|
||||||
record.push(nil)
|
subrecord.push(nil)
|
||||||
elsif !field[/^(?![0-9])\w+$/]
|
elsif !field[/^(?![0-9])\w+$/]
|
||||||
raise _INTL("Field '{1}' must contain only letters, digits, and\r\nunderscores and can't begin with a number.\r\n{2}",field,FileLineData.linereport)
|
raise _INTL("Field '{1}' must contain only letters, digits, and\r\nunderscores and can't begin with a number.\r\n{2}",field,FileLineData.linereport)
|
||||||
else
|
else
|
||||||
record.push(field)
|
subrecord.push(field)
|
||||||
end
|
end
|
||||||
when "s" # String
|
when "s" # String
|
||||||
record.push(csvfield!(rec))
|
subrecord.push(csvfield!(rec))
|
||||||
when "S" # Optional string
|
when "S" # Optional string
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
record.push((nil_or_empty?(field)) ? nil : field)
|
subrecord.push((nil_or_empty?(field)) ? nil : field)
|
||||||
when "q" # Unformatted text
|
when "q" # Unformatted text
|
||||||
record.push(rec)
|
subrecord.push(rec)
|
||||||
rec = ""
|
rec = ""
|
||||||
when "Q" # Optional unformatted text
|
when "Q" # Optional unformatted text
|
||||||
if nil_or_empty?(rec)
|
if nil_or_empty?(rec)
|
||||||
record.push(nil)
|
subrecord.push(nil)
|
||||||
else
|
else
|
||||||
record.push(rec)
|
subrecord.push(rec)
|
||||||
rec = ""
|
rec = ""
|
||||||
end
|
end
|
||||||
when "e" # Enumerable
|
when "e" # Enumerable
|
||||||
record.push(csvEnumField!(rec,schema[2+i-start],"",FileLineData.linereport))
|
subrecord.push(csvEnumField!(rec,schema[2+i-start],"",FileLineData.linereport))
|
||||||
when "E" # Optional enumerable
|
when "E" # Optional enumerable
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
record.push(checkEnumFieldOrNil(field,schema[2+i-start]))
|
subrecord.push(checkEnumFieldOrNil(field,schema[2+i-start]))
|
||||||
when "y" # Enumerable or integer
|
when "y" # Enumerable or integer
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
record.push(csvEnumFieldOrInt!(field,schema[2+i-start],"",FileLineData.linereport))
|
subrecord.push(csvEnumFieldOrInt!(field,schema[2+i-start],"",FileLineData.linereport))
|
||||||
when "Y" # Optional enumerable or integer
|
when "Y" # Optional enumerable or integer
|
||||||
field = csvfield!(rec)
|
field = csvfield!(rec)
|
||||||
if nil_or_empty?(field)
|
if nil_or_empty?(field)
|
||||||
record.push(nil)
|
subrecord.push(nil)
|
||||||
elsif field[/^\-?\d+$/]
|
elsif field[/^\-?\d+$/]
|
||||||
record.push(field.to_i)
|
subrecord.push(field.to_i)
|
||||||
else
|
else
|
||||||
record.push(checkEnumFieldOrNil(field,schema[2+i-start]))
|
subrecord.push(checkEnumFieldOrNil(field,schema[2+i-start]))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if !subrecord.empty?
|
||||||
|
if subarrays
|
||||||
|
record.push(subrecord)
|
||||||
|
else
|
||||||
|
record.concat(subrecord)
|
||||||
|
end
|
||||||
|
end
|
||||||
break if repeat && nil_or_empty?(rec)
|
break if repeat && nil_or_empty?(rec)
|
||||||
end while repeat
|
end while repeat
|
||||||
return (schema[1].length==1) ? record[0] : record
|
return (schema[1].length == 1) ? record[0] : record
|
||||||
end
|
end
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Write values to a file using a schema
|
# Write values to a file using a schema
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
def pbWriteCsvRecord(record,file,schema)
|
def pbWriteCsvRecord(record,file,schema)
|
||||||
rec = (record.is_a?(Array)) ? record.clone : [record]
|
rec = (record.is_a?(Array)) ? record.flatten : [record]
|
||||||
for i in 0...schema[1].length
|
start = (schema[1][0, 1] == "*") ? 1 : 0
|
||||||
chr = schema[1][i,1]
|
index = 0
|
||||||
file.write(",") if i>0
|
begin
|
||||||
if rec[i].nil?
|
for i in start...schema[1].length
|
||||||
# do nothing
|
index += 1
|
||||||
elsif rec[i].is_a?(String)
|
file.write(",") if index > 1
|
||||||
file.write(csvQuote(rec[i]))
|
value = rec[index]
|
||||||
elsif rec[i].is_a?(Symbol)
|
if value.nil?
|
||||||
file.write(csvQuote(rec[i].to_s))
|
# do nothing
|
||||||
elsif rec[i]==true
|
elsif value.is_a?(String)
|
||||||
file.write("true")
|
file.write(csvQuote(value))
|
||||||
elsif rec[i]==false
|
elsif value.is_a?(Symbol)
|
||||||
file.write("false")
|
file.write(csvQuote(value.to_s))
|
||||||
elsif rec[i].is_a?(Numeric)
|
elsif value==true
|
||||||
case chr
|
file.write("true")
|
||||||
when "e", "E" # Enumerable
|
elsif value==false
|
||||||
enumer = schema[2+i]
|
file.write("false")
|
||||||
if enumer.is_a?(Array)
|
elsif value.is_a?(Numeric)
|
||||||
file.write(enumer[rec[i]])
|
case schema[1][i, 1]
|
||||||
elsif enumer.is_a?(Symbol) || enumer.is_a?(String)
|
when "e", "E" # Enumerable
|
||||||
mod = Object.const_get(enumer.to_sym)
|
enumer = schema[2+i]
|
||||||
file.write(getConstantName(mod,rec[i]))
|
if enumer.is_a?(Array)
|
||||||
elsif enumer.is_a?(Module)
|
file.write(enumer[value])
|
||||||
file.write(getConstantName(enumer,rec[i]))
|
elsif enumer.is_a?(Symbol) || enumer.is_a?(String)
|
||||||
elsif enumer.is_a?(Hash)
|
mod = Object.const_get(enumer.to_sym)
|
||||||
for key in enumer.keys
|
file.write(getConstantName(mod,value))
|
||||||
if enumer[key]==rec[i]
|
elsif enumer.is_a?(Module)
|
||||||
file.write(key)
|
file.write(getConstantName(enumer,value))
|
||||||
break
|
elsif enumer.is_a?(Hash)
|
||||||
|
for key in enumer.keys
|
||||||
|
if enumer[key]==value
|
||||||
|
file.write(key)
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
when "y", "Y" # Enumerable or integer
|
||||||
when "y", "Y" # Enumerable or integer
|
enumer = schema[2+i]
|
||||||
enumer = schema[2+i]
|
if enumer.is_a?(Array)
|
||||||
if enumer.is_a?(Array)
|
if enumer[value]!=nil
|
||||||
if enumer[rec[i]]!=nil
|
file.write(enumer[value])
|
||||||
file.write(enumer[rec[i]])
|
else
|
||||||
else
|
file.write(value)
|
||||||
file.write(rec[i])
|
|
||||||
end
|
|
||||||
elsif enumer.is_a?(Symbol) || enumer.is_a?(String)
|
|
||||||
mod = Object.const_get(enumer.to_sym)
|
|
||||||
file.write(getConstantNameOrValue(mod,rec[i]))
|
|
||||||
elsif enumer.is_a?(Module)
|
|
||||||
file.write(getConstantNameOrValue(enumer,rec[i]))
|
|
||||||
elsif enumer.is_a?(Hash)
|
|
||||||
hasenum = false
|
|
||||||
for key in enumer.keys
|
|
||||||
if enumer[key]==rec[i]
|
|
||||||
file.write(key)
|
|
||||||
hasenum = true
|
|
||||||
break
|
|
||||||
end
|
end
|
||||||
|
elsif enumer.is_a?(Symbol) || enumer.is_a?(String)
|
||||||
|
mod = Object.const_get(enumer.to_sym)
|
||||||
|
file.write(getConstantNameOrValue(mod,value))
|
||||||
|
elsif enumer.is_a?(Module)
|
||||||
|
file.write(getConstantNameOrValue(enumer,value))
|
||||||
|
elsif enumer.is_a?(Hash)
|
||||||
|
hasenum = false
|
||||||
|
for key in enumer.keys
|
||||||
|
if enumer[key]==value
|
||||||
|
file.write(key)
|
||||||
|
hasenum = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
file.write(value) unless hasenum
|
||||||
end
|
end
|
||||||
file.write(rec[i]) unless hasenum
|
else # Any other record type
|
||||||
|
file.write(value.inspect)
|
||||||
end
|
end
|
||||||
else # Any other record type
|
else
|
||||||
file.write(rec[i].inspect)
|
file.write(value.inspect)
|
||||||
end
|
end
|
||||||
else
|
|
||||||
file.write(rec[i].inspect)
|
|
||||||
end
|
end
|
||||||
end
|
break if start > 0 && index >= rec.length
|
||||||
|
end while start > 0
|
||||||
return record
|
return record
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -158,11 +158,10 @@ module Compiler
|
|||||||
end
|
end
|
||||||
# Compile value for key
|
# Compile value for key
|
||||||
value = pbGetCsvRecord(contents[key], key, schema[key])
|
value = pbGetCsvRecord(contents[key], key, schema[key])
|
||||||
value = nil if value.is_a?(Array) && value.length == 0
|
value = nil if value.is_a?(Array) && value.empty?
|
||||||
contents[key] = value
|
contents[key] = value
|
||||||
# Ensure weaknesses/resistances/immunities are in arrays and are symbols
|
# Ensure weaknesses/resistances/immunities are in arrays and are symbols
|
||||||
if value && ["Weaknesses", "Resistances", "Immunities"].include?(key)
|
if value && ["Weaknesses", "Resistances", "Immunities"].include?(key)
|
||||||
contents[key] = [contents[key]] if !contents[key].is_a?(Array)
|
|
||||||
contents[key].map! { |x| x.to_sym }
|
contents[key].map! { |x| x.to_sym }
|
||||||
contents[key].uniq!
|
contents[key].uniq!
|
||||||
end
|
end
|
||||||
@@ -173,6 +172,7 @@ module Compiler
|
|||||||
:name => contents["Name"],
|
:name => contents["Name"],
|
||||||
:pseudo_type => contents["IsPseudoType"],
|
:pseudo_type => contents["IsPseudoType"],
|
||||||
:special_type => contents["IsSpecialType"],
|
:special_type => contents["IsSpecialType"],
|
||||||
|
:flags => contents["Flags"],
|
||||||
:weaknesses => contents["Weaknesses"],
|
:weaknesses => contents["Weaknesses"],
|
||||||
:resistances => contents["Resistances"],
|
:resistances => contents["Resistances"],
|
||||||
:immunities => contents["Immunities"],
|
:immunities => contents["Immunities"],
|
||||||
@@ -461,6 +461,8 @@ module Compiler
|
|||||||
consumable = !([3, 4, 5].include?(line[7]) || line[8] >= 6)
|
consumable = !([3, 4, 5].include?(line[7]) || line[8] >= 6)
|
||||||
line[7] = 1 if line[7] == 5
|
line[7] = 1 if line[7] == 5
|
||||||
line[8] -= 5 if line[8] > 5
|
line[8] -= 5 if line[8] > 5
|
||||||
|
flags = []
|
||||||
|
flags.push(line[9]) if !nil_or_empty?(line[9])
|
||||||
# Construct item hash
|
# Construct item hash
|
||||||
item_hash = {
|
item_hash = {
|
||||||
:id => item_id,
|
:id => item_id,
|
||||||
@@ -472,7 +474,7 @@ module Compiler
|
|||||||
:field_use => line[7],
|
:field_use => line[7],
|
||||||
:battle_use => line[8],
|
:battle_use => line[8],
|
||||||
:consumable => consumable,
|
:consumable => consumable,
|
||||||
:type => line[9],
|
:flags => flags,
|
||||||
:move => line[10]
|
:move => line[10]
|
||||||
}
|
}
|
||||||
# Add item's data to records
|
# Add item's data to records
|
||||||
@@ -559,7 +561,7 @@ module Compiler
|
|||||||
FileLineData.setSection(species_id, key, contents[key]) # For error reporting
|
FileLineData.setSection(species_id, key, contents[key]) # For error reporting
|
||||||
# Compile value for key
|
# Compile value for key
|
||||||
value = pbGetCsvRecord(contents[key], key, schema[key])
|
value = pbGetCsvRecord(contents[key], key, schema[key])
|
||||||
value = nil if value.is_a?(Array) && value.length == 0
|
value = nil if value.is_a?(Array) && value.empty?
|
||||||
contents[key] = value
|
contents[key] = value
|
||||||
# Sanitise data
|
# Sanitise data
|
||||||
case key
|
case key
|
||||||
@@ -576,23 +578,8 @@ module Compiler
|
|||||||
raise _INTL("Value for '{1}' can't be less than or close to 0 (section {2}, {3})", key, species_id, path)
|
raise _INTL("Value for '{1}' can't be less than or close to 0 (section {2}, {3})", key, species_id, path)
|
||||||
end
|
end
|
||||||
contents[key] = value
|
contents[key] = value
|
||||||
when "Moves"
|
|
||||||
move_array = []
|
|
||||||
for i in 0...value.length / 2
|
|
||||||
move_array.push([value[i * 2], value[i * 2 + 1], i])
|
|
||||||
end
|
|
||||||
move_array.sort! { |a, b| (a[0] == b[0]) ? a[2] <=> b[2] : a[0] <=>b [0] }
|
|
||||||
move_array.each { |arr| arr.pop }
|
|
||||||
contents[key] = move_array
|
|
||||||
when "TutorMoves", "EggMoves", "Abilities", "HiddenAbilities", "HiddenAbility", "EggGroups", "Compatibility"
|
|
||||||
contents[key] = [contents[key]] if !contents[key].is_a?(Array)
|
|
||||||
contents[key].compact!
|
|
||||||
when "Evolutions"
|
when "Evolutions"
|
||||||
evo_array = []
|
contents[key].each { |evo| evo[3] = false }
|
||||||
for i in 0...value.length / 3
|
|
||||||
evo_array.push([value[i * 3], value[i * 3 + 1], value[i * 3 + 2], false])
|
|
||||||
end
|
|
||||||
contents[key] = evo_array
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Construct species hash
|
# Construct species hash
|
||||||
@@ -629,6 +616,7 @@ module Compiler
|
|||||||
:shape => contents["Shape"],
|
:shape => contents["Shape"],
|
||||||
:habitat => contents["Habitat"],
|
:habitat => contents["Habitat"],
|
||||||
:generation => contents["Generation"],
|
:generation => contents["Generation"],
|
||||||
|
:flags => contents["Flags"],
|
||||||
:back_sprite_x => contents["BattlerPlayerX"],
|
:back_sprite_x => contents["BattlerPlayerX"],
|
||||||
:back_sprite_y => contents["BattlerPlayerY"],
|
:back_sprite_y => contents["BattlerPlayerY"],
|
||||||
:front_sprite_x => contents["BattlerEnemyX"],
|
:front_sprite_x => contents["BattlerEnemyX"],
|
||||||
@@ -655,7 +643,7 @@ module Compiler
|
|||||||
evo[2] = nil
|
evo[2] = nil
|
||||||
elsif param_type == Integer
|
elsif param_type == Integer
|
||||||
evo[2] = csvPosInt!(evo[2])
|
evo[2] = csvPosInt!(evo[2])
|
||||||
else
|
elsif param_type != String
|
||||||
evo[2] = csvEnumField!(evo[2], param_type, "Evolutions", species.id)
|
evo[2] = csvEnumField!(evo[2], param_type, "Evolutions", species.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -743,32 +731,18 @@ module Compiler
|
|||||||
raise _INTL("Value for '{1}' can't be less than or close to 0 (section {2}, {3})", key, section_name, path)
|
raise _INTL("Value for '{1}' can't be less than or close to 0 (section {2}, {3})", key, section_name, path)
|
||||||
end
|
end
|
||||||
contents[key] = value
|
contents[key] = value
|
||||||
when "Moves"
|
|
||||||
move_array = []
|
|
||||||
for i in 0...value.length / 2
|
|
||||||
move_array.push([value[i * 2], value[i * 2 + 1], i])
|
|
||||||
end
|
|
||||||
move_array.sort! { |a, b| (a[0] == b[0]) ? a[2] <=> b[2] : a[0] <=>b [0] }
|
|
||||||
move_array.each { |arr| arr.pop }
|
|
||||||
contents[key] = move_array
|
|
||||||
when "TutorMoves", "EggMoves", "Abilities", "HiddenAbilities", "HiddenAbility", "EggGroups", "Compatibility"
|
|
||||||
contents[key] = [contents[key]] if !contents[key].is_a?(Array)
|
|
||||||
contents[key].compact!
|
|
||||||
when "Evolutions"
|
when "Evolutions"
|
||||||
evo_array = []
|
contents[key].each do |evo|
|
||||||
for i in 0...value.length / 3
|
evo[3] = false
|
||||||
param_type = GameData::Evolution.get(value[i * 3 + 1]).parameter
|
param_type = GameData::Evolution.get(evo[1]).parameter
|
||||||
param = value[i * 3 + 2]
|
|
||||||
if param_type.nil?
|
if param_type.nil?
|
||||||
param = nil
|
evo[2] = nil
|
||||||
elsif param_type == Integer
|
elsif param_type == Integer
|
||||||
param = csvPosInt!(param)
|
evo[2] = csvPosInt!(evo[2])
|
||||||
else
|
elsif param_type != String
|
||||||
param = csvEnumField!(param, param_type, "Evolutions", section_name)
|
evo[2] = csvEnumField!(evo[2], param_type, "Evolutions", section_name)
|
||||||
end
|
end
|
||||||
evo_array.push([value[i * 3], value[i * 3 + 1], param, false])
|
|
||||||
end
|
end
|
||||||
contents[key] = evo_array
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Construct species hash
|
# Construct species hash
|
||||||
@@ -819,6 +793,7 @@ module Compiler
|
|||||||
:shape => contents["Shape"] || base_data.shape,
|
:shape => contents["Shape"] || base_data.shape,
|
||||||
:habitat => contents["Habitat"] || base_data.habitat,
|
:habitat => contents["Habitat"] || base_data.habitat,
|
||||||
:generation => contents["Generation"] || base_data.generation,
|
:generation => contents["Generation"] || base_data.generation,
|
||||||
|
:flags => contents["Flags"] || base_data.flags.clone,
|
||||||
:mega_stone => contents["MegaStone"],
|
:mega_stone => contents["MegaStone"],
|
||||||
:mega_move => contents["MegaMove"],
|
:mega_move => contents["MegaMove"],
|
||||||
:unmega_form => contents["UnmegaForm"],
|
:unmega_form => contents["UnmegaForm"],
|
||||||
@@ -1165,7 +1140,7 @@ module Compiler
|
|||||||
:intro_ME => line[6],
|
:intro_ME => line[6],
|
||||||
:gender => line[7],
|
:gender => line[7],
|
||||||
:skill_level => line[8],
|
:skill_level => line[8],
|
||||||
:skill_flags => line[9]
|
:flags => line[9]
|
||||||
}
|
}
|
||||||
# Add trainer type's data to records
|
# Add trainer type's data to records
|
||||||
GameData::TrainerType.register(tr_type_hash)
|
GameData::TrainerType.register(tr_type_hash)
|
||||||
@@ -1225,9 +1200,6 @@ module Compiler
|
|||||||
property_value = pbGetCsvRecord($~[2], line_no, line_schema)
|
property_value = pbGetCsvRecord($~[2], line_no, line_schema)
|
||||||
# Error checking in XXX=YYY lines
|
# Error checking in XXX=YYY lines
|
||||||
case property_name
|
case property_name
|
||||||
when "Items"
|
|
||||||
property_value = [property_value] if !property_value.is_a?(Array)
|
|
||||||
property_value.compact!
|
|
||||||
when "Pokemon"
|
when "Pokemon"
|
||||||
if property_value[1] > max_level
|
if property_value[1] > max_level
|
||||||
raise _INTL("Bad level: {1} (must be 1-{2}).\r\n{3}", property_value[1], max_level, FileLineData.linereport)
|
raise _INTL("Bad level: {1} (must be 1-{2}).\r\n{3}", property_value[1], max_level, FileLineData.linereport)
|
||||||
@@ -1237,19 +1209,13 @@ module Compiler
|
|||||||
raise _INTL("Bad nickname: {1} (must be 1-{2} characters).\r\n{3}", property_value, Pokemon::MAX_NAME_SIZE, FileLineData.linereport)
|
raise _INTL("Bad nickname: {1} (must be 1-{2} characters).\r\n{3}", property_value, Pokemon::MAX_NAME_SIZE, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
when "Moves"
|
when "Moves"
|
||||||
property_value = [property_value] if !property_value.is_a?(Array)
|
|
||||||
property_value.uniq!
|
property_value.uniq!
|
||||||
property_value.compact!
|
|
||||||
when "IV"
|
when "IV"
|
||||||
property_value = [property_value] if !property_value.is_a?(Array)
|
|
||||||
property_value.compact!
|
|
||||||
property_value.each do |iv|
|
property_value.each do |iv|
|
||||||
next if iv <= Pokemon::IV_STAT_LIMIT
|
next if iv <= Pokemon::IV_STAT_LIMIT
|
||||||
raise _INTL("Bad IV: {1} (must be 0-{2}).\r\n{3}", iv, Pokemon::IV_STAT_LIMIT, FileLineData.linereport)
|
raise _INTL("Bad IV: {1} (must be 0-{2}).\r\n{3}", iv, Pokemon::IV_STAT_LIMIT, FileLineData.linereport)
|
||||||
end
|
end
|
||||||
when "EV"
|
when "EV"
|
||||||
property_value = [property_value] if !property_value.is_a?(Array)
|
|
||||||
property_value.compact!
|
|
||||||
property_value.each do |ev|
|
property_value.each do |ev|
|
||||||
next if ev <= Pokemon::EV_STAT_LIMIT
|
next if ev <= Pokemon::EV_STAT_LIMIT
|
||||||
raise _INTL("Bad EV: {1} (must be 0-{2}).\r\n{3}", ev, Pokemon::EV_STAT_LIMIT, FileLineData.linereport)
|
raise _INTL("Bad EV: {1} (must be 0-{2}).\r\n{3}", ev, Pokemon::EV_STAT_LIMIT, FileLineData.linereport)
|
||||||
@@ -1502,7 +1468,8 @@ module Compiler
|
|||||||
:trainer_victory_ME => contents["TrainerVictoryME"],
|
:trainer_victory_ME => contents["TrainerVictoryME"],
|
||||||
:wild_capture_ME => contents["WildCaptureME"],
|
:wild_capture_ME => contents["WildCaptureME"],
|
||||||
:town_map_size => contents["MapSize"],
|
:town_map_size => contents["MapSize"],
|
||||||
:battle_environment => contents["Environment"]
|
:battle_environment => contents["Environment"],
|
||||||
|
:flags => contents["Flags"]
|
||||||
}
|
}
|
||||||
# Add metadata's data to records
|
# Add metadata's data to records
|
||||||
GameData::MapMetadata.register(metadata_hash)
|
GameData::MapMetadata.register(metadata_hash)
|
||||||
|
|||||||
@@ -141,8 +141,9 @@ module Compiler
|
|||||||
f.write("[#{type.id}]\r\n")
|
f.write("[#{type.id}]\r\n")
|
||||||
f.write("Name = #{type.real_name}\r\n")
|
f.write("Name = #{type.real_name}\r\n")
|
||||||
f.write("IconPosition = #{type.icon_position}\r\n")
|
f.write("IconPosition = #{type.icon_position}\r\n")
|
||||||
f.write("IsPseudoType = true\r\n") if type.pseudo_type
|
|
||||||
f.write("IsSpecialType = true\r\n") if type.special?
|
f.write("IsSpecialType = true\r\n") if type.special?
|
||||||
|
f.write("IsPseudoType = true\r\n") if type.pseudo_type
|
||||||
|
f.write(sprintf("Flags = %s\r\n", type.flags.join(","))) if type.flags.length > 0
|
||||||
f.write("Weaknesses = #{type.weaknesses.join(",")}\r\n") if type.weaknesses.length > 0
|
f.write("Weaknesses = #{type.weaknesses.join(",")}\r\n") if type.weaknesses.length > 0
|
||||||
f.write("Resistances = #{type.resistances.join(",")}\r\n") if type.resistances.length > 0
|
f.write("Resistances = #{type.resistances.join(",")}\r\n") if type.resistances.length > 0
|
||||||
f.write("Immunities = #{type.immunities.join(",")}\r\n") if type.immunities.length > 0
|
f.write("Immunities = #{type.immunities.join(",")}\r\n") if type.immunities.length > 0
|
||||||
@@ -163,6 +164,7 @@ module Compiler
|
|||||||
f.write("[#{ability.id}]\r\n")
|
f.write("[#{ability.id}]\r\n")
|
||||||
f.write("Name = #{ability.real_name}\r\n")
|
f.write("Name = #{ability.real_name}\r\n")
|
||||||
f.write("Description = #{ability.real_description}\r\n")
|
f.write("Description = #{ability.real_description}\r\n")
|
||||||
|
f.write(sprintf("Flags = %s\r\n", ability.flags.join(","))) if ability.flags.length > 0
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
Graphics.update
|
Graphics.update
|
||||||
@@ -188,7 +190,7 @@ module Compiler
|
|||||||
f.write("Target = #{move.target}\r\n")
|
f.write("Target = #{move.target}\r\n")
|
||||||
f.write("Priority = #{move.priority}\r\n") if move.priority != 0
|
f.write("Priority = #{move.priority}\r\n") if move.priority != 0
|
||||||
f.write("FunctionCode = #{move.function_code}\r\n")
|
f.write("FunctionCode = #{move.function_code}\r\n")
|
||||||
f.write("Flags = #{move.flags.join(",")}\r\n") if move.flags && move.flags.length > 0
|
f.write("Flags = #{move.flags.join(",")}\r\n") if move.flags.length > 0
|
||||||
f.write("EffectChance = #{move.effect_chance}\r\n") if move.effect_chance > 0
|
f.write("EffectChance = #{move.effect_chance}\r\n") if move.effect_chance > 0
|
||||||
f.write("Description = #{move.real_description}\r\n")
|
f.write("Description = #{move.real_description}\r\n")
|
||||||
end
|
end
|
||||||
@@ -214,9 +216,8 @@ module Compiler
|
|||||||
f.write(sprintf("FieldUse = %s\r\n", field_use)) if field_use
|
f.write(sprintf("FieldUse = %s\r\n", field_use)) if field_use
|
||||||
battle_use = GameData::Item::SCHEMA["BattleUse"][2].key(item.battle_use)
|
battle_use = GameData::Item::SCHEMA["BattleUse"][2].key(item.battle_use)
|
||||||
f.write(sprintf("BattleUse = %s\r\n", battle_use)) if battle_use
|
f.write(sprintf("BattleUse = %s\r\n", battle_use)) if battle_use
|
||||||
type = GameData::Item::SCHEMA["Type"][2].key(item.type)
|
|
||||||
f.write(sprintf("Consumable = false\r\n")) if !item.is_important? && !item.consumable
|
f.write(sprintf("Consumable = false\r\n")) if !item.is_important? && !item.consumable
|
||||||
f.write(sprintf("Type = %s\r\n", type)) if type
|
f.write(sprintf("Flags = %s\r\n", item.flags.join(","))) if item.flags.length > 0
|
||||||
f.write(sprintf("Move = %s\r\n", item.move)) if item.move
|
f.write(sprintf("Move = %s\r\n", item.move)) if item.move
|
||||||
f.write(sprintf("Description = %s\r\n", item.real_description))
|
f.write(sprintf("Description = %s\r\n", item.real_description))
|
||||||
end
|
end
|
||||||
@@ -303,6 +304,7 @@ module Compiler
|
|||||||
f.write(sprintf("Pokedex = %s\r\n", species.real_pokedex_entry))
|
f.write(sprintf("Pokedex = %s\r\n", species.real_pokedex_entry))
|
||||||
f.write(sprintf("FormName = %s\r\n", species.real_form_name)) if species.real_form_name && !species.real_form_name.empty?
|
f.write(sprintf("FormName = %s\r\n", species.real_form_name)) if species.real_form_name && !species.real_form_name.empty?
|
||||||
f.write(sprintf("Generation = %d\r\n", species.generation)) if species.generation != 0
|
f.write(sprintf("Generation = %d\r\n", species.generation)) if species.generation != 0
|
||||||
|
f.write(sprintf("Flags = %s\r\n", species.flags.join(","))) if species.flags.length > 0
|
||||||
f.write(sprintf("WildItemCommon = %s\r\n", species.wild_item_common)) if species.wild_item_common
|
f.write(sprintf("WildItemCommon = %s\r\n", species.wild_item_common)) if species.wild_item_common
|
||||||
f.write(sprintf("WildItemUncommon = %s\r\n", species.wild_item_uncommon)) if species.wild_item_uncommon
|
f.write(sprintf("WildItemUncommon = %s\r\n", species.wild_item_uncommon)) if species.wild_item_uncommon
|
||||||
f.write(sprintf("WildItemRare = %s\r\n", species.wild_item_rare)) if species.wild_item_rare
|
f.write(sprintf("WildItemRare = %s\r\n", species.wild_item_rare)) if species.wild_item_rare
|
||||||
@@ -324,7 +326,7 @@ module Compiler
|
|||||||
param_type = evo_type_data.parameter
|
param_type = evo_type_data.parameter
|
||||||
f.write(sprintf("%s,%s,", evo[0], evo_type_data.id.to_s))
|
f.write(sprintf("%s,%s,", evo[0], evo_type_data.id.to_s))
|
||||||
if !param_type.nil?
|
if !param_type.nil?
|
||||||
if !GameData.const_defined?(param_type.to_sym) && param_type.is_a?(Symbol)
|
if param_type.is_a?(Symbol) && !GameData.const_defined?(param_type)
|
||||||
f.write(getConstantName(param_type, evo[2]))
|
f.write(getConstantName(param_type, evo[2]))
|
||||||
else
|
else
|
||||||
f.write(evo[2].to_s)
|
f.write(evo[2].to_s)
|
||||||
@@ -405,6 +407,7 @@ module Compiler
|
|||||||
f.write(sprintf("Category = %s\r\n", species.real_category)) if species.real_category != base_species.real_category
|
f.write(sprintf("Category = %s\r\n", species.real_category)) if species.real_category != base_species.real_category
|
||||||
f.write(sprintf("Pokedex = %s\r\n", species.real_pokedex_entry)) if species.real_pokedex_entry != base_species.real_pokedex_entry
|
f.write(sprintf("Pokedex = %s\r\n", species.real_pokedex_entry)) if species.real_pokedex_entry != base_species.real_pokedex_entry
|
||||||
f.write(sprintf("Generation = %d\r\n", species.generation)) if species.generation != base_species.generation
|
f.write(sprintf("Generation = %d\r\n", species.generation)) if species.generation != base_species.generation
|
||||||
|
f.write(sprintf("Flags = %s\r\n", species.flags.join(","))) if species.flags.length > 0 && species.flags != base_species.flags
|
||||||
if species.wild_item_common != base_species.wild_item_common ||
|
if species.wild_item_common != base_species.wild_item_common ||
|
||||||
species.wild_item_uncommon != base_species.wild_item_uncommon ||
|
species.wild_item_uncommon != base_species.wild_item_uncommon ||
|
||||||
species.wild_item_rare != base_species.wild_item_rare
|
species.wild_item_rare != base_species.wild_item_rare
|
||||||
@@ -430,7 +433,7 @@ module Compiler
|
|||||||
param_type = evo_type_data.parameter
|
param_type = evo_type_data.parameter
|
||||||
f.write(sprintf("%s,%s,", evo[0], evo_type_data.id.to_s))
|
f.write(sprintf("%s,%s,", evo[0], evo_type_data.id.to_s))
|
||||||
if !param_type.nil?
|
if !param_type.nil?
|
||||||
if !GameData.const_defined?(param_type.to_sym) && param_type.is_a?(Symbol)
|
if param_type.is_a?(Symbol) && !GameData.const_defined?(param_type)
|
||||||
f.write(getConstantName(param_type, evo[2]))
|
f.write(getConstantName(param_type, evo[2]))
|
||||||
else
|
else
|
||||||
f.write(evo[2].to_s)
|
f.write(evo[2].to_s)
|
||||||
@@ -559,7 +562,7 @@ module Compiler
|
|||||||
f.write(sprintf("Gender = %s\r\n", gender))
|
f.write(sprintf("Gender = %s\r\n", gender))
|
||||||
f.write(sprintf("BaseMoney = %d\r\n", t.base_money))
|
f.write(sprintf("BaseMoney = %d\r\n", t.base_money))
|
||||||
f.write(sprintf("SkillLevel = %d\r\n", t.skill_level)) if t.skill_level != t.base_money
|
f.write(sprintf("SkillLevel = %d\r\n", t.skill_level)) if t.skill_level != t.base_money
|
||||||
f.write(sprintf("SkillFlags = %s\r\n", t.skill_flags.join(","))) if t.skill_flags.length > 0
|
f.write(sprintf("Flags = %s\r\n", t.flags.join(","))) if t.flags.length > 0
|
||||||
f.write(sprintf("IntroME = %s\r\n", t.intro_ME)) if !nil_or_empty?(t.intro_ME)
|
f.write(sprintf("IntroME = %s\r\n", t.intro_ME)) if !nil_or_empty?(t.intro_ME)
|
||||||
f.write(sprintf("BattleBGM = %s\r\n", t.battle_BGM)) if !nil_or_empty?(t.battle_BGM)
|
f.write(sprintf("BattleBGM = %s\r\n", t.battle_BGM)) if !nil_or_empty?(t.battle_BGM)
|
||||||
f.write(sprintf("VictoryME = %s\r\n", t.victory_ME)) if !nil_or_empty?(t.victory_ME)
|
f.write(sprintf("VictoryME = %s\r\n", t.victory_ME)) if !nil_or_empty?(t.victory_ME)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -2705,7 +2705,7 @@ BattlerEnemyX = 0
|
|||||||
BattlerEnemyY = -2
|
BattlerEnemyY = -2
|
||||||
BattlerShadowX = 0
|
BattlerShadowX = 0
|
||||||
BattlerShadowSize = 2
|
BattlerShadowSize = 2
|
||||||
Evolutions = MAGNEZONE,Location,49,MAGNEZONE,Location,50,MAGNEZONE,Location,51
|
Evolutions = MAGNEZONE,LocationFlag,Magnetic
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[FARFETCHD]
|
[FARFETCHD]
|
||||||
Name = Farfetch'd
|
Name = Farfetch'd
|
||||||
@@ -4380,7 +4380,7 @@ BattlerEnemyX = 0
|
|||||||
BattlerEnemyY = 20
|
BattlerEnemyY = 20
|
||||||
BattlerShadowX = 0
|
BattlerShadowX = 0
|
||||||
BattlerShadowSize = 2
|
BattlerShadowSize = 2
|
||||||
Evolutions = VAPOREON,Item,WATERSTONE,JOLTEON,Item,THUNDERSTONE,FLAREON,Item,FIRESTONE,LEAFEON,Location,28,GLACEON,Location,34,ESPEON,HappinessDay,,UMBREON,HappinessNight,
|
Evolutions = VAPOREON,Item,WATERSTONE,JOLTEON,Item,THUNDERSTONE,FLAREON,Item,FIRESTONE,LEAFEON,LocationFlag,MossRock,GLACEON,LocationFlag,IceRock,ESPEON,HappinessDay,,UMBREON,HappinessNight,
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[VAPOREON]
|
[VAPOREON]
|
||||||
Name = Vaporeon
|
Name = Vaporeon
|
||||||
@@ -9810,7 +9810,7 @@ BattlerEnemyX = -2
|
|||||||
BattlerEnemyY = 17
|
BattlerEnemyY = 17
|
||||||
BattlerShadowX = 0
|
BattlerShadowX = 0
|
||||||
BattlerShadowSize = 2
|
BattlerShadowSize = 2
|
||||||
Evolutions = PROBOPASS,Location,49,PROBOPASS,Location,50,PROBOPASS,Location,51
|
Evolutions = PROBOPASS,LocationFlag,Magnetic
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[SKITTY]
|
[SKITTY]
|
||||||
Name = Skitty
|
Name = Skitty
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -2699,7 +2699,7 @@ BattlerEnemyX = 0
|
|||||||
BattlerEnemyY = -2
|
BattlerEnemyY = -2
|
||||||
BattlerShadowX = 0
|
BattlerShadowX = 0
|
||||||
BattlerShadowSize = 2
|
BattlerShadowSize = 2
|
||||||
Evolutions = MAGNEZONE,Location,49,MAGNEZONE,Location,50,MAGNEZONE,Location,51
|
Evolutions = MAGNEZONE,LocationFlag,Magnetic
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[FARFETCHD]
|
[FARFETCHD]
|
||||||
Name = Farfetch'd
|
Name = Farfetch'd
|
||||||
@@ -4375,7 +4375,7 @@ BattlerEnemyX = 0
|
|||||||
BattlerEnemyY = 20
|
BattlerEnemyY = 20
|
||||||
BattlerShadowX = 0
|
BattlerShadowX = 0
|
||||||
BattlerShadowSize = 2
|
BattlerShadowSize = 2
|
||||||
Evolutions = VAPOREON,Item,WATERSTONE,JOLTEON,Item,THUNDERSTONE,FLAREON,Item,FIRESTONE,LEAFEON,Location,28,GLACEON,Location,34,SYLVEON,HappinessMoveType,FAIRY,ESPEON,HappinessDay,,UMBREON,HappinessNight,
|
Evolutions = VAPOREON,Item,WATERSTONE,JOLTEON,Item,THUNDERSTONE,FLAREON,Item,FIRESTONE,LEAFEON,LocationFlag,MossRock,GLACEON,LocationFlag,IceRock,SYLVEON,HappinessMoveType,FAIRY,ESPEON,HappinessDay,,UMBREON,HappinessNight,
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[VAPOREON]
|
[VAPOREON]
|
||||||
Name = Vaporeon
|
Name = Vaporeon
|
||||||
@@ -9811,7 +9811,7 @@ BattlerEnemyX = -2
|
|||||||
BattlerEnemyY = 17
|
BattlerEnemyY = 17
|
||||||
BattlerShadowX = 0
|
BattlerShadowX = 0
|
||||||
BattlerShadowSize = 2
|
BattlerShadowSize = 2
|
||||||
Evolutions = PROBOPASS,Location,49,PROBOPASS,Location,50,PROBOPASS,Location,51
|
Evolutions = PROBOPASS,LocationFlag,Magnetic
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[SKITTY]
|
[SKITTY]
|
||||||
Name = Skitty
|
Name = Skitty
|
||||||
@@ -23743,7 +23743,7 @@ BattlerEnemyX = 0
|
|||||||
BattlerEnemyY = 0
|
BattlerEnemyY = 0
|
||||||
BattlerShadowX = 0
|
BattlerShadowX = 0
|
||||||
BattlerShadowSize = 2
|
BattlerShadowSize = 2
|
||||||
Evolutions = VIKAVOLT,Location,49,VIKAVOLT,Location,50,VIKAVOLT,Location,51
|
Evolutions = VIKAVOLT,LocationFlag,Magnetic
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[VIKAVOLT]
|
[VIKAVOLT]
|
||||||
Name = Vikavolt
|
Name = Vikavolt
|
||||||
@@ -23806,7 +23806,7 @@ BattlerEnemyX = 0
|
|||||||
BattlerEnemyY = 0
|
BattlerEnemyY = 0
|
||||||
BattlerShadowX = 0
|
BattlerShadowX = 0
|
||||||
BattlerShadowSize = 2
|
BattlerShadowSize = 2
|
||||||
Evolutions = CRABOMINABLE,Location,34
|
Evolutions = CRABOMINABLE,LocationFlag,IceRock
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[CRABOMINABLE]
|
[CRABOMINABLE]
|
||||||
Name = Crabominable
|
Name = Crabominable
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -23808,7 +23808,7 @@ BattlerEnemyX = 0
|
|||||||
BattlerEnemyY = 0
|
BattlerEnemyY = 0
|
||||||
BattlerShadowX = 0
|
BattlerShadowX = 0
|
||||||
BattlerShadowSize = 2
|
BattlerShadowSize = 2
|
||||||
Evolutions = CRABOMINABLE,Location,34
|
Evolutions = CRABOMINABLE,LocationFlag,IceRock
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[CRABOMINABLE]
|
[CRABOMINABLE]
|
||||||
Name = Crabominable
|
Name = Crabominable
|
||||||
|
|||||||
492
PBS/items.txt
492
PBS/items.txt
File diff suppressed because it is too large
Load Diff
@@ -142,6 +142,7 @@ Outdoor = true
|
|||||||
ShowArea = true
|
ShowArea = true
|
||||||
MapPosition = 0,16,8
|
MapPosition = 0,16,8
|
||||||
BattleBack = field
|
BattleBack = field
|
||||||
|
Flags = MossRock
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[029]
|
[029]
|
||||||
# Natural Park Entrance
|
# Natural Park Entrance
|
||||||
@@ -166,6 +167,7 @@ Bicycle = true
|
|||||||
MapPosition = 0,15,6
|
MapPosition = 0,15,6
|
||||||
BattleBack = cave1
|
BattleBack = cave1
|
||||||
Environment = Cave
|
Environment = Cave
|
||||||
|
Flags = IceRock
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[035]
|
[035]
|
||||||
# Ingido Plateau
|
# Ingido Plateau
|
||||||
@@ -246,6 +248,7 @@ Bicycle = true
|
|||||||
MapPosition = 0,16,10
|
MapPosition = 0,16,10
|
||||||
BattleBack = cave1
|
BattleBack = cave1
|
||||||
Environment = Cave
|
Environment = Cave
|
||||||
|
Flags = Magnetic
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[050]
|
[050]
|
||||||
# Rock Cave
|
# Rock Cave
|
||||||
@@ -254,6 +257,7 @@ MapPosition = 0,16,10
|
|||||||
DarkMap = true
|
DarkMap = true
|
||||||
BattleBack = cave3
|
BattleBack = cave3
|
||||||
Environment = Cave
|
Environment = Cave
|
||||||
|
Flags = Magnetic
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[051]
|
[051]
|
||||||
# Dungeon
|
# Dungeon
|
||||||
@@ -262,6 +266,7 @@ MapPosition = 0,16,10
|
|||||||
Dungeon = true
|
Dungeon = true
|
||||||
BattleBack = cave2
|
BattleBack = cave2
|
||||||
Environment = Cave
|
Environment = Cave
|
||||||
|
Flags = Magnetic
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[052]
|
[052]
|
||||||
# Battle Frontier
|
# Battle Frontier
|
||||||
|
|||||||
@@ -23808,7 +23808,7 @@ BattlerEnemyX = 0
|
|||||||
BattlerEnemyY = 0
|
BattlerEnemyY = 0
|
||||||
BattlerShadowX = 0
|
BattlerShadowX = 0
|
||||||
BattlerShadowSize = 2
|
BattlerShadowSize = 2
|
||||||
Evolutions = CRABOMINABLE,Location,34
|
Evolutions = CRABOMINABLE,LocationFlag,IceRock
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[CRABOMINABLE]
|
[CRABOMINABLE]
|
||||||
Name = Crabominable
|
Name = Crabominable
|
||||||
|
|||||||
Reference in New Issue
Block a user