From 9a9bc2869c1ea21621f6a3a1a34ab088b9a8294d Mon Sep 17 00:00:00 2001 From: LoveEevee Date: Sat, 29 Feb 2020 19:50:28 +0300 Subject: [PATCH] [PATCH] Fix big notes being hit for a short time --- public/src/js/game.js | 40 +++++++++++++++++++++------------------- public/src/js/strings.js | 6 +++--- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/public/src/js/game.js b/public/src/js/game.js index 3b038a1..60c02da 100644 --- a/public/src/js/game.js +++ b/public/src/js/game.js @@ -31,7 +31,6 @@ class Game{ this.branchNames = ["normal", "advanced", "master"] this.resetSection() this.gameLagSync = !this.controller.touchEnabled && !(/Firefox/.test(navigator.userAgent)) - this.lastPressedKeys = [false, false, false, false] assets.songs.forEach(song => { if(song.id == selectedSong.folder){ @@ -105,7 +104,9 @@ class Game{ circle.beatMSCopied = true } } - if(ms > endTime){ + if(circle.daiFailed && (ms >= circle.daiFailed.ms + this.rules.daiLeniency || ms > endTime)){ + this.checkScore(circle, circle.daiFailed.check) + }else if(ms > endTime){ if(!this.controller.autoPlayEnabled){ if(drumrollNotes){ if(circle.section && circle.timesHit === 0){ @@ -265,11 +266,6 @@ class Game{ var don_r = keys["don_r"] && !this.controller.isWaiting("don_r", "score") var ka_l = keys["ka_l"] && !this.controller.isWaiting("ka_l", "score") var ka_r = keys["ka_r"] && !this.controller.isWaiting("ka_r", "score") - if(don_l || don_r || ka_l || ka_r){ - this.lastPressedKeys = [don_l, don_r, ka_l, ka_r] - }else{ - [don_l, don_r, ka_l, ka_r] = this.lastPressedKeys - } var checkDon = () => { if(don_l && don_r){ @@ -320,7 +316,7 @@ class Game{ var typeDai = type === "daiDon" || type === "daiKa" var keyTime = this.controller.getKeyTime() - var currentTime = keysDon ? keyTime["don"] : keyTime["ka"] + var currentTime = circle.daiFailed ? circle.daiFailed.ms : keysDon ? keyTime["don"] : keyTime["ka"] var relative = currentTime - circle.ms - this.controller.audioLatency if(relative >= this.rules.ok){ @@ -336,17 +332,6 @@ class Game{ } var score = 0 if(keysDon && typeDon || keysKa && typeKa){ - if(typeDai && !keyDai){ - if(this.controller.easierBigNotes){ - // Taiko Force Lv5 can't hit both Dons at the same time, so dai offered - keyDai = true - }else if(!circle.daiFailed){ - circle.daiFailed = ms - return false - }else if(ms < circle.daiFailed + this.rules.daiLeniency){ - return false - } - } var circleStatus = -1 relative = Math.abs(relative) if(relative < this.rules.good){ @@ -356,6 +341,23 @@ class Game{ }else if(relative < this.rules.bad){ circleStatus = 0 } + if(typeDai && !keyDai){ + if(this.controller.easierBigNotes){ + // Taiko Force Lv5 can't hit both Dons at the same time, so dai offered + keyDai = true + }else if(!circle.daiFailed){ + circle.daiFailed = { + ms: ms, + status: circleStatus, + check: check + } + return false + }else if(ms < circle.daiFailed.ms + this.rules.daiLeniency){ + return false + }else{ + circleStatus = circle.daiFailed.status + } + } if(circleStatus === 230 || circleStatus === 450){ score = circleStatus } diff --git a/public/src/js/strings.js b/public/src/js/strings.js index f7089c6..2b76c46 100644 --- a/public/src/js/strings.js +++ b/public/src/js/strings.js @@ -152,7 +152,7 @@ drumSounds: "Drum Sounds" }, easierBigNotes: { - name: "大きな音符を簡単にする" + name: "簡単な大きな音符" }, on: "オン", off: "オフ", @@ -542,7 +542,7 @@ function StringsCn(){ drumSounds: "Drum Sounds" }, easierBigNotes: { - name: "使大音符变得容易" + name: "简单的大音符" }, on: "开", off: "关", @@ -737,7 +737,7 @@ function StringsTw(){ drumSounds: "Drum Sounds" }, easierBigNotes: { - name: "使大音符變得容易" + name: "簡單的大音符" }, on: "開", off: "關",