From 2ab0de96442efa91ddb7b38e0b29e2fb51362707 Mon Sep 17 00:00:00 2001 From: purerosefallen <78877@qq.com> Date: Thu, 27 Feb 2020 22:50:54 +0800 Subject: [PATCH] improve Dais for Taiko Force Lv5 --- public/src/js/controller.js | 1 + public/src/js/game.js | 6 ++++-- public/src/js/keyboard.js | 7 +++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/public/src/js/controller.js b/public/src/js/controller.js index cb20acd..3ac679e 100644 --- a/public/src/js/controller.js +++ b/public/src/js/controller.js @@ -60,6 +60,7 @@ class Controller{ this.view = new View(this) this.mekadon = new Mekadon(this, this.game) this.keyboard = new GameInput(this) + this.TaikoForceLv5 = this.keyboard.keyboard.TaikoForceLv5 && !autoPlayEnabled && (this.multiplayer !== 2); this.drumSounds = settings.getItem("latency").drumSounds this.playedSounds = {} diff --git a/public/src/js/game.js b/public/src/js/game.js index bb790ba..e58b238 100644 --- a/public/src/js/game.js +++ b/public/src/js/game.js @@ -330,8 +330,10 @@ class Game{ } var score = 0 if(keysDon && typeDon || keysKa && typeKa){ - if(typeDai && !keyDai){ - if(!circle.daiFailed){ + if (typeDai && !keyDai) { + 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 return false }else if(ms < circle.daiFailed + this.rules.daiLeniency){ diff --git a/public/src/js/keyboard.js b/public/src/js/keyboard.js index 949673b..4df67ea 100644 --- a/public/src/js/keyboard.js +++ b/public/src/js/keyboard.js @@ -14,12 +14,19 @@ class Keyboard{ "altgr": "altgraph" } this.btn = {} + this.TaikoForceLv5 = false; this.update() pageEvents.keyAdd(this, "all", "both", this.keyEvent.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(){ var kbdSettings = settings.getItem("keyboardSettings") + this.TaikoForceLv5 = this.isTaikoForceLv5(kbdSettings); + //console.log("Taiko Force Lv5", this.TaikoForceLv5); var drumKeys = {} for(var name in kbdSettings){ var keys = kbdSettings[name]