Bug fixes for Illusion with 1 Pokémon in team, Magician triggering and Fake Out failing after switching in by an effect

This commit is contained in:
Maruno17
2021-02-08 18:36:02 +00:00
parent f3f21d4679
commit 9fe513ca16
6 changed files with 10 additions and 8 deletions

View File

@@ -169,7 +169,8 @@ class PokeBattle_Battle
idxPartyForName = idxPartyNew
enemyParty = pbParty(idxBattler)
if isConst?(enemyParty[idxPartyNew].ability,PBAbilities,:ILLUSION)
idxPartyForName = pbLastInTeam(idxBattler)
new_index = pbLastInTeam(idxBattler)
idxPartyForName = new_index if new_index >= 0
end
if pbDisplayConfirm(_INTL("{1} is about to send in {2}. Will you switch your Pokémon?",
opponent.fullname,enemyParty[idxPartyForName].name))
@@ -255,7 +256,8 @@ class PokeBattle_Battle
party = pbParty(idxBattler)
newPkmnName = party[idxParty].name
if isConst?(party[idxParty].ability,PBAbilities,:ILLUSION)
newPkmnName = party[pbLastInTeam(idxBattler)].name
new_index = pbLastInTeam(idxBattler)
newPkmnName = party[new_index].name if new_index >= 0
end
if pbOwnedByPlayer?(idxBattler)
opposing = @battlers[idxBattler].pbDirectOpposing