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