From 33e71605b4e84f4ffebf4a3964469eba5d067831 Mon Sep 17 00:00:00 2001 From: Jakub Hanko <60473007+JakubHanko@users.noreply.github.com> Date: Mon, 13 May 2024 23:15:49 +0200 Subject: [PATCH] Make ExposedAttr extend AddBattlerTagAttr and fail on overlap --- src/data/move.ts | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index ce4fa46d8..434215ae3 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1830,29 +1830,6 @@ export class ResetStatsAttr extends MoveEffectAttr { } } -export class ExposedAttr extends MoveEffectAttr { - private tagType: BattlerTagType; - - constructor(tagType: BattlerTagType) { - super(); - - this.tagType = tagType; - } - - apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - if (!super.apply(user, target, move, args)) - return false; - - target.summonData.battleStats[BattleStat.EVA] = 0; - target.updateInfo(); - target.addTag(this.tagType, 20, move.id, user.id); - - target.scene.queueMessage(`${getPokemonMessage(user, " identified\n")}${getPokemonMessage(target, "!")}`); - - return true; - } -} - /** * Attribute used for moves which swap the user and the target's stat changes. */ @@ -3109,6 +3086,24 @@ export class FaintCountdownAttr extends AddBattlerTagAttr { } } +export class ExposedAttr extends AddBattlerTagAttr { + constructor(tagType: BattlerTagType) { + super(tagType, false, true); + } + + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + if (!super.apply(user, target, move, args)) + return false; + + target.summonData.battleStats[BattleStat.EVA] = 0; + target.updateInfo(); + + target.scene.queueMessage(`${getPokemonMessage(user, " identified\n")}${getPokemonMessage(target, "!")}`); + + return true; + } +} + export class HitsTagAttr extends MoveAttr { public tagType: BattlerTagType; public doubleDamage: boolean;