Changed battle victory MEs to BGMs

This commit is contained in:
Maruno17
2022-04-21 21:43:11 +01:00
parent 77f9547687
commit a85ec1e51a
12 changed files with 181 additions and 192 deletions

View File

@@ -664,10 +664,7 @@ class Interpreter
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Battle End ME # * Change Battle End ME
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
def command_133 def command_133; command_dummy; end
($PokemonGlobal.nextBattleME = @parameters[0]) ? @parameters[0].clone : nil
return true
end
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# * Change Save Access # * Change Save Access
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------

View File

@@ -8,7 +8,7 @@ module GameData
attr_reader :flags attr_reader :flags
attr_reader :intro_BGM attr_reader :intro_BGM
attr_reader :battle_BGM attr_reader :battle_BGM
attr_reader :victory_ME attr_reader :victory_BGM
DATA = {} DATA = {}
DATA_FILENAME = "trainer_types.dat" DATA_FILENAME = "trainer_types.dat"
@@ -24,7 +24,7 @@ module GameData
"Flags" => [:flags, "*s"], "Flags" => [:flags, "*s"],
"IntroBGM" => [:intro_BGM, "s"], "IntroBGM" => [:intro_BGM, "s"],
"BattleBGM" => [:battle_BGM, "s"], "BattleBGM" => [:battle_BGM, "s"],
"VictoryME" => [:victory_ME, "s"] "VictoryBGM" => [:victory_BGM, "s"]
} }
extend ClassMethodsSymbols extend ClassMethodsSymbols
@@ -88,7 +88,7 @@ module GameData
@flags = hash[:flags] || [] @flags = hash[:flags] || []
@intro_BGM = hash[:intro_BGM] @intro_BGM = hash[:intro_BGM]
@battle_BGM = hash[:battle_BGM] @battle_BGM = hash[:battle_BGM]
@victory_ME = hash[:victory_ME] @victory_BGM = hash[:victory_BGM]
end end
# @return [String] the translated name of this trainer type # @return [String] the translated name of this trainer type

View File

@@ -7,8 +7,8 @@ module GameData
attr_reader :real_storage_creator attr_reader :real_storage_creator
attr_reader :wild_battle_BGM attr_reader :wild_battle_BGM
attr_reader :trainer_battle_BGM attr_reader :trainer_battle_BGM
attr_reader :wild_victory_ME attr_reader :wild_victory_BGM
attr_reader :trainer_victory_ME attr_reader :trainer_victory_BGM
attr_reader :wild_capture_ME attr_reader :wild_capture_ME
attr_reader :surf_BGM attr_reader :surf_BGM
attr_reader :bicycle_BGM attr_reader :bicycle_BGM
@@ -17,17 +17,17 @@ module GameData
DATA_FILENAME = "metadata.dat" DATA_FILENAME = "metadata.dat"
SCHEMA = { SCHEMA = {
"StartMoney" => [1, "u"], "StartMoney" => [1, "u"],
"StartItemStorage" => [2, "*e", :Item], "StartItemStorage" => [2, "*e", :Item],
"Home" => [3, "vuuu"], "Home" => [3, "vuuu"],
"StorageCreator" => [4, "s"], "StorageCreator" => [4, "s"],
"WildBattleBGM" => [5, "s"], "WildBattleBGM" => [5, "s"],
"TrainerBattleBGM" => [6, "s"], "TrainerBattleBGM" => [6, "s"],
"WildVictoryME" => [7, "s"], "WildVictoryBGM" => [7, "s"],
"TrainerVictoryME" => [8, "s"], "TrainerVictoryBGM" => [8, "s"],
"WildCaptureME" => [9, "s"], "WildCaptureME" => [9, "s"],
"SurfBGM" => [10, "s"], "SurfBGM" => [10, "s"],
"BicycleBGM" => [11, "s"] "BicycleBGM" => [11, "s"]
} }
extend ClassMethodsIDNumbers extend ClassMethodsIDNumbers
@@ -35,17 +35,17 @@ module GameData
def self.editor_properties def self.editor_properties
return [ return [
["StartMoney", LimitProperty.new(Settings::MAX_MONEY), _INTL("The amount of money that the player starts the game with.")], ["StartMoney", LimitProperty.new(Settings::MAX_MONEY), _INTL("The amount of money that the player starts the game with.")],
["StartItemStorage", GameDataPoolProperty.new(:Item), _INTL("Items that are already in the player's PC at the start of the game.")], ["StartItemStorage", GameDataPoolProperty.new(:Item), _INTL("Items that are already in the player's PC at the start of the game.")],
["Home", MapCoordsFacingProperty, _INTL("Map ID and X/Y coordinates of where the player goes after a loss if no Pokémon Center was visited.")], ["Home", MapCoordsFacingProperty, _INTL("Map ID and X/Y coordinates of where the player goes after a loss if no Pokémon Center was visited.")],
["StorageCreator", StringProperty, _INTL("Name of the Pokémon Storage creator (the storage option is named \"XXX's PC\").")], ["StorageCreator", StringProperty, _INTL("Name of the Pokémon Storage creator (the storage option is named \"XXX's PC\").")],
["WildBattleBGM", BGMProperty, _INTL("Default BGM for wild Pokémon battles.")], ["WildBattleBGM", BGMProperty, _INTL("Default BGM for wild Pokémon battles.")],
["TrainerBattleBGM", BGMProperty, _INTL("Default BGM for Trainer battles.")], ["TrainerBattleBGM", BGMProperty, _INTL("Default BGM for Trainer battles.")],
["WildVictoryME", MEProperty, _INTL("Default ME played after winning a wild Pokémon battle.")], ["WildVictoryBGM", BGMProperty, _INTL("Default BGM played after winning a wild Pokémon battle.")],
["TrainerVictoryME", MEProperty, _INTL("Default ME played after winning a Trainer battle.")], ["TrainerVictoryBGM", BGMProperty, _INTL("Default BGM played after winning a Trainer battle.")],
["WildCaptureME", MEProperty, _INTL("Default ME played after catching a Pokémon.")], ["WildCaptureME", MEProperty, _INTL("Default ME played after catching a Pokémon.")],
["SurfBGM", BGMProperty, _INTL("BGM played while surfing.")], ["SurfBGM", BGMProperty, _INTL("BGM played while surfing.")],
["BicycleBGM", BGMProperty, _INTL("BGM played while on a bicycle.")] ["BicycleBGM", BGMProperty, _INTL("BGM played while on a bicycle.")]
] ]
end end
@@ -61,8 +61,8 @@ module GameData
@real_storage_creator = hash[:storage_creator] @real_storage_creator = hash[:storage_creator]
@wild_battle_BGM = hash[:wild_battle_BGM] @wild_battle_BGM = hash[:wild_battle_BGM]
@trainer_battle_BGM = hash[:trainer_battle_BGM] @trainer_battle_BGM = hash[:trainer_battle_BGM]
@wild_victory_ME = hash[:wild_victory_ME] @wild_victory_BGM = hash[:wild_victory_BGM]
@trainer_victory_ME = hash[:trainer_victory_ME] @trainer_victory_BGM = hash[:trainer_victory_BGM]
@wild_capture_ME = hash[:wild_capture_ME] @wild_capture_ME = hash[:wild_capture_ME]
@surf_BGM = hash[:surf_BGM] @surf_BGM = hash[:surf_BGM]
@bicycle_BGM = hash[:bicycle_BGM] @bicycle_BGM = hash[:bicycle_BGM]
@@ -76,17 +76,17 @@ module GameData
def property_from_string(str) def property_from_string(str)
case str case str
when "StartMoney" then return @start_money when "StartMoney" then return @start_money
when "StartItemStorage" then return @start_item_storage when "StartItemStorage" then return @start_item_storage
when "Home" then return @home when "Home" then return @home
when "StorageCreator" then return @real_storage_creator when "StorageCreator" then return @real_storage_creator
when "WildBattleBGM" then return @wild_battle_BGM when "WildBattleBGM" then return @wild_battle_BGM
when "TrainerBattleBGM" then return @trainer_battle_BGM when "TrainerBattleBGM" then return @trainer_battle_BGM
when "WildVictoryME" then return @wild_victory_ME when "WildVictoryBGM" then return @wild_victory_BGM
when "TrainerVictoryME" then return @trainer_victory_ME when "TrainerVictoryBGM" then return @trainer_victory_BGM
when "WildCaptureME" then return @wild_capture_ME when "WildCaptureME" then return @wild_capture_ME
when "SurfBGM" then return @surf_BGM when "SurfBGM" then return @surf_BGM
when "BicycleBGM" then return @bicycle_BGM when "BicycleBGM" then return @bicycle_BGM
end end
return nil return nil
end end

View File

@@ -17,8 +17,8 @@ module GameData
attr_reader :battle_background attr_reader :battle_background
attr_reader :wild_battle_BGM attr_reader :wild_battle_BGM
attr_reader :trainer_battle_BGM attr_reader :trainer_battle_BGM
attr_reader :wild_victory_ME attr_reader :wild_victory_BGM
attr_reader :trainer_victory_ME attr_reader :trainer_victory_BGM
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
@@ -28,28 +28,28 @@ module GameData
DATA_FILENAME = "map_metadata.dat" DATA_FILENAME = "map_metadata.dat"
SCHEMA = { SCHEMA = {
"Name" => [1, "s"], "Name" => [1, "s"],
"Outdoor" => [2, "b"], "Outdoor" => [2, "b"],
"ShowArea" => [3, "b"], "ShowArea" => [3, "b"],
"Bicycle" => [4, "b"], "Bicycle" => [4, "b"],
"BicycleAlways" => [5, "b"], "BicycleAlways" => [5, "b"],
"HealingSpot" => [6, "vuu"], "HealingSpot" => [6, "vuu"],
"Weather" => [7, "eu", :Weather], "Weather" => [7, "eu", :Weather],
"MapPosition" => [8, "uuu"], "MapPosition" => [8, "uuu"],
"DiveMap" => [9, "v"], "DiveMap" => [9, "v"],
"DarkMap" => [10, "b"], "DarkMap" => [10, "b"],
"SafariMap" => [11, "b"], "SafariMap" => [11, "b"],
"SnapEdges" => [12, "b"], "SnapEdges" => [12, "b"],
"Dungeon" => [13, "b"], "Dungeon" => [13, "b"],
"BattleBack" => [14, "s"], "BattleBack" => [14, "s"],
"WildBattleBGM" => [15, "s"], "WildBattleBGM" => [15, "s"],
"TrainerBattleBGM" => [16, "s"], "TrainerBattleBGM" => [16, "s"],
"WildVictoryME" => [17, "s"], "WildVictoryBGM" => [17, "s"],
"TrainerVictoryME" => [18, "s"], "TrainerVictoryBGM" => [18, "s"],
"WildCaptureME" => [19, "s"], "WildCaptureME" => [19, "s"],
"MapSize" => [20, "us"], "MapSize" => [20, "us"],
"Environment" => [21, "e", :Environment], "Environment" => [21, "e", :Environment],
"Flags" => [22, "*s"] "Flags" => [22, "*s"]
} }
extend ClassMethodsIDNumbers extend ClassMethodsIDNumbers
@@ -57,28 +57,28 @@ module GameData
def self.editor_properties def self.editor_properties
return [ return [
["Name", StringProperty, _INTL("The name of the map, as seen by the player. Can be different to the map's name as seen in RMXP.")], ["Name", StringProperty, _INTL("The name of the map, as seen by the player. Can be different to the map's name as seen in RMXP.")],
["Outdoor", BooleanProperty, _INTL("If true, this map is an outdoor map and will be tinted according to time of day.")], ["Outdoor", BooleanProperty, _INTL("If true, this map is an outdoor map and will be tinted according to time of day.")],
["ShowArea", BooleanProperty, _INTL("If true, the game will display the map's name upon entry.")], ["ShowArea", BooleanProperty, _INTL("If true, the game will display the map's name upon entry.")],
["Bicycle", BooleanProperty, _INTL("If true, the bicycle can be used on this map.")], ["Bicycle", BooleanProperty, _INTL("If true, the bicycle can be used on this map.")],
["BicycleAlways", BooleanProperty, _INTL("If true, the bicycle will be mounted automatically on this map and cannot be dismounted.")], ["BicycleAlways", BooleanProperty, _INTL("If true, the bicycle will be mounted automatically on this map and cannot be dismounted.")],
["HealingSpot", MapCoordsProperty, _INTL("Map ID of this Pokémon Center's town, and X and Y coordinates of its entrance within that town.")], ["HealingSpot", MapCoordsProperty, _INTL("Map ID of this Pokémon Center's town, and X and Y coordinates of its entrance within that town.")],
["Weather", WeatherEffectProperty, _INTL("Weather conditions in effect for this map.")], ["Weather", WeatherEffectProperty, _INTL("Weather conditions in effect for this map.")],
["MapPosition", RegionMapCoordsProperty, _INTL("Identifies the point on the regional map for this map.")], ["MapPosition", RegionMapCoordsProperty, _INTL("Identifies the point on the regional map for this map.")],
["DiveMap", MapProperty, _INTL("Specifies the underwater layer of this map. Use only if this map has deep water.")], ["DiveMap", MapProperty, _INTL("Specifies the underwater layer of this map. Use only if this map has deep water.")],
["DarkMap", BooleanProperty, _INTL("If true, this map is dark and a circle of light appears around the player. Flash can be used to expand the circle.")], ["DarkMap", BooleanProperty, _INTL("If true, this map is dark and a circle of light appears around the player. Flash can be used to expand the circle.")],
["SafariMap", BooleanProperty, _INTL("If true, this map is part of the Safari Zone (both indoor and outdoor). Not to be used in the reception desk.")], ["SafariMap", BooleanProperty, _INTL("If true, this map is part of the Safari Zone (both indoor and outdoor). Not to be used in the reception desk.")],
["SnapEdges", BooleanProperty, _INTL("If true, when the player goes near this map's edge, the game doesn't center the player as usual.")], ["SnapEdges", BooleanProperty, _INTL("If true, when the player goes near this map's edge, the game doesn't center the player as usual.")],
["Dungeon", BooleanProperty, _INTL("If true, this map has a randomly generated layout. See the wiki for more information.")], ["Dungeon", BooleanProperty, _INTL("If true, this map has a randomly generated layout. See the wiki for more information.")],
["BattleBack", StringProperty, _INTL("PNG files named 'XXX_bg', 'XXX_base0', 'XXX_base1', 'XXX_message' in Battlebacks folder, where XXX is this property's value.")], ["BattleBack", StringProperty, _INTL("PNG files named 'XXX_bg', 'XXX_base0', 'XXX_base1', 'XXX_message' in Battlebacks folder, where XXX is this property's value.")],
["WildBattleBGM", BGMProperty, _INTL("Default BGM for wild Pokémon battles on this map.")], ["WildBattleBGM", BGMProperty, _INTL("Default BGM for wild Pokémon battles on this map.")],
["TrainerBattleBGM", BGMProperty, _INTL("Default BGM for trainer battles on this map.")], ["TrainerBattleBGM", BGMProperty, _INTL("Default BGM for trainer battles on this map.")],
["WildVictoryME", MEProperty, _INTL("Default ME played after winning a wild Pokémon battle on this map.")], ["WildVictoryBGM", BGMProperty, _INTL("Default BGM played after winning a wild Pokémon battle on this map.")],
["TrainerVictoryME", MEProperty, _INTL("Default ME played after winning a Trainer battle on this map.")], ["TrainerVictoryBGM", BGMProperty, _INTL("Default BGM 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.")] ["Flags", StringListProperty, _INTL("Words/phrases that distinguish this map from others.")]
] ]
end end
@@ -100,8 +100,8 @@ module GameData
@battle_background = hash[:battle_background] @battle_background = hash[:battle_background]
@wild_battle_BGM = hash[:wild_battle_BGM] @wild_battle_BGM = hash[:wild_battle_BGM]
@trainer_battle_BGM = hash[:trainer_battle_BGM] @trainer_battle_BGM = hash[:trainer_battle_BGM]
@wild_victory_ME = hash[:wild_victory_ME] @wild_victory_BGM = hash[:wild_victory_BGM]
@trainer_victory_ME = hash[:trainer_victory_ME] @trainer_victory_BGM = hash[:trainer_victory_BGM]
@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]
@@ -110,28 +110,28 @@ module GameData
def property_from_string(str) def property_from_string(str)
case str case str
when "Name" then return @real_name when "Name" then return @real_name
when "Outdoor" then return @outdoor_map when "Outdoor" then return @outdoor_map
when "ShowArea" then return @announce_location when "ShowArea" then return @announce_location
when "Bicycle" then return @can_bicycle when "Bicycle" then return @can_bicycle
when "BicycleAlways" then return @always_bicycle when "BicycleAlways" then return @always_bicycle
when "HealingSpot" then return @teleport_destination when "HealingSpot" then return @teleport_destination
when "Weather" then return @weather when "Weather" then return @weather
when "MapPosition" then return @town_map_position when "MapPosition" then return @town_map_position
when "DiveMap" then return @dive_map_id when "DiveMap" then return @dive_map_id
when "DarkMap" then return @dark_map when "DarkMap" then return @dark_map
when "SafariMap" then return @safari_map when "SafariMap" then return @safari_map
when "SnapEdges" then return @snap_edges when "SnapEdges" then return @snap_edges
when "Dungeon" then return @random_dungeon when "Dungeon" then return @random_dungeon
when "BattleBack" then return @battle_background when "BattleBack" then return @battle_background
when "WildBattleBGM" then return @wild_battle_BGM when "WildBattleBGM" then return @wild_battle_BGM
when "TrainerBattleBGM" then return @trainer_battle_BGM when "TrainerBattleBGM" then return @trainer_battle_BGM
when "WildVictoryME" then return @wild_victory_ME when "WildVictoryBGM" then return @wild_victory_BGM
when "TrainerVictoryME" then return @trainer_victory_ME when "TrainerVictoryBGM" then return @trainer_victory_BGM
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 when "Flags" then return @flags
end end
return nil return nil
end end

View File

@@ -410,13 +410,13 @@ class Battle::Scene
# This method can change the battle's music for example. # This method can change the battle's music for example.
def pbWildBattleSuccess def pbWildBattleSuccess
@battleEnd = true @battleEnd = true
pbBGMPlay(pbGetWildVictoryME) pbBGMPlay(pbGetWildVictoryBGM)
end end
# This method is called when the player wins a trainer battle. # This method is called when the player wins a trainer battle.
# This method can change the battle's music for example. # This method can change the battle's music for example.
def pbTrainerBattleSuccess def pbTrainerBattleSuccess
@battleEnd = true @battleEnd = true
pbBGMPlay(pbGetTrainerVictoryME(@battle.opponent)) pbBGMPlay(pbGetTrainerVictoryBGM(@battle.opponent))
end end
end end

View File

@@ -3,7 +3,7 @@
#=============================================================================== #===============================================================================
class PokemonGlobalMetadata class PokemonGlobalMetadata
attr_accessor :nextBattleBGM attr_accessor :nextBattleBGM
attr_accessor :nextBattleME attr_accessor :nextBattleVictoryBGM
attr_accessor :nextBattleCaptureME attr_accessor :nextBattleCaptureME
attr_accessor :nextBattleBack attr_accessor :nextBattleBack
end end
@@ -236,10 +236,10 @@ def pbWildBattleCore(*args)
pbMessage(_INTL("SKIPPING BATTLE...")) if $player.pokemon_count > 0 pbMessage(_INTL("SKIPPING BATTLE...")) if $player.pokemon_count > 0
pbSet(outcomeVar, 1) # Treat it as a win pbSet(outcomeVar, 1) # Treat it as a win
$game_temp.clear_battle_rules $game_temp.clear_battle_rules
$PokemonGlobal.nextBattleBGM = nil $PokemonGlobal.nextBattleBGM = nil
$PokemonGlobal.nextBattleME = nil $PokemonGlobal.nextBattleVictoryBGM = nil
$PokemonGlobal.nextBattleCaptureME = nil $PokemonGlobal.nextBattleCaptureME = nil
$PokemonGlobal.nextBattleBack = nil $PokemonGlobal.nextBattleBack = nil
pbMEStop pbMEStop
return 1 # Treat it as a win return 1 # Treat it as a win
end end
@@ -381,10 +381,10 @@ def pbTrainerBattleCore(*args)
pbMessage(_INTL("AFTER WINNING...")) if $DEBUG && $player.able_pokemon_count > 0 pbMessage(_INTL("AFTER WINNING...")) if $DEBUG && $player.able_pokemon_count > 0
pbSet(outcomeVar, ($player.able_pokemon_count == 0) ? 0 : 1) # Treat it as undecided/a win pbSet(outcomeVar, ($player.able_pokemon_count == 0) ? 0 : 1) # Treat it as undecided/a win
$game_temp.clear_battle_rules $game_temp.clear_battle_rules
$PokemonGlobal.nextBattleBGM = nil $PokemonGlobal.nextBattleBGM = nil
$PokemonGlobal.nextBattleME = nil $PokemonGlobal.nextBattleVictoryBGM = nil
$PokemonGlobal.nextBattleCaptureME = nil $PokemonGlobal.nextBattleCaptureME = nil
$PokemonGlobal.nextBattleBack = nil $PokemonGlobal.nextBattleBack = nil
pbMEStop pbMEStop
return ($player.able_pokemon_count == 0) ? 0 : 1 # Treat it as undecided/a win return ($player.able_pokemon_count == 0) ? 0 : 1 # Treat it as undecided/a win
end end

View File

@@ -130,12 +130,12 @@ def pbBattleAnimation(bgm = nil, battletype = 0, foe = nil)
$game_system.bgm_resume(playingBGM) $game_system.bgm_resume(playingBGM)
$game_system.bgs_resume(playingBGS) $game_system.bgs_resume(playingBGS)
end end
$game_temp.memorized_bgm = nil $game_temp.memorized_bgm = nil
$game_temp.memorized_bgm_position = 0 $game_temp.memorized_bgm_position = 0
$PokemonGlobal.nextBattleBGM = nil $PokemonGlobal.nextBattleBGM = nil
$PokemonGlobal.nextBattleME = nil $PokemonGlobal.nextBattleVictoryBGM = nil
$PokemonGlobal.nextBattleCaptureME = nil $PokemonGlobal.nextBattleCaptureME = nil
$PokemonGlobal.nextBattleBack = nil $PokemonGlobal.nextBattleBack = nil
$PokemonEncounters.reset_step_count $PokemonEncounters.reset_step_count
# Fade back to the overworld in 0.4 seconds # Fade back to the overworld in 0.4 seconds
viewport.color = Color.new(0, 0, 0, 255) viewport.color = Color.new(0, 0, 0, 255)

View File

@@ -20,23 +20,21 @@ def pbGetWildBattleBGM(_wildParty) # wildParty is an array of Pokémon objects
return ret return ret
end end
def pbGetWildVictoryME def pbGetWildVictoryBGM
if $PokemonGlobal.nextBattleME if $PokemonGlobal.nextBattleVictoryBGM
return $PokemonGlobal.nextBattleME.clone return $PokemonGlobal.nextBattleVictoryBGM.clone
end end
ret = nil ret = nil
if !ret # Check map metadata
# Check map metadata music = $game_map.metadata&.wild_victory_BGM
music = $game_map.metadata&.wild_victory_ME ret = pbStringToAudioFile(music) if music && music != ""
ret = pbStringToAudioFile(music) if music && music != ""
end
if !ret if !ret
# Check global metadata # Check global metadata
music = GameData::Metadata.get.wild_victory_ME music = GameData::Metadata.get.wild_victory_BGM
ret = pbStringToAudioFile(music) if music && music != "" ret = pbStringToAudioFile(music) if music && music != ""
end end
ret = pbStringToAudioFile("Battle victory") if !ret ret = pbStringToAudioFile("Battle victory") if !ret
ret.name = "../../Audio/ME/" + ret.name ret.name = "../../Audio/BGM/" + ret.name
return ret return ret
end end
@@ -92,9 +90,7 @@ def pbGetTrainerBattleBGM(trainer) # can be a Player, NPCTrainer or an array o
if !ret if !ret
# Check global metadata # Check global metadata
music = GameData::Metadata.get.trainer_battle_BGM music = GameData::Metadata.get.trainer_battle_BGM
if music && music != "" ret = pbStringToAudioFile(music) if music && music != ""
ret = pbStringToAudioFile(music)
end
end end
ret = pbStringToAudioFile("Battle trainer") if !ret ret = pbStringToAudioFile("Battle trainer") if !ret
return ret return ret
@@ -120,33 +116,29 @@ def pbGetTrainerBattleBGMFromType(trainertype)
return ret return ret
end end
def pbGetTrainerVictoryME(trainer) # can be a Player, NPCTrainer or an array of them def pbGetTrainerVictoryBGM(trainer) # can be a Player, NPCTrainer or an array of them
if $PokemonGlobal.nextBattleME if $PokemonGlobal.nextBattleVictoryBGM
return $PokemonGlobal.nextBattleME.clone return $PokemonGlobal.nextBattleVictoryBGM.clone
end end
music = nil music = nil
trainerarray = (trainer.is_a?(Array)) ? trainer : [trainer] trainerarray = (trainer.is_a?(Array)) ? trainer : [trainer]
trainerarray.each do |t| trainerarray.each do |t|
trainer_type_data = GameData::TrainerType.get(t.trainer_type) trainer_type_data = GameData::TrainerType.get(t.trainer_type)
music = trainer_type_data.victory_ME if trainer_type_data.victory_ME music = trainer_type_data.victory_BGM if trainer_type_data.victory_BGM
end end
ret = nil ret = nil
if music && music != "" ret = pbStringToAudioFile(music) if music && music != ""
ret = pbStringToAudioFile(music)
end
if !ret if !ret
# Check map metadata # Check map metadata
music = $game_map.metadata&.trainer_victory_ME music = $game_map.metadata&.trainer_victory_BGM
ret = pbStringToAudioFile(music) if music && music != "" ret = pbStringToAudioFile(music) if music && music != ""
end end
if !ret if !ret
# Check global metadata # Check global metadata
music = GameData::Metadata.get.trainer_victory_ME music = GameData::Metadata.get.trainer_victory_BGM
if music && music != "" ret = pbStringToAudioFile(music) if music && music != ""
ret = pbStringToAudioFile(music)
end
end end
ret = pbStringToAudioFile("Battle victory") if !ret ret = pbStringToAudioFile("Battle victory") if !ret
ret.name = "../../Audio/ME/" + ret.name ret.name = "../../Audio/BGM/" + ret.name
return ret return ret
end end

View File

@@ -355,7 +355,7 @@ def pbTrainerTypeEditor
[_INTL("Flags"), StringListProperty, _INTL("Words/phrases that can be used to make trainers of this type behave differently to others.")], [_INTL("Flags"), StringListProperty, _INTL("Words/phrases that can be used to make trainers of this type behave differently to others.")],
[_INTL("IntroBGM"), BGMProperty, _INTL("BGM played before battles against trainers of this type.")], [_INTL("IntroBGM"), BGMProperty, _INTL("BGM 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("VictoryBGM"), BGMProperty, _INTL("BGM played when player wins battles against trainers of this type.")]
] ]
pbListScreenBlock(_INTL("Trainer Types"), TrainerTypeLister.new(0, true)) { |button, tr_type| pbListScreenBlock(_INTL("Trainer Types"), TrainerTypeLister.new(0, true)) { |button, tr_type|
if tr_type if tr_type
@@ -379,7 +379,7 @@ def pbTrainerTypeEditor
t_data.flags, t_data.flags,
t_data.intro_BGM, t_data.intro_BGM,
t_data.battle_BGM, t_data.battle_BGM,
t_data.victory_ME t_data.victory_BGM
] ]
if pbPropertyList(t_data.id.to_s, data, trainer_type_properties, true) if pbPropertyList(t_data.id.to_s, data, trainer_type_properties, true)
# Construct trainer type hash # Construct trainer type hash
@@ -392,7 +392,7 @@ def pbTrainerTypeEditor
:flags => data[5], :flags => data[5],
:intro_BGM => data[6], :intro_BGM => data[6],
:battle_BGM => data[7], :battle_BGM => data[7],
:victory_ME => data[8] :victory_BGM => data[8]
} }
# Add trainer type's data to records # Add trainer type's data to records
GameData::TrainerType.register(type_hash) GameData::TrainerType.register(type_hash)
@@ -737,18 +737,18 @@ def pbEditMetadata
if pbPropertyList(_INTL("Global Metadata"), data, properties, true) if pbPropertyList(_INTL("Global Metadata"), data, properties, true)
# Construct metadata hash # Construct metadata hash
metadata_hash = { metadata_hash = {
:id => 0, :id => 0,
:start_money => data[0], :start_money => data[0],
:start_item_storage => data[1], :start_item_storage => data[1],
:home => data[2], :home => data[2],
:storage_creator => data[3], :storage_creator => data[3],
:wild_battle_BGM => data[4], :wild_battle_BGM => data[4],
:trainer_battle_BGM => data[5], :trainer_battle_BGM => data[5],
:wild_victory_ME => data[6], :wild_victory_BGM => data[6],
:trainer_victory_ME => data[7], :trainer_victory_BGM => data[7],
:wild_capture_ME => data[8], :wild_capture_ME => data[8],
:surf_BGM => data[9], :surf_BGM => data[9],
:bicycle_BGM => data[10] :bicycle_BGM => data[10]
} }
# Add metadata's data to records # Add metadata's data to records
GameData::Metadata.register(metadata_hash) GameData::Metadata.register(metadata_hash)
@@ -841,8 +841,8 @@ def pbEditMapMetadata(map_id)
:battle_background => data[13], :battle_background => data[13],
:wild_battle_BGM => data[14], :wild_battle_BGM => data[14],
:trainer_battle_BGM => data[15], :trainer_battle_BGM => data[15],
:wild_victory_ME => data[16], :wild_victory_BGM => data[16],
:trainer_victory_ME => data[17], :trainer_victory_BGM => data[17],
:wild_capture_ME => data[18], :wild_capture_ME => data[18],
:town_map_size => data[19], :town_map_size => data[19],
:battle_environment => data[20], :battle_environment => data[20],

View File

@@ -1398,7 +1398,7 @@ module Compiler
:name => line[2], :name => line[2],
:base_money => line[3], :base_money => line[3],
:battle_BGM => line[4], :battle_BGM => line[4],
:victory_ME => line[5], :victory_BGM => line[5],
:intro_BGM => line[6], :intro_BGM => line[6],
:gender => line[7], :gender => line[7],
:skill_level => line[8], :skill_level => line[8],
@@ -1700,18 +1700,18 @@ module Compiler
if section_id == 0 # Metadata if section_id == 0 # Metadata
# Construct metadata hash # Construct metadata hash
metadata_hash = { metadata_hash = {
:id => section_id, :id => section_id,
:start_money => contents["StartMoney"], :start_money => contents["StartMoney"],
:start_item_storage => contents["StartItemStorage"], :start_item_storage => contents["StartItemStorage"],
:home => contents["Home"], :home => contents["Home"],
:storage_creator => contents["StorageCreator"], :storage_creator => contents["StorageCreator"],
:wild_battle_BGM => contents["WildBattleBGM"], :wild_battle_BGM => contents["WildBattleBGM"],
:trainer_battle_BGM => contents["TrainerBattleBGM"], :trainer_battle_BGM => contents["TrainerBattleBGM"],
:wild_victory_ME => contents["WildVictoryME"], :wild_victory_BGM => contents["WildVictoryBGM"],
:trainer_victory_ME => contents["TrainerVictoryME"], :trainer_victory_BGM => contents["TrainerVictoryBGM"],
:wild_capture_ME => contents["WildCaptureME"], :wild_capture_ME => contents["WildCaptureME"],
:surf_BGM => contents["SurfBGM"], :surf_BGM => contents["SurfBGM"],
:bicycle_BGM => contents["BicycleBGM"] :bicycle_BGM => contents["BicycleBGM"]
} }
storage_creator[0] = contents["StorageCreator"] storage_creator[0] = contents["StorageCreator"]
# Add metadata's data to records # Add metadata's data to records
@@ -1794,8 +1794,8 @@ module Compiler
:battle_background => contents["BattleBack"], :battle_background => contents["BattleBack"],
:wild_battle_BGM => contents["WildBattleBGM"], :wild_battle_BGM => contents["WildBattleBGM"],
:trainer_battle_BGM => contents["TrainerBattleBGM"], :trainer_battle_BGM => contents["TrainerBattleBGM"],
:wild_victory_ME => contents["WildVictoryME"], :wild_victory_BGM => contents["WildVictoryBGM"],
:trainer_victory_ME => contents["TrainerVictoryME"], :trainer_victory_BGM => contents["TrainerVictoryBGM"],
: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"],

View File

@@ -636,7 +636,7 @@ module Compiler
f.write(sprintf("Flags = %s\r\n", t.flags.join(","))) if t.flags.length > 0 f.write(sprintf("Flags = %s\r\n", t.flags.join(","))) if t.flags.length > 0
f.write(sprintf("IntroBGM = %s\r\n", t.intro_BGM)) if !nil_or_empty?(t.intro_BGM) f.write(sprintf("IntroBGM = %s\r\n", t.intro_BGM)) if !nil_or_empty?(t.intro_BGM)
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("VictoryBGM = %s\r\n", t.victory_BGM)) if !nil_or_empty?(t.victory_BGM)
end end
} }
process_pbs_file_message_end process_pbs_file_message_end

View File

@@ -7,8 +7,8 @@ Home = 3,7,5,8
StorageCreator = Bill StorageCreator = Bill
WildBattleBGM = Battle wild WildBattleBGM = Battle wild
TrainerBattleBGM = Battle trainer TrainerBattleBGM = Battle trainer
WildVictoryME = Battle victory wild WildVictoryBGM = Battle victory wild
TrainerVictoryME = Battle victory trainer TrainerVictoryBGM = Battle victory trainer
SurfBGM = Surfing SurfBGM = Surfing
BicycleBGM = Bicycle BicycleBGM = Bicycle
#------------------------------- #-------------------------------