From fd5d3e332d78488113ef055b2e21e72861e97f36 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sun, 24 Apr 2022 21:06:40 +0100 Subject: [PATCH] Fixed moves taught via battle Debug menu not working, fixed Max Mushrooms showing the stat up animation for every stat --- Data/Scripts/013_Items/003_Item_BattleEffects.rb | 11 ++++++----- .../003_Debug menus/005_Debug_BattlePkmnCommands.rb | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Data/Scripts/013_Items/003_Item_BattleEffects.rb b/Data/Scripts/013_Items/003_Item_BattleEffects.rb index c1e580638..758270293 100644 --- a/Data/Scripts/013_Items/003_Item_BattleEffects.rb +++ b/Data/Scripts/013_Items/003_Item_BattleEffects.rb @@ -673,11 +673,12 @@ ItemHandlers::BattleUseOnBattler.add(:XACCURACY6, proc { |item, battler, scene| }) ItemHandlers::BattleUseOnBattler.add(:MAXMUSHROOMS, proc { |item, battler, scene| - battler.pbRaiseStatStage(:ATTACK, 1, battler) if battler.pbCanRaiseStatStage?(:ATTACK, battler) - battler.pbRaiseStatStage(:DEFENSE, 1, battler) if battler.pbCanRaiseStatStage?(:DEFENSE, battler) - battler.pbRaiseStatStage(:SPECIAL_ATTACK, 1, battler) if battler.pbCanRaiseStatStage?(:SPECIAL_ATTACK, battler) - battler.pbRaiseStatStage(:SPECIAL_DEFENSE, 1, battler) if battler.pbCanRaiseStatStage?(:SPECIAL_DEFENSE, battler) - battler.pbRaiseStatStage(:SPEED, 1, battler) if battler.pbCanRaiseStatStage?(:SPEED, battler) + show_anim = true + GameData::Stat.each_main_battle do |stat| + next if !battler.pbCanRaiseStatStage?(stat.id, battler) + battler.pbRaiseStatStage(stat.id, 1, battler, show_anim) + show_anim = false + end battler.pokemon.changeHappiness("battleitem") }) diff --git a/Data/Scripts/020_Debug/003_Debug menus/005_Debug_BattlePkmnCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/005_Debug_BattlePkmnCommands.rb index f7bd063e6..baf49069a 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/005_Debug_BattlePkmnCommands.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/005_Debug_BattlePkmnCommands.rb @@ -484,7 +484,7 @@ MenuHandlers.add(:battle_pokemon_debug_menu, :teach_move, { next end pkmn.learn_move(new_move) - battler&.moves&.push(Battle::Move.from_pokemon_move(self, pkmn.moves.last)) + battler&.moves&.push(Battle::Move.from_pokemon_move(battle, pkmn.moves.last)) pbMessage("\\ts[]" + _INTL("{1} learned {2}!", pkmn.name, move_name)) } })