From aa396cf402a5506a157105c765b9f274347496e7 Mon Sep 17 00:00:00 2001 From: chardub Date: Wed, 12 Mar 2025 10:45:54 -0400 Subject: [PATCH] =?UTF-8?q?Battle=20menu:=20Automatically=20select=20the?= =?UTF-8?q?=20Fight=20option=20after=20switching=20out=20a=20Pok=C3=A9mon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../011_Battle/003_Battle/010_Battle_Phase_Command.rb | 5 ++++- .../011_Battle/005_Battle scene/008_Scene_Commands.rb | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Data/Scripts/011_Battle/003_Battle/010_Battle_Phase_Command.rb b/Data/Scripts/011_Battle/003_Battle/010_Battle_Phase_Command.rb index 8e0ee5fdc..a5529ae4d 100644 --- a/Data/Scripts/011_Battle/003_Battle/010_Battle_Phase_Command.rb +++ b/Data/Scripts/011_Battle/003_Battle/010_Battle_Phase_Command.rb @@ -219,7 +219,10 @@ class PokeBattle_Battle break end when 2 # Pokémon - break if pbPartyMenu(idxBattler) + if pbPartyMenu(idxBattler) + @scene.setLastCommandIndex(idxBattler,0) + break + end when 3 # Run # NOTE: "Run" is only an available option for the first battler the # player chooses an action for in a round. Attempting to run diff --git a/Data/Scripts/011_Battle/005_Battle scene/008_Scene_Commands.rb b/Data/Scripts/011_Battle/005_Battle scene/008_Scene_Commands.rb index a4dc59576..1b788a7db 100644 --- a/Data/Scripts/011_Battle/005_Battle scene/008_Scene_Commands.rb +++ b/Data/Scripts/011_Battle/005_Battle scene/008_Scene_Commands.rb @@ -1,4 +1,9 @@ class PokeBattle_Scene + + def setLastCommandIndex(battlerIndex,commandIndex) + @lastCmd[battlerIndex] = commandIndex + end + #============================================================================= # The player chooses a main command for a Pokémon # Return values: -1=Cancel, 0=Fight, 1=Bag, 2=Pokémon, 3=Run, 4=Call