AI now keeps their last defined Pokémon for last, tweaks to some battle effects based on mechanics generation

This commit is contained in:
Maruno17
2021-10-24 23:06:47 +01:00
parent 18049c22b9
commit 680c1de392
8 changed files with 49 additions and 13 deletions

View File

@@ -342,6 +342,18 @@ class PokeBattle_Battle
return pbAbleCount(idxBattler)==0
end
def pbTeamAbleNonActiveCount(idxBattler = 0)
inBattleIndices = []
eachSameSideBattler(idxBattler) { |b| inBattleIndices.push(b.pokemonIndex) }
count = 0
eachInTeamFromBattlerIndex(idxBattler) do |pkmn, i|
next if !pkmn || !pkmn.able?
next if inBattleIndices.include?(idxParty)
count += 1
end
return count
end
# For the given side of the field (0=player's, 1=opponent's), returns an array
# containing the number of able Pokémon in each team.
def pbAbleTeamCounts(side)