From b50ce948f606c31d019f012bfe2932adc3ef47eb Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Thu, 7 Jul 2022 20:42:23 +0100 Subject: [PATCH] =?UTF-8?q?Fixed=20battle=20rule=20"forceCatchIntoParty"?= =?UTF-8?q?=20being=20circumventable,=20fixed=20wrong=20message=20when=20s?= =?UTF-8?q?ending=20a=20party=20Pok=C3=A9mon=20to=20storage=20and=20replac?= =?UTF-8?q?ing=20it=20with=20a=20caught=20Pok=C3=A9mon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/Scripts/007_Objects and windows/011_Messages.rb | 2 +- .../006_Other battle code/005_Battle_CatchAndStoreMixin.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Data/Scripts/007_Objects and windows/011_Messages.rb b/Data/Scripts/007_Objects and windows/011_Messages.rb index 0fa08333c..d098be41a 100644 --- a/Data/Scripts/007_Objects and windows/011_Messages.rb +++ b/Data/Scripts/007_Objects and windows/011_Messages.rb @@ -30,7 +30,7 @@ def pbEventCommentInput(*args) return nil if list.nil? return nil unless list.is_a?(Array) list.each do |item| - next if ![108, 108].include?(item.code) + next if ![108, 408].include?(item.code) next if item.parameters[0] != trigger start = list.index(item) + 1 finish = start + elements diff --git a/Data/Scripts/011_Battle/006_Other battle code/005_Battle_CatchAndStoreMixin.rb b/Data/Scripts/011_Battle/006_Other battle code/005_Battle_CatchAndStoreMixin.rb index 063ee8e0b..8369257c6 100644 --- a/Data/Scripts/011_Battle/006_Other battle code/005_Battle_CatchAndStoreMixin.rb +++ b/Data/Scripts/011_Battle/006_Other battle code/005_Battle_CatchAndStoreMixin.rb @@ -26,7 +26,7 @@ module Battle::CatchAndStoreMixin when 0 # Add to your party pbDisplay(_INTL("Choose a Pokémon in your party to send to your Boxes.")) party_index = -1 - @scene.pbPartyScreen(0, true, 1) { |idxParty, _partyScene| + @scene.pbPartyScreen(0, (@sendToBoxes != 2), 1) { |idxParty, _partyScene| party_index = idxParty next true } @@ -43,8 +43,9 @@ module Battle::CatchAndStoreMixin # this would take a surprising amount of code, and it's very # unlikely to be needed anyway, so I'm ignoring it for now. send_pkmn = pbPlayer.party[party_index] - box_name = @peer.pbStorePokemon(pbPlayer, send_pkmn) + stored_box = @peer.pbStorePokemon(pbPlayer, send_pkmn) pbPlayer.party.delete_at(party_index) + box_name = @peer.pbBoxName(stored_box) pbDisplayPaused(_INTL("{1} has been sent to Box \"{2}\".", send_pkmn.name, box_name)) # Rearrange all remembered properties of party Pokémon (party_index...party_size).each do |idx|