From 5e12109e40a0fe4aedf430fa591d4f39d3b97a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Fri, 2 Nov 2018 10:46:12 +0900 Subject: [PATCH] Add: add time bonus if all meat was welldone --- src/game/lib/stage_timer.js | 3 +++ src/game/mouse/grilled_meat/game.js | 20 ++++++++++++++++++-- src/game/mouse/grilled_meat/meat.js | 1 + 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/game/lib/stage_timer.js b/src/game/lib/stage_timer.js index 24c73c6..57693a0 100644 --- a/src/game/lib/stage_timer.js +++ b/src/game/lib/stage_timer.js @@ -82,6 +82,9 @@ StageTimer.prototype.addTime = function(timeSec) { } StageTimer.prototype.addBonusTime = function(timeSec) { + if(timeSec == 0) + return; + this.addTime(timeSec); game.world.bringToTop(this.bonusTimeText); diff --git a/src/game/mouse/grilled_meat/game.js b/src/game/mouse/grilled_meat/game.js index cbc1d10..4185a1d 100644 --- a/src/game/mouse/grilled_meat/game.js +++ b/src/game/mouse/grilled_meat/game.js @@ -107,6 +107,7 @@ var Game = { this.gameTimeEvents = []; this.meatCount; + this.badMeatCount = 0; }, @@ -157,6 +158,7 @@ var Game = { startStage: function() { this.clearedMeatCount = 0; + this.badMeatCount = 0; this.activatedMeatCount = this.getStageMeatCount(); this.serveMeats(); }, @@ -184,8 +186,20 @@ var Game = { } }, + getScore: function() { + return this.playingStageNo * 10; + }, + getBonusTime: function() { - return this.playingStageNo * 4; + if(this.badMeatCount > 0) + return 0; + + if(this.playingStageNo == 1) + return 5; + else if(this.playingStageNo == 2) + return 7; + else + return 6 + this.playingStageNo; }, @@ -234,12 +248,14 @@ var Game = { if(meat.getMeatGrade() == Meat.DONENESS_WELLDONE) { this.god.animateHappy(Meat.DONENESS_WELLDONE); // "맛있어♥♡♥"); - var score = 10 * this.playingStageNo; + var score = this.getScore(); this.scoreManager.plusScore(score); var tempPlusScore = new PlusScore(this.god.x, this.god.y - 180, score); this.plusScoreGroup.add(tempPlusScore); } else { + this.badMeatCount++; + if(meat.getMeatGrade() == Meat.DONENESS_RARE) { this.god.animateAngry(Meat.DONENESS_RARE); // "날고기 싫어!!!"); } else { // Meat.DONENESS_BURN_BLACK diff --git a/src/game/mouse/grilled_meat/meat.js b/src/game/mouse/grilled_meat/meat.js index 0ec038f..09e800c 100644 --- a/src/game/mouse/grilled_meat/meat.js +++ b/src/game/mouse/grilled_meat/meat.js @@ -202,6 +202,7 @@ Meat.prototype.show = function() { Meat.prototype.hide = function() { this.isActivated = false; this.alpha = 0; + this.stopCook(); } Meat.prototype.startCook = function() {