@rian8337/osu-rebalance-difficulty-calculator 4.0.0-beta.61 → 4.0.0-beta.64
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 +65 -60
- 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,9 +212,7 @@ 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
|
-
this.index = index;
|
|
210
216
|
if (object instanceof osuBase.Slider) {
|
|
211
217
|
this.fullGreatWindow =
|
|
212
218
|
((_b = (_a = object.head.hitWindow) === null || _a === void 0 ? void 0 : _a.greatWindow) !== null && _b !== void 0 ? _b : 1200) * 2;
|
|
@@ -215,6 +221,7 @@ class DifficultyHitObject {
|
|
|
215
221
|
this.fullGreatWindow = ((_d = (_c = object.hitWindow) === null || _c === void 0 ? void 0 : _c.greatWindow) !== null && _d !== void 0 ? _d : 1200) * 2;
|
|
216
222
|
}
|
|
217
223
|
this.fullGreatWindow /= clockRate;
|
|
224
|
+
this.index = index;
|
|
218
225
|
// Capped to 25ms to prevent difficulty calculation breaking from simultaneous objects.
|
|
219
226
|
this.startTime = object.startTime / clockRate;
|
|
220
227
|
this.endTime = object.endTime / clockRate;
|
|
@@ -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
|
*/
|
|
@@ -1199,7 +1207,7 @@ class DroidFlashlightEvaluator {
|
|
|
1199
1207
|
let sliderBonus = 0;
|
|
1200
1208
|
if (current.object instanceof osuBase.Slider && withSliders) {
|
|
1201
1209
|
// Invert the scaling factor to determine the true travel distance independent of circle size.
|
|
1202
|
-
const pixelTravelDistance = current.
|
|
1210
|
+
const pixelTravelDistance = current.lazyTravelDistance / scalingFactor;
|
|
1203
1211
|
// Reward sliders based on velocity.
|
|
1204
1212
|
sliderBonus = Math.pow(Math.max(0, pixelTravelDistance / current.travelTime - this.minVelocity), 0.5);
|
|
1205
1213
|
// Longer sliders require more memorization.
|
|
@@ -1687,7 +1695,7 @@ class DroidVisualEvaluator {
|
|
|
1687
1695
|
if (current.object instanceof osuBase.Slider && withSliders) {
|
|
1688
1696
|
const scalingFactor = 50 / current.object.radius;
|
|
1689
1697
|
// Invert the scaling factor to determine the true travel distance independent of circle size.
|
|
1690
|
-
const pixelTravelDistance = current.
|
|
1698
|
+
const pixelTravelDistance = current.lazyTravelDistance / scalingFactor;
|
|
1691
1699
|
const currentVelocity = pixelTravelDistance / current.travelTime;
|
|
1692
1700
|
const spanTravelDistance = pixelTravelDistance / current.object.spanCount;
|
|
1693
1701
|
strain +=
|
|
@@ -1706,7 +1714,7 @@ class DroidVisualEvaluator {
|
|
|
1706
1714
|
continue;
|
|
1707
1715
|
}
|
|
1708
1716
|
// Invert the scaling factor to determine the true travel distance independent of circle size.
|
|
1709
|
-
const lastPixelTravelDistance = last.
|
|
1717
|
+
const lastPixelTravelDistance = last.lazyTravelDistance / scalingFactor;
|
|
1710
1718
|
const lastVelocity = lastPixelTravelDistance / last.travelTime;
|
|
1711
1719
|
const lastSpanTravelDistance = lastPixelTravelDistance / last.object.spanCount;
|
|
1712
1720
|
strain +=
|
|
@@ -1798,15 +1806,12 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1798
1806
|
constructor() {
|
|
1799
1807
|
super();
|
|
1800
1808
|
this.difficultyMultiplier = 0.18;
|
|
1801
|
-
this.difficultyAdjustmentMods
|
|
1802
|
-
.add(osuBase.ModPrecise)
|
|
1803
|
-
.add(osuBase.ModScoreV2)
|
|
1804
|
-
.add(osuBase.ModTraceable);
|
|
1809
|
+
this.difficultyAdjustmentMods.push(osuBase.ModPrecise, osuBase.ModScoreV2, osuBase.ModTraceable);
|
|
1805
1810
|
}
|
|
1806
1811
|
retainDifficultyAdjustmentMods(mods) {
|
|
1807
1812
|
return mods.filter((mod) => mod.isApplicableToDroid() &&
|
|
1808
|
-
|
|
1809
|
-
|
|
1813
|
+
mod.isDroidRelevant &&
|
|
1814
|
+
this.difficultyAdjustmentMods.some((m) => mod instanceof m));
|
|
1810
1815
|
}
|
|
1811
1816
|
createDifficultyAttributes(beatmap, skills, objects) {
|
|
1812
1817
|
const attributes = new ExtendedDroidDifficultyAttributes();
|
|
@@ -1867,12 +1872,12 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1867
1872
|
return beatmap.createDroidPlayableBeatmap(mods);
|
|
1868
1873
|
}
|
|
1869
1874
|
createDifficultyHitObjects(beatmap) {
|
|
1870
|
-
var _a
|
|
1875
|
+
var _a;
|
|
1871
1876
|
const clockRate = beatmap.speedMultiplier;
|
|
1872
1877
|
const difficultyObjects = [];
|
|
1873
1878
|
const { objects } = beatmap.hitObjects;
|
|
1874
1879
|
for (let i = 0; i < objects.length; ++i) {
|
|
1875
|
-
const difficultyObject = new DroidDifficultyHitObject(objects[i], (_a = objects[i - 1]) !== null && _a !== void 0 ? _a : null,
|
|
1880
|
+
const difficultyObject = new DroidDifficultyHitObject(objects[i], (_a = objects[i - 1]) !== null && _a !== void 0 ? _a : null, difficultyObjects, clockRate, i - 1);
|
|
1876
1881
|
difficultyObject.computeProperties(clockRate, objects);
|
|
1877
1882
|
difficultyObjects.push(difficultyObject);
|
|
1878
1883
|
}
|
|
@@ -3115,7 +3120,7 @@ class OsuFlashlightEvaluator {
|
|
|
3115
3120
|
let sliderBonus = 0;
|
|
3116
3121
|
if (current.object instanceof osuBase.Slider) {
|
|
3117
3122
|
// Invert the scaling factor to determine the true travel distance independent of circle size.
|
|
3118
|
-
const pixelTravelDistance = current.
|
|
3123
|
+
const pixelTravelDistance = current.lazyTravelDistance / scalingFactor;
|
|
3119
3124
|
// Reward sliders based on velocity.
|
|
3120
3125
|
sliderBonus = Math.pow(Math.max(0, pixelTravelDistance / current.travelTime - this.minVelocity), 0.5);
|
|
3121
3126
|
// Longer sliders require more memorization.
|
|
@@ -3435,12 +3440,12 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
3435
3440
|
constructor() {
|
|
3436
3441
|
super();
|
|
3437
3442
|
this.difficultyMultiplier = 0.0675;
|
|
3438
|
-
this.difficultyAdjustmentMods.
|
|
3443
|
+
this.difficultyAdjustmentMods.push(osuBase.ModTouchDevice);
|
|
3439
3444
|
}
|
|
3440
3445
|
retainDifficultyAdjustmentMods(mods) {
|
|
3441
3446
|
return mods.filter((mod) => mod.isApplicableToOsu() &&
|
|
3442
|
-
|
|
3443
|
-
|
|
3447
|
+
mod.isOsuRelevant &&
|
|
3448
|
+
this.difficultyAdjustmentMods.some((m) => mod instanceof m));
|
|
3444
3449
|
}
|
|
3445
3450
|
createDifficultyAttributes(beatmap, skills) {
|
|
3446
3451
|
const attributes = new OsuDifficultyAttributes();
|
|
@@ -3491,12 +3496,12 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
3491
3496
|
return beatmap.createOsuPlayableBeatmap(mods);
|
|
3492
3497
|
}
|
|
3493
3498
|
createDifficultyHitObjects(beatmap) {
|
|
3494
|
-
var _a
|
|
3499
|
+
var _a;
|
|
3495
3500
|
const clockRate = beatmap.speedMultiplier;
|
|
3496
3501
|
const difficultyObjects = [];
|
|
3497
3502
|
const { objects } = beatmap.hitObjects;
|
|
3498
3503
|
for (let i = 1; i < objects.length; ++i) {
|
|
3499
|
-
const difficultyObject = new OsuDifficultyHitObject(objects[i], (_a = objects[i - 1]) !== null && _a !== void 0 ? _a : null,
|
|
3504
|
+
const difficultyObject = new OsuDifficultyHitObject(objects[i], (_a = objects[i - 1]) !== null && _a !== void 0 ? _a : null, difficultyObjects, clockRate, i - 1);
|
|
3500
3505
|
difficultyObject.computeProperties(clockRate, objects);
|
|
3501
3506
|
difficultyObjects.push(difficultyObject);
|
|
3502
3507
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rian8337/osu-rebalance-difficulty-calculator",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.64",
|
|
4
4
|
"description": "A module for calculating osu!standard beatmap difficulty and performance value with respect to the latest osu!lazer 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.64"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "94b205d8882d39d3436d93fb4de19871dea8a4b8"
|
|
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
|
*
|
|
@@ -413,7 +429,7 @@ declare abstract class DifficultyCalculator<TBeatmap extends PlayableBeatmap, TH
|
|
|
413
429
|
/**
|
|
414
430
|
* `Mod`s that adjust the difficulty of a beatmap.
|
|
415
431
|
*/
|
|
416
|
-
protected readonly difficultyAdjustmentMods:
|
|
432
|
+
protected readonly difficultyAdjustmentMods: (typeof Mod)[];
|
|
417
433
|
/**
|
|
418
434
|
* Retains `Mod`s that adjust a beatmap's difficulty from the specified mods.
|
|
419
435
|
*
|
|
@@ -580,11 +596,10 @@ declare class DroidDifficultyHitObject extends DifficultyHitObject {
|
|
|
580
596
|
*
|
|
581
597
|
* @param object The underlying hitobject.
|
|
582
598
|
* @param lastObject The hitobject before this hitobject.
|
|
583
|
-
* @param lastLastObject The hitobject before the last hitobject.
|
|
584
599
|
* @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
|
|
585
600
|
* @param clockRate The clock rate of the beatmap.
|
|
586
601
|
*/
|
|
587
|
-
constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null,
|
|
602
|
+
constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number, index: number);
|
|
588
603
|
computeProperties(clockRate: number, hitObjects: readonly PlaceableHitObject[]): void;
|
|
589
604
|
opacityAt(time: number, mods: ModMap): number;
|
|
590
605
|
previous(backwardsIndex: number): this | null;
|