mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-03-13 13:28:14 +00:00
fix money formatting and some nits
This commit is contained in:
parent
d4565158b1
commit
550fe76eb1
@ -96,7 +96,7 @@ export const ATrainersTestEncounter: MysteryEncounter =
|
|||||||
encounter.misc = { trainerType, trainerNameKey, trainerEggDescription: eggDescription };
|
encounter.misc = { trainerType, trainerNameKey, trainerEggDescription: eggDescription };
|
||||||
|
|
||||||
// Trainer config
|
// Trainer config
|
||||||
const trainerConfig = trainerConfigs[trainerType].copy();
|
const trainerConfig = trainerConfigs[trainerType].clone();
|
||||||
const trainerSpriteKey = trainerConfig.getSpriteKey();
|
const trainerSpriteKey = trainerConfig.getSpriteKey();
|
||||||
encounter.enemyPartyConfigs.push({
|
encounter.enemyPartyConfigs.push({
|
||||||
levelAdditiveMultiplier: 1,
|
levelAdditiveMultiplier: 1,
|
||||||
|
@ -440,7 +440,7 @@ export const BugTypeSuperfanEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
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].copy();
|
const config = trainerConfigs[TrainerType.BUG_TYPE_SUPERFAN].clone();
|
||||||
config.name = i18next.t("trainerNames:bug_type_superfan");
|
config.name = i18next.t("trainerNames:bug_type_superfan");
|
||||||
|
|
||||||
const pool3Copy = POOL_3_POKEMON.slice(0);
|
const pool3Copy = POOL_3_POKEMON.slice(0);
|
||||||
|
@ -108,7 +108,7 @@ export const ClowningAroundEncounter: MysteryEncounter =
|
|||||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||||
|
|
||||||
const clownTrainerType = TrainerType.HARLEQUIN;
|
const clownTrainerType = TrainerType.HARLEQUIN;
|
||||||
const clownConfig = trainerConfigs[clownTrainerType].copy();
|
const clownConfig = trainerConfigs[clownTrainerType].clone();
|
||||||
const clownPartyTemplate = new TrainerPartyCompoundTemplate(
|
const clownPartyTemplate = new TrainerPartyCompoundTemplate(
|
||||||
new TrainerPartyTemplate(1, PartyMemberStrength.STRONG),
|
new TrainerPartyTemplate(1, PartyMemberStrength.STRONG),
|
||||||
new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER));
|
new TrainerPartyTemplate(1, PartyMemberStrength.STRONGER));
|
||||||
|
@ -43,7 +43,7 @@ export const MysteriousChallengersEncounter: MysteryEncounter =
|
|||||||
|
|
||||||
// Normal difficulty trainer is randomly pulled from biome
|
// Normal difficulty trainer is randomly pulled from biome
|
||||||
const normalTrainerType = scene.arena.randomTrainerType(scene.currentBattle.waveIndex);
|
const normalTrainerType = scene.arena.randomTrainerType(scene.currentBattle.waveIndex);
|
||||||
const normalConfig = trainerConfigs[normalTrainerType].copy();
|
const normalConfig = trainerConfigs[normalTrainerType].clone();
|
||||||
let female = false;
|
let female = false;
|
||||||
if (normalConfig.hasGenders) {
|
if (normalConfig.hasGenders) {
|
||||||
female = !!Utils.randSeedInt(2);
|
female = !!Utils.randSeedInt(2);
|
||||||
@ -66,7 +66,7 @@ export const MysteriousChallengersEncounter: MysteryEncounter =
|
|||||||
true
|
true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
const hardConfig = trainerConfigs[hardTrainerType].copy();
|
const hardConfig = trainerConfigs[hardTrainerType].clone();
|
||||||
hardConfig.setPartyTemplates(hardTemplate);
|
hardConfig.setPartyTemplates(hardTemplate);
|
||||||
female = false;
|
female = false;
|
||||||
if (hardConfig.hasGenders) {
|
if (hardConfig.hasGenders) {
|
||||||
@ -86,7 +86,7 @@ export const MysteriousChallengersEncounter: MysteryEncounter =
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
const e4Template = trainerPartyTemplates.ELITE_FOUR;
|
const e4Template = trainerPartyTemplates.ELITE_FOUR;
|
||||||
const brutalConfig = trainerConfigs[brutalTrainerType].copy();
|
const brutalConfig = trainerConfigs[brutalTrainerType].clone();
|
||||||
brutalConfig.setPartyTemplates(e4Template);
|
brutalConfig.setPartyTemplates(e4Template);
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
brutalConfig.partyTemplateFunc = null; // Overrides gym leader party template func
|
brutalConfig.partyTemplateFunc = null; // Overrides gym leader party template func
|
||||||
|
@ -555,46 +555,6 @@ export class CompatibleMoveRequirement extends EncounterPokemonRequirement {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
export class EvolutionTargetSpeciesRequirement extends EncounterPokemonRequirement {
|
|
||||||
requiredEvolutionTargetSpecies: Species[];
|
|
||||||
minNumberOfPokemon:number;
|
|
||||||
invertQuery:boolean;
|
|
||||||
|
|
||||||
constructor(evolutionTargetSpecies: Species | Species[], minNumberOfPokemon: number = 1, invertQuery: boolean = false) {
|
|
||||||
super();
|
|
||||||
this.minNumberOfPokemon = minNumberOfPokemon;
|
|
||||||
this.invertQuery = invertQuery;
|
|
||||||
this.requiredEvolutionTargetSpecies = Array.isArray(evolutionTargetSpecies) ? evolutionTargetSpecies : [evolutionTargetSpecies];
|
|
||||||
}
|
|
||||||
|
|
||||||
override meetsRequirement(scene: BattleScene): boolean {
|
|
||||||
const partyPokemon = scene.getParty();
|
|
||||||
if (isNullOrUndefined(partyPokemon) || this.requiredEvolutionTargetSpecies?.length < 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return this.queryParty(partyPokemon).length >= this.minNumberOfPokemon;
|
|
||||||
}
|
|
||||||
|
|
||||||
override queryParty(partyPokemon: PlayerPokemon[]): PlayerPokemon[] {
|
|
||||||
if (!this.invertQuery) {
|
|
||||||
return partyPokemon.filter((pokemon) => this.requiredEvolutionTargetSpecies.filter((evolutionTargetSpecies) => pokemon.getEvolution()?.speciesId === evolutionTargetSpecies).length > 0);
|
|
||||||
} else {
|
|
||||||
// for an inverted query, we only want to get the pokemon that don't have ANY of the listed evolutionTargetSpeciess
|
|
||||||
return partyPokemon.filter((pokemon) => this.requiredEvolutionTargetSpecies.filter((evolutionTargetSpecies) => pokemon.getEvolution()?.speciesId === evolutionTargetSpecies).length === 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getMatchingDialogueToken(str:string, pokemon: PlayerPokemon): [RegExp, string] {
|
|
||||||
const evos = this.requiredEvolutionTargetSpecies.filter((evolutionTargetSpecies) => pokemon.getEvolution().speciesId === evolutionTargetSpecies);
|
|
||||||
if (evos.length > 0) {
|
|
||||||
return ["evolution", Species[evos[0]]];
|
|
||||||
}
|
|
||||||
return ["evolution", ""];
|
|
||||||
}
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
export class AbilityRequirement extends EncounterPokemonRequirement {
|
export class AbilityRequirement extends EncounterPokemonRequirement {
|
||||||
requiredAbilities: Abilities[];
|
requiredAbilities: Abilities[];
|
||||||
minNumberOfPokemon: number;
|
minNumberOfPokemon: number;
|
||||||
@ -991,7 +951,7 @@ export class HealthRatioRequirement extends EncounterPokemonRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override meetsRequirement(scene: BattleScene): boolean {
|
override meetsRequirement(scene: BattleScene): boolean {
|
||||||
// Party Pokemon inside required level range
|
// Party Pokemon's health inside required health range
|
||||||
if (!isNullOrUndefined(this.requiredHealthRange) && this.requiredHealthRange[0] <= this.requiredHealthRange[1]) {
|
if (!isNullOrUndefined(this.requiredHealthRange) && this.requiredHealthRange[0] <= this.requiredHealthRange[1]) {
|
||||||
const partyPokemon = scene.getParty();
|
const partyPokemon = scene.getParty();
|
||||||
const pokemonInRange = this.queryParty(partyPokemon);
|
const pokemonInRange = this.queryParty(partyPokemon);
|
||||||
@ -1034,7 +994,7 @@ export class WeightRequirement extends EncounterPokemonRequirement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override meetsRequirement(scene: BattleScene): boolean {
|
override meetsRequirement(scene: BattleScene): boolean {
|
||||||
// Party Pokemon inside required friendship range
|
// Party Pokemon's weight inside required weight range
|
||||||
if (!isNullOrUndefined(this.requiredWeightRange) && this.requiredWeightRange[0] <= this.requiredWeightRange[1]) {
|
if (!isNullOrUndefined(this.requiredWeightRange) && this.requiredWeightRange[0] <= this.requiredWeightRange[1]) {
|
||||||
const partyPokemon = scene.getParty();
|
const partyPokemon = scene.getParty();
|
||||||
const pokemonInRange = this.queryParty(partyPokemon);
|
const pokemonInRange = this.queryParty(partyPokemon);
|
||||||
|
@ -355,9 +355,9 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the configuration for trainers with genders, including the female name and encounter background music (BGM).
|
* Sets the configuration for trainers with genders, including the female name and encounter background music (BGM).
|
||||||
* @param {string} [nameFemale] - The name of the female trainer. If 'Ivy', a localized name will be assigned.
|
* @param {string} [nameFemale] The name of the female trainer. If 'Ivy', a localized name will be assigned.
|
||||||
* @param {TrainerType | string} [femaleEncounterBgm] - The encounter BGM for the female trainer, which can be a TrainerType or a string.
|
* @param {TrainerType | string} [femaleEncounterBgm] The encounter BGM for the female trainer, which can be a TrainerType or a string.
|
||||||
* @returns {TrainerConfig} - The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
**/
|
**/
|
||||||
setHasGenders(nameFemale?: string, femaleEncounterBgm?: TrainerType | string): TrainerConfig {
|
setHasGenders(nameFemale?: string, femaleEncounterBgm?: TrainerType | string): TrainerConfig {
|
||||||
// If the female name is 'Ivy' (the rival), assign a localized name.
|
// If the female name is 'Ivy' (the rival), assign a localized name.
|
||||||
@ -392,9 +392,9 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the configuration for trainers with double battles, including the name of the double trainer and the encounter BGM.
|
* Sets the configuration for trainers with double battles, including the name of the double trainer and the encounter BGM.
|
||||||
* @param nameDouble - The name of the double trainer (e.g., "Ace Duo" for Trainer Class Doubles or "red_blue_double" for NAMED trainer doubles).
|
* @param nameDouble The name of the double trainer (e.g., "Ace Duo" for Trainer Class Doubles or "red_blue_double" for NAMED trainer doubles).
|
||||||
* @param doubleEncounterBgm - The encounter BGM for the double trainer, which can be a TrainerType or a string.
|
* @param doubleEncounterBgm The encounter BGM for the double trainer, which can be a TrainerType or a string.
|
||||||
* @returns {TrainerConfig} - The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
*/
|
*/
|
||||||
setHasDouble(nameDouble: string, doubleEncounterBgm?: TrainerType | string): TrainerConfig {
|
setHasDouble(nameDouble: string, doubleEncounterBgm?: TrainerType | string): TrainerConfig {
|
||||||
this.hasDouble = true;
|
this.hasDouble = true;
|
||||||
@ -407,8 +407,8 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the trainer type for double battles.
|
* Sets the trainer type for double battles.
|
||||||
* @param trainerTypeDouble - The TrainerType of the partner in a double battle.
|
* @param trainerTypeDouble The TrainerType of the partner in a double battle.
|
||||||
* @returns {TrainerConfig} - The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
*/
|
*/
|
||||||
setDoubleTrainerType(trainerTypeDouble: TrainerType): TrainerConfig {
|
setDoubleTrainerType(trainerTypeDouble: TrainerType): TrainerConfig {
|
||||||
this.trainerTypeDouble = trainerTypeDouble;
|
this.trainerTypeDouble = trainerTypeDouble;
|
||||||
@ -432,8 +432,8 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the title for double trainers
|
* Sets the title for double trainers
|
||||||
* @param titleDouble - the key for the title in the i18n file. (e.g., "champion_double").
|
* @param titleDouble The key for the title in the i18n file. (e.g., "champion_double").
|
||||||
* @returns {TrainerConfig} - The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
*/
|
*/
|
||||||
setDoubleTitle(titleDouble: string): TrainerConfig {
|
setDoubleTitle(titleDouble: string): TrainerConfig {
|
||||||
// First check if i18n is initialized
|
// First check if i18n is initialized
|
||||||
@ -625,10 +625,10 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the trainer configuration for an evil team admin.
|
* Initializes the trainer configuration for an evil team admin.
|
||||||
* @param title - The title of the evil team admin.
|
* @param title The title of the evil team admin.
|
||||||
* @param poolName - The evil team the admin belongs to.
|
* @param poolName The evil team the admin belongs to.
|
||||||
* @param {Species | Species[]} signatureSpecies - The signature species for the evil team leader.
|
* @param {Species | Species[]} signatureSpecies The signature species for the evil team leader.
|
||||||
* @returns {TrainerConfig} - The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
* **/
|
* **/
|
||||||
initForEvilTeamAdmin(title: string, poolName: string, signatureSpecies: (Species | Species[])[],): TrainerConfig {
|
initForEvilTeamAdmin(title: string, poolName: string, signatureSpecies: (Species | Species[])[],): TrainerConfig {
|
||||||
if (!getIsInitialized()) {
|
if (!getIsInitialized()) {
|
||||||
@ -661,10 +661,10 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the trainer configuration for a Stat Trainer, as part of the Trainer's Test Mystery Encounter.
|
* Initializes the trainer configuration for a Stat Trainer, as part of the Trainer's Test Mystery Encounter.
|
||||||
* @param {Species | Species[]} signatureSpecies - The signature species for the Elite Four member.
|
* @param {Species | Species[]} signatureSpecies The signature species for the Elite Four member.
|
||||||
* @param {Type[]} specialtyTypes - The specialty types for the Stat Trainer.
|
* @param {Type[]} specialtyTypes The specialty types for the Stat Trainer.
|
||||||
* @param isMale - Whether the Elite Four Member is Male or Female (for localization of the title).
|
* @param isMale Whether the Elite Four Member is Male or Female (for localization of the title).
|
||||||
* @returns {TrainerConfig} - The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
**/
|
**/
|
||||||
initForStatTrainer(signatureSpecies: (Species | Species[])[], isMale: boolean, ...specialtyTypes: Type[]): TrainerConfig {
|
initForStatTrainer(signatureSpecies: (Species | Species[])[], isMale: boolean, ...specialtyTypes: Type[]): TrainerConfig {
|
||||||
if (!getIsInitialized()) {
|
if (!getIsInitialized()) {
|
||||||
@ -698,10 +698,10 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the trainer configuration for an evil team leader. Temporarily hardcoding evil leader teams though.
|
* Initializes the trainer configuration for an evil team leader. Temporarily hardcoding evil leader teams though.
|
||||||
* @param {Species | Species[]} signatureSpecies - The signature species for the evil team leader.
|
* @param {Species | Species[]} signatureSpecies The signature species for the evil team leader.
|
||||||
* @param {Type[]} specialtyTypes - The specialty types for the evil team Leader.
|
* @param {Type[]} specialtyTypes The specialty types for the evil team Leader.
|
||||||
* @param boolean whether or not this is the rematch fight
|
* @param boolean Whether or not this is the rematch fight
|
||||||
* @returns {TrainerConfig} - The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
* **/
|
* **/
|
||||||
initForEvilTeamLeader(title: string, signatureSpecies: (Species | Species[])[], rematch: boolean = false, ...specialtyTypes: Type[]): TrainerConfig {
|
initForEvilTeamLeader(title: string, signatureSpecies: (Species | Species[])[], rematch: boolean = false, ...specialtyTypes: Type[]): TrainerConfig {
|
||||||
if (!getIsInitialized()) {
|
if (!getIsInitialized()) {
|
||||||
@ -737,10 +737,10 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the trainer configuration for a Gym Leader.
|
* Initializes the trainer configuration for a Gym Leader.
|
||||||
* @param {Species | Species[]} signatureSpecies - The signature species for the Gym Leader.
|
* @param {Species | Species[]} signatureSpecies The signature species for the Gym Leader.
|
||||||
* @param {Type[]} specialtyTypes - The specialty types for the Gym Leader.
|
* @param {Type[]} specialtyTypes The specialty types for the Gym Leader.
|
||||||
* @param isMale - Whether the Gym Leader is Male or Not (for localization of the title).
|
* @param isMale Whether the Gym Leader is Male or Not (for localization of the title).
|
||||||
* @returns {TrainerConfig} - The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
* **/
|
* **/
|
||||||
initForGymLeader(signatureSpecies: (Species | Species[])[], isMale: boolean, ...specialtyTypes: Type[]): TrainerConfig {
|
initForGymLeader(signatureSpecies: (Species | Species[])[], isMale: boolean, ...specialtyTypes: Type[]): TrainerConfig {
|
||||||
// Check if the internationalization (i18n) system is initialized.
|
// Check if the internationalization (i18n) system is initialized.
|
||||||
@ -794,10 +794,10 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the trainer configuration for an Elite Four member.
|
* Initializes the trainer configuration for an Elite Four member.
|
||||||
* @param {Species | Species[]} signatureSpecies - The signature species for the Elite Four member.
|
* @param {Species | Species[]} signatureSpecies The signature species for the Elite Four member.
|
||||||
* @param {Type[]} specialtyTypes - The specialty types for the Elite Four member.
|
* @param {Type[]} specialtyTypes The specialty types for the Elite Four member.
|
||||||
* @param isMale - Whether the Elite Four Member is Male or Female (for localization of the title).
|
* @param isMale Whether the Elite Four Member is Male or Female (for localization of the title).
|
||||||
* @returns {TrainerConfig} - The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
**/
|
**/
|
||||||
initForEliteFour(signatureSpecies: (Species | Species[])[], isMale: boolean, ...specialtyTypes: Type[]): TrainerConfig {
|
initForEliteFour(signatureSpecies: (Species | Species[])[], isMale: boolean, ...specialtyTypes: Type[]): TrainerConfig {
|
||||||
// Check if the internationalization (i18n) system is initialized.
|
// Check if the internationalization (i18n) system is initialized.
|
||||||
@ -850,9 +850,9 @@ export class TrainerConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the trainer configuration for a Champion.
|
* Initializes the trainer configuration for a Champion.
|
||||||
* @param {Species | Species[]} signatureSpecies - The signature species for the Champion.
|
* @param {Species | Species[]} signatureSpecies The signature species for the Champion.
|
||||||
* @param isMale - Whether the Champion is Male or Female (for localization of the title).
|
* @param isMale Whether the Champion is Male or Female (for localization of the title).
|
||||||
* @returns {TrainerConfig} - The updated TrainerConfig instance.
|
* @returns {TrainerConfig} The updated TrainerConfig instance.
|
||||||
**/
|
**/
|
||||||
initForChampion(signatureSpecies: (Species | Species[])[], isMale: boolean): TrainerConfig {
|
initForChampion(signatureSpecies: (Species | Species[])[], isMale: boolean): TrainerConfig {
|
||||||
// Check if the internationalization (i18n) system is initialized.
|
// Check if the internationalization (i18n) system is initialized.
|
||||||
@ -995,63 +995,63 @@ export class TrainerConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a copy of a trainer config so that it can be modified without affecting the {@link trainerConfigs} source map
|
* Creates a shallow copy of a trainer config so that it can be modified without affecting the {@link trainerConfigs} source map
|
||||||
*/
|
*/
|
||||||
copy(): TrainerConfig {
|
clone(): TrainerConfig {
|
||||||
let copy = new TrainerConfig(this.trainerType);
|
let clone = new TrainerConfig(this.trainerType);
|
||||||
copy = this.trainerTypeDouble ? copy.setDoubleTrainerType(this.trainerTypeDouble) : copy;
|
clone = this.trainerTypeDouble ? clone.setDoubleTrainerType(this.trainerTypeDouble) : clone;
|
||||||
copy = this.name ? copy.setName(this.name) : copy;
|
clone = this.name ? clone.setName(this.name) : clone;
|
||||||
copy = this.hasGenders ? copy.setHasGenders(this.nameFemale, this.femaleEncounterBgm) : copy;
|
clone = this.hasGenders ? clone.setHasGenders(this.nameFemale, this.femaleEncounterBgm) : clone;
|
||||||
copy = this.hasDouble ? copy.setHasDouble(this.nameDouble, this.doubleEncounterBgm) : copy;
|
clone = this.hasDouble ? clone.setHasDouble(this.nameDouble, this.doubleEncounterBgm) : clone;
|
||||||
copy = this.title ? copy.setTitle(this.title) : copy;
|
clone = this.title ? clone.setTitle(this.title) : clone;
|
||||||
copy = this.titleDouble ? copy.setDoubleTitle(this.titleDouble) : copy;
|
clone = this.titleDouble ? clone.setDoubleTitle(this.titleDouble) : clone;
|
||||||
copy = this.hasCharSprite ? copy.setHasCharSprite() : copy;
|
clone = this.hasCharSprite ? clone.setHasCharSprite() : clone;
|
||||||
copy = this.doubleOnly ? copy.setDoubleOnly() : copy;
|
clone = this.doubleOnly ? clone.setDoubleOnly() : clone;
|
||||||
copy = this.moneyMultiplier ? copy.setMoneyMultiplier(this.moneyMultiplier) : copy;
|
clone = this.moneyMultiplier ? clone.setMoneyMultiplier(this.moneyMultiplier) : clone;
|
||||||
copy = this.isBoss ? copy.setBoss() : copy;
|
clone = this.isBoss ? clone.setBoss() : clone;
|
||||||
copy = this.hasStaticParty ? copy.setStaticParty() : copy;
|
clone = this.hasStaticParty ? clone.setStaticParty() : clone;
|
||||||
copy = this.useSameSeedForAllMembers ? copy.setUseSameSeedForAllMembers() : copy;
|
clone = this.useSameSeedForAllMembers ? clone.setUseSameSeedForAllMembers() : clone;
|
||||||
copy = this.battleBgm ? copy.setBattleBgm(this.battleBgm) : copy;
|
clone = this.battleBgm ? clone.setBattleBgm(this.battleBgm) : clone;
|
||||||
copy = this.encounterBgm ? copy.setEncounterBgm(this.encounterBgm) : copy;
|
clone = this.encounterBgm ? clone.setEncounterBgm(this.encounterBgm) : clone;
|
||||||
copy = this.victoryBgm ? copy.setVictoryBgm(this.victoryBgm) : copy;
|
clone = this.victoryBgm ? clone.setVictoryBgm(this.victoryBgm) : clone;
|
||||||
copy = this.genModifiersFunc ? copy.setGenModifiersFunc(this.genModifiersFunc) : copy;
|
clone = this.genModifiersFunc ? clone.setGenModifiersFunc(this.genModifiersFunc) : clone;
|
||||||
|
|
||||||
if (this.modifierRewardFuncs) {
|
if (this.modifierRewardFuncs) {
|
||||||
// Clones array instead of passing ref
|
// Clones array instead of passing ref
|
||||||
copy.modifierRewardFuncs = this.modifierRewardFuncs.slice(0);
|
clone.modifierRewardFuncs = this.modifierRewardFuncs.slice(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.partyTemplates) {
|
if (this.partyTemplates) {
|
||||||
copy.partyTemplates = this.partyTemplates.slice(0);
|
clone.partyTemplates = this.partyTemplates.slice(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
copy = this.partyTemplateFunc ? copy.setPartyTemplateFunc(this.partyTemplateFunc) : copy;
|
clone = this.partyTemplateFunc ? clone.setPartyTemplateFunc(this.partyTemplateFunc) : clone;
|
||||||
|
|
||||||
if (this.partyMemberFuncs) {
|
if (this.partyMemberFuncs) {
|
||||||
Object.keys(this.partyMemberFuncs).forEach((index) => {
|
Object.keys(this.partyMemberFuncs).forEach((index) => {
|
||||||
copy = copy.setPartyMemberFunc(parseInt(index, 10), this.partyMemberFuncs[index]);
|
clone = clone.setPartyMemberFunc(parseInt(index, 10), this.partyMemberFuncs[index]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
copy = this.speciesPools ? copy.setSpeciesPools(this.speciesPools) : copy;
|
clone = this.speciesPools ? clone.setSpeciesPools(this.speciesPools) : clone;
|
||||||
copy = this.speciesFilter ? copy.setSpeciesFilter(this.speciesFilter) : copy;
|
clone = this.speciesFilter ? clone.setSpeciesFilter(this.speciesFilter) : clone;
|
||||||
if (this.specialtyTypes) {
|
if (this.specialtyTypes) {
|
||||||
copy.specialtyTypes = this.specialtyTypes.slice(0);
|
clone.specialtyTypes = this.specialtyTypes.slice(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
copy.encounterMessages = this.encounterMessages?.slice(0);
|
clone.encounterMessages = this.encounterMessages?.slice(0);
|
||||||
copy.victoryMessages = this.victoryMessages?.slice(0);
|
clone.victoryMessages = this.victoryMessages?.slice(0);
|
||||||
copy.defeatMessages = this.defeatMessages?.slice(0);
|
clone.defeatMessages = this.defeatMessages?.slice(0);
|
||||||
|
|
||||||
copy.femaleEncounterMessages = this.femaleEncounterMessages?.slice(0);
|
clone.femaleEncounterMessages = this.femaleEncounterMessages?.slice(0);
|
||||||
copy.femaleVictoryMessages = this.femaleVictoryMessages?.slice(0);
|
clone.femaleVictoryMessages = this.femaleVictoryMessages?.slice(0);
|
||||||
copy.femaleDefeatMessages = this.femaleDefeatMessages?.slice(0);
|
clone.femaleDefeatMessages = this.femaleDefeatMessages?.slice(0);
|
||||||
|
|
||||||
copy.doubleEncounterMessages = this.doubleEncounterMessages?.slice(0);
|
clone.doubleEncounterMessages = this.doubleEncounterMessages?.slice(0);
|
||||||
copy.doubleVictoryMessages = this.doubleVictoryMessages?.slice(0);
|
clone.doubleVictoryMessages = this.doubleVictoryMessages?.slice(0);
|
||||||
copy.doubleDefeatMessages = this.doubleDefeatMessages?.slice(0);
|
clone.doubleDefeatMessages = this.doubleDefeatMessages?.slice(0);
|
||||||
|
|
||||||
return copy;
|
return clone;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ export class ModifierType {
|
|||||||
* Populates item tier for ModifierType instance
|
* Populates item tier for ModifierType instance
|
||||||
* Tier is a necessary field for items that appear in player shop (determines the Pokeball visual they use)
|
* Tier is a necessary field for items that appear in player shop (determines the Pokeball visual they use)
|
||||||
* To find the tier, this function performs a reverse lookup of the item type in modifier pools
|
* To find the tier, this function performs a reverse lookup of the item type in modifier pools
|
||||||
* @param poolType - Default 'ModifierPoolType.PLAYER'. Which pool to lookup item tier from
|
* @param poolType Default 'ModifierPoolType.PLAYER'. Which pool to lookup item tier from
|
||||||
*/
|
*/
|
||||||
withTierFromPool(poolType: ModifierPoolType = ModifierPoolType.PLAYER): ModifierType {
|
withTierFromPool(poolType: ModifierPoolType = ModifierPoolType.PLAYER): ModifierType {
|
||||||
for (const tier of Object.values(getModifierPoolForType(poolType))) {
|
for (const tier of Object.values(getModifierPoolForType(poolType))) {
|
||||||
|
@ -172,7 +172,18 @@ export async function initI18n(): Promise<void> {
|
|||||||
// If you don't want the BBCode tag applied, just use 'number' formatter
|
// If you don't want the BBCode tag applied, just use 'number' formatter
|
||||||
i18next.services.formatter?.add("money", (value, lng, options) => {
|
i18next.services.formatter?.add("money", (value, lng, options) => {
|
||||||
const numberFormattedString = Intl.NumberFormat(lng, options).format(value);
|
const numberFormattedString = Intl.NumberFormat(lng, options).format(value);
|
||||||
|
switch (lng) {
|
||||||
|
case "ja":
|
||||||
|
return `@[MONEY]{${numberFormattedString}}円`;
|
||||||
|
case "de":
|
||||||
|
case "es":
|
||||||
|
case "fr":
|
||||||
|
case "it":
|
||||||
|
return `@[MONEY]{${numberFormattedString} ₽}`;
|
||||||
|
default:
|
||||||
|
// English and other languages that use same format
|
||||||
return `@[MONEY]{₽${numberFormattedString}}`;
|
return `@[MONEY]{₽${numberFormattedString}}`;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
await initFonts(localStorage.getItem("prLang") ?? undefined);
|
await initFonts(localStorage.getItem("prLang") ?? undefined);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user