@rian8337/osu-difficulty-calculator 3.0.0-beta.7 → 3.0.0
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.
- package/README.md +13 -9
- package/dist/index.js +3100 -2893
- package/dist/index.js.map +1 -1
- package/package.json +37 -37
- package/typings/index.d.ts +1325 -1199
package/README.md
CHANGED
|
@@ -43,17 +43,19 @@ if (!beatmapInfo.title) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
// Calculate osu!droid difficulty
|
|
46
|
-
const droidRating = new DroidDifficultyCalculator(
|
|
46
|
+
const droidRating = new DroidDifficultyCalculator(
|
|
47
|
+
beatmapInfo.beatmap
|
|
48
|
+
).calculate();
|
|
47
49
|
|
|
48
50
|
console.log(droidRating);
|
|
49
51
|
|
|
50
52
|
// Calculate osu!standard difficulty
|
|
51
|
-
const osuRating = new OsuDifficultyCalculator(beatmapInfo.
|
|
53
|
+
const osuRating = new OsuDifficultyCalculator(beatmapInfo.beatmap).calculate();
|
|
52
54
|
|
|
53
55
|
console.log(osuRating);
|
|
54
56
|
|
|
55
57
|
// Calculate both osu!droid and osu!standard difficulty
|
|
56
|
-
const rating = new MapStars(beatmapInfo.
|
|
58
|
+
const rating = new MapStars(beatmapInfo.beatmap);
|
|
57
59
|
|
|
58
60
|
// osu!droid difficulty
|
|
59
61
|
console.log(rating.droid);
|
|
@@ -87,7 +89,7 @@ const stats = new MapStats({
|
|
|
87
89
|
});
|
|
88
90
|
|
|
89
91
|
// Also available in `DroidDifficultyCalculator` and `OsuDifficultyCalculator` as a parameter of `calculate`
|
|
90
|
-
const rating = new MapStars(beatmapInfo.
|
|
92
|
+
const rating = new MapStars(beatmapInfo.beatmap, {
|
|
91
93
|
mods: mods,
|
|
92
94
|
stats: stats,
|
|
93
95
|
});
|
|
@@ -114,17 +116,19 @@ if (!beatmapInfo.title) {
|
|
|
114
116
|
return console.log("Beatmap not found");
|
|
115
117
|
}
|
|
116
118
|
|
|
117
|
-
const rating = new MapStars(beatmapInfo.
|
|
119
|
+
const rating = new MapStars(beatmapInfo.beatmap);
|
|
118
120
|
|
|
119
121
|
// osu!droid performance
|
|
120
122
|
const droidPerformance = new DroidPerformanceCalculator(
|
|
121
|
-
rating.droid
|
|
123
|
+
rating.droid.attributes
|
|
122
124
|
).calculate();
|
|
123
125
|
|
|
124
126
|
console.log(droidPerformance);
|
|
125
127
|
|
|
126
128
|
// osu!standard performance
|
|
127
|
-
const osuPerformance = new OsuPerformanceCalculator(
|
|
129
|
+
const osuPerformance = new OsuPerformanceCalculator(
|
|
130
|
+
rating.osu.attributes
|
|
131
|
+
).calculate();
|
|
128
132
|
|
|
129
133
|
console.log(osuPerformance);
|
|
130
134
|
```
|
|
@@ -152,7 +156,7 @@ if (!beatmapInfo.title) {
|
|
|
152
156
|
return console.log("Beatmap not found");
|
|
153
157
|
}
|
|
154
158
|
|
|
155
|
-
const rating = new OsuDifficultyCalculator(beatmapInfo.
|
|
159
|
+
const rating = new OsuDifficultyCalculator(beatmapInfo.beatmap).calculate();
|
|
156
160
|
|
|
157
161
|
const accuracy = new Accuracy({
|
|
158
162
|
// Specify your misses here
|
|
@@ -179,7 +183,7 @@ const stats = new MapStats({
|
|
|
179
183
|
speedMultiplier: 1.25,
|
|
180
184
|
});
|
|
181
185
|
|
|
182
|
-
const performance = new OsuPerformanceCalculator(rating).calculate({
|
|
186
|
+
const performance = new OsuPerformanceCalculator(rating.attributes).calculate({
|
|
183
187
|
combo: 1250,
|
|
184
188
|
accPercent: accuracy,
|
|
185
189
|
// The tap penalty will only be used by `DroidPerformanceCalculator` and
|