diff --git a/src/components/Customer.ts b/src/components/Customer.ts index d6be6bc..5dabe72 100644 --- a/src/components/Customer.ts +++ b/src/components/Customer.ts @@ -154,6 +154,17 @@ export class Customer extends Button { this.angryImage.setVisible(this.patience <= 0.5); if (this.patience <= 0) { + if(this.hasCompleted){ + if(Math.random()>0.2){ + this.scene.sound.play("cashmoney"); + this.scene.addEffect(new TextEffect(this.scene, this.x-70+(Math.random()*80), this.y-80, "+" + this.moneySpent +" €", "yellow", 40, true, "red", 800, 100, 0.7, 0)); + this.emit("pay", this.moneySpent); + } else { + this.scene.sound.play("fail"); + } + } else { + this.scene.sound.play("fail"); + } this.leave(); this.thoughtBubble.showSymbol("sad"); this.emit("angry"); diff --git a/src/scenes/GameScene.ts b/src/scenes/GameScene.ts index 931713a..ed3f541 100644 --- a/src/scenes/GameScene.ts +++ b/src/scenes/GameScene.ts @@ -307,8 +307,8 @@ export class GameScene extends BaseScene { } endDay() { + //this.stations.forEach((s) => s.returnItems()); this.employees.forEach((e) => e.walkTo(e.startX, e.startY)); - this.setState(GameState.Shopping); }