@rian8337/osu-base 2.0.0-alpha.0 → 2.0.0-alpha.26
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/dist/index.js +71 -35
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/typings/index.d.ts +12 -4
- package/dist/beatmap/Beatmap.js +0 -309
- package/dist/beatmap/Beatmap.js.map +0 -1
- package/dist/beatmap/Parser.js +0 -632
- package/dist/beatmap/Parser.js.map +0 -1
- package/dist/beatmap/hitobjects/Circle.js +0 -21
- package/dist/beatmap/hitobjects/Circle.js.map +0 -1
- package/dist/beatmap/hitobjects/HitObject.js +0 -75
- package/dist/beatmap/hitobjects/HitObject.js.map +0 -1
- package/dist/beatmap/hitobjects/Slider.js +0 -144
- package/dist/beatmap/hitobjects/Slider.js.map +0 -1
- package/dist/beatmap/hitobjects/Spinner.js +0 -27
- package/dist/beatmap/hitobjects/Spinner.js.map +0 -1
- package/dist/beatmap/hitobjects/sliderObjects/HeadCircle.js +0 -11
- package/dist/beatmap/hitobjects/sliderObjects/HeadCircle.js.map +0 -1
- package/dist/beatmap/hitobjects/sliderObjects/RepeatPoint.js +0 -22
- package/dist/beatmap/hitobjects/sliderObjects/RepeatPoint.js.map +0 -1
- package/dist/beatmap/hitobjects/sliderObjects/SliderTick.js +0 -22
- package/dist/beatmap/hitobjects/sliderObjects/SliderTick.js.map +0 -1
- package/dist/beatmap/hitobjects/sliderObjects/TailCircle.js +0 -11
- package/dist/beatmap/hitobjects/sliderObjects/TailCircle.js.map +0 -1
- package/dist/beatmap/timings/BreakPoint.js +0 -35
- package/dist/beatmap/timings/BreakPoint.js.map +0 -1
- package/dist/beatmap/timings/DifficultyControlPoint.js +0 -23
- package/dist/beatmap/timings/DifficultyControlPoint.js.map +0 -1
- package/dist/beatmap/timings/TimingControlPoint.js +0 -23
- package/dist/beatmap/timings/TimingControlPoint.js.map +0 -1
- package/dist/beatmap/timings/TimingPoint.js +0 -13
- package/dist/beatmap/timings/TimingPoint.js.map +0 -1
- package/dist/constants/ParserConstants.js +0 -20
- package/dist/constants/ParserConstants.js.map +0 -1
- package/dist/constants/PathType.js +0 -14
- package/dist/constants/PathType.js.map +0 -1
- package/dist/constants/modes.js +0 -12
- package/dist/constants/modes.js.map +0 -1
- package/dist/constants/objectTypes.js +0 -13
- package/dist/constants/objectTypes.js.map +0 -1
- package/dist/constants/rankedStatus.js +0 -17
- package/dist/constants/rankedStatus.js.map +0 -1
- package/dist/mathutil/Interpolation.js +0 -10
- package/dist/mathutil/Interpolation.js.map +0 -1
- package/dist/mathutil/MathUtils.js +0 -42
- package/dist/mathutil/MathUtils.js.map +0 -1
- package/dist/mathutil/Vector2.js +0 -80
- package/dist/mathutil/Vector2.js.map +0 -1
- package/dist/mods/Mod.js +0 -10
- package/dist/mods/Mod.js.map +0 -1
- package/dist/mods/ModAuto.js +0 -22
- package/dist/mods/ModAuto.js.map +0 -1
- package/dist/mods/ModAutopilot.js +0 -22
- package/dist/mods/ModAutopilot.js.map +0 -1
- package/dist/mods/ModDoubleTime.js +0 -22
- package/dist/mods/ModDoubleTime.js.map +0 -1
- package/dist/mods/ModEasy.js +0 -22
- package/dist/mods/ModEasy.js.map +0 -1
- package/dist/mods/ModFlashlight.js +0 -22
- package/dist/mods/ModFlashlight.js.map +0 -1
- package/dist/mods/ModHalfTime.js +0 -22
- package/dist/mods/ModHalfTime.js.map +0 -1
- package/dist/mods/ModHardRock.js +0 -22
- package/dist/mods/ModHardRock.js.map +0 -1
- package/dist/mods/ModHidden.js +0 -22
- package/dist/mods/ModHidden.js.map +0 -1
- package/dist/mods/ModNightCore.js +0 -22
- package/dist/mods/ModNightCore.js.map +0 -1
- package/dist/mods/ModNoFail.js +0 -22
- package/dist/mods/ModNoFail.js.map +0 -1
- package/dist/mods/ModPerfect.js +0 -22
- package/dist/mods/ModPerfect.js.map +0 -1
- package/dist/mods/ModPrecise.js +0 -22
- package/dist/mods/ModPrecise.js.map +0 -1
- package/dist/mods/ModReallyEasy.js +0 -22
- package/dist/mods/ModReallyEasy.js.map +0 -1
- package/dist/mods/ModRelax.js +0 -22
- package/dist/mods/ModRelax.js.map +0 -1
- package/dist/mods/ModScoreV2.js +0 -22
- package/dist/mods/ModScoreV2.js.map +0 -1
- package/dist/mods/ModSmallCircle.js +0 -22
- package/dist/mods/ModSmallCircle.js.map +0 -1
- package/dist/mods/ModSpunOut.js +0 -22
- package/dist/mods/ModSpunOut.js.map +0 -1
- package/dist/mods/ModSuddenDeath.js +0 -22
- package/dist/mods/ModSuddenDeath.js.map +0 -1
- package/dist/mods/ModTouchDevice.js +0 -22
- package/dist/mods/ModTouchDevice.js.map +0 -1
- package/dist/tools/MapInfo.js +0 -515
- package/dist/tools/MapInfo.js.map +0 -1
- package/dist/utils/APIRequestBuilder.js +0 -145
- package/dist/utils/APIRequestBuilder.js.map +0 -1
- package/dist/utils/Accuracy.js +0 -97
- package/dist/utils/Accuracy.js.map +0 -1
- package/dist/utils/HitWindow.js +0 -57
- package/dist/utils/HitWindow.js.map +0 -1
- package/dist/utils/MapStats.js +0 -217
- package/dist/utils/MapStats.js.map +0 -1
- package/dist/utils/ModUtil.js +0 -138
- package/dist/utils/ModUtil.js.map +0 -1
- package/dist/utils/PathApproximator.js +0 -270
- package/dist/utils/PathApproximator.js.map +0 -1
- package/dist/utils/Precision.js +0 -32
- package/dist/utils/Precision.js.map +0 -1
- package/dist/utils/SliderPath.js +0 -188
- package/dist/utils/SliderPath.js.map +0 -1
- package/dist/utils/Utils.js +0 -54
- package/dist/utils/Utils.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1177,7 +1177,9 @@ class ControlPointManager {
|
|
|
1177
1177
|
}
|
|
1178
1178
|
// Remove the existing control point if the new control point overrides it at the same time.
|
|
1179
1179
|
while (controlPoint.time === existing.time) {
|
|
1180
|
-
this.remove(existing)
|
|
1180
|
+
if (!this.remove(existing)) {
|
|
1181
|
+
break;
|
|
1182
|
+
}
|
|
1181
1183
|
existing = this.controlPointAt(controlPoint.time);
|
|
1182
1184
|
}
|
|
1183
1185
|
// Get the index at which to add the control point.
|
|
@@ -3359,18 +3361,6 @@ class BeatmapHitObjectsDecoder extends SectionDecoder {
|
|
|
3359
3361
|
extraComboOffset = 0;
|
|
3360
3362
|
forceNewCombo = false;
|
|
3361
3363
|
decodeInternal(line) {
|
|
3362
|
-
// Need to check if the beatmap doesn't have an uninherited timing point.
|
|
3363
|
-
// This exists in cases such as /b/2290233 where the beatmap has been
|
|
3364
|
-
// edited by the user.
|
|
3365
|
-
//
|
|
3366
|
-
// In lazer, the default BPM is set to 60 (60000 / 1000).
|
|
3367
|
-
if (this.target.controlPoints.timing.points.length === 0) {
|
|
3368
|
-
this.target.controlPoints.timing.add(new TimingControlPoint({
|
|
3369
|
-
time: Number.NEGATIVE_INFINITY,
|
|
3370
|
-
msPerBeat: 1000,
|
|
3371
|
-
timeSignature: 4,
|
|
3372
|
-
}));
|
|
3373
|
-
}
|
|
3374
3364
|
const s = line.split(",");
|
|
3375
3365
|
if (s.length < 4) {
|
|
3376
3366
|
throw new Error("Ignoring malformed hitobject");
|
|
@@ -5680,6 +5670,12 @@ class StoryboardVariablesEncoder extends StoryboardBaseEncoder {
|
|
|
5680
5670
|
}
|
|
5681
5671
|
}
|
|
5682
5672
|
|
|
5673
|
+
/**
|
|
5674
|
+
* A storyboard encoder.
|
|
5675
|
+
*
|
|
5676
|
+
* Note that this storyboard encoder does not encode storyboards, and as such equality with the
|
|
5677
|
+
* original beatmap or storyboard file is not guaranteed (and usually will not be equal).
|
|
5678
|
+
*/
|
|
5683
5679
|
class StoryboardEncoder extends Encoder {
|
|
5684
5680
|
finalResult = "";
|
|
5685
5681
|
encoders = [];
|
|
@@ -6317,10 +6313,12 @@ class MapInfo {
|
|
|
6317
6313
|
*
|
|
6318
6314
|
* - Option `0`: return map title and mods used if defined
|
|
6319
6315
|
* - Option `1`: return song source and map download link to beatmap mirrors
|
|
6320
|
-
* - Option `2`: return
|
|
6321
|
-
* - Option `3`: return
|
|
6322
|
-
* - Option `4`: return
|
|
6323
|
-
* - Option `5`: return
|
|
6316
|
+
* - Option `2`: return circle, slider, and spinner count
|
|
6317
|
+
* - Option `3`: return CS, AR, OD, HP, and max score statistics for droid
|
|
6318
|
+
* - Option `4`: return CS, AR, OD, HP, and max score statistics for PC
|
|
6319
|
+
* - Option `5`: return BPM, map length, and max combo
|
|
6320
|
+
* - Option `6`: return last update date and map status
|
|
6321
|
+
* - Option `7`: return favorite count and play count
|
|
6324
6322
|
*
|
|
6325
6323
|
* @param option The option to pick.
|
|
6326
6324
|
* @param stats The custom statistics to apply. This will only be used to apply mods, custom speed multiplier, and force AR.
|
|
@@ -6343,13 +6341,9 @@ class MapInfo {
|
|
|
6343
6341
|
mapParams.speedMultiplier =
|
|
6344
6342
|
stats.speedMultiplier ?? mapParams.speedMultiplier;
|
|
6345
6343
|
}
|
|
6346
|
-
const mapStatistics = new MapStats(mapParams).calculate();
|
|
6347
|
-
mapStatistics.cs = parseFloat(mapStatistics.cs.toFixed(2));
|
|
6348
|
-
mapStatistics.ar = parseFloat(mapStatistics.ar.toFixed(2));
|
|
6349
|
-
mapStatistics.od = parseFloat(mapStatistics.od.toFixed(2));
|
|
6350
|
-
mapStatistics.hp = parseFloat(mapStatistics.hp.toFixed(2));
|
|
6351
6344
|
switch (option) {
|
|
6352
6345
|
case 0: {
|
|
6346
|
+
const mapStatistics = new MapStats(mapParams).calculate();
|
|
6353
6347
|
let string = `${this.fullTitle}${(mapStatistics.mods.length ?? 0) > 0
|
|
6354
6348
|
? ` +${mapStatistics.mods
|
|
6355
6349
|
.map((m) => m.acronym)
|
|
@@ -6393,9 +6387,57 @@ class MapInfo {
|
|
|
6393
6387
|
return string;
|
|
6394
6388
|
}
|
|
6395
6389
|
case 2:
|
|
6396
|
-
return `**Circles**: ${this.circles} - **Sliders**: ${this.sliders} - **Spinners**: ${this.spinners}
|
|
6390
|
+
return `**Circles**: ${this.circles} - **Sliders**: ${this.sliders} - **Spinners**: ${this.spinners}`;
|
|
6397
6391
|
case 3: {
|
|
6398
|
-
const
|
|
6392
|
+
const droidOriginalStats = new MapStats({
|
|
6393
|
+
cs: this.cs,
|
|
6394
|
+
ar: this.ar,
|
|
6395
|
+
od: this.od,
|
|
6396
|
+
hp: this.hp,
|
|
6397
|
+
}).calculate({ mode: exports.modes.droid });
|
|
6398
|
+
const droidModifiedStats = new MapStats(mapParams).calculate({ mode: exports.modes.droid });
|
|
6399
|
+
droidOriginalStats.cs = MathUtils.round(droidOriginalStats.cs, 2);
|
|
6400
|
+
droidOriginalStats.ar = MathUtils.round(droidOriginalStats.ar, 2);
|
|
6401
|
+
droidOriginalStats.od = MathUtils.round(droidOriginalStats.od, 2);
|
|
6402
|
+
droidOriginalStats.hp = MathUtils.round(droidOriginalStats.hp, 2);
|
|
6403
|
+
droidModifiedStats.cs = MathUtils.round(droidModifiedStats.cs, 2);
|
|
6404
|
+
droidModifiedStats.ar = MathUtils.round(droidModifiedStats.ar, 2);
|
|
6405
|
+
droidModifiedStats.od = MathUtils.round(droidModifiedStats.od, 2);
|
|
6406
|
+
droidModifiedStats.hp = MathUtils.round(droidModifiedStats.hp, 2);
|
|
6407
|
+
const maxScore = this.map?.maxDroidScore(new MapStats(mapParams)) ?? 0;
|
|
6408
|
+
return `**CS**: ${droidOriginalStats.cs}${Precision.almostEqualsNumber(droidOriginalStats.cs, droidModifiedStats.cs)
|
|
6409
|
+
? ""
|
|
6410
|
+
: ` (${droidModifiedStats.cs})`} - **AR**: ${droidOriginalStats.ar}${Precision.almostEqualsNumber(droidOriginalStats.ar, droidModifiedStats.ar)
|
|
6411
|
+
? ""
|
|
6412
|
+
: ` (${droidModifiedStats.ar})`} - **OD**: ${droidOriginalStats.od}${Precision.almostEqualsNumber(droidOriginalStats.od, droidModifiedStats.od)
|
|
6413
|
+
? ""
|
|
6414
|
+
: ` (${droidModifiedStats.od})`} - **HP**: ${droidOriginalStats.hp}${Precision.almostEqualsNumber(droidOriginalStats.hp, droidModifiedStats.hp)
|
|
6415
|
+
? ""
|
|
6416
|
+
: ` (${droidModifiedStats.hp})`}${maxScore > 0
|
|
6417
|
+
? `\n**Max Score**: ${maxScore.toLocaleString()}`
|
|
6418
|
+
: ""}`;
|
|
6419
|
+
}
|
|
6420
|
+
case 4: {
|
|
6421
|
+
const mapStatistics = new MapStats(mapParams).calculate();
|
|
6422
|
+
mapStatistics.cs = MathUtils.round(mapStatistics.cs, 2);
|
|
6423
|
+
mapStatistics.ar = MathUtils.round(mapStatistics.ar, 2);
|
|
6424
|
+
mapStatistics.od = MathUtils.round(mapStatistics.od, 2);
|
|
6425
|
+
mapStatistics.hp = MathUtils.round(mapStatistics.hp, 2);
|
|
6426
|
+
const maxScore = this.map?.maxOsuScore(mapStatistics.mods) ?? 0;
|
|
6427
|
+
return `**CS**: ${this.cs}${Precision.almostEqualsNumber(this.cs, mapStatistics.cs)
|
|
6428
|
+
? ""
|
|
6429
|
+
: ` (${mapStatistics.cs})`} - **AR**: ${this.ar}${Precision.almostEqualsNumber(this.ar, mapStatistics.ar)
|
|
6430
|
+
? ""
|
|
6431
|
+
: ` (${mapStatistics.ar})`} - **OD**: ${this.od}${Precision.almostEqualsNumber(this.od, mapStatistics.od)
|
|
6432
|
+
? ""
|
|
6433
|
+
: ` (${mapStatistics.od})`} - **HP**: ${this.hp}${Precision.almostEqualsNumber(this.hp, mapStatistics.hp)
|
|
6434
|
+
? ""
|
|
6435
|
+
: ` (${mapStatistics.hp})`}${maxScore > 0
|
|
6436
|
+
? `\n**Max Score**: ${maxScore.toLocaleString()}`
|
|
6437
|
+
: ""}`;
|
|
6438
|
+
}
|
|
6439
|
+
case 5: {
|
|
6440
|
+
const mapStatistics = new MapStats(mapParams).calculate();
|
|
6399
6441
|
const convertedBPM = this.convertBPM(mapStatistics);
|
|
6400
6442
|
let string = "**BPM**: ";
|
|
6401
6443
|
if (this.map) {
|
|
@@ -6403,9 +6445,7 @@ class MapInfo {
|
|
|
6403
6445
|
if (uninheritedTimingPoints.length === 1) {
|
|
6404
6446
|
string += `${this.bpm}${!Precision.almostEqualsNumber(this.bpm, convertedBPM)
|
|
6405
6447
|
? ` (${convertedBPM})`
|
|
6406
|
-
: ""} - **Length**: ${this.convertTime(mapStatistics)} - **Max Combo**: ${this.maxCombo}x
|
|
6407
|
-
? `\n**Max Score**: ${maxScore.toLocaleString()}`
|
|
6408
|
-
: ""}`;
|
|
6448
|
+
: ""} - **Length**: ${this.convertTime(mapStatistics)} - **Max Combo**: ${this.maxCombo}x`;
|
|
6409
6449
|
}
|
|
6410
6450
|
else {
|
|
6411
6451
|
let maxBPM = this.bpm;
|
|
@@ -6432,23 +6472,19 @@ class MapInfo {
|
|
|
6432
6472
|
string += `(${convertedBPM}) `;
|
|
6433
6473
|
}
|
|
6434
6474
|
}
|
|
6435
|
-
string += `- **Length**: ${this.convertTime(mapStatistics)} - **Max Combo**: ${this.maxCombo}x
|
|
6436
|
-
? `\n**Max score**: ${maxScore.toLocaleString()}`
|
|
6437
|
-
: ""}`;
|
|
6475
|
+
string += `- **Length**: ${this.convertTime(mapStatistics)} - **Max Combo**: ${this.maxCombo}x`;
|
|
6438
6476
|
}
|
|
6439
6477
|
}
|
|
6440
6478
|
else {
|
|
6441
6479
|
string += `${this.bpm}${!Precision.almostEqualsNumber(this.bpm, convertedBPM)
|
|
6442
6480
|
? ` (${convertedBPM})`
|
|
6443
|
-
: ""} - **Length**: ${this.convertTime(mapStatistics)} - **Max Combo**: ${this.maxCombo}x
|
|
6444
|
-
? `\n**Max score**: ${maxScore.toLocaleString()}`
|
|
6445
|
-
: ""}`;
|
|
6481
|
+
: ""} - **Length**: ${this.convertTime(mapStatistics)} - **Max Combo**: ${this.maxCombo}x`;
|
|
6446
6482
|
}
|
|
6447
6483
|
return string;
|
|
6448
6484
|
}
|
|
6449
|
-
case
|
|
6485
|
+
case 6:
|
|
6450
6486
|
return `**Last Update**: ${this.lastUpdate.toUTCString()} | **${this.convertStatus()}**`;
|
|
6451
|
-
case
|
|
6487
|
+
case 7:
|
|
6452
6488
|
return `❤️ **${this.favorites.toLocaleString()}** - ▶️ **${this.plays.toLocaleString()}**`;
|
|
6453
6489
|
default:
|
|
6454
6490
|
throw {
|