mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 22:24:58 +00:00
Fixed a Pokémon's form being reset upon evolving, fixed Pokémon not using Struggle
This commit is contained in:
@@ -88,10 +88,8 @@ class PokeBattle_AI
|
|||||||
next if !@battle.pbCanChooseMove?(idxBattler,i,false)
|
next if !@battle.pbCanChooseMove?(idxBattler,i,false)
|
||||||
choices.push([i,100,-1]) # Move index, score, target
|
choices.push([i,100,-1]) # Move index, score, target
|
||||||
end
|
end
|
||||||
if choices.length==0 # No moves are physically possible to use
|
if choices.length==0 # No moves are physically possible to use; use Struggle
|
||||||
user.eachMoveWithIndex do |_m,i|
|
@battle.pbAutoChooseMove(user.index)
|
||||||
choices.push([i,100,-1]) # Move index, score, target
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Randomly choose a move from the choices and register it
|
# Randomly choose a move from the choices and register it
|
||||||
|
|||||||
@@ -629,7 +629,8 @@ class PokeBattle_Pokemon
|
|||||||
#=============================================================================
|
#=============================================================================
|
||||||
def species=(value)
|
def species=(value)
|
||||||
hasNickname = nicknamed?
|
hasNickname = nicknamed?
|
||||||
@species, @form = pbGetSpeciesFromFSpecies(value)
|
@species, new_form = pbGetSpeciesFromFSpecies(value)
|
||||||
|
@form = new_form if @species != value
|
||||||
@name = PBSpecies.getName(@species) unless hasNickname
|
@name = PBSpecies.getName(@species) unless hasNickname
|
||||||
@level = nil # In case growth rate is different for the new species
|
@level = nil # In case growth rate is different for the new species
|
||||||
@forcedForm = nil
|
@forcedForm = nil
|
||||||
|
|||||||
Reference in New Issue
Block a user