mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-19 22:09:27 +02:00
change trainer names
This commit is contained in:
parent
0162879ee8
commit
4d02e74012
@ -514,7 +514,7 @@ export const BugTypeSuperfanEncounter: MysteryEncounter = MysteryEncounterBuilde
|
|||||||
function getTrainerConfigForWave(waveIndex: number) {
|
function getTrainerConfigForWave(waveIndex: number) {
|
||||||
// Bug type superfan trainer config
|
// Bug type superfan trainer config
|
||||||
const config = trainerConfigs[TrainerType.BUG_TYPE_SUPERFAN].clone();
|
const config = trainerConfigs[TrainerType.BUG_TYPE_SUPERFAN].clone();
|
||||||
config.name = i18next.t("trainerNames:bug_type_superfan");
|
config.name = i18next.t("trainerNames:bugTypeSuperfan");
|
||||||
|
|
||||||
let pool3Copy = POOL_3_POKEMON.slice(0);
|
let pool3Copy = POOL_3_POKEMON.slice(0);
|
||||||
pool3Copy = randSeedShuffle(pool3Copy);
|
pool3Copy = randSeedShuffle(pool3Copy);
|
||||||
|
@ -33,7 +33,7 @@ import i18next from "i18next";
|
|||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounters/theExpertPokemonBreeder";
|
const namespace = "mysteryEncounters/theExpertPokemonBreeder";
|
||||||
|
|
||||||
const trainerNameKey = "trainerNames:expert_pokemon_breeder";
|
const trainerNameKey = "trainerNames:expertPokemonBreeder";
|
||||||
|
|
||||||
const FIRST_STAGE_EVOLUTION_WAVE = 45;
|
const FIRST_STAGE_EVOLUTION_WAVE = 45;
|
||||||
const SECOND_STAGE_EVOLUTION_WAVE = 60;
|
const SECOND_STAGE_EVOLUTION_WAVE = 60;
|
||||||
|
@ -43,7 +43,7 @@ import type {
|
|||||||
} from "#types/trainer-funcs";
|
} from "#types/trainer-funcs";
|
||||||
import { coerceArray, isNullOrUndefined, randSeedInt, randSeedIntRange, randSeedItem } from "#utils/common";
|
import { coerceArray, isNullOrUndefined, randSeedInt, randSeedIntRange, randSeedItem } from "#utils/common";
|
||||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||||
import { toCamelCase, toSnakeCase, toTitleCase } from "#utils/strings";
|
import { toCamelCase, toTitleCase } from "#utils/strings";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
/** Minimum BST for Pokemon generated onto the Elite Four's teams */
|
/** Minimum BST for Pokemon generated onto the Elite Four's teams */
|
||||||
@ -288,7 +288,7 @@ export class TrainerConfig {
|
|||||||
initI18n();
|
initI18n();
|
||||||
}
|
}
|
||||||
// Set the localized name for the female rival.
|
// Set the localized name for the female rival.
|
||||||
this.nameFemale = i18next.t("trainerNames:rival_female");
|
this.nameFemale = i18next.t("trainerNames:rivalFemale");
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, assign the provided female name.
|
// Otherwise, assign the provided female name.
|
||||||
this.nameFemale = nameFemale!; // TODO: is this bang correct?
|
this.nameFemale = nameFemale!; // TODO: is this bang correct?
|
||||||
@ -552,7 +552,7 @@ export class TrainerConfig {
|
|||||||
this.setPartyMemberFunc(-(s + 1), getRandomPartyMemberFunc(coerceArray(speciesPool)));
|
this.setPartyMemberFunc(-(s + 1), getRandomPartyMemberFunc(coerceArray(speciesPool)));
|
||||||
});
|
});
|
||||||
|
|
||||||
const nameForCall = this.name.toLowerCase().replace(/\s/g, "_");
|
const nameForCall = toCamelCase(this.name);
|
||||||
this.name = i18next.t(`trainerNames:${nameForCall}`);
|
this.name = i18next.t(`trainerNames:${nameForCall}`);
|
||||||
this.setHasVoucher(false);
|
this.setHasVoucher(false);
|
||||||
this.setTitle(title);
|
this.setTitle(title);
|
||||||
@ -577,7 +577,7 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
this.setPartyTemplates(trainerPartyTemplates.ELITE_FOUR);
|
this.setPartyTemplates(trainerPartyTemplates.ELITE_FOUR);
|
||||||
|
|
||||||
const nameForCall = this.name.toLowerCase().replace(/\s/g, "_");
|
const nameForCall = toCamelCase(this.name);
|
||||||
this.name = i18next.t(`trainerNames:${nameForCall}`);
|
this.name = i18next.t(`trainerNames:${nameForCall}`);
|
||||||
this.setMoneyMultiplier(2);
|
this.setMoneyMultiplier(2);
|
||||||
this.setBoss();
|
this.setBoss();
|
||||||
@ -618,7 +618,7 @@ export class TrainerConfig {
|
|||||||
this.setSpeciesFilter(p => p.isOfType(specialtyType));
|
this.setSpeciesFilter(p => p.isOfType(specialtyType));
|
||||||
this.setSpecialtyType(specialtyType);
|
this.setSpecialtyType(specialtyType);
|
||||||
}
|
}
|
||||||
const nameForCall = this.name.toLowerCase().replace(/\s/g, "_");
|
const nameForCall = toCamelCase(this.name);
|
||||||
this.name = i18next.t(`trainerNames:${nameForCall}`);
|
this.name = i18next.t(`trainerNames:${nameForCall}`);
|
||||||
this.setTitle(title);
|
this.setTitle(title);
|
||||||
this.setMoneyMultiplier(2.5);
|
this.setMoneyMultiplier(2.5);
|
||||||
@ -666,7 +666,7 @@ export class TrainerConfig {
|
|||||||
this.setSpecialtyType(specialtyType);
|
this.setSpecialtyType(specialtyType);
|
||||||
|
|
||||||
// Localize the trainer's name by converting it to lowercase and replacing spaces with underscores.
|
// Localize the trainer's name by converting it to lowercase and replacing spaces with underscores.
|
||||||
const nameForCall = this.name.toLowerCase().replace(/\s/g, "_");
|
const nameForCall = toCamelCase(this.name);
|
||||||
this.name = i18next.t(`trainerNames:${nameForCall}`);
|
this.name = i18next.t(`trainerNames:${nameForCall}`);
|
||||||
|
|
||||||
// Set the title to "gym_leader". (this is the key in the i18n file)
|
// Set the title to "gym_leader". (this is the key in the i18n file)
|
||||||
@ -727,7 +727,7 @@ export class TrainerConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Localize the trainer's name by converting it to lowercase and replacing spaces with underscores.
|
// Localize the trainer's name by converting it to lowercase and replacing spaces with underscores.
|
||||||
const nameForCall = toSnakeCase(this.name);
|
const nameForCall = toCamelCase(this.name);
|
||||||
this.name = i18next.t(`trainerNames:${nameForCall}`);
|
this.name = i18next.t(`trainerNames:${nameForCall}`);
|
||||||
|
|
||||||
// Set the title to "elite_four". (this is the key in the i18n file)
|
// Set the title to "elite_four". (this is the key in the i18n file)
|
||||||
@ -764,7 +764,7 @@ export class TrainerConfig {
|
|||||||
this.setPartyTemplates(trainerPartyTemplates.CHAMPION);
|
this.setPartyTemplates(trainerPartyTemplates.CHAMPION);
|
||||||
|
|
||||||
// Localize the trainer's name by converting it to lowercase and replacing spaces with underscores.
|
// Localize the trainer's name by converting it to lowercase and replacing spaces with underscores.
|
||||||
const nameForCall = this.name.toLowerCase().replace(/\s/g, "_");
|
const nameForCall = toCamelCase(this.name);
|
||||||
this.name = i18next.t(`trainerNames:${nameForCall}`);
|
this.name = i18next.t(`trainerNames:${nameForCall}`);
|
||||||
|
|
||||||
// Set the title to "champion". (this is the key in the i18n file)
|
// Set the title to "champion". (this is the key in the i18n file)
|
||||||
@ -794,7 +794,7 @@ export class TrainerConfig {
|
|||||||
if (!getIsInitialized()) {
|
if (!getIsInitialized()) {
|
||||||
initI18n();
|
initI18n();
|
||||||
}
|
}
|
||||||
this.name = i18next.t(`trainerNames:${name.toLowerCase().replace(/\s/g, "_")}`);
|
this.name = i18next.t(`trainerNames:${toCamelCase(name)}`);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ import {
|
|||||||
} from "#trainers/trainer-party-template";
|
} from "#trainers/trainer-party-template";
|
||||||
import { randSeedInt, randSeedItem, randSeedWeightedItem } from "#utils/common";
|
import { randSeedInt, randSeedItem, randSeedWeightedItem } from "#utils/common";
|
||||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||||
import { toCamelCase, toSnakeCase } from "#utils/strings";
|
import { toCamelCase } from "#utils/strings";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
export class Trainer extends Phaser.GameObjects.Container {
|
export class Trainer extends Phaser.GameObjects.Container {
|
||||||
@ -208,7 +208,7 @@ export class Trainer extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
if (this.config.titleDouble && this.variant === TrainerVariant.DOUBLE && !this.config.doubleOnly) {
|
if (this.config.titleDouble && this.variant === TrainerVariant.DOUBLE && !this.config.doubleOnly) {
|
||||||
title = this.config.titleDouble;
|
title = this.config.titleDouble;
|
||||||
name = i18next.t(`trainerNames:${toSnakeCase(this.config.nameDouble)}`);
|
name = i18next.t(`trainerNames:${toCamelCase(this.config.nameDouble)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(title ? `${title} ${name}` : name);
|
console.log(title ? `${title} ${name}` : name);
|
||||||
|
@ -308,8 +308,8 @@ export class GameStatsUiHandler extends UiHandler {
|
|||||||
private getUsername(): string {
|
private getUsername(): string {
|
||||||
const usernameReplacement =
|
const usernameReplacement =
|
||||||
globalScene.gameData.gender === PlayerGender.FEMALE
|
globalScene.gameData.gender === PlayerGender.FEMALE
|
||||||
? i18next.t("trainerNames:player_f")
|
? i18next.t("trainerNames:playerF")
|
||||||
: i18next.t("trainerNames:player_m");
|
: i18next.t("trainerNames:playerM");
|
||||||
|
|
||||||
const displayName = !globalScene.hideUsername
|
const displayName = !globalScene.hideUsername
|
||||||
? (loggedInUser?.username ?? i18next.t("common:guest"))
|
? (loggedInUser?.username ?? i18next.t("common:guest"))
|
||||||
|
@ -337,7 +337,7 @@ class RunEntryContainer extends Phaser.GameObjects.Container {
|
|||||||
// Because of the interesting mechanics behind rival names, the rival name and title have to be retrieved differently
|
// Because of the interesting mechanics behind rival names, the rival name and title have to be retrieved differently
|
||||||
const RIVAL_TRAINER_ID_THRESHOLD = 375;
|
const RIVAL_TRAINER_ID_THRESHOLD = 375;
|
||||||
if (data.trainer.trainerType >= RIVAL_TRAINER_ID_THRESHOLD) {
|
if (data.trainer.trainerType >= RIVAL_TRAINER_ID_THRESHOLD) {
|
||||||
const rivalName = tObj.variant === TrainerVariant.FEMALE ? "trainerNames:rival_female" : "trainerNames:rival";
|
const rivalName = tObj.variant === TrainerVariant.FEMALE ? "trainerNames:rivalFemale" : "trainerNames:rival";
|
||||||
const gameOutcomeLabel = addTextObject(
|
const gameOutcomeLabel = addTextObject(
|
||||||
8,
|
8,
|
||||||
5,
|
5,
|
||||||
|
@ -337,7 +337,7 @@ export class RunInfoUiHandler extends UiHandler {
|
|||||||
if (this.runInfo.trainer.trainerType >= RIVAL_TRAINER_ID_THRESHOLD) {
|
if (this.runInfo.trainer.trainerType >= RIVAL_TRAINER_ID_THRESHOLD) {
|
||||||
trainerName =
|
trainerName =
|
||||||
trainerObj.variant === TrainerVariant.FEMALE
|
trainerObj.variant === TrainerVariant.FEMALE
|
||||||
? i18next.t("trainerNames:rival_female")
|
? i18next.t("trainerNames:rivalFemale")
|
||||||
: i18next.t("trainerNames:rival");
|
: i18next.t("trainerNames:rival");
|
||||||
} else {
|
} else {
|
||||||
trainerName = trainerObj.getName(0, true);
|
trainerName = trainerObj.getName(0, true);
|
||||||
|
@ -808,8 +808,8 @@ export class SummaryUiHandler extends UiHandler {
|
|||||||
globalScene.gameData.gender === PlayerGender.FEMALE ? TextStyle.SUMMARY_PINK : TextStyle.SUMMARY_BLUE;
|
globalScene.gameData.gender === PlayerGender.FEMALE ? TextStyle.SUMMARY_PINK : TextStyle.SUMMARY_BLUE;
|
||||||
const usernameReplacement =
|
const usernameReplacement =
|
||||||
globalScene.gameData.gender === PlayerGender.FEMALE
|
globalScene.gameData.gender === PlayerGender.FEMALE
|
||||||
? i18next.t("trainerNames:player_f")
|
? i18next.t("trainerNames:playerF")
|
||||||
: i18next.t("trainerNames:player_m");
|
: i18next.t("trainerNames:playerM");
|
||||||
|
|
||||||
// TODO: should add field for original trainer name to Pokemon object, to support gift/traded Pokemon from MEs
|
// TODO: should add field for original trainer name to Pokemon object, to support gift/traded Pokemon from MEs
|
||||||
const trainerText = addBBCodeTextObject(
|
const trainerText = addBBCodeTextObject(
|
||||||
|
@ -122,8 +122,8 @@ export class TitleUiHandler extends OptionSelectUiHandler {
|
|||||||
genderSplash(): void {
|
genderSplash(): void {
|
||||||
if (this.splashMessage === "splashMessages:aprilFools.helloKyleAmber") {
|
if (this.splashMessage === "splashMessages:aprilFools.helloKyleAmber") {
|
||||||
globalScene.gameData.gender === PlayerGender.MALE
|
globalScene.gameData.gender === PlayerGender.MALE
|
||||||
? this.splashMessageText.setText(i18next.t(this.splashMessage, { name: i18next.t("trainerNames:player_m") }))
|
? this.splashMessageText.setText(i18next.t(this.splashMessage, { name: i18next.t("trainerNames:playerM") }))
|
||||||
: this.splashMessageText.setText(i18next.t(this.splashMessage, { name: i18next.t("trainerNames:player_f") }));
|
: this.splashMessageText.setText(i18next.t(this.splashMessage, { name: i18next.t("trainerNames:playerF") }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ describe("The Expert Pokémon Breeder - Mystery Encounter", () => {
|
|||||||
text: `${namespace}:intro`,
|
text: `${namespace}:intro`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
speaker: "trainerNames:expert_pokemon_breeder",
|
speaker: "trainerNames:expertPokemonBreeder",
|
||||||
text: `${namespace}:introDialogue`,
|
text: `${namespace}:introDialogue`,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
@ -123,7 +123,7 @@ describe("The Expert Pokémon Breeder - Mystery Encounter", () => {
|
|||||||
buttonTooltip: expect.any(String), // Varies based on pokemon
|
buttonTooltip: expect.any(String), // Varies based on pokemon
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
speaker: "trainerNames:expert_pokemon_breeder",
|
speaker: "trainerNames:expertPokemonBreeder",
|
||||||
text: `${namespace}:option.selected`,
|
text: `${namespace}:option.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -208,7 +208,7 @@ describe("The Expert Pokémon Breeder - Mystery Encounter", () => {
|
|||||||
buttonTooltip: expect.any(String), // Varies based on pokemon
|
buttonTooltip: expect.any(String), // Varies based on pokemon
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
speaker: "trainerNames:expert_pokemon_breeder",
|
speaker: "trainerNames:expertPokemonBreeder",
|
||||||
text: `${namespace}:option.selected`,
|
text: `${namespace}:option.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -290,7 +290,7 @@ describe("The Expert Pokémon Breeder - Mystery Encounter", () => {
|
|||||||
buttonTooltip: expect.any(String), // Varies based on pokemon
|
buttonTooltip: expect.any(String), // Varies based on pokemon
|
||||||
selected: [
|
selected: [
|
||||||
{
|
{
|
||||||
speaker: "trainerNames:expert_pokemon_breeder",
|
speaker: "trainerNames:expertPokemonBreeder",
|
||||||
text: `${namespace}:option.selected`,
|
text: `${namespace}:option.selected`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user