From be0b0c61cf557d13cd536afc514bab145094e664 Mon Sep 17 00:00:00 2001 From: purerosefallen <78877@qq.com> Date: Fri, 21 Jun 2019 11:17:11 +0800 Subject: [PATCH] new score --- public/src/js/game.js | 29 ++++++++++++++++++++++++++++- public/src/js/parsetja.js | 12 ++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/public/src/js/game.js b/public/src/js/game.js index 63a92b7..dd05956 100644 --- a/public/src/js/game.js +++ b/public/src/js/game.js @@ -582,6 +582,9 @@ class Game{ if(this.combo === 50 || this.combo > 0 && this.combo % 100 === 0 && this.combo < 1500 || this.combo > 0 && this.combo % 500 === 0){ this.controller.playSoundMeka("v_combo_" + (this.combo <= 1400 ? this.combo : "over1500")) } + if (this.songData.scoremode == 2 && this.combo > 0 && this.combo % 100 == 0) { + this.globalScore.points += 10000; + } this.view.updateCombo(this.combo) } getCombo(){ @@ -603,6 +606,16 @@ class Game{ this.globalScore.bad++ break } + if (this.songData.scoremode) { + switch (score) { + case 450: + score = this.songData.scoreinit; + break; + case 230: + score = Math.floor(this.songData.scoreinit / 2); + break; + } + } // Gauge update if(score !== 0){ this.globalScore.gauge += this.HPGain @@ -612,7 +625,21 @@ class Game{ this.globalScore.gauge = 0 } // Points update - score += Math.max(0, Math.floor((Math.min(this.combo, 100) - 1) / 10) * 100) + if (this.songData.scoremode == 2) { + var diff_mul = 0; + if (this.combo >= 100) { + diff_mul = 8; + } else if (this.combo >= 50) { + diff_mul = 4; + } else if (this.combo >= 30) { + diff_mul = 2; + } else if (this.combo >= 10) { + diff_mul = 1; + } + score += this.songData.scorediff * diff_mul; + } else { + score += Math.max(0, Math.floor((Math.min(this.combo, 100) - 1) / 10) * (this.songData.scoremode ? this.songData.scorediff : 100)); + } if(gogoTime){ multiplier *= 1.2 diff --git a/public/src/js/parsetja.js b/public/src/js/parsetja.js index 2b10f9b..31bc67e 100644 --- a/public/src/js/parsetja.js +++ b/public/src/js/parsetja.js @@ -41,7 +41,7 @@ } } parseMetadata(){ - var metaNumbers = ["bpm", "offset", "demostart", "level"] + var metaNumbers = ["bpm", "offset", "demostart", "level", "scoremode", "scorediff"] var inSong = false var hasSong = false var courses = {} @@ -99,7 +99,10 @@ }else if(this.inArray(name, metaNumbers)){ value = parseFloat(value) } - + else if (name === "scoreinit") { + value = value ? parseFloat(value.split(",")[0]) : 0; + } + currentCourse[name] = value } @@ -119,6 +122,11 @@ } parseCircles(){ var meta = this.metadata[this.difficulty] + this.scoreinit = meta.scoreinit; + this.scorediff = meta.scorediff; + if (this.scoreinit && this.scorediff) { + this.scoremode = meta.scoremode || 1; + } var ms = (meta.offset || 0) * -1000 + this.offset var bpm = Math.abs(meta.bpm) || 120 var scroll = 1