From 5627e112cb8c2ac9f347c4797d2bc36e4b78fd5a Mon Sep 17 00:00:00 2001 From: Golen Date: Tue, 20 Aug 2024 14:23:41 +0200 Subject: [PATCH] Adjust volumes --- src/components/Customer.ts | 3 ++- src/components/Employee.ts | 4 ---- src/components/Intermission.ts | 2 ++ src/components/Inventory.ts | 10 +++++----- src/components/ShopInventory.ts | 12 ++++++------ src/components/Station.ts | 24 ++++++++++++------------ src/scenes/GameScene.ts | 9 ++++++--- 7 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/components/Customer.ts b/src/components/Customer.ts index dc52ec7..66ea66a 100644 --- a/src/components/Customer.ts +++ b/src/components/Customer.ts @@ -292,7 +292,7 @@ export class Customer extends Button { this.emit("pickup"); this.dragged = true; this.sprite.setTexture(this.spriteKeys.sit); - this.scene.sound.play("grab", { volume: 0.5 }); + this.scene.sound.play("grab", { volume: 0.4 }); } onDrag(pointer: Phaser.Input.Pointer, dragX: number, dragY: number) { @@ -385,6 +385,7 @@ export class Customer extends Button { this.sprite.setTexture(this.spriteKeys.sit); this.sprite.flipX = false; this.hasEnteredShop = true; + this.scene.sound.play("letgo1", { volume: 0.2 }); this.emit("seated"); }, }); diff --git a/src/components/Employee.ts b/src/components/Employee.ts index 69246c1..a03d89f 100644 --- a/src/components/Employee.ts +++ b/src/components/Employee.ts @@ -75,10 +75,6 @@ export class Employee extends Button { } setCustomer(customer: Customer | null) { - if (customer) { - this.scene.sound.play("sqk"); - } - this.currentCustomer = customer; if(this.currentCustomer){ if(this.currentCustomer.currentStation) { diff --git a/src/components/Intermission.ts b/src/components/Intermission.ts index c382379..abbfb81 100644 --- a/src/components/Intermission.ts +++ b/src/components/Intermission.ts @@ -146,6 +146,8 @@ export class Intermission extends Phaser.GameObjects.Container { } proceed() { + this.scene.sound.play("scroll", { volume: 0.3 }); + switch (this.mode) { case Mode.IntroCutscene1: this.setMode(Mode.IntroCutscene2); diff --git a/src/components/Inventory.ts b/src/components/Inventory.ts index 7ad5619..b2ed58c 100644 --- a/src/components/Inventory.ts +++ b/src/components/Inventory.ts @@ -84,7 +84,7 @@ export class Inventory extends Phaser.GameObjects.Container { highlight(id: number){ this.title.setText(this.itemList[id].name + " x" + this.itemList[id].quant); this.tdisplay.setText(this.itemList[id].desc); - this.scene.sound.play("scroll"); + this.scene.sound.play("scroll", {volume: 0.5}); this.highlightIndex = id; } @@ -136,7 +136,7 @@ export class Inventory extends Phaser.GameObjects.Container { } close(){ - this.scene.sound.play("t_rustle"); + this.scene.sound.play("t_rustle", {volume: 0.5}); this.display.forEach((ib) => ib.destroy()); this.setPosition(-650,0); this.isOpen=false; @@ -149,7 +149,7 @@ export class Inventory extends Phaser.GameObjects.Container { } open(){ - this.scene.sound.play("t_rustle"); + this.scene.sound.play("t_rustle", {volume: 0.5}); this.window.setVisible(true); //console.log("Open Processed"); this.x = 0; @@ -163,7 +163,7 @@ export class Inventory extends Phaser.GameObjects.Container { //console.log("STATE: " + this.isOpen + " ID: " + id + " HIGHLIGHT: " + this.highlightIndex); if(this.isOpen){ if((this.highlightIndex >=0) && (id==this.highlightIndex)){ - //this.scene.sound.play("meme_explosion_sound"); + //this.scene.sound.play("meme_explosion_sound", {volume: 0.5}); this.updateAmountText(id,this.itemList[id].quant); } } @@ -209,7 +209,7 @@ export class Inventory extends Phaser.GameObjects.Container { } this.title.setText(""); this.tdisplay.setText(""); - this.scene.sound.play("button"); + this.scene.sound.play("button", {volume: 0.5}); this.repopulate(); } diff --git a/src/components/ShopInventory.ts b/src/components/ShopInventory.ts index d60dcae..6397301 100644 --- a/src/components/ShopInventory.ts +++ b/src/components/ShopInventory.ts @@ -135,7 +135,7 @@ export class ShopInventory extends Phaser.GameObjects.Container { this.tdisplay.setVisible(true); this.title.setText(this.itemList[id].name); this.tdisplay.setText(this.itemList[id].desc); - this.scene.sound.play("scroll"); + this.scene.sound.play("scroll", {volume: 0.5}); this.highlightIndex = id; this.updateInvDisp(id); this.updateButtons(id); @@ -150,7 +150,7 @@ export class ShopInventory extends Phaser.GameObjects.Container { let pr = nr*this.itemList[this.highlightIndex].price; if(pr > this.scene.money) { - this.scene.sound.play("fail"); + this.scene.sound.play("fail", {volume: 0.5}); return; } @@ -318,7 +318,7 @@ export class ShopInventory extends Phaser.GameObjects.Container { } close(){ - this.scene.sound.play("t_rustle"); + this.scene.sound.play("t_rustle", {volume: 0.5}); this.display.forEach((ib) => ib.destroy()); this.setPosition(-650,0); this.isOpen=false; @@ -334,7 +334,7 @@ export class ShopInventory extends Phaser.GameObjects.Container { } open(){ - this.scene.sound.play("t_rustle"); + this.scene.sound.play("t_rustle", {volume: 0.5}); this.window.setVisible(true); //console.log("Open Processed"); this.x = 0; @@ -351,7 +351,7 @@ export class ShopInventory extends Phaser.GameObjects.Container { //console.log("STATE: " + this.isOpen + " ID: " + id + " HIGHLIGHT: " + this.highlightIndex); if(this.isOpen){ if((this.highlightIndex >=0) && (id==this.highlightIndex)){ - //this.scene.sound.play("meme_explosion_sound"); + //this.scene.sound.play("meme_explosion_sound", {volume: 0.5}); this.updateAmountText(id,this.itemList[id].quant); } } @@ -377,7 +377,7 @@ export class ShopInventory extends Phaser.GameObjects.Container { } this.title.setText(""); this.tdisplay.setText(""); - this.scene.sound.play("button"); + this.scene.sound.play("button", {volume: 0.5}); this.clearPriceDisp(); this.hideInvDisp(); this.disableAllBuyButtons(); diff --git a/src/components/Station.ts b/src/components/Station.ts index 9040c7f..bb499fc 100644 --- a/src/components/Station.ts +++ b/src/components/Station.ts @@ -131,7 +131,7 @@ export class Station extends Button { : (this.taskHaste *= 1); this.parseItems(); if (this.queueFail) { - this.scene.sound.play("rip"); + this.scene.sound.play("rip", { volume: 0.5 }); } else { this.playJingle(); } @@ -198,7 +198,7 @@ export class Station extends Button { 0 ) ); - this.scene.sound.play("crit"); + this.scene.sound.play("crit", { volume: 0.5 }); if (this.currentCustomer) { this.currentCustomer.happinessBonus += 0.75; this.currentCustomer.recheckHappiness(); @@ -227,16 +227,16 @@ export class Station extends Button { this.sprite.input!.enabled = value; } - pauseClickable(){ - if(!(this.sprite.input!.enabled)){ + pauseClickable() { + if (!this.sprite.input!.enabled) { this.jolteon = true; } else { this.sprite.input!.enabled = false; } } - resumeClickable(){ - if(this.jolteon) { + resumeClickable() { + if (this.jolteon) { this.jolteon = false; } else { this.sprite.input!.enabled = true; @@ -244,7 +244,7 @@ export class Station extends Button { } upgrade() { - // this.scene.sound.play("upgrade"); + // this.scene.sound.play("upgrade", {volume: 0.5 }); if (!this.hasBeenPurchased) { this.hasBeenPurchased = true; @@ -312,23 +312,23 @@ export class Station extends Button { this.appliedItems = []; this.appliedSprites = []; - this.scene.sound.play("return"); + this.scene.sound.play("return", { volume: 0.5 }); this.clearButton.setVisible(false); - //this.scene.sound.play("meme_explosion_sound"); + //this.scene.sound.play("meme_explosion_sound", {volume: 0.5 }); } playJingle() { switch (this.stationType) { case StationType.ScalePolish: { - this.scene.sound.play("polish"); + this.scene.sound.play("polish", { volume: 0.5 }); break; } case StationType.GoldBath: { - this.scene.sound.play("goldbath"); + this.scene.sound.play("goldbath", { volume: 0.5 }); break; } case StationType.HornAndNails: { - this.scene.sound.play("snip"); + this.scene.sound.play("snip", { volume: 0.5 }); break; } } diff --git a/src/scenes/GameScene.ts b/src/scenes/GameScene.ts index e71609a..e19fd4c 100644 --- a/src/scenes/GameScene.ts +++ b/src/scenes/GameScene.ts @@ -312,7 +312,7 @@ export class GameScene extends BaseScene { this.loadLevel(LevelId.Level1); this.setState(GameState.Shopping); // this.startDay(); - this.intermission.fadeToGame(); // Comment this out to see cutscenes + // this.intermission.fadeToGame(); // Comment this out to see cutscenes this.pauseInvButton(); } @@ -505,13 +505,13 @@ export class GameScene extends BaseScene { onStart: () => { this.attemptSpawnCustomer(); - this.sound.play("endday", { volume: 0.4 }); + this.sound.play("endday", { volume: 0.2 }); }, onUpdate: (tween) => { this.ui.setTimeOfDay(1 - this.timeOfDay / 100); }, onComplete: () => { - this.sound.play("endday", { volume: 0.4 }); + this.sound.play("endday", { volume: 0.2 }); }, }); } @@ -864,6 +864,7 @@ export class GameScene extends BaseScene { customer.setRequest(null); customer.setEmployee(closestEmployee); closestEmployee.setCustomer(customer); + this.sound.play("crit", { volume: 0.5 }); const start = this.board.coordToNav(closestEmployee.x, closestEmployee.y); const goal = this.board.coordToNav(station.x, station.y); @@ -897,6 +898,8 @@ export class GameScene extends BaseScene { ); closestEmployee.walk(path); } + } else { + this.sound.play("sqk", { volume: 0.6 }); } }