Adjust game volume

This commit is contained in:
Flashfyre committed 2023-10-21 08:58:39 -04:00
1 parent c2cb433409
commit 96a15ccb0d
13 files changed
+62 -49

No files matched your search

+2 -2
View File
@@ -273,7 +273,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
}
let duration = this.visible && !instant ? ((levelExp - this.lastLevelExp) / relLevelExp) * 1650 : 0;
if (duration)
this.scene.sound.play('exp');
(this.scene as BattleScene).playSound('exp');
this.scene.tweens.add({
targets: this.expBar,
ease: 'Sine.easeIn',
@@ -289,7 +289,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
if (ratio === 1) {
this.lastLevelExp = 0;
this.lastLevel++;
this.scene.sound.play('level_up');
(this.scene as BattleScene).playSound('level_up');
this.setLevel(this.lastLevel);
this.scene.time.delayedCall(500, () => {
this.expBar.setScale(0, 1);
+1 -1
View File
@@ -72,7 +72,7 @@ export default abstract class MessageUiHandler extends AwaitableUiHandler {
this.message.setText(text.slice(0, charIndex));
const advance = () => {
if (charSound)
this.scene.sound.play(charSound);
this.scene.playSound(charSound);
if (callback && !this.textTimer.repeatCount) {
if (callbackDelay && !prompt) {
this.textCallbackTimer = this.scene.time.delayedCall(callbackDelay, () => {
+3 -3
View File
@@ -313,7 +313,7 @@ class ModifierOption extends Phaser.GameObjects.Container {
return;
const value = t.getValue();
if (!bounce && value > lastValue) {
this.scene.sound.play('pb_bounce_1', { volume: 1 / ++bounceCount });
(this.scene as BattleScene).playSound('pb_bounce_1', { volume: 1 / ++bounceCount });
bounce = true;
} else if (bounce && value < lastValue)
bounce = false;
@@ -323,7 +323,7 @@ class ModifierOption extends Phaser.GameObjects.Container {
if (this.modifierTypeOption.upgraded) {
this.scene.time.delayedCall(remainingDuration, () => {
this.scene.sound.play('upgrade');
(this.scene as BattleScene).playSound('upgrade');
this.pbTint.setPosition(this.pb.x, this.pb.y);
this.pbTint.setTintFill(0xFFFFFF);
this.pbTint.setAlpha(0);
@@ -354,7 +354,7 @@ class ModifierOption extends Phaser.GameObjects.Container {
return;
this.pb.setTexture('pb', `${this.getPbAtlasKey(false)}_open`);
this.scene.sound.play('pb_rel');
(this.scene as BattleScene).playSound('pb_rel');
this.scene.tweens.add({
targets: this.pb,
+2 -2
View File
@@ -55,7 +55,7 @@ export default class PokeballTray extends Phaser.GameObjects.Container {
ball.setFrame(ballFrame);
});
this.scene.sound.play('pb_tray_enter');
(this.scene as BattleScene).playSound('pb_tray_enter');
this.scene.tweens.add({
targets: this,
@@ -69,7 +69,7 @@ export default class PokeballTray extends Phaser.GameObjects.Container {
x: `${this.player ? '-' : '+'}=104`,
duration: b * 100,
ease: 'Sine.easeIn',
onComplete: () => this.scene.sound.play(b < party.length ? 'pb_tray_ball' : 'pb_tray_empty')
onComplete: () => (this.scene as BattleScene).playSound(b < party.length ? 'pb_tray_ball' : 'pb_tray_empty')
});
});
}
+1 -1
View File
@@ -325,7 +325,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
if (this.canCycleShiny) {
this.setSpeciesDetails(this.lastSpecies, !this.shinyCursor, undefined, undefined, undefined);
if (this.shinyCursor)
this.scene.sound.play('sparkle');
this.scene.playSound('sparkle');
else
success = true;
}
+2 -2
View File
@@ -129,11 +129,11 @@ export default class UI extends Phaser.GameObjects.Container {
}
playSelect(): void {
this.scene.sound.play('select');
(this.scene as BattleScene).playSound('select');
}
playError(): void {
this.scene.sound.play('error');
(this.scene as BattleScene).playSound('error');
}
fadeOut(duration: integer): Promise<void> {