From 896ec4ab854649b4adb45b1cc1707bc5df5ca750 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Mon, 26 Oct 2020 17:52:42 +0000 Subject: [PATCH] =?UTF-8?q?Fixed=20partner=20trainers=20being=20unable=20t?= =?UTF-8?q?o=20participate=20in=20wild/trainer=20battles=20against=20a=20s?= =?UTF-8?q?ingle=20Pok=C3=A9mon=20even=20if=20a=20battle=20rule=20gives=20?= =?UTF-8?q?them=20a=20space=20in=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../002_PokeBattle_SafariZone.rb | 4 ++-- Data/Scripts/013_Overworld/006_PField_Battles.rb | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Data/Scripts/012_Battle/006_Other battle types/002_PokeBattle_SafariZone.rb b/Data/Scripts/012_Battle/006_Other battle types/002_PokeBattle_SafariZone.rb index 6ab9c6cf9..fecf29ea7 100644 --- a/Data/Scripts/012_Battle/006_Other battle types/002_PokeBattle_SafariZone.rb +++ b/Data/Scripts/012_Battle/006_Other battle types/002_PokeBattle_SafariZone.rb @@ -25,8 +25,8 @@ class PokeBattle_FakeBattler def shiny?; return @pokemon.shiny?; end alias isShiny? shiny? - def isSpecies?(checK_species) - return @pokemon && @pokemon.isSpecies?(checK_species) + def isSpecies?(check_species) + return @pokemon && @pokemon.isSpecies?(check_species) end def fainted?; return false; end diff --git a/Data/Scripts/013_Overworld/006_PField_Battles.rb b/Data/Scripts/013_Overworld/006_PField_Battles.rb index c8204bba6..424da21ac 100644 --- a/Data/Scripts/013_Overworld/006_PField_Battles.rb +++ b/Data/Scripts/013_Overworld/006_PField_Battles.rb @@ -251,7 +251,12 @@ def pbWildBattleCore(*args) playerTrainers = [$Trainer] playerParty = $Trainer.party playerPartyStarts = [0] - if $PokemonGlobal.partner && !$PokemonTemp.battleRules["noPartner"] && foeParty.length>1 + room_for_partner = (foeParty.length > 1) + if !room_for_partner && $PokemonTemp.battleRules["size"] && + !["single", "1v1", "1v2", "1v3"].include?($PokemonTemp.battleRules["size"]) + room_for_partner = true + end + if $PokemonGlobal.partner && !$PokemonTemp.battleRules["noPartner"] && room_for_partner ally = PokeBattle_Trainer.new($PokemonGlobal.partner[1],$PokemonGlobal.partner[0]) ally.id = $PokemonGlobal.partner[2] ally.party = $PokemonGlobal.partner[3] @@ -391,7 +396,12 @@ def pbTrainerBattleCore(*args) playerTrainers = [$Trainer] playerParty = $Trainer.party playerPartyStarts = [0] - if $PokemonGlobal.partner && !$PokemonTemp.battleRules["noPartner"] && foeParty.length>1 + room_for_partner = (foeParty.length > 1) + if !room_for_partner && $PokemonTemp.battleRules["size"] && + !["single", "1v1", "1v2", "1v3"].include?($PokemonTemp.battleRules["size"]) + room_for_partner = true + end + if $PokemonGlobal.partner && !$PokemonTemp.battleRules["noPartner"] && room_for_partner ally = PokeBattle_Trainer.new($PokemonGlobal.partner[1],$PokemonGlobal.partner[0]) ally.id = $PokemonGlobal.partner[2] ally.party = $PokemonGlobal.partner[3]