From 96fbe1563d619b60e306087f04fe83f79f4f956c Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sun, 29 Nov 2020 16:28:12 +0000 Subject: [PATCH] =?UTF-8?q?Fixed=20a=20Pok=C3=A9mon's=20form=20being=20res?= =?UTF-8?q?et=20upon=20evolving,=20fixed=20Pok=C3=A9mon=20not=20using=20St?= =?UTF-8?q?ruggle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/Scripts/012_Battle/004_AI/004_AI_Move.rb | 6 ++---- Data/Scripts/016_Pokemon/001_PokeBattle_Pokemon.rb | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Data/Scripts/012_Battle/004_AI/004_AI_Move.rb b/Data/Scripts/012_Battle/004_AI/004_AI_Move.rb index c42cc49c6..4aef071a3 100644 --- a/Data/Scripts/012_Battle/004_AI/004_AI_Move.rb +++ b/Data/Scripts/012_Battle/004_AI/004_AI_Move.rb @@ -88,10 +88,8 @@ class PokeBattle_AI next if !@battle.pbCanChooseMove?(idxBattler,i,false) choices.push([i,100,-1]) # Move index, score, target end - if choices.length==0 # No moves are physically possible to use - user.eachMoveWithIndex do |_m,i| - choices.push([i,100,-1]) # Move index, score, target - end + if choices.length==0 # No moves are physically possible to use; use Struggle + @battle.pbAutoChooseMove(user.index) end end # Randomly choose a move from the choices and register it diff --git a/Data/Scripts/016_Pokemon/001_PokeBattle_Pokemon.rb b/Data/Scripts/016_Pokemon/001_PokeBattle_Pokemon.rb index eeadb5e8f..550a76788 100644 --- a/Data/Scripts/016_Pokemon/001_PokeBattle_Pokemon.rb +++ b/Data/Scripts/016_Pokemon/001_PokeBattle_Pokemon.rb @@ -629,7 +629,8 @@ class PokeBattle_Pokemon #============================================================================= def species=(value) hasNickname = nicknamed? - @species, @form = pbGetSpeciesFromFSpecies(value) + @species, new_form = pbGetSpeciesFromFSpecies(value) + @form = new_form if @species != value @name = PBSpecies.getName(@species) unless hasNickname @level = nil # In case growth rate is different for the new species @forcedForm = nil