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

@@ -195,7 +195,7 @@ class PokeBattle_Battler
@effects[PBEffects::Illusion] = nil @effects[PBEffects::Illusion] = nil
if hasActiveAbility?(:ILLUSION) if hasActiveAbility?(:ILLUSION)
idxLastParty = @battle.pbLastInTeam(@index) idxLastParty = @battle.pbLastInTeam(@index)
if idxLastParty!=@pokemonIndex if idxLastParty >= 0 && idxLastParty != @pokemonIndex
@effects[PBEffects::Illusion] = @battle.pbParty(@index)[idxLastParty] @effects[PBEffects::Illusion] = @battle.pbParty(@index)[idxLastParty]
end end
end end

View File

@@ -274,7 +274,7 @@ end
#=============================================================================== #===============================================================================
class PokeBattle_Move_012 < PokeBattle_FlinchMove class PokeBattle_Move_012 < PokeBattle_FlinchMove
def pbMoveFailed?(user,targets) def pbMoveFailed?(user,targets)
if user.turnCount>1 || user.lastRoundMoved>=0 if user.turnCount > 1
@battle.pbDisplay(_INTL("But it failed!")) @battle.pbDisplay(_INTL("But it failed!"))
return true return true
end end

View File

@@ -1557,7 +1557,7 @@ end
#=============================================================================== #===============================================================================
class PokeBattle_Move_149 < PokeBattle_Move class PokeBattle_Move_149 < PokeBattle_Move
def pbMoveFailed?(user,targets) def pbMoveFailed?(user,targets)
if user.turnCount>1 || user.lastRoundMoved>=0 if user.turnCount > 1
@battle.pbDisplay(_INTL("But it failed!")) @battle.pbDisplay(_INTL("But it failed!"))
return true return true
end end
@@ -2576,7 +2576,7 @@ end
#=============================================================================== #===============================================================================
class PokeBattle_Move_174 < PokeBattle_Move class PokeBattle_Move_174 < PokeBattle_Move
def pbMoveFailed?(user,targets) def pbMoveFailed?(user,targets)
if user.turnCount>1 || user.lastRoundMoved>=0 if user.turnCount > 1
@battle.pbDisplay(_INTL("But it failed!")) @battle.pbDisplay(_INTL("But it failed!"))
return true return true
end end

View File

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

View File

@@ -3064,7 +3064,7 @@ class PokeBattle_AI
when "173" when "173"
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
when "174" when "174"
score -= 90 if user.turnCount>0 || user.lastRoundMoved>=0 score -= 90 if user.turnCount > 0
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
when "175" when "175"
score += 30 if target.effects[PBEffects::Minimize] score += 30 if target.effects[PBEffects::Minimize]

View File

@@ -1672,7 +1672,7 @@ BattleHandlers::UserAbilityEndOfMove.add(:BEASTBOOST,
BattleHandlers::UserAbilityEndOfMove.add(:MAGICIAN, BattleHandlers::UserAbilityEndOfMove.add(:MAGICIAN,
proc { |ability,user,targets,move,battle| proc { |ability,user,targets,move,battle|
next if !battle.futureSight next if battle.futureSight
next if !move.pbDamagingMove? next if !move.pbDamagingMove?
next if user.item>0 next if user.item>0
next if battle.wildBattle? && user.opposes? next if battle.wildBattle? && user.opposes?