mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-19 06:42:20 +02:00
Update gts
This commit is contained in:
parent
3e875810de
commit
55e7079c82
@ -985,12 +985,11 @@ function doTradeReceivedSequence(
|
|||||||
function generateRandomTraderName() {
|
function generateRandomTraderName() {
|
||||||
const length = TrainerType.YOUNGSTER - TrainerType.ACE_TRAINER + 1;
|
const length = TrainerType.YOUNGSTER - TrainerType.ACE_TRAINER + 1;
|
||||||
// +1 avoids TrainerType.UNKNOWN
|
// +1 avoids TrainerType.UNKNOWN
|
||||||
const trainerTypePool = i18next.t("trainersCommon:" + TrainerType[randInt(length) + 1], { returnObjects: true });
|
const classKey = `trainersCommon:${TrainerType[randInt(length) + 1]}`;
|
||||||
// Some trainers have 2 gendered pools, some do not
|
// Some trainers have 2 gendered pools, some do not
|
||||||
const gender = randInt(2) === 0 ? "MALE" : "FEMALE";
|
const genderKey = i18next.exists(`${classKey}.MALE`) ? (randInt(2) === 0 ? ".MALE" : ".FEMALE") : "";
|
||||||
const trainerNameString = randSeedItem(
|
const trainerNameKey = randSeedItem(Object.keys(i18next.t(`${classKey}${genderKey}`, { returnObjects: true })));
|
||||||
Object.values(trainerTypePool.hasOwnProperty(gender) ? trainerTypePool[gender] : trainerTypePool),
|
const trainerNameString = i18next.t(`${classKey}${genderKey}.${trainerNameKey}`);
|
||||||
) as string;
|
|
||||||
// Some names have an '&' symbol and need to be trimmed to a single name instead of a double name
|
// Some names have an '&' symbol and need to be trimmed to a single name instead of a double name
|
||||||
const trainerNames = trainerNameString.split(" & ");
|
const trainerNames = trainerNameString.split(" & ");
|
||||||
return trainerNames[randInt(trainerNames.length)];
|
return trainerNames[randInt(trainerNames.length)];
|
||||||
|
@ -70,7 +70,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
|
|||||||
? variant === TrainerVariant.FEMALE
|
? variant === TrainerVariant.FEMALE
|
||||||
? ".FEMALE"
|
? ".FEMALE"
|
||||||
: ".MALE"
|
: ".MALE"
|
||||||
: undefined;
|
: "";
|
||||||
const trainerKey = Utils.randSeedItem(
|
const trainerKey = Utils.randSeedItem(
|
||||||
Object.keys(i18next.t(`${classKey}${genderKey}`, { returnObjects: true })),
|
Object.keys(i18next.t(`${classKey}${genderKey}`, { returnObjects: true })),
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user