From 703f8c43c2c4a8491ce7b817032aebb21fd157d6 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Fri, 19 Apr 2024 17:19:24 -0400 Subject: [PATCH] Fix move implementation indicators --- src/data/move.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index cd527661e27..3f7bed9960d 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -91,6 +91,7 @@ export default class Move implements Localizable { public attrs: MoveAttr[]; private conditions: MoveCondition[]; private flags: integer; + private nameAppend: string; constructor(id: Moves, type: Type, category: MoveCategory, defaultMoveTarget: MoveTarget, power: integer, accuracy: integer, pp: integer, chance: integer, priority: integer, generation: integer) { this.id = id; @@ -98,6 +99,7 @@ export default class Move implements Localizable { const i18nKey = Moves[id].split('_').filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join('') as unknown as string; this.name = id ? i18next.t(`move:${i18nKey}.name`).toString() : ''; + this.nameAppend = ''; this.type = type; this.category = category; this.moveTarget = defaultMoveTarget; @@ -122,8 +124,8 @@ export default class Move implements Localizable { localize() { const i18nKey = Moves[this.id].split('_').filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join('') as unknown as string; - this.name = this.id ? i18next.t(`move:${i18nKey}.name`).toString() : ''; - this.effect = this.id ? i18next.t(`move:${i18nKey}.effect`).toString() : ''; + this.name = this.id ? `${i18next.t(`move:${i18nKey}.name`).toString()}${this.nameAppend}` : ''; + this.effect = this.id ? `${i18next.t(`move:${i18nKey}.effect`).toString()}${this.nameAppend}` : ''; } getAttrs(attrType: { new(...args: any[]): MoveAttr }): MoveAttr[] { @@ -203,12 +205,12 @@ export default class Move implements Localizable { } partial(): this { - this.name += ' (P)'; + this.nameAppend += ' (P)'; return this; } unimplemented(): this { - this.name += ' (N)'; + this.nameAppend += ' (N)'; return this; }