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:
Maruno17
2021-05-11 18:44:35 +01:00
parent ab3bb12d53
commit 5005b2a7e9
8 changed files with 23 additions and 13 deletions

View File

@@ -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