pokerogue icon indicating copy to clipboard operation
pokerogue copied to clipboard

Secondary fusion component evolution moves can't be learned nor remembered

Open Flashfyre opened this issue 9 months ago • 1 comments

Level '0' learnset moves are not learned on evolution nor can they be remembered via Memory Mushroom

Flashfyre avatar May 06 '24 00:05 Flashfyre

I ran into this as well; in this case, a Volcarona fusion could not remember Quiver Dance.

ArbitraryCuriosity avatar May 07 '24 00:05 ArbitraryCuriosity

After running into this issue I looked into the code, and it seems like it's a simple fix (for the item) by copying/modifying a bit of logic in src/field/pokemon.ts from: https://github.com/pagefaultgames/pokerogue/blob/50c1f8aee461a45d8f69de8f02a452a34b59f78b/src/field/pokemon.ts#L1168-L1182 to:

if (this.fusionSpecies) {
  const evolutionLevelMoves = levelMoves.slice(0, Math.max(levelMoves.findIndex(lm => !!lm[0]), 0));
  const fusionLevelMoves = this.getFusionSpeciesForm(true).getLevelMoves();
  // here [
  const fusionEvolutionLevelMoves = fusionLevelMoves.slice(0, Math.max(fusionLevelMoves.findIndex(flm => !!flm[0]), 0));
  // ]
  const newLevelMoves: LevelMoves = [];
  while (levelMoves.length && levelMoves[0][0] < startingLevel) {
    levelMoves.shift();
  }
  while (fusionLevelMoves.length && fusionLevelMoves[0][0] < startingLevel) { 
    fusionLevelMoves.shift();
  }
  if (includeEvolutionMoves) {
    for (const elm of evolutionLevelMoves.reverse()) {
      levelMoves.unshift(elm);
    }
    // and here [
    for (const felm of fusionEvolutionLevelMoves.reverse()) {
      fusionLevelMoves.unshift(felm);
    }
    // ]
  }

Testing this change did indeed seem to fix the issue (though only for the Memory Mushroom item, I haven't looked into the level up logic yet):

image

Am I missing something or is this correct?

DayKev avatar Jun 03 '24 08:06 DayKev

Oh apparently that fixes evolution not letting you learn the move either, after looking at the evolution logic it seemed to lead to the same place and testing it confirmed that it does fix both.

DayKev avatar Jun 04 '24 02:06 DayKev