pokerogue/src/data/pokemon-stat.ts

35 lines
1.0 KiB
TypeScript
Raw Normal View History

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:
ret = !shorten ? i18next.t('pokemonInfo:Stat.HP') : i18next.t('pokemonInfo:Stat.HPshortened');
2023-03-28 14:54:52 -04:00
break;
case Stat.ATK:
ret = !shorten ? i18next.t('pokemonInfo:Stat.ATK') : i18next.t('pokemonInfo:Stat.ATKshortened');
2023-03-28 14:54:52 -04:00
break;
case Stat.DEF:
ret = !shorten ? i18next.t('pokemonInfo:Stat.DEF') : i18next.t('pokemonInfo:Stat.DEFshortened');
2023-03-28 14:54:52 -04:00
break;
case Stat.SPATK:
ret = !shorten ? i18next.t('pokemonInfo:Stat.SPATK') : i18next.t('pokemonInfo:Stat.SPATKshortened');
2023-03-28 14:54:52 -04:00
break;
case Stat.SPDEF:
ret = !shorten ? i18next.t('pokemonInfo:Stat.SPDEF') : i18next.t('pokemonInfo:Stat.SPDEFshortened');
2023-03-28 14:54:52 -04:00
break;
case Stat.SPD:
ret = !shorten ? i18next.t('pokemonInfo:Stat.SPD') : i18next.t('pokemonInfo:Stat.SPDshortened');
2023-03-28 14:54:52 -04:00
break;
}
return ret;
2023-03-28 14:54:52 -04:00
}