maidraw 0.13.5 → 0.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,4 +5,4 @@ export declare function getMaxPlatinumScore(chart: Chart): number;
|
|
|
5
5
|
*
|
|
6
6
|
* @param starRatio Ratio between achieved and maximum platinum score, from 0 to 1.
|
|
7
7
|
*/
|
|
8
|
-
export declare function getStar(starRatio: number): 1 | 0 | 4 | 2 | 3 | 5;
|
|
8
|
+
export declare function getStar(starRatio: number): 1 | 0 | 4 | -1 | 2 | 3 | 5;
|
package/dist/ongeki/lib/util.js
CHANGED
|
@@ -3,7 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getMaxPlatinumScore = getMaxPlatinumScore;
|
|
4
4
|
exports.getStar = getStar;
|
|
5
5
|
function getMaxPlatinumScore(chart) {
|
|
6
|
-
|
|
6
|
+
if (chart.optionalData &&
|
|
7
|
+
typeof chart.optionalData === "object" &&
|
|
8
|
+
"totalNotes" in chart.optionalData &&
|
|
9
|
+
typeof chart.optionalData.totalNotes === "number") {
|
|
10
|
+
return chart.optionalData.totalNotes * 2;
|
|
11
|
+
}
|
|
12
|
+
return (chart.notes.tap + chart.notes.hold + chart.notes.side + chart.notes.flick) * 2;
|
|
7
13
|
}
|
|
8
14
|
/**
|
|
9
15
|
* Get the amount of platinum stars given a platinum score ratio.
|
|
@@ -12,7 +18,7 @@ function getMaxPlatinumScore(chart) {
|
|
|
12
18
|
*/
|
|
13
19
|
function getStar(starRatio) {
|
|
14
20
|
if (starRatio < 0 || starRatio > 1)
|
|
15
|
-
return
|
|
21
|
+
return -1;
|
|
16
22
|
if (starRatio >= 0.98)
|
|
17
23
|
return 5;
|
|
18
24
|
if (starRatio >= 0.97)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/ongeki/lib/util.ts"],"names":[],"mappings":";;AAEA,
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/ongeki/lib/util.ts"],"names":[],"mappings":";;AAEA,kDAUC;AAOD,0BAQC;AAzBD,SAAgB,mBAAmB,CAAC,KAAY;IAC5C,IACI,KAAK,CAAC,YAAY;QAClB,OAAO,KAAK,CAAC,YAAY,KAAK,QAAQ;QACtC,YAAY,IAAI,KAAK,CAAC,YAAY;QAClC,OAAO,KAAK,CAAC,YAAY,CAAC,UAAU,KAAK,QAAQ,EACnD,CAAC;QACC,OAAO,KAAK,CAAC,YAAY,CAAC,UAAU,GAAG,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC3F,CAAC;AAED;;;;GAIG;AACH,SAAgB,OAAO,CAAC,SAAiB;IACrC,IAAI,SAAS,GAAG,CAAC,IAAI,SAAS,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC,CAAC;IAC9C,IAAI,SAAS,IAAI,IAAI;QAAE,OAAO,CAAC,CAAC;IAChC,IAAI,SAAS,IAAI,IAAI;QAAE,OAAO,CAAC,CAAC;IAChC,IAAI,SAAS,IAAI,IAAI;QAAE,OAAO,CAAC,CAAC;IAChC,IAAI,SAAS,IAAI,IAAI;QAAE,OAAO,CAAC,CAAC;IAChC,IAAI,SAAS,IAAI,IAAI;QAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,CAAC;AACb,CAAC"}
|