Skip to content

Commit

Permalink
Fix mistimed sound effect in LearnMovePhase
Browse files Browse the repository at this point in the history
  • Loading branch information
innerthunder committed Oct 21, 2024
1 parent 75a114a commit ad070dd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/phases/learn-move-phase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,16 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
pokemon.setMove(index, this.moveId);
initMoveAnim(this.scene, this.moveId).then(() => {
loadMoveAnimAssets(this.scene, [ this.moveId ], true);
this.scene.playSound("level_up_fanfare"); // Sound loaded into game as is
});
this.scene.ui.setMode(this.messageMode);
const learnMoveText = i18next.t("battle:learnMove", { pokemonName: getPokemonNameWithAffix(pokemon), moveName: move.name });
textMessage = textMessage ? textMessage + "$" + learnMoveText : learnMoveText;
await this.scene.ui.showTextPromise(textMessage, this.messageMode === Mode.EVOLUTION_SCENE ? 1000 : undefined, true);
this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeMoveLearnedTrigger, true);
this.end();
if (textMessage) {
await this.scene.ui.showTextPromise(textMessage);
}
this.scene.playSound("level_up_fanfare"); // Sound loaded into game as is
this.scene.ui.showText(learnMoveText, null, () => {
this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeMoveLearnedTrigger, true);
this.end();
}, this.messageMode === Mode.EVOLUTION_SCENE ? 1000 : undefined, true);
}
}

0 comments on commit ad070dd

Please sign in to comment.