From 5ad4d7649e786aa3fde7aa5e4a2b91b9216b9866 Mon Sep 17 00:00:00 2001 From: Jannik Tappert Date: Sun, 12 May 2024 15:55:11 +0200 Subject: [PATCH] For Trainer Classes that have a female and male variant the correct name is now choosen. (If a language has both). Also added a safety net that if the female version does not exist it uses the one without the suffix --- src/data/trainer-config.ts | 16 +++++++++++++++- src/overrides.ts | 4 ++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/data/trainer-config.ts b/src/data/trainer-config.ts index a08f83ebf..3938b3d15 100644 --- a/src/data/trainer-config.ts +++ b/src/data/trainer-config.ts @@ -480,7 +480,21 @@ export class TrainerConfig { if (variant === TrainerVariant.FEMALE || (variant === TrainerVariant.DOUBLE && trainerSlot === TrainerSlot.TRAINER_PARTNER)) return this.nameFemale; } else - ret += !variant ? '♂' : '♀'; + + // Check if !variant is true, if so return the name, else return the name with _female appended + if (variant) { + if (!getIsInitialized()) { + initI18n(); + } + // Check if the female version exists in the i18n file + if (i18next.exists(`trainerClasses:${this.name.toLowerCase().replace}`)) { + // If it does, return + return ret + "_female"; + } else { + // If it doesn't, we do not do anything and go to the normal return + // This is to prevent the game from displaying an error if a female version of the trainer does not exist in the localization + } + } } return ret; diff --git a/src/overrides.ts b/src/overrides.ts index 2b6106a74..a74319bac 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -23,7 +23,7 @@ import { Stat } from './data/pokemon-stat'; export const SEED_OVERRIDE: string = ''; export const WEATHER_OVERRIDE: WeatherType = WeatherType.NONE; export const DOUBLE_BATTLE_OVERRIDE: boolean = false; -export const STARTING_WAVE_OVERRIDE: integer = 0; +export const STARTING_WAVE_OVERRIDE: integer = 5 ; export const STARTING_BIOME_OVERRIDE: Biome = Biome.TOWN; // default 1000 export const STARTING_MONEY_OVERRIDE: integer = 0; @@ -35,7 +35,7 @@ export const STARTING_MONEY_OVERRIDE: integer = 0; // forms can be found in pokemon-species.ts export const STARTER_FORM_OVERRIDE: integer = 0; // default 5 or 20 for Daily -export const STARTING_LEVEL_OVERRIDE: integer = 0; +export const STARTING_LEVEL_OVERRIDE: integer = 500; export const ABILITY_OVERRIDE: Abilities = Abilities.NONE; export const PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE; export const MOVESET_OVERRIDE: Array = [];