diff --git a/src/data/move.ts b/src/data/move.ts index 60e492deb..f5fc8e3eb 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -2876,7 +2876,7 @@ export class AddArenaTagAttr extends MoveEffectAttr { public tagType: ArenaTagType; public turnCount: integer; private failOnOverlap: boolean; - private selfSideTarget: boolean; + public selfSideTarget: boolean; constructor(tagType: ArenaTagType, turnCount?: integer, failOnOverlap: boolean = false, selfSideTarget: boolean = false) { super(true, MoveEffectTrigger.POST_APPLY, true); @@ -2909,9 +2909,10 @@ export class AddArenaTagAttr extends MoveEffectAttr { export class AddArenaTrapTagAttr extends AddArenaTagAttr { getCondition(): MoveConditionFunc { return (user, target, move) => { - if (move.category !== MoveCategory.STATUS || !user.scene.arena.getTag(this.tagType)) + const side = (this.selfSideTarget ? user : target).isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY; + if (move.category !== MoveCategory.STATUS || !user.scene.arena.getTagOnSide(this.tagType, side)) return true; - const tag = user.scene.arena.getTag(this.tagType) as ArenaTrapTag; + const tag = user.scene.arena.getTagOnSide(this.tagType, side) as ArenaTrapTag; return tag.layers < tag.maxLayers; }; } diff --git a/src/field/arena.ts b/src/field/arena.ts index 6026560c1..c27e42b89 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -492,7 +492,7 @@ export class Arena { } addTag(tagType: ArenaTagType, turnCount: integer, sourceMove: Moves, sourceId: integer, side: ArenaTagSide = ArenaTagSide.BOTH, targetIndex?: BattlerIndex): boolean { - const existingTag = this.getTag(tagType); + const existingTag = this.getTagOnSide(tagType, side); if (existingTag) { existingTag.onOverlap(this); return false;