[Hotfix][Bug] Retrieves the correct cry for Fused Pokemon (#4116)

* [DOCS] adding JSDocs to `arena.ts` (#3590)

* adding some docs

* Update src/field/pokemon.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* seems like battleStats changed to statStages

* Apply suggestions from code review

editing doc text

Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* Update tsdocs, convert comment to tsdoc in `pokemon.ts`

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>

* [Bug] Fix scrappy (+ some immunity move and ability) in inverse battle (#4067)

* fix scrappy + etc. update inverse battle test code

* update test code following request from swain

* fix and optimize imports (#4061)

- remove any `.js` extension imports
- remove unncessary dynamic imports of `modifier.ts` file. The file was being imported statically & dynamically. Made it pure static
- increase vite chunk-size warning limit

Co-authored-by: Mumble <171087428+frutescens@users.noreply.github.com>

* Fusion hotfix

* Revert "fix and optimize imports (#4061)"

This reverts commit 287d671cfd.

* Revert "[Bug] Fix scrappy (+ some immunity move and ability) in inverse battle (#4067)"

This reverts commit 9fd34c95d5.

* Revert "[DOCS] adding JSDocs to `arena.ts` (#3590)"

This reverts commit 0742efd196.

* typo

* Fixed fusionFaintCry to return correct cry

---------

Co-authored-by: DustinLin <39450497+DustinLin@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com>
Co-authored-by: Leo Kim <47556641+KimJeongSun@users.noreply.github.com>
Co-authored-by: frutescens <info@laptop>
This commit is contained in:
Mumble 2024-09-08 13:42:11 -07:00 committed by GitHub
parent 4a98c36427
commit 22c60ab532
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -2829,7 +2829,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} }
private fusionFaintCry(callback: Function): void { private fusionFaintCry(callback: Function): void {
const key = `cry/${this.getSpeciesForm().getCryKey(this.formIndex)}`; const key = `cry/${this.species.getCryKey(this.formIndex)}`;
let i = 0; let i = 0;
let rate = 0.85; let rate = 0.85;
const cry = this.scene.playSound(key, { rate: rate }) as AnySound; const cry = this.scene.playSound(key, { rate: rate }) as AnySound;
@ -2837,7 +2837,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
const tintSprite = this.getTintSprite(); const tintSprite = this.getTintSprite();
let duration = cry.totalDuration * 1000; let duration = cry.totalDuration * 1000;
const fusionCryKey = `cry/${this.getFusionSpeciesForm().getCryKey(this.fusionFormIndex)}`; const fusionCryKey = `cry/${this.fusionSpecies?.getCryKey(this.fusionFormIndex)}`;
let fusionCry = this.scene.playSound(fusionCryKey, { rate: rate }) as AnySound; let fusionCry = this.scene.playSound(fusionCryKey, { rate: rate }) as AnySound;
fusionCry.stop(); fusionCry.stop();
duration = Math.min(duration, fusionCry.totalDuration * 1000); duration = Math.min(duration, fusionCry.totalDuration * 1000);