@rian8337/osu-difficulty-calculator 4.0.0-beta.63 → 4.0.0-beta.65
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 +63 -59
- package/package.json +3 -3
- package/typings/index.d.ts +22 -7
package/dist/index.js
CHANGED
|
@@ -65,19 +65,17 @@ class DifficultyCalculator {
|
|
|
65
65
|
/**
|
|
66
66
|
* `Mod`s that adjust the difficulty of a beatmap.
|
|
67
67
|
*/
|
|
68
|
-
this.difficultyAdjustmentMods =
|
|
69
|
-
osuBase.ModDoubleTime,
|
|
70
|
-
osuBase.ModNightCore,
|
|
68
|
+
this.difficultyAdjustmentMods = [
|
|
71
69
|
osuBase.ModDifficultyAdjust,
|
|
72
|
-
osuBase.
|
|
73
|
-
osuBase.ModHalfTime,
|
|
70
|
+
osuBase.ModRateAdjust,
|
|
74
71
|
osuBase.ModEasy,
|
|
75
72
|
osuBase.ModHardRock,
|
|
76
73
|
osuBase.ModFlashlight,
|
|
77
74
|
osuBase.ModHidden,
|
|
78
75
|
osuBase.ModRelax,
|
|
79
76
|
osuBase.ModAutopilot,
|
|
80
|
-
|
|
77
|
+
osuBase.ModMirror,
|
|
78
|
+
];
|
|
81
79
|
}
|
|
82
80
|
calculate(beatmap, mods) {
|
|
83
81
|
const playableBeatmap = beatmap instanceof osuBase.PlayableBeatmap
|
|
@@ -145,11 +143,11 @@ class DifficultyHitObject {
|
|
|
145
143
|
*
|
|
146
144
|
* @param object The underlying hitobject.
|
|
147
145
|
* @param lastObject The hitobject before this hitobject.
|
|
148
|
-
* @param lastLastObject The hitobject before the last hitobject.
|
|
149
146
|
* @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
|
|
150
147
|
* @param clockRate The clock rate of the beatmap.
|
|
148
|
+
* @param index The index of this hitobject in the list of all hitobjects.
|
|
151
149
|
*/
|
|
152
|
-
constructor(object, lastObject,
|
|
150
|
+
constructor(object, lastObject, difficultyHitObjects, clockRate, index) {
|
|
153
151
|
var _a, _b, _c, _d;
|
|
154
152
|
/**
|
|
155
153
|
* The aim strain generated by the hitobject if sliders are considered.
|
|
@@ -194,6 +192,16 @@ class DifficultyHitObject {
|
|
|
194
192
|
* The time taken to travel through `travelDistance`, with a minimum value of 25ms for sliders.
|
|
195
193
|
*/
|
|
196
194
|
this.travelTime = 0;
|
|
195
|
+
/**
|
|
196
|
+
* The distance travelled by the cursor upon completion of this hitobject if it was hit
|
|
197
|
+
* with as few movements as possible.
|
|
198
|
+
*/
|
|
199
|
+
this.lazyTravelDistance = 0;
|
|
200
|
+
/**
|
|
201
|
+
* The time taken by the cursor upon completion of this hitobject if it was hit with
|
|
202
|
+
* as few movements as possible.
|
|
203
|
+
*/
|
|
204
|
+
this.lazyTravelTime = 0;
|
|
197
205
|
/**
|
|
198
206
|
* Angle the player has to take to hit this hitobject.
|
|
199
207
|
*
|
|
@@ -204,7 +212,6 @@ class DifficultyHitObject {
|
|
|
204
212
|
this.assumedSliderRadius = DifficultyHitObject.normalizedRadius * 1.8;
|
|
205
213
|
this.object = object;
|
|
206
214
|
this.lastObject = lastObject;
|
|
207
|
-
this.lastLastObject = lastLastObject;
|
|
208
215
|
this.hitObjects = difficultyHitObjects;
|
|
209
216
|
if (object instanceof osuBase.Slider) {
|
|
210
217
|
this.fullGreatWindow =
|
|
@@ -226,6 +233,8 @@ class DifficultyHitObject {
|
|
|
226
233
|
this.deltaTime = 0;
|
|
227
234
|
this.strainTime = 0;
|
|
228
235
|
}
|
|
236
|
+
this.lastDifficultyObject = this.previous(0);
|
|
237
|
+
this.lastLastDifficultyObject = this.previous(1);
|
|
229
238
|
}
|
|
230
239
|
/**
|
|
231
240
|
* Computes the properties of this hitobject.
|
|
@@ -237,6 +246,7 @@ class DifficultyHitObject {
|
|
|
237
246
|
// Required for `DroidDifficultyHitObject` override.
|
|
238
247
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
239
248
|
hitObjects) {
|
|
249
|
+
this.calculateSliderCursorPosition();
|
|
240
250
|
this.setDistances(clockRate);
|
|
241
251
|
}
|
|
242
252
|
/**
|
|
@@ -311,8 +321,8 @@ class DifficultyHitObject {
|
|
|
311
321
|
}
|
|
312
322
|
setDistances(clockRate) {
|
|
313
323
|
if (this.object instanceof osuBase.Slider) {
|
|
314
|
-
this.calculateSliderCursorPosition(
|
|
315
|
-
this.travelDistance = this.
|
|
324
|
+
this.calculateSliderCursorPosition();
|
|
325
|
+
this.travelDistance = this.lazyTravelDistance;
|
|
316
326
|
// Bonus for repeat sliders until a better per nested object strain system can be achieved.
|
|
317
327
|
if (this.mode === osuBase.Modes.droid) {
|
|
318
328
|
this.travelDistance *= Math.pow(1 + this.object.repeatCount / 4, 1 / 4);
|
|
@@ -320,7 +330,7 @@ class DifficultyHitObject {
|
|
|
320
330
|
else {
|
|
321
331
|
this.travelDistance *= Math.pow(1 + this.object.repeatCount / 2.5, 1 / 2.5);
|
|
322
332
|
}
|
|
323
|
-
this.travelTime = Math.max(this.
|
|
333
|
+
this.travelTime = Math.max(this.lazyTravelTime / clockRate, DifficultyHitObject.minDeltaTime);
|
|
324
334
|
}
|
|
325
335
|
// We don't need to calculate either angle or distance when one of the last->curr objects is a spinner.
|
|
326
336
|
if (!this.lastObject ||
|
|
@@ -330,15 +340,18 @@ class DifficultyHitObject {
|
|
|
330
340
|
}
|
|
331
341
|
// We will scale distances by this factor, so we can assume a uniform CircleSize among beatmaps.
|
|
332
342
|
const { scalingFactor } = this;
|
|
333
|
-
const lastCursorPosition = this.
|
|
343
|
+
const lastCursorPosition = this.lastDifficultyObject !== null
|
|
344
|
+
? this.getEndCursorPosition(this.lastDifficultyObject)
|
|
345
|
+
: this.lastObject.getStackedPosition(this.mode);
|
|
334
346
|
this.lazyJumpDistance = this.object
|
|
335
347
|
.getStackedPosition(this.mode)
|
|
336
348
|
.scale(scalingFactor)
|
|
337
349
|
.subtract(lastCursorPosition.scale(scalingFactor)).length;
|
|
338
350
|
this.minimumJumpTime = this.strainTime;
|
|
339
351
|
this.minimumJumpDistance = this.lazyJumpDistance;
|
|
340
|
-
if (this.lastObject instanceof osuBase.Slider
|
|
341
|
-
|
|
352
|
+
if (this.lastObject instanceof osuBase.Slider &&
|
|
353
|
+
this.lastDifficultyObject !== null) {
|
|
354
|
+
const lastTravelTime = Math.max(this.lastDifficultyObject.lazyTravelTime / clockRate, DifficultyHitObject.minDeltaTime);
|
|
342
355
|
this.minimumJumpTime = Math.max(this.strainTime - lastTravelTime, DifficultyHitObject.minDeltaTime);
|
|
343
356
|
// There are two types of slider-to-object patterns to consider in order to better approximate the real movement a player will take to jump between the hitobjects.
|
|
344
357
|
//
|
|
@@ -366,8 +379,9 @@ class DifficultyHitObject {
|
|
|
366
379
|
this.minimumJumpDistance = Math.max(0, Math.min(this.lazyJumpDistance -
|
|
367
380
|
(this.maximumSliderRadius - this.assumedSliderRadius), tailJumpDistance - this.maximumSliderRadius));
|
|
368
381
|
}
|
|
369
|
-
if (this.
|
|
370
|
-
|
|
382
|
+
if (this.lastLastDifficultyObject &&
|
|
383
|
+
!(this.lastLastDifficultyObject.object instanceof osuBase.Spinner)) {
|
|
384
|
+
const lastLastCursorPosition = this.getEndCursorPosition(this.lastLastDifficultyObject);
|
|
371
385
|
const v1 = lastLastCursorPosition.subtract(this.lastObject.getStackedPosition(this.mode));
|
|
372
386
|
const v2 = this.object
|
|
373
387
|
.getStackedPosition(this.mode)
|
|
@@ -377,14 +391,14 @@ class DifficultyHitObject {
|
|
|
377
391
|
this.angle = Math.abs(Math.atan2(det, dot));
|
|
378
392
|
}
|
|
379
393
|
}
|
|
380
|
-
calculateSliderCursorPosition(
|
|
381
|
-
if (
|
|
394
|
+
calculateSliderCursorPosition() {
|
|
395
|
+
if (!(this.object instanceof osuBase.Slider) || this.lazyEndPosition) {
|
|
382
396
|
return;
|
|
383
397
|
}
|
|
384
|
-
let trackingEndTime =
|
|
385
|
-
let { nestedHitObjects: nestedObjects } =
|
|
398
|
+
let trackingEndTime = this.object.endTime;
|
|
399
|
+
let { nestedHitObjects: nestedObjects } = this.object;
|
|
386
400
|
if (this.mode === osuBase.Modes.osu) {
|
|
387
|
-
trackingEndTime = Math.max(
|
|
401
|
+
trackingEndTime = Math.max(this.object.endTime - osuBase.Slider.legacyLastTickOffset, this.object.startTime + this.object.duration / 2);
|
|
388
402
|
let lastRealTick = null;
|
|
389
403
|
for (let i = nestedObjects.length - 2; i > 0; --i) {
|
|
390
404
|
const current = nestedObjects[i];
|
|
@@ -413,15 +427,15 @@ class DifficultyHitObject {
|
|
|
413
427
|
}
|
|
414
428
|
if (this.mode === osuBase.Modes.droid) {
|
|
415
429
|
// Temporary lazy end position until a real result can be derived.
|
|
416
|
-
|
|
430
|
+
this.lazyEndPosition = this.object.getStackedPosition(this.mode);
|
|
417
431
|
// Stop here if the slider has too short duration, allowing the player to essentially
|
|
418
432
|
// complete the slider without movement, making travel distance and time irrelevant.
|
|
419
|
-
if (osuBase.Precision.almostEqualsNumber(
|
|
433
|
+
if (osuBase.Precision.almostEqualsNumber(this.object.startTime, this.object.endTime)) {
|
|
420
434
|
return;
|
|
421
435
|
}
|
|
422
436
|
}
|
|
423
|
-
|
|
424
|
-
let endTimeMin =
|
|
437
|
+
this.lazyTravelTime = trackingEndTime - this.object.startTime;
|
|
438
|
+
let endTimeMin = this.lazyTravelTime / this.object.spanDuration;
|
|
425
439
|
if (endTimeMin % 2 >= 1) {
|
|
426
440
|
endTimeMin = 1 - (endTimeMin % 1);
|
|
427
441
|
}
|
|
@@ -429,11 +443,11 @@ class DifficultyHitObject {
|
|
|
429
443
|
endTimeMin %= 1;
|
|
430
444
|
}
|
|
431
445
|
// Temporary lazy end position until a real result can be derived.
|
|
432
|
-
|
|
446
|
+
this.lazyEndPosition = this.object
|
|
433
447
|
.getStackedPosition(this.mode)
|
|
434
|
-
.add(
|
|
435
|
-
let currentCursorPosition =
|
|
436
|
-
const scalingFactor = DifficultyHitObject.normalizedRadius /
|
|
448
|
+
.add(this.object.path.positionAt(endTimeMin));
|
|
449
|
+
let currentCursorPosition = this.object.getStackedPosition(this.mode);
|
|
450
|
+
const scalingFactor = DifficultyHitObject.normalizedRadius / this.object.radius;
|
|
437
451
|
for (let i = 1; i < nestedObjects.length; ++i) {
|
|
438
452
|
const currentMovementObject = nestedObjects[i];
|
|
439
453
|
let currentMovement = currentMovementObject
|
|
@@ -447,7 +461,7 @@ class DifficultyHitObject {
|
|
|
447
461
|
// There is both a lazy end position as well as the actual end slider position. We assume the player takes the simpler movement.
|
|
448
462
|
// For sliders that are circular, the lazy end position may actually be farther away than the sliders' true end.
|
|
449
463
|
// This code is designed to prevent buffing situations where lazy end is actually a less efficient movement.
|
|
450
|
-
const lazyMovement =
|
|
464
|
+
const lazyMovement = this.lazyEndPosition.subtract(currentCursorPosition);
|
|
451
465
|
if (lazyMovement.length < currentMovement.length) {
|
|
452
466
|
currentMovement = lazyMovement;
|
|
453
467
|
}
|
|
@@ -465,21 +479,16 @@ class DifficultyHitObject {
|
|
|
465
479
|
currentMovementLength *=
|
|
466
480
|
(currentMovementLength - requiredMovement) /
|
|
467
481
|
currentMovementLength;
|
|
468
|
-
|
|
482
|
+
this.lazyTravelDistance += currentMovementLength;
|
|
469
483
|
}
|
|
470
484
|
if (i === nestedObjects.length - 1) {
|
|
471
|
-
|
|
485
|
+
this.lazyEndPosition = currentCursorPosition;
|
|
472
486
|
}
|
|
473
487
|
}
|
|
474
488
|
}
|
|
475
489
|
getEndCursorPosition(object) {
|
|
476
490
|
var _a;
|
|
477
|
-
|
|
478
|
-
if (object instanceof osuBase.Slider) {
|
|
479
|
-
this.calculateSliderCursorPosition(object);
|
|
480
|
-
pos = (_a = object.lazyEndPosition) !== null && _a !== void 0 ? _a : pos;
|
|
481
|
-
}
|
|
482
|
-
return pos;
|
|
491
|
+
return ((_a = object.lazyEndPosition) !== null && _a !== void 0 ? _a : object.object.getStackedPosition(this.mode));
|
|
483
492
|
}
|
|
484
493
|
}
|
|
485
494
|
/**
|
|
@@ -512,12 +521,11 @@ class DroidDifficultyHitObject extends DifficultyHitObject {
|
|
|
512
521
|
*
|
|
513
522
|
* @param object The underlying hitobject.
|
|
514
523
|
* @param lastObject The hitobject before this hitobject.
|
|
515
|
-
* @param lastLastObject The hitobject before the last hitobject.
|
|
516
524
|
* @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
|
|
517
525
|
* @param clockRate The clock rate of the beatmap.
|
|
518
526
|
*/
|
|
519
|
-
constructor(object, lastObject,
|
|
520
|
-
super(object, lastObject,
|
|
527
|
+
constructor(object, lastObject, difficultyHitObjects, clockRate, index) {
|
|
528
|
+
super(object, lastObject, difficultyHitObjects, clockRate, index);
|
|
521
529
|
/**
|
|
522
530
|
* The tap strain generated by the hitobject.
|
|
523
531
|
*/
|
|
@@ -1198,7 +1206,7 @@ class DroidFlashlightEvaluator {
|
|
|
1198
1206
|
let sliderBonus = 0;
|
|
1199
1207
|
if (current.object instanceof osuBase.Slider && withSliders) {
|
|
1200
1208
|
// Invert the scaling factor to determine the true travel distance independent of circle size.
|
|
1201
|
-
const pixelTravelDistance = current.
|
|
1209
|
+
const pixelTravelDistance = current.lazyTravelDistance / scalingFactor;
|
|
1202
1210
|
// Reward sliders based on velocity.
|
|
1203
1211
|
sliderBonus = Math.pow(Math.max(0, pixelTravelDistance / current.travelTime - this.minVelocity), 0.5);
|
|
1204
1212
|
// Longer sliders require more memorization.
|
|
@@ -1688,7 +1696,7 @@ class DroidVisualEvaluator {
|
|
|
1688
1696
|
if (current.object instanceof osuBase.Slider && withSliders) {
|
|
1689
1697
|
const scalingFactor = 50 / current.object.radius;
|
|
1690
1698
|
// Invert the scaling factor to determine the true travel distance independent of circle size.
|
|
1691
|
-
const pixelTravelDistance = current.
|
|
1699
|
+
const pixelTravelDistance = current.lazyTravelDistance / scalingFactor;
|
|
1692
1700
|
const currentVelocity = pixelTravelDistance / current.travelTime;
|
|
1693
1701
|
const spanTravelDistance = pixelTravelDistance / current.object.spanCount;
|
|
1694
1702
|
strain +=
|
|
@@ -1707,7 +1715,7 @@ class DroidVisualEvaluator {
|
|
|
1707
1715
|
continue;
|
|
1708
1716
|
}
|
|
1709
1717
|
// Invert the scaling factor to determine the true travel distance independent of circle size.
|
|
1710
|
-
const lastPixelTravelDistance = last.
|
|
1718
|
+
const lastPixelTravelDistance = last.lazyTravelDistance / scalingFactor;
|
|
1711
1719
|
const lastVelocity = lastPixelTravelDistance / last.travelTime;
|
|
1712
1720
|
const lastSpanTravelDistance = lastPixelTravelDistance / last.object.spanCount;
|
|
1713
1721
|
strain +=
|
|
@@ -1799,15 +1807,12 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1799
1807
|
constructor() {
|
|
1800
1808
|
super();
|
|
1801
1809
|
this.difficultyMultiplier = 0.18;
|
|
1802
|
-
this.difficultyAdjustmentMods
|
|
1803
|
-
.add(osuBase.ModPrecise)
|
|
1804
|
-
.add(osuBase.ModScoreV2)
|
|
1805
|
-
.add(osuBase.ModTraceable);
|
|
1810
|
+
this.difficultyAdjustmentMods.push(osuBase.ModPrecise, osuBase.ModScoreV2, osuBase.ModTraceable);
|
|
1806
1811
|
}
|
|
1807
1812
|
retainDifficultyAdjustmentMods(mods) {
|
|
1808
1813
|
return mods.filter((mod) => mod.isApplicableToDroid() &&
|
|
1809
|
-
|
|
1810
|
-
|
|
1814
|
+
mod.isDroidRelevant &&
|
|
1815
|
+
this.difficultyAdjustmentMods.some((m) => mod instanceof m));
|
|
1811
1816
|
}
|
|
1812
1817
|
createDifficultyAttributes(beatmap, skills, objects) {
|
|
1813
1818
|
const attributes = new ExtendedDroidDifficultyAttributes();
|
|
@@ -1868,12 +1873,12 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1868
1873
|
return beatmap.createDroidPlayableBeatmap(mods);
|
|
1869
1874
|
}
|
|
1870
1875
|
createDifficultyHitObjects(beatmap) {
|
|
1871
|
-
var _a
|
|
1876
|
+
var _a;
|
|
1872
1877
|
const clockRate = beatmap.speedMultiplier;
|
|
1873
1878
|
const difficultyObjects = [];
|
|
1874
1879
|
const { objects } = beatmap.hitObjects;
|
|
1875
1880
|
for (let i = 0; i < objects.length; ++i) {
|
|
1876
|
-
const difficultyObject = new DroidDifficultyHitObject(objects[i], (_a = objects[i - 1]) !== null && _a !== void 0 ? _a : null,
|
|
1881
|
+
const difficultyObject = new DroidDifficultyHitObject(objects[i], (_a = objects[i - 1]) !== null && _a !== void 0 ? _a : null, difficultyObjects, clockRate, i - 1);
|
|
1877
1882
|
difficultyObject.computeProperties(clockRate, objects);
|
|
1878
1883
|
difficultyObjects.push(difficultyObject);
|
|
1879
1884
|
}
|
|
@@ -3132,7 +3137,7 @@ class OsuFlashlightEvaluator {
|
|
|
3132
3137
|
let sliderBonus = 0;
|
|
3133
3138
|
if (current.object instanceof osuBase.Slider) {
|
|
3134
3139
|
// Invert the scaling factor to determine the true travel distance independent of circle size.
|
|
3135
|
-
const pixelTravelDistance = current.
|
|
3140
|
+
const pixelTravelDistance = current.lazyTravelDistance / scalingFactor;
|
|
3136
3141
|
// Reward sliders based on velocity.
|
|
3137
3142
|
sliderBonus = Math.pow(Math.max(0, pixelTravelDistance / current.travelTime - this.minVelocity), 0.5);
|
|
3138
3143
|
// Longer sliders require more memorization.
|
|
@@ -3452,12 +3457,12 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
3452
3457
|
constructor() {
|
|
3453
3458
|
super();
|
|
3454
3459
|
this.difficultyMultiplier = 0.0675;
|
|
3455
|
-
this.difficultyAdjustmentMods.
|
|
3460
|
+
this.difficultyAdjustmentMods.push(osuBase.ModTouchDevice);
|
|
3456
3461
|
}
|
|
3457
3462
|
retainDifficultyAdjustmentMods(mods) {
|
|
3458
3463
|
return mods.filter((mod) => mod.isApplicableToOsu() &&
|
|
3459
|
-
|
|
3460
|
-
|
|
3464
|
+
mod.isOsuRelevant &&
|
|
3465
|
+
this.difficultyAdjustmentMods.some((m) => mod instanceof m));
|
|
3461
3466
|
}
|
|
3462
3467
|
createDifficultyAttributes(beatmap, skills) {
|
|
3463
3468
|
const attributes = new OsuDifficultyAttributes();
|
|
@@ -3508,12 +3513,11 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
3508
3513
|
return beatmap.createOsuPlayableBeatmap(mods);
|
|
3509
3514
|
}
|
|
3510
3515
|
createDifficultyHitObjects(beatmap) {
|
|
3511
|
-
var _a;
|
|
3512
3516
|
const clockRate = beatmap.speedMultiplier;
|
|
3513
3517
|
const difficultyObjects = [];
|
|
3514
3518
|
const { objects } = beatmap.hitObjects;
|
|
3515
3519
|
for (let i = 1; i < objects.length; ++i) {
|
|
3516
|
-
const difficultyObject = new OsuDifficultyHitObject(objects[i], objects[i - 1],
|
|
3520
|
+
const difficultyObject = new OsuDifficultyHitObject(objects[i], objects[i - 1], difficultyObjects, clockRate, i - 1);
|
|
3517
3521
|
difficultyObject.computeProperties(clockRate, objects);
|
|
3518
3522
|
difficultyObjects.push(difficultyObject);
|
|
3519
3523
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rian8337/osu-difficulty-calculator",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.65",
|
|
4
4
|
"description": "A module for calculating osu!standard beatmap difficulty and performance value with respect to the current difficulty and performance algorithm.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"osu",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"url": "https://github.com/Rian8337/osu-droid-module/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@rian8337/osu-base": "^4.0.0-beta.
|
|
36
|
+
"@rian8337/osu-base": "^4.0.0-beta.65"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "7fde5e9b7f6240fc962a2ce3866d63059ff65767"
|
|
42
42
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModMap, SerializedMod, PlaceableHitObject, Modes, PlayableBeatmap, Mod, Beatmap, DroidPlayableBeatmap, Accuracy, OsuPlayableBeatmap } from '@rian8337/osu-base';
|
|
1
|
+
import { ModMap, SerializedMod, PlaceableHitObject, Vector2, Modes, PlayableBeatmap, Mod, Beatmap, DroidPlayableBeatmap, Accuracy, OsuPlayableBeatmap } from '@rian8337/osu-base';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Holds data that can be used to calculate performance points.
|
|
@@ -168,6 +168,21 @@ declare abstract class DifficultyHitObject {
|
|
|
168
168
|
* The time taken to travel through `travelDistance`, with a minimum value of 25ms for sliders.
|
|
169
169
|
*/
|
|
170
170
|
travelTime: number;
|
|
171
|
+
/**
|
|
172
|
+
* The position of the cursor at the point of completion of this hitobject if it was hit
|
|
173
|
+
* with as few movements as possible.
|
|
174
|
+
*/
|
|
175
|
+
lazyEndPosition?: Vector2;
|
|
176
|
+
/**
|
|
177
|
+
* The distance travelled by the cursor upon completion of this hitobject if it was hit
|
|
178
|
+
* with as few movements as possible.
|
|
179
|
+
*/
|
|
180
|
+
lazyTravelDistance: number;
|
|
181
|
+
/**
|
|
182
|
+
* The time taken by the cursor upon completion of this hitobject if it was hit with
|
|
183
|
+
* as few movements as possible.
|
|
184
|
+
*/
|
|
185
|
+
lazyTravelTime: number;
|
|
171
186
|
/**
|
|
172
187
|
* Angle the player has to take to hit this hitobject.
|
|
173
188
|
*
|
|
@@ -214,18 +229,19 @@ declare abstract class DifficultyHitObject {
|
|
|
214
229
|
*/
|
|
215
230
|
static readonly minDeltaTime = 25;
|
|
216
231
|
private readonly lastObject;
|
|
217
|
-
private readonly
|
|
232
|
+
private readonly lastDifficultyObject;
|
|
233
|
+
private readonly lastLastDifficultyObject;
|
|
218
234
|
/**
|
|
219
235
|
* Note: You **must** call `computeProperties` at some point due to how TypeScript handles
|
|
220
236
|
* overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue).
|
|
221
237
|
*
|
|
222
238
|
* @param object The underlying hitobject.
|
|
223
239
|
* @param lastObject The hitobject before this hitobject.
|
|
224
|
-
* @param lastLastObject The hitobject before the last hitobject.
|
|
225
240
|
* @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
|
|
226
241
|
* @param clockRate The clock rate of the beatmap.
|
|
242
|
+
* @param index The index of this hitobject in the list of all hitobjects.
|
|
227
243
|
*/
|
|
228
|
-
constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null,
|
|
244
|
+
constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number, index: number);
|
|
229
245
|
/**
|
|
230
246
|
* Computes the properties of this hitobject.
|
|
231
247
|
*
|
|
@@ -414,7 +430,7 @@ declare abstract class DifficultyCalculator<TBeatmap extends PlayableBeatmap, TH
|
|
|
414
430
|
/**
|
|
415
431
|
* `Mod`s that adjust the difficulty of a beatmap.
|
|
416
432
|
*/
|
|
417
|
-
protected readonly difficultyAdjustmentMods:
|
|
433
|
+
protected readonly difficultyAdjustmentMods: (typeof Mod)[];
|
|
418
434
|
/**
|
|
419
435
|
* Retains `Mod`s that adjust a beatmap's difficulty from the specified mods.
|
|
420
436
|
*
|
|
@@ -581,11 +597,10 @@ declare class DroidDifficultyHitObject extends DifficultyHitObject {
|
|
|
581
597
|
*
|
|
582
598
|
* @param object The underlying hitobject.
|
|
583
599
|
* @param lastObject The hitobject before this hitobject.
|
|
584
|
-
* @param lastLastObject The hitobject before the last hitobject.
|
|
585
600
|
* @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
|
|
586
601
|
* @param clockRate The clock rate of the beatmap.
|
|
587
602
|
*/
|
|
588
|
-
constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null,
|
|
603
|
+
constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number, index: number);
|
|
589
604
|
computeProperties(clockRate: number, hitObjects: readonly PlaceableHitObject[]): void;
|
|
590
605
|
opacityAt(time: number, mods: ModMap): number;
|
|
591
606
|
previous(backwardsIndex: number): this | null;
|