Fixed a Pokémon's form being reset upon evolving, fixed Pokémon not using Struggle

This commit is contained in:
Maruno17
2020-11-29 16:28:12 +00:00
parent e2dcba2169
commit 96fbe1563d
2 changed files with 4 additions and 5 deletions

View File

@@ -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

View File

@@ -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