2024-06-16 03:54:53 +02:00
|
|
|
import i18next from "i18next";
|
|
|
|
|
2023-04-10 23:15:06 -04:00
|
|
|
export enum BattleStat {
|
|
|
|
ATK,
|
|
|
|
DEF,
|
|
|
|
SPATK,
|
|
|
|
SPDEF,
|
|
|
|
SPD,
|
|
|
|
ACC,
|
|
|
|
EVA,
|
|
|
|
RAND
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getBattleStatName(stat: BattleStat) {
|
|
|
|
switch (stat) {
|
2024-05-23 17:03:10 +02:00
|
|
|
case BattleStat.ATK:
|
2024-06-16 11:25:18 +09:00
|
|
|
return i18next.t("pokemonInfo:Stat.ATK");
|
2024-05-23 17:03:10 +02:00
|
|
|
case BattleStat.DEF:
|
2024-06-16 11:25:18 +09:00
|
|
|
return i18next.t("pokemonInfo:Stat.DEF");
|
2024-05-23 17:03:10 +02:00
|
|
|
case BattleStat.SPATK:
|
2024-06-16 11:25:18 +09:00
|
|
|
return i18next.t("pokemonInfo:Stat.SPATK");
|
2024-05-23 17:03:10 +02:00
|
|
|
case BattleStat.SPDEF:
|
2024-06-16 11:25:18 +09:00
|
|
|
return i18next.t("pokemonInfo:Stat.SPDEF");
|
2024-05-23 17:03:10 +02:00
|
|
|
case BattleStat.SPD:
|
2024-06-16 11:25:18 +09:00
|
|
|
return i18next.t("pokemonInfo:Stat.SPD");
|
2024-05-23 17:03:10 +02:00
|
|
|
case BattleStat.ACC:
|
2024-06-16 11:25:18 +09:00
|
|
|
return i18next.t("pokemonInfo:Stat.ACC");
|
2024-05-23 17:03:10 +02:00
|
|
|
case BattleStat.EVA:
|
2024-06-16 11:25:18 +09:00
|
|
|
return i18next.t("pokemonInfo:Stat.EVA");
|
2024-05-23 17:03:10 +02:00
|
|
|
default:
|
2024-06-16 11:25:18 +09:00
|
|
|
return "???";
|
2023-04-10 23:15:06 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getBattleStatLevelChangeDescription(levels: integer, up: boolean) {
|
|
|
|
if (up) {
|
|
|
|
switch (levels) {
|
2024-05-23 17:03:10 +02:00
|
|
|
case 1:
|
2024-06-16 11:25:18 +09:00
|
|
|
return i18next.t("battle:statRose");
|
2024-05-23 17:03:10 +02:00
|
|
|
case 2:
|
2024-06-16 11:25:18 +09:00
|
|
|
return i18next.t("battle:statSharplyRose");
|
2024-05-23 17:03:10 +02:00
|
|
|
case 3:
|
|
|
|
case 4:
|
|
|
|
case 5:
|
|
|
|
case 6:
|
2024-06-16 11:25:18 +09:00
|
|
|
return i18next.t("battle:statRoseDrastically");
|
2024-05-23 17:03:10 +02:00
|
|
|
default:
|
2024-06-16 11:25:18 +09:00
|
|
|
return i18next.t("battle:statWontGoAnyHigher");
|
2023-04-10 23:15:06 -04:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
switch (levels) {
|
2024-05-23 17:03:10 +02:00
|
|
|
case 1:
|
2024-06-16 11:25:18 +09:00
|
|
|
return i18next.t("battle:statFell");
|
2024-05-23 17:03:10 +02:00
|
|
|
case 2:
|
2024-06-16 11:25:18 +09:00
|
|
|
return i18next.t("battle:statHarshlyFell");
|
2024-05-23 17:03:10 +02:00
|
|
|
case 3:
|
|
|
|
case 4:
|
|
|
|
case 5:
|
|
|
|
case 6:
|
2024-06-16 11:25:18 +09:00
|
|
|
return i18next.t("battle:statSeverelyFell");
|
2024-05-23 17:03:10 +02:00
|
|
|
default:
|
2024-06-16 11:25:18 +09:00
|
|
|
return i18next.t("battle:statWontGoAnyLower");
|
2023-04-10 23:15:06 -04:00
|
|
|
}
|
|
|
|
}
|
2024-05-23 17:03:10 +02:00
|
|
|
}
|