mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 14:29:28 +02:00
fixed nested if issue, remove trapped tag removal
This commit is contained in:
parent
20ad144f52
commit
80315d2451
@ -4823,10 +4823,6 @@ class ForceSwitchOutHelper {
|
||||
const player = switchOutTarget instanceof PlayerPokemon;
|
||||
|
||||
if (player) {
|
||||
if (!player && pokemon.scene.currentBattle.isBattleMysteryEncounter() && !pokemon.scene.currentBattle.mysteryEncounter?.fleeAllowed) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const blockedByAbility = new Utils.BooleanHolder(false);
|
||||
applyAbAttrs(ForceSwitchOutImmunityAbAttr, opponent, blockedByAbility);
|
||||
return !blockedByAbility.value;
|
||||
@ -4838,6 +4834,10 @@ class ForceSwitchOutHelper {
|
||||
}
|
||||
}
|
||||
|
||||
if (!player && pokemon.scene.currentBattle.isBattleMysteryEncounter() && !pokemon.scene.currentBattle.mysteryEncounter?.fleeAllowed) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const party = player ? pokemon.scene.getParty() : pokemon.scene.getEnemyParty();
|
||||
return (!player && !pokemon.scene.currentBattle.battleType)
|
||||
|| party.filter(p => p.isAllowedInBattle()
|
||||
@ -4955,10 +4955,6 @@ export class PostDamageForceSwitchAbAttr extends PostDamageAbAttr {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Trapping moves do not prevent activation
|
||||
if (pokemon.getTag(BattlerTagType.TRAPPED) !== undefined) {
|
||||
pokemon.removeTag(BattlerTagType.TRAPPED);
|
||||
}
|
||||
return this.helper.switchOutLogic(pokemon);
|
||||
} else {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user