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.
This commit is contained in:
Landon Lee 2024-05-12 03:01:59 -05:00 committed by GitHub
parent d5f82611f5
commit a27822b624
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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