Commit 3b5d49ba authored by nanahira's avatar nanahira

add score in AC16 as SCOREMODE:3

parent 84e04813
......@@ -70,6 +70,11 @@ class AutoScore {
this.ScoreInit = 0;
var max_init = this.GetMaxPossibleInit(target);
var min_init = 0;
if (this.scoremode === 3) {
this.ScoreDiff = 0;
this.ScoreInit = max_init;
return;
}
while (true) {
this.ScoreInit = (max_init + min_init) / 2;
this.ScoreDiff = Math.round(this.ScoreInit / 4);
......@@ -113,15 +118,15 @@ class AutoScore {
}
if (this.IsCommonCircle(circle)) {
combo++;
if (combo % 100 === 0 && this.scoremode !== 1) {
if (combo % 100 === 0 && this.scoremode === 2) {
score += 10000;
}
}
var diff_mul = 0;
var multiplier = circle.gogoTime ? 1.2 : 1;
var multiplier = (this.scoremode !== 3 && circle.gogoTime) ? 1.2 : 1;
if (this.scoremode === 1) {
diff_mul = Math.max(0, Math.floor((Math.min(combo, 100) - 1) / 10));
} else {
} else if (this.scoremode === 2) {
if (combo >= 100) {
diff_mul = 8;
} else if (combo >= 50) {
......@@ -132,23 +137,42 @@ class AutoScore {
diff_mul = 1;
}
}
switch (circle.type) {
case "don":
case "ka": {
score += Math.floor((init + diff * diff_mul) * multiplier / 10) * 10;
break;
if (this.scoremode === 3) {
switch (circle.type) {
case "don":
case "ka":
case "daiDon":
case "daiKa": {
score += Math.floor(init / 10) * 10;
break;
}
case "balloon": {
score += 100 * circle.requiredHits;
break;
}
default: {
break;
}
}
case "daiDon":
case "daiKa": {
score += Math.floor((init + diff * diff_mul) * multiplier / 5) * 10;
break;
}
case "balloon": {
score += (5000 + 300 * circle.requiredHits) * multiplier;
break;
}
default: {
break;
} else {
switch (circle.type) {
case "don":
case "ka": {
score += Math.floor((init + diff * diff_mul) * multiplier / 10) * 10;
break;
}
case "daiDon":
case "daiKa": {
score += Math.floor((init + diff * diff_mul) * multiplier / 5) * 10;
break;
}
case "balloon": {
score += (5000 + 300 * (circle.requiredHits - 1)) * multiplier;
break;
}
default: {
break;
}
}
}
}
......@@ -156,6 +180,9 @@ class AutoScore {
}
GetTargetScore(difficulty, level) {
//console.log(difficulty, level)
if (this.scoremode === 3) {
return 1000000;
}
var ret = this.basic_max_score_list[difficulty][level];
if (!ret) {
ret = this.basic_max_score_list[difficulty][0];
......@@ -167,40 +194,59 @@ class AutoScore {
for (var circle of this.circles) {
//alert(this.IsCommonCircle(circle));
if (this.IsCommonCircle(circle) && (!circle.branch || circle.branch.name === "master")) {
combo++;
++combo;
}
}
return combo;
}
GetMaxPossibleInit(target) {
var basic_score = 0;
if (this.scoremode !== 1) {
if (this.scoremode === 2) {
const max_combo = this.GetMaxCombo();
basic_score += Math.floor(max_combo / 100);
basic_score += Math.floor(max_combo / 100) * 10000;
}
var combo = 0;
for (var circle of this.circles) {
if (circle.branch && circle.branch.name !== "master") {
continue;
}
var multiplier = circle.gogoTime ? 1.2 : 1;
switch (circle.type) {
case "don":
case "ka": {
combo += (1 * multiplier);
break;
}
case "daiDon":
case "daiKa": {
combo += (2 * multiplier);
break;
var multiplier = (circle.gogoTime && this.scoremode !== 3) ? 1.2 : 1;
if (this.scoremode === 3) {
switch (circle.type) {
case "don":
case "ka":
case "daiDon":
case "daiKa": {
++combo;
break;
}
case "balloon": {
basic_score += 100 * this.requiredHits;
break;
}
default: {
break;
}
}
case "balloon": {
basic_score += (5000 + 300 * circle.requiredHits) * multiplier;
break;
}
default: {
break;
} else {
switch (circle.type) {
case "don":
case "ka": {
combo += (1 * multiplier);
break;
}
case "daiDon":
case "daiKa": {
combo += (2 * multiplier);
break;
}
case "balloon": {
basic_score += (5000 + 300 * (circle.requiredHits - 1)) * multiplier;
break;
}
default: {
break;
}
}
}
}
......
......@@ -240,7 +240,7 @@ class Game{
this.sectionNotes.push(0)
this.controller.displayScore(0, true)
this.updateCombo(0)
this.updateGlobalScore(0, 1)
this.updateGlobalScore(0, false, false, false);
if(this.controller.multiplayer === 1){
p2.send("note", {
score: -1
......@@ -370,7 +370,7 @@ class Game{
this.controller.displayScore(score, true, false)
}
this.updateCombo(score)
this.updateGlobalScore(score, typeDai && keyDai ? 2 : 1, circle.gogoTime)
this.updateGlobalScore(score, typeDai, keyDai, circle.gogoTime);
this.updateCurrentCircle()
if(circle.section){
this.resetSection()
......@@ -405,9 +405,10 @@ class Game{
}
return true
}
checkBalloon(circle){
checkBalloon(circle) {
var score;
if(circle.timesHit >= circle.requiredHits - 1){
var score = 5000
score = this.songData.scoremode === 3 ? 100 : 5000;
this.updateCurrentCircle()
circle.hit()
circle.played(score)
......@@ -417,7 +418,7 @@ class Game{
})
}
}else{
var score = 300
score = this.songData.scoremode === 3 ? 100 : 300;
circle.hit()
}
this.globalScore.drumroll++
......@@ -453,7 +454,7 @@ class Game{
this.view.drumroll.push(circleAnim)
this.globalScore.drumroll++
this.sectionDrumroll++
this.globalScore.points += score * (dai ? 2 : 1)
this.globalScore.points += score * ((dai && this.songData.scoremode !== 3) ? 2 : 1)
this.view.setDarkBg(false)
}
getLastCircle(circles){
......@@ -638,7 +639,7 @@ class Game{
getGlobalScore(){
return this.globalScore
}
updateGlobalScore(score, multiplier, gogoTime){
updateGlobalScore(score, typeDai, keyDai, gogoTime){
// Circle score
switch(score){
case 450:
......@@ -683,12 +684,21 @@ class Game{
diff_mul = 1;
}
score += this.songData.scorediff * diff_mul;
} else {
} else if (this.songData.scoremode == 1) {
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
let multiplier = 1;
if (this.songData.scoremode === 3) {
if (typeDai && !keyDai){
multiplier = 0.5;
}
} else {
if (typeDai && keyDai){
multiplier = 2;
}
if(gogoTime){
multiplier *= 1.2;
}
}
this.globalScore.points += Math.floor(score * multiplier / 10) * 10
}
......
......@@ -44,13 +44,14 @@ class Mekadon{
this.controller.displayScore(0, true)
this.game.updateCurrentCircle()
this.game.updateCombo(0)
this.game.updateGlobalScore(0, 1, circle.gogoTime)
this.game.updateGlobalScore(0, false, false, circle.gogoTime)
this.game.sectionNotes.push(0)
return true
}
}
playNow(circle, score, dai, reverse){
var type = circle.type
var typeDai = type === "daiDon" || type === "daiKa";
var keyDai = false
var playDai = !dai || dai === 2
var drumrollNotes = type === "balloon" || type === "drumroll" || type === "daiDrumroll"
......@@ -95,7 +96,7 @@ class Mekadon{
}else{
this.controller.displayScore(score, false, keyDai)
this.game.updateCombo(score)
this.game.updateGlobalScore(score, keyDai ? 2 : 1, circle.gogoTime)
this.game.updateGlobalScore(score, typeDai, keyDai, circle.gogoTime)
this.game.updateCurrentCircle()
circle.played(score, keyDai)
if(circle.section){
......
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