mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Sprite renamer is now in the Debug menu and doesn't run when compiling, fixed Poké Flute not working in battle, fixed Advanced Trainer Battle Debug feature not working, fixed special Mega Evolution messages not being used
This commit is contained in:
@@ -403,6 +403,6 @@ end
|
||||
|
||||
# DO NOT EDIT THESE!
|
||||
module Essentials
|
||||
VERSION = "19.1"
|
||||
VERSION = "19.0.dev"
|
||||
ERROR_TEXT = ""
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
#=============================================================================
|
||||
|
||||
@@ -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"),
|
||||
|
||||
@@ -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
|
||||
@@ -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 ""
|
||||
|
||||
Reference in New Issue
Block a user