mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 22:54:59 +00:00
AI now keeps their last defined Pokémon for last, tweaks to some battle effects based on mechanics generation
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -16,9 +16,11 @@ class PokeBattle_Battle
|
||||
return false
|
||||
end
|
||||
if !pbIsOwner?(idxBattler,idxParty)
|
||||
owner = pbGetOwnerFromPartyIndex(idxBattler,idxParty)
|
||||
partyScene.pbDisplay(_INTL("You can't switch {1}'s Pokémon with one of yours!",
|
||||
owner.name)) if partyScene
|
||||
if partyScene
|
||||
owner = pbGetOwnerFromPartyIndex(idxBattler,idxParty)
|
||||
partyScene.pbDisplay(_INTL("You can't switch {1}'s Pokémon with one of yours!",
|
||||
owner.name))
|
||||
end
|
||||
return false
|
||||
end
|
||||
if party[idxParty].fainted?
|
||||
@@ -129,7 +131,7 @@ class PokeBattle_Battle
|
||||
end
|
||||
|
||||
# For choosing a replacement Pokémon when prompted in the middle of other
|
||||
# things happening (U-turn, Baton Pass, in def pbSwitch).
|
||||
# things happening (U-turn, Baton Pass, in def pbEORSwitch).
|
||||
def pbSwitchInBetween(idxBattler,checkLaxOnly=false,canCancel=false)
|
||||
return pbPartyScreen(idxBattler,checkLaxOnly,canCancel) if pbOwnedByPlayer?(idxBattler)
|
||||
return @battleAI.pbDefaultChooseNewEnemy(idxBattler,pbParty(idxBattler))
|
||||
|
||||
Reference in New Issue
Block a user