diff --git a/src/classes/Move.ts b/src/classes/Move.ts index 7598c3a..ba218bc 100644 --- a/src/classes/Move.ts +++ b/src/classes/Move.ts @@ -33,22 +33,24 @@ export default class Moves extends Masterfile { data: { moveSettings }, } = object try { - const id: number = - Rpc.HoloPokemonMove[templateId.substring(11) as MoveProto] + const isMax = templateId.startsWith('VN_BM_') + const proto = isMax ? templateId : templateId.substring(11) + const id = Rpc.HoloPokemonMove[proto as MoveProto] if (id || id === 0) { if (!this.parsedMoves[id]) { this.parsedMoves[id] = { moveId: id, moveName: this.capitalize( - templateId.substring(11).replace('_FAST', ''), + isMax ? moveSettings.vfxName : proto.replace('_FAST', '') ), - proto: templateId.substring(11), + proto, fast: templateId.endsWith('_FAST'), } } this.parsedMoves[id].type = Rpc.HoloPokemonType[moveSettings.pokemonType as TypeProto] - this.parsedMoves[id].power = moveSettings.power + this.parsedMoves[id].power = isMax + ? moveSettings.obMoveSettingsNumber18[2] : moveSettings.power this.parsedMoves[id].durationMs = moveSettings.durationMs this.parsedMoves[id].energyDelta = moveSettings.energyDelta } diff --git a/src/classes/Pokemon.ts b/src/classes/Pokemon.ts index 6c47dd3..236a9fd 100644 --- a/src/classes/Pokemon.ts +++ b/src/classes/Pokemon.ts @@ -978,6 +978,45 @@ export default class Pokemon extends Masterfile { } } + addSourdoughMoveMappings({ data: { + sourdoughMoveMappingSettings: { mappings } + } }: NiaMfObj) { + for (let i = 0; i < mappings.length; i += 1) try { + let id = Rpc.HoloPokemonId[ + mappings[i].pokemonId as PokemonIdProto + ] + if (!this.parsedPokemon[id]) { + this.parsedPokemon[id] = {} + } + let target = this.parsedPokemon[id] + if (mappings[i].form) { + let formId = Rpc.PokemonDisplayProto.Form[mappings[i].form as FormProto] + if (!this.parsedPokemon[id].forms) { + this.parsedPokemon[id].forms = [] + } + const formName = this.formName(id, mappings[i].form) + if (!this.skipForms(formName)) { + this.parsedForms[formId] = { + ...this.parsedForms[formId], + formName, + formId, + } + if (!this.parsedPokemon[id].forms.includes(formId)) { + this.parsedPokemon[id].forms.push(formId) + } + target = this.parsedForms[formId] + } + } + target.gmaxMove = Rpc.HoloPokemonMove[mappings[i].move as MoveProto] + } catch (e) { + console.warn( + e, + `Failed to parse gmax move mapping #${i}`, + JSON.stringify(mappings[i], null, 2), + ) + } + } + missingPokemon() { Object.values(Rpc.HoloPokemonId).forEach((id) => { try { diff --git a/src/index.ts b/src/index.ts index 5b68565..f6b3872 100644 --- a/src/index.ts +++ b/src/index.ts @@ -35,7 +35,7 @@ export async function generate({ const final: FinalResult = {} const urlToFetch = url || - 'https://raw.githubusercontent.com/PokeMiners/game_masters/master/latest/latest.json' + 'https://raw.githubusercontent.com/alexelgt/game_masters/refs/heads/master/GAME_MASTER.json' const { pokemon, types, @@ -91,6 +91,8 @@ export async function generate({ AllPokemon.addForm(data[i]) } else if (data[i].data.pokemonSettings) { AllPokemon.addPokemon(data[i]) + } else if (data[i].data.sourdoughMoveMappingSettings) { + AllPokemon.addSourdoughMoveMappings(data[i]) } else if (data[i].data.itemSettings) { AllItems.addItem(data[i]) } else if (data[i].data.moveSettings) { @@ -305,6 +307,7 @@ export async function generate({ forms: localForms, itemRequirement: localItems, questRequirement: localEvolutionQuests, + // TODO gmaxMove }) if (pokemon.options.includeRawForms || raw) { final.forms = localForms diff --git a/src/typings/dataTypes.ts b/src/typings/dataTypes.ts index b5ea4c1..addaa99 100644 --- a/src/typings/dataTypes.ts +++ b/src/typings/dataTypes.ts @@ -152,6 +152,7 @@ interface SingleForm extends BaseStats { costumeName: string }[] sizeSettings?: { name: string; value: number }[] + gmaxMove?: number } export interface TempEvolutions extends BaseStats { diff --git a/src/typings/general.ts b/src/typings/general.ts index 08c801b..4ef77db 100644 --- a/src/typings/general.ts +++ b/src/typings/general.ts @@ -84,9 +84,11 @@ export interface NiaMfObj { moveSettings?: { movementId: string pokemonType: string - power: number + power?: number durationMs: number - energyDelta: number + energyDelta?: number + vfxName: string + obMoveSettingsNumber18: number[] } combatMove?: { uniqueId: string | number @@ -102,6 +104,13 @@ export interface NiaMfObj { buffActivationChance: number }[] } + sourdoughMoveMappingSettings?: { + mappings: { + pokemonId: string + form?: string + move: string + }[] + } itemSettings?: { itemId: string | number itemType: string | number diff --git a/src/typings/inputs.ts b/src/typings/inputs.ts index aee828f..4518a81 100644 --- a/src/typings/inputs.ts +++ b/src/typings/inputs.ts @@ -127,6 +127,7 @@ interface Form extends BaseStats { transferable?: boolean costumeOverrideEvos?: CostumeOverrideEvo | StringBool sizeSettings?: { name: boolean; value: boolean } | string + gmaxMove?: Move | StringBool } type CostumeOverrideEvo = {