Fix `Pokemon.isTrapped` only checking enemy Pokemon for trapping abilities (#4124)
This commit is contained in:
parent
39b6a72517
commit
c710f85fd3
|
@ -1324,9 +1324,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
}
|
||||
|
||||
const trappedByAbility = new Utils.BooleanHolder(false);
|
||||
const opposingField = this.isPlayer() ? this.scene.getEnemyField() : this.scene.getPlayerField();
|
||||
|
||||
this.scene.getEnemyField()!.forEach(enemyPokemon =>
|
||||
applyCheckTrappedAbAttrs(CheckTrappedAbAttr, enemyPokemon, trappedByAbility, this, trappedAbMessages, simulated)
|
||||
opposingField.forEach(opponent =>
|
||||
applyCheckTrappedAbAttrs(CheckTrappedAbAttr, opponent, trappedByAbility, this, trappedAbMessages, simulated)
|
||||
);
|
||||
|
||||
return (trappedByAbility.value || !!this.getTag(TrappedTag));
|
||||
|
|
Loading…
Reference in New Issue