mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 07:52:17 +02:00
attempt 2
This commit is contained in:
parent
bc574ac87d
commit
8588ad17b9
@ -14,7 +14,7 @@ import { GameMode } from "../game-mode";
|
||||
import { QuantizerCelebi, argbFromRgba, rgbaFromArgb } from "@material/material-color-utilities";
|
||||
import { VariantSet } from "./variant";
|
||||
import i18next from "i18next";
|
||||
import { Localizable } from "#app/interfaces/locales";
|
||||
import { FusionTranslationEntry, Localizable } from "#app/interfaces/locales";
|
||||
import { Stat } from "./pokemon-stat";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { PartyMemberStrength } from "#enums/party-member-strength";
|
||||
@ -51,18 +51,15 @@ export function getPokemonSpeciesForm(species: Species, formIndex: integer): Pok
|
||||
}
|
||||
|
||||
export function getFusedSpeciesName(speciesAName: string, speciesBName: string): string {
|
||||
// Get the fusion affixes for the species
|
||||
const speciesAFusionAffixes = fusionAffixes[speciesAName];
|
||||
const speciesBFusionAffixes = fusionAffixes[speciesBName];
|
||||
const speciesA = i18next.t(`fusionAffixes:${speciesAName}`) as FusionTranslationEntry;
|
||||
const speciesB = i18next.t(`fusionAffixes:${speciesBName}`) as FusionTranslationEntry;
|
||||
|
||||
// Get the fusion prefix and suffix for each species
|
||||
const speciesAPrefix = speciesAFusionAffixes.fusionPrefix;
|
||||
const speciesBSuffix = speciesBFusionAffixes.fusionSuffix;
|
||||
if (!speciesA || !speciesB) {
|
||||
throw new Error(`One or both species not found: ${speciesAName}, ${speciesBName}`);
|
||||
}
|
||||
|
||||
// Construct the fused species name
|
||||
const fusedSpeciesName = `${speciesAPrefix}${speciesBSuffix}`;
|
||||
|
||||
return fusedSpeciesName;
|
||||
// Combine the fusionPrefix of speciesA with the fusionSuffix of speciesB using template literals
|
||||
return `${speciesA.fusionPrefix}${speciesB.fusionSuffix}`;
|
||||
}
|
||||
|
||||
export type PokemonSpeciesFilter = (species: PokemonSpecies) => boolean;
|
||||
|
@ -29,6 +29,7 @@ import { move } from "./move";
|
||||
import { nature } from "./nature";
|
||||
import { pokeball } from "./pokeball";
|
||||
import { pokemon } from "./pokemon";
|
||||
import { fusionAffixes } from "./pokemon-fusion-affixes";
|
||||
import { pokemonInfo } from "./pokemon-info";
|
||||
import { pokemonInfoContainer } from "./pokemon-info-container";
|
||||
import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler";
|
||||
@ -74,6 +75,7 @@ export const deConfig = {
|
||||
nature: nature,
|
||||
pokeball: pokeball,
|
||||
pokemon: pokemon,
|
||||
fusionAffixes: fusionAffixes,
|
||||
pokemonInfo: pokemonInfo,
|
||||
pokemonInfoContainer: pokemonInfoContainer,
|
||||
saveSlotSelectUiHandler: saveSlotSelectUiHandler,
|
||||
|
@ -32,6 +32,7 @@ import { nature } from "./nature";
|
||||
import { partyUiHandler } from "./party-ui-handler";
|
||||
import { pokeball } from "./pokeball";
|
||||
import { pokemon } from "./pokemon";
|
||||
import { fusionAffixes } from "./pokemon-fusion-affixes";
|
||||
import { pokemonInfo } from "./pokemon-info";
|
||||
import { pokemonInfoContainer } from "./pokemon-info-container";
|
||||
import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler";
|
||||
@ -75,6 +76,7 @@ export const enConfig = {
|
||||
partyUiHandler: partyUiHandler,
|
||||
pokeball: pokeball,
|
||||
pokemon: pokemon,
|
||||
fusionAffixes: fusionAffixes,
|
||||
pokemonInfo: pokemonInfo,
|
||||
pokemonInfoContainer: pokemonInfoContainer,
|
||||
saveSlotSelectUiHandler: saveSlotSelectUiHandler,
|
||||
|
@ -29,6 +29,7 @@ import { move } from "./move";
|
||||
import { nature } from "./nature";
|
||||
import { pokeball } from "./pokeball";
|
||||
import { pokemon } from "./pokemon";
|
||||
import { fusionAffixes } from "./pokemon-fusion-affixes";
|
||||
import { pokemonInfo } from "./pokemon-info";
|
||||
import { pokemonInfoContainer } from "./pokemon-info-container";
|
||||
import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler";
|
||||
@ -74,6 +75,7 @@ export const esConfig = {
|
||||
nature: nature,
|
||||
pokeball: pokeball,
|
||||
pokemon: pokemon,
|
||||
fusionAffixes: fusionAffixes,
|
||||
pokemonInfo: pokemonInfo,
|
||||
pokemonInfoContainer: pokemonInfoContainer,
|
||||
saveSlotSelectUiHandler: saveSlotSelectUiHandler,
|
||||
|
@ -29,6 +29,7 @@ import { move } from "./move";
|
||||
import { nature } from "./nature";
|
||||
import { pokeball } from "./pokeball";
|
||||
import { pokemon } from "./pokemon";
|
||||
import { fusionAffixes } from "./pokemon-fusion-affixes";
|
||||
import { pokemonInfo } from "./pokemon-info";
|
||||
import { pokemonInfoContainer } from "./pokemon-info-container";
|
||||
import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler";
|
||||
@ -74,6 +75,7 @@ export const frConfig = {
|
||||
nature: nature,
|
||||
pokeball: pokeball,
|
||||
pokemon: pokemon,
|
||||
fusionAffixes: fusionAffixes,
|
||||
pokemonInfo: pokemonInfo,
|
||||
pokemonInfoContainer: pokemonInfoContainer,
|
||||
saveSlotSelectUiHandler: saveSlotSelectUiHandler,
|
||||
|
@ -29,6 +29,7 @@ import { move } from "./move";
|
||||
import { nature } from "./nature";
|
||||
import { pokeball } from "./pokeball";
|
||||
import { pokemon } from "./pokemon";
|
||||
import { fusionAffixes } from "./pokemon-fusion-affixes";
|
||||
import { pokemonInfo } from "./pokemon-info";
|
||||
import { pokemonInfoContainer } from "./pokemon-info-container";
|
||||
import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler";
|
||||
@ -74,6 +75,7 @@ export const itConfig = {
|
||||
nature: nature,
|
||||
pokeball: pokeball,
|
||||
pokemon: pokemon,
|
||||
fusionAffixes: fusionAffixes,
|
||||
pokemonInfo: pokemonInfo,
|
||||
pokemonInfoContainer: pokemonInfoContainer,
|
||||
saveSlotSelectUiHandler: saveSlotSelectUiHandler,
|
||||
|
@ -29,6 +29,7 @@ import { move } from "./move";
|
||||
import { nature } from "./nature";
|
||||
import { pokeball } from "./pokeball";
|
||||
import { pokemon } from "./pokemon";
|
||||
import { fusionAffixes } from "./pokemon-fusion-affixes";
|
||||
import { pokemonInfo } from "./pokemon-info";
|
||||
import { pokemonInfoContainer } from "./pokemon-info-container";
|
||||
import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler";
|
||||
@ -74,6 +75,7 @@ export const koConfig = {
|
||||
nature: nature,
|
||||
pokeball: pokeball,
|
||||
pokemon: pokemon,
|
||||
fusionAffixes: fusionAffixes,
|
||||
pokemonInfo: pokemonInfo,
|
||||
pokemonInfoContainer: pokemonInfoContainer,
|
||||
saveSlotSelectUiHandler: saveSlotSelectUiHandler,
|
||||
|
@ -32,6 +32,7 @@ import { nature } from "./nature";
|
||||
import { partyUiHandler } from "./party-ui-handler";
|
||||
import { pokeball } from "./pokeball";
|
||||
import { pokemon } from "./pokemon";
|
||||
import { fusionAffixes } from "./pokemon-fusion-affixes";
|
||||
import { pokemonInfo } from "./pokemon-info";
|
||||
import { pokemonInfoContainer } from "./pokemon-info-container";
|
||||
import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler";
|
||||
@ -75,6 +76,7 @@ export const ptBrConfig = {
|
||||
partyUiHandler: partyUiHandler,
|
||||
pokeball: pokeball,
|
||||
pokemon: pokemon,
|
||||
fusionAffixes: fusionAffixes,
|
||||
pokemonInfo: pokemonInfo,
|
||||
pokemonInfoContainer: pokemonInfoContainer,
|
||||
saveSlotSelectUiHandler: saveSlotSelectUiHandler,
|
||||
|
@ -29,6 +29,7 @@ import { move } from "./move";
|
||||
import { nature } from "./nature";
|
||||
import { pokeball } from "./pokeball";
|
||||
import { pokemon } from "./pokemon";
|
||||
import { fusionAffixes } from "./pokemon-fusion-affixes";
|
||||
import { pokemonInfo } from "./pokemon-info";
|
||||
import { pokemonInfoContainer } from "./pokemon-info-container";
|
||||
import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler";
|
||||
@ -74,6 +75,7 @@ export const zhCnConfig = {
|
||||
nature: nature,
|
||||
pokeball: pokeball,
|
||||
pokemon: pokemon,
|
||||
fusionAffixes: fusionAffixes,
|
||||
pokemonInfo: pokemonInfo,
|
||||
pokemonInfoContainer: pokemonInfoContainer,
|
||||
saveSlotSelectUiHandler: saveSlotSelectUiHandler,
|
||||
|
@ -29,6 +29,7 @@ import { move } from "./move";
|
||||
import { nature } from "./nature";
|
||||
import { pokeball } from "./pokeball";
|
||||
import { pokemon } from "./pokemon";
|
||||
import { fusionAffixes } from "./pokemon-fusion-affixes";
|
||||
import { pokemonInfo } from "./pokemon-info";
|
||||
import { pokemonInfoContainer } from "./pokemon-info-container";
|
||||
import { saveSlotSelectUiHandler } from "./save-slot-select-ui-handler";
|
||||
@ -74,6 +75,7 @@ export const zhTwConfig = {
|
||||
nature: nature,
|
||||
pokeball: pokeball,
|
||||
pokemon: pokemon,
|
||||
fusionAffixes: fusionAffixes,
|
||||
pokemonInfo: pokemonInfo,
|
||||
pokemonInfoContainer: pokemonInfoContainer,
|
||||
saveSlotSelectUiHandler: saveSlotSelectUiHandler,
|
||||
|
Loading…
Reference in New Issue
Block a user