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 suffixpull/752/head
parent
25bb22a0fb
commit
5ad4d7649e
|
@ -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;
|
||||
|
|
|
@ -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<Moves> = [];
|
||||
|
|
Loading…
Reference in New Issue