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