From da8629164e4e11c79476d9b27a18cfe409f8298e Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Mon, 5 Jun 2023 11:39:49 -0400 Subject: [PATCH] Fix some bugs --- src/battle-phases.ts | 10 ++++++---- src/pipelines/sprite.ts | 2 +- src/pokemon.ts | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/battle-phases.ts b/src/battle-phases.ts index dc44b005cec..655189d53f4 100644 --- a/src/battle-phases.ts +++ b/src/battle-phases.ts @@ -1877,10 +1877,12 @@ export class GameOverPhase extends BattlePhase { } end(): void { - if (!this.scene.gameData.unlocks[Unlockables.ENDLESS_MODE]) - this.scene.unshiftPhase(new UnlockPhase(this.scene, Unlockables.ENDLESS_MODE)); - if (!this.scene.gameData.unlocks[Unlockables.MINI_BLACK_HOLE]) - this.scene.unshiftPhase(new UnlockPhase(this.scene, Unlockables.MINI_BLACK_HOLE)); + if (this.victory) { + if (!this.scene.gameData.unlocks[Unlockables.ENDLESS_MODE]) + this.scene.unshiftPhase(new UnlockPhase(this.scene, Unlockables.ENDLESS_MODE)); + if (!this.scene.gameData.unlocks[Unlockables.MINI_BLACK_HOLE]) + this.scene.unshiftPhase(new UnlockPhase(this.scene, Unlockables.MINI_BLACK_HOLE)); + } super.end(); } diff --git a/src/pipelines/sprite.ts b/src/pipelines/sprite.ts index 3a02ece1d67..541d51e1ac2 100644 --- a/src/pipelines/sprite.ts +++ b/src/pipelines/sprite.ts @@ -179,7 +179,7 @@ export default class SpritePipeline extends Phaser.Renderer.WebGL.Pipelines.Mult const baseY = (sprite.parentContainer instanceof Pokemon ? sprite.parentContainer.y : sprite.y + sprite.height / 2) * 6; - const bottomPadding = Math.ceil(sprite.height * 6 * 0.05); + const bottomPadding = Math.ceil(sprite.height * 0.05) * 6; const yDelta = (baseY - y1) / 6; y2 = y1 = baseY + bottomPadding; const pixelHeight = (v1 - v0) / sprite.frame.height; diff --git a/src/pokemon.ts b/src/pokemon.ts index d8d07ff8c61..08a4ab6161a 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -854,7 +854,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { frameProgress -= frameThreshold; } const crySound = this.scene.sound.get(key); - if (crySound) { + if (crySound && !crySound.pendingRemove) { rate *= 0.99; crySound.play({ rate: rate,