[PATCH] Fix big notes being hit for a short time

This commit is contained in:
LoveEevee 2020-02-29 19:50:28 +03:00 committed by purerosefallen
parent 3097dd3736
commit 9a9bc2869c
No known key found for this signature in database
GPG Key ID: E6D78C90943A3185
2 changed files with 24 additions and 22 deletions

View File

@ -31,7 +31,6 @@ class Game{
this.branchNames = ["normal", "advanced", "master"] this.branchNames = ["normal", "advanced", "master"]
this.resetSection() this.resetSection()
this.gameLagSync = !this.controller.touchEnabled && !(/Firefox/.test(navigator.userAgent)) this.gameLagSync = !this.controller.touchEnabled && !(/Firefox/.test(navigator.userAgent))
this.lastPressedKeys = [false, false, false, false]
assets.songs.forEach(song => { assets.songs.forEach(song => {
if(song.id == selectedSong.folder){ if(song.id == selectedSong.folder){
@ -105,7 +104,9 @@ class Game{
circle.beatMSCopied = true 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(!this.controller.autoPlayEnabled){
if(drumrollNotes){ if(drumrollNotes){
if(circle.section && circle.timesHit === 0){ 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 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_l = keys["ka_l"] && !this.controller.isWaiting("ka_l", "score")
var ka_r = keys["ka_r"] && !this.controller.isWaiting("ka_r", "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 = () => { var checkDon = () => {
if(don_l && don_r){ if(don_l && don_r){
@ -320,7 +316,7 @@ class Game{
var typeDai = type === "daiDon" || type === "daiKa" var typeDai = type === "daiDon" || type === "daiKa"
var keyTime = this.controller.getKeyTime() 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 var relative = currentTime - circle.ms - this.controller.audioLatency
if(relative >= this.rules.ok){ if(relative >= this.rules.ok){
@ -336,17 +332,6 @@ class Game{
} }
var score = 0 var score = 0
if(keysDon && typeDon || keysKa && typeKa){ 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 var circleStatus = -1
relative = Math.abs(relative) relative = Math.abs(relative)
if(relative < this.rules.good){ if(relative < this.rules.good){
@ -356,6 +341,23 @@ class Game{
}else if(relative < this.rules.bad){ }else if(relative < this.rules.bad){
circleStatus = 0 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){ if(circleStatus === 230 || circleStatus === 450){
score = circleStatus score = circleStatus
} }

View File

@ -152,7 +152,7 @@
drumSounds: "Drum Sounds" drumSounds: "Drum Sounds"
}, },
easierBigNotes: { easierBigNotes: {
name: "大きな音符を簡単にする" name: "簡単な大きな音符"
}, },
on: "オン", on: "オン",
off: "オフ", off: "オフ",
@ -542,7 +542,7 @@ function StringsCn(){
drumSounds: "Drum Sounds" drumSounds: "Drum Sounds"
}, },
easierBigNotes: { easierBigNotes: {
name: "使大音符变得容易" name: "简单的大音符"
}, },
on: "开", on: "开",
off: "关", off: "关",
@ -737,7 +737,7 @@ function StringsTw(){
drumSounds: "Drum Sounds" drumSounds: "Drum Sounds"
}, },
easierBigNotes: { easierBigNotes: {
name: "使大音符變得容易" name: "簡單的大音符"
}, },
on: "開", on: "開",
off: "關", off: "關",