Fix cry when pokemon is fused with its own species

If the pokemon species and form is the same as the second fusion component, then skip the logic to make a fused cry and just use the cry of the primary component.
pull/615/head
Landon Lee 2024-05-07 15:46:00 -05:00
parent 08067d9937
commit 18c7824033
1 changed files with 2 additions and 2 deletions

View File

@ -1712,7 +1712,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
const scene = sceneOverride || this.scene; const scene = sceneOverride || this.scene;
const cry = this.getSpeciesForm().cry(scene, soundConfig); const cry = this.getSpeciesForm().cry(scene, soundConfig);
let duration = cry.totalDuration * 1000; let duration = cry.totalDuration * 1000;
if (this.fusionSpecies) { if (this.fusionSpecies && this.getSpeciesForm() != this.getFusionSpeciesForm()) {
let fusionCry = this.getFusionSpeciesForm().cry(scene, soundConfig, true); let fusionCry = this.getFusionSpeciesForm().cry(scene, soundConfig, true);
duration = Math.min(duration, fusionCry.totalDuration * 1000); duration = Math.min(duration, fusionCry.totalDuration * 1000);
fusionCry.destroy(); fusionCry.destroy();
@ -1731,7 +1731,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} }
faintCry(callback: Function): void { faintCry(callback: Function): void {
if (this.fusionSpecies) if (this.fusionSpecies && this.getSpeciesForm() != this.getFusionSpeciesForm())
return this.fusionFaintCry(callback); return this.fusionFaintCry(callback);
const key = this.getSpeciesForm().getCryKey(this.formIndex); const key = this.getSpeciesForm().getCryKey(this.formIndex);