[Bug] Allow second mon of a fusion to learn/remember on-evo moves (#1778)

Fixes #520
This commit is contained in:
NightKev 2024-06-05 07:36:42 -07:00 committed by GitHub
parent dce4518b93
commit 395fa6e33d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -1168,6 +1168,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (this.fusionSpecies) {
const evolutionLevelMoves = levelMoves.slice(0, Math.max(levelMoves.findIndex(lm => !!lm[0]), 0));
const fusionLevelMoves = this.getFusionSpeciesForm(true).getLevelMoves();
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();
@ -1179,6 +1180,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
for (const elm of evolutionLevelMoves.reverse()) {
levelMoves.unshift(elm);
}
for (const felm of fusionEvolutionLevelMoves.reverse()) {
fusionLevelMoves.unshift(felm);
}
}
for (let l = includeEvolutionMoves ? 0 : startingLevel; l <= this.level; l++) {
if (l === 1 && startingLevel > 1) {