Merge pull request #158 from purerosefallen/score_bui

Update score with SCOREINIT and SCOREDIFF
This commit is contained in:
Bui 2019-06-22 05:53:59 +01:00 committed by GitHub
commit 66612d222b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 3 deletions

View File

@ -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){ 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")) 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) this.view.updateCombo(this.combo)
} }
getCombo(){ getCombo(){
@ -603,6 +606,16 @@ class Game{
this.globalScore.bad++ this.globalScore.bad++
break 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 // Gauge update
if(score !== 0){ if(score !== 0){
this.globalScore.gauge += this.HPGain this.globalScore.gauge += this.HPGain
@ -612,7 +625,21 @@ class Game{
this.globalScore.gauge = 0 this.globalScore.gauge = 0
} }
// Points update // 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){ if(gogoTime){
multiplier *= 1.2 multiplier *= 1.2

View File

@ -41,7 +41,7 @@
} }
} }
parseMetadata(){ parseMetadata(){
var metaNumbers = ["bpm", "offset", "demostart", "level"] var metaNumbers = ["bpm", "offset", "demostart", "level", "scoremode", "scorediff"]
var inSong = false var inSong = false
var hasSong = false var hasSong = false
var courses = {} var courses = {}
@ -99,6 +99,9 @@
}else if(this.inArray(name, metaNumbers)){ }else if(this.inArray(name, metaNumbers)){
value = parseFloat(value) value = parseFloat(value)
} }
else if (name === "scoreinit") {
value = value ? parseFloat(value.split(",")[0]) : 0;
}
currentCourse[name] = value currentCourse[name] = value
} }
@ -119,6 +122,11 @@
} }
parseCircles(){ parseCircles(){
var meta = this.metadata[this.difficulty] 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 ms = (meta.offset || 0) * -1000 + this.offset
var bpm = Math.abs(meta.bpm) || 120 var bpm = Math.abs(meta.bpm) || 120
var scroll = 1 var scroll = 1