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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-23 10:55:09 +09:00
|
|
|
export function getBattleStatLevelChangeDescription(pokemonNameWithAffix: string, stats: string, levels: integer, up: boolean) {
|
|
|
|
const stringKey = (() => {
|
|
|
|
if (up) {
|
|
|
|
switch (levels) {
|
|
|
|
case 1:
|
|
|
|
return "battle:statRose";
|
|
|
|
case 2:
|
|
|
|
return "battle:statSharplyRose";
|
|
|
|
case 3:
|
|
|
|
case 4:
|
|
|
|
case 5:
|
|
|
|
case 6:
|
|
|
|
return "battle:statRoseDrastically";
|
|
|
|
default:
|
|
|
|
return "battle:statWontGoAnyHigher";
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
switch (levels) {
|
|
|
|
case 1:
|
|
|
|
return "battle:statFell";
|
|
|
|
case 2:
|
|
|
|
return "battle:statHarshlyFell";
|
|
|
|
case 3:
|
|
|
|
case 4:
|
|
|
|
case 5:
|
|
|
|
case 6:
|
|
|
|
return "battle:statSeverelyFell";
|
|
|
|
default:
|
|
|
|
return "battle:statWontGoAnyLower";
|
|
|
|
}
|
2023-04-10 23:15:06 -04:00
|
|
|
}
|
2024-06-23 10:55:09 +09:00
|
|
|
})();
|
|
|
|
|
|
|
|
return i18next.t(stringKey, { pokemonNameWithAffix, stats });
|
2024-05-23 17:03:10 +02:00
|
|
|
}
|