mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 07:52:17 +02:00
more isTrapped
cleanup
This commit is contained in:
parent
cdd1a274e2
commit
b1fd71fdf5
@ -1218,16 +1218,15 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* @param simulated `boolean` if `true`, applies abilities via simulated calls.
|
* @param simulated `boolean` if `true`, applies abilities via simulated calls.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
isTrapped(trappedAbMessages?: string[], simulated: boolean = true): boolean {
|
isTrapped(trappedAbMessages: string[] = [], simulated: boolean = true): boolean {
|
||||||
if (this.isOfType(Type.GHOST)) {
|
if (this.isOfType(Type.GHOST)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const trappedMessages = trappedAbMessages ?? [];
|
|
||||||
const trappedByAbility = new Utils.BooleanHolder(false);
|
const trappedByAbility = new Utils.BooleanHolder(false);
|
||||||
|
|
||||||
this.scene.getEnemyField()!.forEach(enemyPokemon =>
|
this.scene.getEnemyField()!.forEach(enemyPokemon =>
|
||||||
applyCheckTrappedAbAttrs(CheckTrappedAbAttr, enemyPokemon, trappedByAbility, this, trappedMessages, simulated)
|
applyCheckTrappedAbAttrs(CheckTrappedAbAttr, enemyPokemon, trappedByAbility, this, trappedAbMessages, simulated)
|
||||||
);
|
);
|
||||||
|
|
||||||
return (trappedByAbility.value || !!this.getTag(TrappedTag));
|
return (trappedByAbility.value || !!this.getTag(TrappedTag));
|
||||||
|
Loading…
Reference in New Issue
Block a user