mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 06:49:35 +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;
|
const player = switchOutTarget instanceof PlayerPokemon;
|
||||||
|
|
||||||
if (player) {
|
if (player) {
|
||||||
if (!player && pokemon.scene.currentBattle.isBattleMysteryEncounter() && !pokemon.scene.currentBattle.mysteryEncounter?.fleeAllowed) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const blockedByAbility = new Utils.BooleanHolder(false);
|
const blockedByAbility = new Utils.BooleanHolder(false);
|
||||||
applyAbAttrs(ForceSwitchOutImmunityAbAttr, opponent, blockedByAbility);
|
applyAbAttrs(ForceSwitchOutImmunityAbAttr, opponent, blockedByAbility);
|
||||||
return !blockedByAbility.value;
|
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();
|
const party = player ? pokemon.scene.getParty() : pokemon.scene.getEnemyParty();
|
||||||
return (!player && !pokemon.scene.currentBattle.battleType)
|
return (!player && !pokemon.scene.currentBattle.battleType)
|
||||||
|| party.filter(p => p.isAllowedInBattle()
|
|| party.filter(p => p.isAllowedInBattle()
|
||||||
@ -4955,10 +4955,6 @@ export class PostDamageForceSwitchAbAttr extends PostDamageAbAttr {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Trapping moves do not prevent activation
|
|
||||||
if (pokemon.getTag(BattlerTagType.TRAPPED) !== undefined) {
|
|
||||||
pokemon.removeTag(BattlerTagType.TRAPPED);
|
|
||||||
}
|
|
||||||
return this.helper.switchOutLogic(pokemon);
|
return this.helper.switchOutLogic(pokemon);
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user