Merge branch 'master' into dev

This commit is contained in:
Maruno17
2020-12-04 20:56:37 +00:00
3 changed files with 5 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

@@ -61,6 +61,7 @@ class PokeBattle_RealBattlePeer
# For switching out, including due to fainting, and for the end of battle
def pbOnLeavingBattle(battle,pkmn,usedInBattle,endBattle=false)
return if !pkmn
f = MultipleForms.call("getFormOnLeavingBattle",pkmn,battle,usedInBattle,endBattle)
pkmn.form = f if f && pkmn.form!=f
pkmn.hp = pkmn.totalhp if pkmn.hp>pkmn.totalhp

View File

@@ -486,7 +486,8 @@ class PokemonGlobalMetadata
attr_writer :hallOfFameLastNumber
def hallOfFame
return @hallOfFame || []
@hallOfFame = [] if !@hallOfFame
return @hallOfFame
end
def hallOfFameLastNumber