mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 06:49:35 +02:00
Apply suggestions from code review
Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
This commit is contained in:
parent
b0e511ade3
commit
785c04a4b4
@ -3214,7 +3214,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
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;
|
||||||
if (!cry || this.scene.fieldVolume === 0) {
|
if (!cry || this.scene.fieldVolume === 0) {
|
||||||
return;
|
return callback();
|
||||||
}
|
}
|
||||||
const sprite = this.getSprite();
|
const sprite = this.getSprite();
|
||||||
const tintSprite = this.getTintSprite();
|
const tintSprite = this.getTintSprite();
|
||||||
@ -3280,7 +3280,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
const fusionCryKey = this.fusionSpecies!.getCryKey(this.fusionFormIndex);
|
const fusionCryKey = 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;
|
||||||
if (!cry || !fusionCry || this.scene.fieldVolume === 0) {
|
if (!cry || !fusionCry || this.scene.fieldVolume === 0) {
|
||||||
return;
|
return callback();
|
||||||
}
|
}
|
||||||
fusionCry.stop();
|
fusionCry.stop();
|
||||||
duration = Math.min(duration, fusionCry.totalDuration * 1000);
|
duration = Math.min(duration, fusionCry.totalDuration * 1000);
|
||||||
@ -3325,7 +3325,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
if (i === transitionIndex && fusionCryKey) {
|
if (i === transitionIndex && fusionCryKey) {
|
||||||
SoundFade.fadeOut(this.scene, cry, Utils.fixedInt(Math.ceil((duration / rate) * 0.2)));
|
SoundFade.fadeOut(this.scene, cry, Utils.fixedInt(Math.ceil((duration / rate) * 0.2)));
|
||||||
fusionCry = this.scene.playSound(fusionCryKey, Object.assign({ seek: Math.max(fusionCry.totalDuration * 0.4, 0), rate: rate }));
|
fusionCry = this.scene.playSound(fusionCryKey, Object.assign({ seek: Math.max(fusionCry.totalDuration * 0.4, 0), rate: rate }));
|
||||||
SoundFade.fadeIn(this.scene, fusionCry, Utils.fixedInt(Math.ceil((duration / rate) * 0.2)), this.scene.masterVolume * this.scene.seVolume, 0);
|
SoundFade.fadeIn(this.scene, fusionCry, Utils.fixedInt(Math.ceil((duration / rate) * 0.2)), this.scene.masterVolume * this.scene.fieldVolume, 0);
|
||||||
}
|
}
|
||||||
rate *= 0.99;
|
rate *= 0.99;
|
||||||
if (cry && !cry.pendingRemove) {
|
if (cry && !cry.pendingRemove) {
|
||||||
|
Loading…
Reference in New Issue
Block a user