mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Merge branch 'master' into dev
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
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class PokeBattle_RealBattlePeer
|
|||||||
|
|
||||||
# For switching out, including due to fainting, and for the end of battle
|
# For switching out, including due to fainting, and for the end of battle
|
||||||
def pbOnLeavingBattle(battle,pkmn,usedInBattle,endBattle=false)
|
def pbOnLeavingBattle(battle,pkmn,usedInBattle,endBattle=false)
|
||||||
|
return if !pkmn
|
||||||
f = MultipleForms.call("getFormOnLeavingBattle",pkmn,battle,usedInBattle,endBattle)
|
f = MultipleForms.call("getFormOnLeavingBattle",pkmn,battle,usedInBattle,endBattle)
|
||||||
pkmn.form = f if f && pkmn.form!=f
|
pkmn.form = f if f && pkmn.form!=f
|
||||||
pkmn.hp = pkmn.totalhp if pkmn.hp>pkmn.totalhp
|
pkmn.hp = pkmn.totalhp if pkmn.hp>pkmn.totalhp
|
||||||
|
|||||||
@@ -486,7 +486,8 @@ class PokemonGlobalMetadata
|
|||||||
attr_writer :hallOfFameLastNumber
|
attr_writer :hallOfFameLastNumber
|
||||||
|
|
||||||
def hallOfFame
|
def hallOfFame
|
||||||
return @hallOfFame || []
|
@hallOfFame = [] if !@hallOfFame
|
||||||
|
return @hallOfFame
|
||||||
end
|
end
|
||||||
|
|
||||||
def hallOfFameLastNumber
|
def hallOfFameLastNumber
|
||||||
|
|||||||
Reference in New Issue
Block a user