pokerogue/src/data/battle-stat.ts
Lee ByungHoon 9b8f6f312b
[Localization] Modification some code about battle stat for localization (#1985)
* [Localization] Modification some code about battle stat for localization.

* Corrections to failed generating typedoc docs.

* [Localization] Modification some code about battle stat for localization.

* Corrections to failed generating typedoc docs.

* Corrections to change localized key for battle stat and level change description.

* Deleted battle-stat.ts file in Deutsch locales.

* Fixed build failure

* Move unit test file into localisation folder from battle folder.

* Fixed localization key

* Fixed build failure

* Fix merge conflict

* Fix merge conflict again

---------

Co-authored-by: Tempoanon <163687446+Tempo-anon@users.noreply.github.com>
Co-authored-by: Temps Ray <temps.ray@gmail.com>
2024-06-15 22:25:18 -04:00

66 lines
1.4 KiB
TypeScript

import i18next from "i18next";
export enum BattleStat {
ATK,
DEF,
SPATK,
SPDEF,
SPD,
ACC,
EVA,
RAND
}
export function getBattleStatName(stat: BattleStat) {
switch (stat) {
case BattleStat.ATK:
return i18next.t("pokemonInfo:Stat.ATK");
case BattleStat.DEF:
return i18next.t("pokemonInfo:Stat.DEF");
case BattleStat.SPATK:
return i18next.t("pokemonInfo:Stat.SPATK");
case BattleStat.SPDEF:
return i18next.t("pokemonInfo:Stat.SPDEF");
case BattleStat.SPD:
return i18next.t("pokemonInfo:Stat.SPD");
case BattleStat.ACC:
return i18next.t("pokemonInfo:Stat.ACC");
case BattleStat.EVA:
return i18next.t("pokemonInfo:Stat.EVA");
default:
return "???";
}
}
export function getBattleStatLevelChangeDescription(levels: integer, up: boolean) {
if (up) {
switch (levels) {
case 1:
return i18next.t("battle:statRose");
case 2:
return i18next.t("battle:statSharplyRose");
case 3:
case 4:
case 5:
case 6:
return i18next.t("battle:statRoseDrastically");
default:
return i18next.t("battle:statWontGoAnyHigher");
}
} else {
switch (levels) {
case 1:
return i18next.t("battle:statFell");
case 2:
return i18next.t("battle:statHarshlyFell");
case 3:
case 4:
case 5:
case 6:
return i18next.t("battle:statSeverelyFell");
default:
return i18next.t("battle:statWontGoAnyLower");
}
}
}