From 5005b2a7e9fcd077711e3b8bb0c7e83d9ec40c87 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Tue, 11 May 2021 18:44:35 +0100 Subject: [PATCH] =?UTF-8?q?Sprite=20renamer=20is=20now=20in=20the=20Debug?= =?UTF-8?q?=20menu=20and=20doesn't=20run=20when=20compiling,=20fixed=20Pok?= =?UTF-8?q?=C3=A9=20Flute=20not=20working=20in=20battle,=20fixed=20Advance?= =?UTF-8?q?d=20Trainer=20Battle=20Debug=20feature=20not=20working,=20fixed?= =?UTF-8?q?=20special=20Mega=20Evolution=20messages=20not=20being=20used?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/Scripts/001_Settings.rb | 2 +- .../001_Overworld_BattleStarting.rb | 10 +++++----- Data/Scripts/013_Items/003_Item_BattleEffects.rb | 3 +-- Data/Scripts/014_Pokemon/002_Pokemon_MegaEvolution.rb | 4 +++- .../003_Debug menus/002_Debug_MenuCommands.rb | 10 ++++++++++ .../003_Debug menus/004_Debug_MenuSpriteRenamer.rb} | 5 +++-- ...PokemonCommands.rb => 005_Debug_PokemonCommands.rb} | 0 Data/Scripts/021_Compiler/001_Compiler.rb | 2 -- 8 files changed, 23 insertions(+), 13 deletions(-) rename Data/Scripts/{021_Compiler/005_Compiler_SpriteRenamer.rb => 020_Debug/003_Debug menus/004_Debug_MenuSpriteRenamer.rb} (98%) rename Data/Scripts/020_Debug/003_Debug menus/{004_Debug_PokemonCommands.rb => 005_Debug_PokemonCommands.rb} (100%) diff --git a/Data/Scripts/001_Settings.rb b/Data/Scripts/001_Settings.rb index 0ab4a74cb..2aafd22f8 100644 --- a/Data/Scripts/001_Settings.rb +++ b/Data/Scripts/001_Settings.rb @@ -403,6 +403,6 @@ end # DO NOT EDIT THESE! module Essentials - VERSION = "19.1" + VERSION = "19.0.dev" ERROR_TEXT = "" end diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb index 7551eb8e7..b2260631c 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb @@ -367,15 +367,13 @@ def pbTrainerBattleCore(*args) foeParty = [] foePartyStarts = [] for arg in args - raise _INTL("Expected an array of trainer data, got {1}.",arg) if !arg.is_a?(Array) - if arg[0].is_a?(NPCTrainer) + if arg.is_a?(NPCTrainer) foeTrainers.push(arg[0]) foePartyStarts.push(foeParty.length) arg[0].party.each { |pkmn| foeParty.push(pkmn) } foeEndSpeeches.push(arg[0].lose_text) foeItems.push(arg[0].items) - else - # [trainer type, trainer name, ID, speech (optional)] + elsif arg.is_a?(Array) # [trainer type, trainer name, ID, speech (optional)] trainer = pbLoadTrainer(arg[0],arg[1],arg[2]) pbMissingTrainer(arg[0],arg[1],arg[2]) if !trainer return 0 if !trainer @@ -385,6 +383,8 @@ def pbTrainerBattleCore(*args) trainer.party.each { |pkmn| foeParty.push(pkmn) } foeEndSpeeches.push(arg[3] || trainer.lose_text) foeItems.push(trainer.items) + else + raise _INTL("Expected NPCTrainer or array of trainer data, got {1}.", arg) end end # Calculate who the player trainer(s) and their party are @@ -485,7 +485,7 @@ def pbTrainerBattle(trainerID, trainerName, endSpeech=nil, setBattleRule("double") if doubleBattle || $PokemonTemp.waitingTrainer # Perform the battle if $PokemonTemp.waitingTrainer - decision = pbTrainerBattleCore($PokemonTemp.waitingTrainer, + decision = pbTrainerBattleCore($PokemonTemp.waitingTrainer[0], [trainerID,trainerName,trainerPartyID,endSpeech] ) else diff --git a/Data/Scripts/013_Items/003_Item_BattleEffects.rb b/Data/Scripts/013_Items/003_Item_BattleEffects.rb index 280dc5f46..582535d68 100644 --- a/Data/Scripts/013_Items/003_Item_BattleEffects.rb +++ b/Data/Scripts/013_Items/003_Item_BattleEffects.rb @@ -302,8 +302,7 @@ ItemHandlers::UseInBattle.add(:POKEFLUTE,proc { |item,battler,battle| next if b.status != :SLEEP || b.hasActiveAbility?(:SOUNDPROOF) b.pbCureStatus(false) end - scene.pbRefresh - scene.pbDisplay(_INTL("All Pokémon were roused by the tune!")) + battle.pbDisplay(_INTL("All Pokémon were roused by the tune!")) }) ItemHandlers::UseInBattle.addIf(proc { |item| GameData::Item.get(item).is_poke_ball? }, # Poké Balls diff --git a/Data/Scripts/014_Pokemon/002_Pokemon_MegaEvolution.rb b/Data/Scripts/014_Pokemon/002_Pokemon_MegaEvolution.rb index 3f9db2dd3..75648f6ab 100644 --- a/Data/Scripts/014_Pokemon/002_Pokemon_MegaEvolution.rb +++ b/Data/Scripts/014_Pokemon/002_Pokemon_MegaEvolution.rb @@ -47,7 +47,9 @@ class Pokemon end def megaMessage # 0=default message, 1=Rayquaza message - return species_data.mega_message + megaForm = self.getMegaForm + message_number = GameData::Species.get_species_form(@species, megaForm)&.mega_message + return message_number || 0 end #============================================================================= diff --git a/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb index d35de8238..6f67c12b4 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb @@ -1144,6 +1144,16 @@ DebugMenuCommands.register("createpbs", { } }) +DebugMenuCommands.register("renamesprites", { + "parent" => "othermenu", + "name" => _INTL("Rename Old Sprites"), + "description" => _INTL("Renames and moves Pokémon/item/trainer sprites from their old places."), + "always_show" => true, + "effect" => proc { + SpriteRenamer.convert_files + } +}) + DebugMenuCommands.register("invalidtiles", { "parent" => "othermenu", "name" => _INTL("Fix Invalid Tiles"), diff --git a/Data/Scripts/021_Compiler/005_Compiler_SpriteRenamer.rb b/Data/Scripts/020_Debug/003_Debug menus/004_Debug_MenuSpriteRenamer.rb similarity index 98% rename from Data/Scripts/021_Compiler/005_Compiler_SpriteRenamer.rb rename to Data/Scripts/020_Debug/003_Debug menus/004_Debug_MenuSpriteRenamer.rb index be97f5dc1..bfb78a76b 100644 --- a/Data/Scripts/021_Compiler/005_Compiler_SpriteRenamer.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/004_Debug_MenuSpriteRenamer.rb @@ -28,7 +28,7 @@ end #=============================================================================== # #=============================================================================== -module Compiler +module SpriteRenamer module_function def readDirectoryFiles(directory, formats) @@ -217,7 +217,7 @@ module Compiler end def convert_files - return if !pbConfirmMessage("Check for Pokémon/item/trainer files that need renaming?") + return if !pbConfirmMessage("Check for Pokémon/item/trainer files in their old folders that need renaming and moving?") # Rename and move Pokémon sprites/icons dest_dir = "Graphics/Pokemon/" Dir.mkdir(dest_dir) if !FileTest.directory?(dest_dir) @@ -237,5 +237,6 @@ module Compiler # Rename trainer sprites convert_trainer_sprites("Graphics/Trainers/") pbSetWindowText(nil) + pbMessage(_INTL("All found sprites and icons were renamed and moved.")) end end diff --git a/Data/Scripts/020_Debug/003_Debug menus/004_Debug_PokemonCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb similarity index 100% rename from Data/Scripts/020_Debug/003_Debug menus/004_Debug_PokemonCommands.rb rename to Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb diff --git a/Data/Scripts/021_Compiler/001_Compiler.rb b/Data/Scripts/021_Compiler/001_Compiler.rb index 0e38652d4..649e4cdab 100644 --- a/Data/Scripts/021_Compiler/001_Compiler.rb +++ b/Data/Scripts/021_Compiler/001_Compiler.rb @@ -728,8 +728,6 @@ module Compiler yield(_INTL("Saving messages")) pbSetTextMessages MessageTypes.saveMessages - yield(_INTL("Renaming sprites and cries")) - convert_files echoln "" echoln _INTL("*** Finished full compile ***") echoln ""