Commit f53788ee authored by Bui's avatar Bui Committed by GitHub

Merge pull request #184 from N-Field/patch-lv5

improve Dais for Taiko Force Lv5
parents 09c212df 9a9bc286
...@@ -60,6 +60,11 @@ class Controller{ ...@@ -60,6 +60,11 @@ class Controller{
this.view = new View(this) this.view = new View(this)
this.mekadon = new Mekadon(this, this.game) this.mekadon = new Mekadon(this, this.game)
this.keyboard = new GameInput(this) this.keyboard = new GameInput(this)
if(!autoPlayEnabled && this.multiplayer !== 2){
this.easierBigNotes = settings.getItem("easierBigNotes") || this.keyboard.keyboard.TaikoForceLv5
}else{
this.easierBigNotes = false
}
this.drumSounds = settings.getItem("latency").drumSounds this.drumSounds = settings.getItem("latency").drumSounds
this.playedSounds = {} this.playedSounds = {}
......
...@@ -104,7 +104,9 @@ class Game{ ...@@ -104,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){
...@@ -314,7 +316,7 @@ class Game{ ...@@ -314,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){
...@@ -330,14 +332,6 @@ class Game{ ...@@ -330,14 +332,6 @@ class Game{
} }
var score = 0 var score = 0
if(keysDon && typeDon || keysKa && typeKa){ if(keysDon && typeDon || keysKa && typeKa){
if(typeDai && !keyDai){
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){
...@@ -347,6 +341,23 @@ class Game{ ...@@ -347,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
} }
......
...@@ -14,12 +14,18 @@ class Keyboard{ ...@@ -14,12 +14,18 @@ class Keyboard{
"altgr": "altgraph" "altgr": "altgraph"
} }
this.btn = {} this.btn = {}
this.TaikoForceLv5 = false;
this.update() this.update()
pageEvents.keyAdd(this, "all", "both", this.keyEvent.bind(this)) pageEvents.keyAdd(this, "all", "both", this.keyEvent.bind(this))
pageEvents.blurAdd(this, this.blurEvent.bind(this)) pageEvents.blurAdd(this, this.blurEvent.bind(this))
} }
isTaikoForceLv5(kbdSettings){
// the key of Taiko Force Lv5's PC module looks like this
return (kbdSettings.ka_l[0] === "f") && (kbdSettings.ka_r[0] === "e") && (kbdSettings.don_l[0] === "i") && (kbdSettings.don_r[0] === "j");
}
update(){ update(){
var kbdSettings = settings.getItem("keyboardSettings") var kbdSettings = settings.getItem("keyboardSettings")
this.TaikoForceLv5 = this.isTaikoForceLv5(kbdSettings)
var drumKeys = {} var drumKeys = {}
for(var name in kbdSettings){ for(var name in kbdSettings){
var keys = kbdSettings[name] var keys = kbdSettings[name]
......
...@@ -46,6 +46,10 @@ class Settings{ ...@@ -46,6 +46,10 @@ class Settings{
"video": 0, "video": 0,
"drumSounds": true "drumSounds": true
} }
},
easierBigNotes: {
type: "toggle",
default: false
} }
} }
......
...@@ -151,6 +151,9 @@ ...@@ -151,6 +151,9 @@
video: "Video", video: "Video",
drumSounds: "Drum Sounds" drumSounds: "Drum Sounds"
}, },
easierBigNotes: {
name: "簡単な大きな音符"
},
on: "オン", on: "オン",
off: "オフ", off: "オフ",
default: "既定値にリセット", default: "既定値にリセット",
...@@ -343,6 +346,9 @@ function StringsEn(){ ...@@ -343,6 +346,9 @@ function StringsEn(){
video: "Video", video: "Video",
drumSounds: "Drum Sounds" drumSounds: "Drum Sounds"
}, },
easierBigNotes: {
name: "Easier Big Notes"
},
on: "On", on: "On",
off: "Off", off: "Off",
default: "Reset to Defaults", default: "Reset to Defaults",
...@@ -535,6 +541,9 @@ function StringsCn(){ ...@@ -535,6 +541,9 @@ function StringsCn(){
video: "Video", video: "Video",
drumSounds: "Drum Sounds" drumSounds: "Drum Sounds"
}, },
easierBigNotes: {
name: "简单的大音符"
},
on: "", on: "",
off: "", off: "",
default: "重置为默认值", default: "重置为默认值",
...@@ -727,6 +736,9 @@ function StringsTw(){ ...@@ -727,6 +736,9 @@ function StringsTw(){
video: "Video", video: "Video",
drumSounds: "Drum Sounds" drumSounds: "Drum Sounds"
}, },
easierBigNotes: {
name: "簡單的大音符"
},
on: "", on: "",
off: "", off: "",
default: "重置為默認值", default: "重置為默認值",
...@@ -919,6 +931,9 @@ function StringsKo(){ ...@@ -919,6 +931,9 @@ function StringsKo(){
video: "Video", video: "Video",
drumSounds: "Drum Sounds" drumSounds: "Drum Sounds"
}, },
easierBigNotes: {
name: "쉬운 큰 음표"
},
on: "", on: "",
off: "오프", off: "오프",
default: "기본값으로 재설정", default: "기본값으로 재설정",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment