improve Dais for Taiko Force Lv5

This commit is contained in:
purerosefallen 2020-02-27 22:50:54 +08:00
parent 09c212df8b
commit 2ab0de9644
No known key found for this signature in database
GPG Key ID: E6D78C90943A3185
3 changed files with 12 additions and 2 deletions

View File

@ -60,6 +60,7 @@ 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)
this.TaikoForceLv5 = this.keyboard.keyboard.TaikoForceLv5 && !autoPlayEnabled && (this.multiplayer !== 2);
this.drumSounds = settings.getItem("latency").drumSounds this.drumSounds = settings.getItem("latency").drumSounds
this.playedSounds = {} this.playedSounds = {}

View File

@ -331,7 +331,9 @@ class Game{
var score = 0 var score = 0
if(keysDon && typeDon || keysKa && typeKa){ if(keysDon && typeDon || keysKa && typeKa){
if (typeDai && !keyDai) { if (typeDai && !keyDai) {
if(!circle.daiFailed){ if (this.controller.TaikoForceLv5) { // Taiko Force Lv5 can't hit both Dons at the same time, so dai offered
keyDai = true;
} else if(!circle.daiFailed){
circle.daiFailed = ms circle.daiFailed = ms
return false return false
}else if(ms < circle.daiFailed + this.rules.daiLeniency){ }else if(ms < circle.daiFailed + this.rules.daiLeniency){

View File

@ -14,12 +14,19 @@ 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
//console.log(kbdSettings);
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);
//console.log("Taiko Force Lv5", this.TaikoForceLv5);
var drumKeys = {} var drumKeys = {}
for(var name in kbdSettings){ for(var name in kbdSettings){
var keys = kbdSettings[name] var keys = kbdSettings[name]