2024-04-24 22:10:03 +02:00
|
|
|
import i18next from '../plugins/i18n';
|
|
|
|
|
2023-03-28 14:54:52 -04:00
|
|
|
export enum Stat {
|
|
|
|
HP = 0,
|
|
|
|
ATK,
|
|
|
|
DEF,
|
|
|
|
SPATK,
|
|
|
|
SPDEF,
|
|
|
|
SPD
|
|
|
|
};
|
|
|
|
|
2024-01-05 22:24:05 -05:00
|
|
|
export function getStatName(stat: Stat, shorten: boolean = false) {
|
2023-04-01 20:06:44 -04:00
|
|
|
let ret: string;
|
2023-03-28 14:54:52 -04:00
|
|
|
switch (stat) {
|
|
|
|
case Stat.HP:
|
2024-04-24 22:10:03 +02:00
|
|
|
ret = !shorten ? i18next.t('pokemonStat:HP') : i18next.t('pokemonStat:HPshortened');
|
2023-03-28 14:54:52 -04:00
|
|
|
break;
|
|
|
|
case Stat.ATK:
|
2024-04-24 22:10:03 +02:00
|
|
|
ret = !shorten ? i18next.t('pokemonStat:ATK') : i18next.t('pokemonStat:ATKshortened');
|
2023-03-28 14:54:52 -04:00
|
|
|
break;
|
|
|
|
case Stat.DEF:
|
2024-04-24 22:10:03 +02:00
|
|
|
ret = !shorten ? i18next.t('pokemonStat:DEF') : i18next.t('pokemonStat:DEFshortened');
|
2023-03-28 14:54:52 -04:00
|
|
|
break;
|
|
|
|
case Stat.SPATK:
|
2024-04-24 22:10:03 +02:00
|
|
|
ret = !shorten ? i18next.t('pokemonStat:SPATK') : i18next.t('pokemonStat:SPATKshortened');
|
2023-03-28 14:54:52 -04:00
|
|
|
break;
|
|
|
|
case Stat.SPDEF:
|
2024-04-24 22:10:03 +02:00
|
|
|
ret = !shorten ? i18next.t('pokemonStat:SPDEF') : i18next.t('pokemonStat:SPDEFshortened');
|
2023-03-28 14:54:52 -04:00
|
|
|
break;
|
|
|
|
case Stat.SPD:
|
2024-04-24 22:10:03 +02:00
|
|
|
ret = !shorten ? i18next.t('pokemonStat:SPD') : i18next.t('pokemonStat:SPDshortened');
|
2023-03-28 14:54:52 -04:00
|
|
|
break;
|
|
|
|
}
|
2023-10-18 18:01:15 -04:00
|
|
|
return ret;
|
2023-03-28 14:54:52 -04:00
|
|
|
}
|