@rian8337/osu-rebalance-difficulty-calculator 4.0.0-beta.95 → 4.0.0-beta.97
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 +168 -33
- package/package.json +3 -3
- package/typings/index.d.ts +42 -1
package/dist/index.js
CHANGED
|
@@ -60,6 +60,118 @@ class DifficultyCalculator {
|
|
|
60
60
|
flashlight: skills[3].peaks,
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Calculates the difficulty of a `Beatmap` with specific `Mod`s and returns a set of
|
|
65
|
+
* `TimedDifficultyAttributes` representing the difficulty at every relevant time value in the `Beatmap`.
|
|
66
|
+
*
|
|
67
|
+
* @param beatmap The `Beatmap` whose difficulty is to be calculated.
|
|
68
|
+
* @param mods The `Mod`s to apply to the `Beatmap`.
|
|
69
|
+
* @return The set of `TimedDifficultyAttributes`.
|
|
70
|
+
*/
|
|
71
|
+
calculateTimed(beatmap, mods) {
|
|
72
|
+
if (beatmap.hitObjects.objects.length === 0) {
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
const playableBeatmap = this.createPlayableBeatmap(beatmap, mods);
|
|
76
|
+
const attributes = osuBase.Utils.initializeArray(beatmap.hitObjects.objects.length);
|
|
77
|
+
const skills = this.createSkills(playableBeatmap);
|
|
78
|
+
const progressiveBeatmap = new ProgressiveCalculationBeatmap(playableBeatmap);
|
|
79
|
+
const { objects } = playableBeatmap.hitObjects;
|
|
80
|
+
const difficultyObjects = this.createDifficultyHitObjects(playableBeatmap);
|
|
81
|
+
let currentIndex = 0;
|
|
82
|
+
for (let i = 0; i < objects.length; ++i) {
|
|
83
|
+
const obj = objects[i];
|
|
84
|
+
progressiveBeatmap.hitObjects.add(obj);
|
|
85
|
+
while (currentIndex < difficultyObjects.length && difficultyObjects[currentIndex].object.endTime <= obj.endTime) {
|
|
86
|
+
for (const skill of skills) {
|
|
87
|
+
skill.process(difficultyObjects[currentIndex]);
|
|
88
|
+
}
|
|
89
|
+
++currentIndex;
|
|
90
|
+
}
|
|
91
|
+
attributes[i] = {
|
|
92
|
+
time: obj.endTime,
|
|
93
|
+
attributes: this.createDifficultyAttributes(beatmap, playableBeatmap, skills, difficultyObjects.slice(0, currentIndex)),
|
|
94
|
+
sliderCount: progressiveBeatmap.hitObjects.sliders,
|
|
95
|
+
sliderTickCount: progressiveBeatmap.hitObjects.sliderTicks,
|
|
96
|
+
sliderRepeatCount: progressiveBeatmap.hitObjects.sliderRepeatPoints
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
return attributes;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A {@link PlayableBeatmap} for timed difficulty calculation.
|
|
104
|
+
*/
|
|
105
|
+
class ProgressiveCalculationBeatmap extends osuBase.PlayableBeatmap {
|
|
106
|
+
get maxCombo() {
|
|
107
|
+
return this.hitObjects.maxCombo;
|
|
108
|
+
}
|
|
109
|
+
constructor(baseBeatmap) {
|
|
110
|
+
super(baseBeatmap, baseBeatmap.mods);
|
|
111
|
+
this.hitObjects = new ProgressiveCalculationHitObjects();
|
|
112
|
+
this.baseHitWindow = baseBeatmap.hitWindow;
|
|
113
|
+
}
|
|
114
|
+
createHitWindow() {
|
|
115
|
+
return this.baseHitWindow;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
class ProgressiveCalculationHitObjects extends osuBase.BeatmapHitObjects {
|
|
119
|
+
constructor() {
|
|
120
|
+
super(...arguments);
|
|
121
|
+
this.maxCombo = 0;
|
|
122
|
+
// We store these locally since the super class's getters iterate through all objects, which is inefficient for progressive calculation.
|
|
123
|
+
this.sliderTickCount = 0;
|
|
124
|
+
this.sliderRepeatCount = 0;
|
|
125
|
+
}
|
|
126
|
+
get sliderTicks() {
|
|
127
|
+
return this.sliderTickCount;
|
|
128
|
+
}
|
|
129
|
+
get sliderRepeatPoints() {
|
|
130
|
+
return this.sliderRepeatCount;
|
|
131
|
+
}
|
|
132
|
+
add(...objects) {
|
|
133
|
+
super.add(...objects);
|
|
134
|
+
for (const obj of objects) {
|
|
135
|
+
if (obj instanceof osuBase.Slider) {
|
|
136
|
+
this.maxCombo += obj.nestedHitObjects.length;
|
|
137
|
+
// Similarly, we loop through the nested hit objects since `Slider.ticks` also loops
|
|
138
|
+
// through the nested hit objects, which is inefficient for progressive calculation.
|
|
139
|
+
for (const nestedObj of obj.nestedHitObjects) {
|
|
140
|
+
if (nestedObj instanceof osuBase.SliderTick) {
|
|
141
|
+
++this.sliderTickCount;
|
|
142
|
+
}
|
|
143
|
+
else if (nestedObj instanceof osuBase.SliderRepeat) {
|
|
144
|
+
++this.sliderRepeatCount;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
++this.maxCombo;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
removeAt(index) {
|
|
154
|
+
const obj = super.removeAt(index);
|
|
155
|
+
if (obj !== null) {
|
|
156
|
+
if (obj instanceof osuBase.Slider) {
|
|
157
|
+
this.maxCombo -= obj.nestedHitObjects.length;
|
|
158
|
+
// Similarly, we loop through the nested hit objects since `Slider.ticks` also loops
|
|
159
|
+
// through the nested hit objects, which is inefficient for progressive calculation.
|
|
160
|
+
for (const nestedObj of obj.nestedHitObjects) {
|
|
161
|
+
if (nestedObj instanceof osuBase.SliderTick) {
|
|
162
|
+
--this.sliderTickCount;
|
|
163
|
+
}
|
|
164
|
+
else if (nestedObj instanceof osuBase.SliderRepeat) {
|
|
165
|
+
--this.sliderRepeatCount;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
--this.maxCombo;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return obj;
|
|
174
|
+
}
|
|
63
175
|
}
|
|
64
176
|
|
|
65
177
|
/**
|
|
@@ -151,11 +263,11 @@ class PerformanceCalculator {
|
|
|
151
263
|
* @param options Options for performance calculation.
|
|
152
264
|
*/
|
|
153
265
|
handleOptions(options) {
|
|
154
|
-
var _a, _b;
|
|
266
|
+
var _a, _b, _c;
|
|
155
267
|
if ((options === null || options === void 0 ? void 0 : options.accPercent) instanceof osuBase.Accuracy) {
|
|
156
268
|
// Copy into new instance to not modify the original
|
|
157
269
|
this.computedAccuracy = new osuBase.Accuracy(options.accPercent);
|
|
158
|
-
if (this.computedAccuracy.
|
|
270
|
+
if (!this.computedAccuracy.isN300Resolved) {
|
|
159
271
|
this.computedAccuracy.n300 = Math.max(0, this.totalHits -
|
|
160
272
|
this.computedAccuracy.n100 -
|
|
161
273
|
this.computedAccuracy.n50 -
|
|
@@ -165,16 +277,15 @@ class PerformanceCalculator {
|
|
|
165
277
|
this.computedAccuracy.nmiss = Math.max(0, this.totalHits - this.totalSuccessfulHits);
|
|
166
278
|
}
|
|
167
279
|
}
|
|
280
|
+
else if ((options === null || options === void 0 ? void 0 : options.accPercent) !== undefined) {
|
|
281
|
+
this.computedAccuracy = osuBase.Accuracy.fromPercent(options.accPercent, this.totalHits, (_a = options.miss) !== null && _a !== void 0 ? _a : 0);
|
|
282
|
+
}
|
|
168
283
|
else {
|
|
169
|
-
this.computedAccuracy =
|
|
170
|
-
percent: options === null || options === void 0 ? void 0 : options.accPercent,
|
|
171
|
-
nobjects: this.totalHits,
|
|
172
|
-
nmiss: (_a = options === null || options === void 0 ? void 0 : options.miss) !== null && _a !== void 0 ? _a : 0,
|
|
173
|
-
});
|
|
284
|
+
this.computedAccuracy = osuBase.Accuracy.fromHitCounts({ nmiss: (_b = options === null || options === void 0 ? void 0 : options.miss) !== null && _b !== void 0 ? _b : 0 }, this.totalHits);
|
|
174
285
|
}
|
|
175
286
|
const maxCombo = this.difficultyAttributes.maxCombo;
|
|
176
287
|
const miss = this.computedAccuracy.nmiss;
|
|
177
|
-
this.combo = (
|
|
288
|
+
this.combo = (_c = options === null || options === void 0 ? void 0 : options.combo) !== null && _c !== void 0 ? _c : maxCombo - miss;
|
|
178
289
|
if ((options === null || options === void 0 ? void 0 : options.sliderEndsDropped) !== undefined &&
|
|
179
290
|
options.sliderTicksMissed !== undefined) {
|
|
180
291
|
this._usingClassicSliderAccuracy = false;
|
|
@@ -533,16 +644,16 @@ class DroidSnapAimEvaluator {
|
|
|
533
644
|
const radius = current.normalizedRadius;
|
|
534
645
|
const diameter = current.normalizedDiameter;
|
|
535
646
|
// Calculate the velocity to the current hitobject, which starts with a base distance / time assuming the last object is a hitcircle.
|
|
536
|
-
const currentDistance = withSliders
|
|
647
|
+
const currentDistance = withSliders && !current.is2BSlider
|
|
537
648
|
? current.lazyJumpDistance
|
|
538
649
|
: current.jumpDistance;
|
|
539
650
|
let currentVelocity = currentDistance / current.strainTime;
|
|
540
651
|
// But if the last object is a slider, then we extend the travel velocity through the slider into the current object.
|
|
541
|
-
if (last.object instanceof osuBase.Slider && withSliders) {
|
|
652
|
+
if (last.object instanceof osuBase.Slider && !last.is2BSlider && withSliders) {
|
|
542
653
|
const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
|
|
543
654
|
currentVelocity = Math.max(currentVelocity, sliderDistance / current.strainTime);
|
|
544
655
|
}
|
|
545
|
-
const prevDistance = withSliders
|
|
656
|
+
const prevDistance = withSliders && !last.is2BSlider
|
|
546
657
|
? last.lazyJumpDistance
|
|
547
658
|
: last.jumpDistance;
|
|
548
659
|
const prevVelocity = prevDistance / last.strainTime;
|
|
@@ -716,14 +827,14 @@ class DroidFlowAimEvaluator {
|
|
|
716
827
|
}
|
|
717
828
|
const last = current.previous(0);
|
|
718
829
|
const lastLast = current.previous(1);
|
|
719
|
-
const currentDistance = withSliders
|
|
830
|
+
const currentDistance = withSliders && !current.is2BSlider
|
|
720
831
|
? current.lazyJumpDistance
|
|
721
832
|
: current.jumpDistance;
|
|
722
|
-
const prevDistance = withSliders
|
|
833
|
+
const prevDistance = withSliders && !last.is2BSlider
|
|
723
834
|
? last.lazyJumpDistance
|
|
724
835
|
: last.jumpDistance;
|
|
725
836
|
let currentVelocity = currentDistance / current.strainTime;
|
|
726
|
-
if (last.object instanceof osuBase.Slider && withSliders) {
|
|
837
|
+
if (last.object instanceof osuBase.Slider && !last.is2BSlider && withSliders) {
|
|
727
838
|
// If the last object is a slider, then we extend the travel velocity through the slider into the current object.
|
|
728
839
|
const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
|
|
729
840
|
currentVelocity = Math.max(currentVelocity, sliderDistance / current.strainTime);
|
|
@@ -1812,20 +1923,29 @@ class DroidTapEvaluator {
|
|
|
1812
1923
|
current.isOverlapping(false)) {
|
|
1813
1924
|
return 0;
|
|
1814
1925
|
}
|
|
1926
|
+
let { strainTime } = current;
|
|
1927
|
+
// Nerf doubletappable doubles.
|
|
1815
1928
|
const doubletapness = considerCheesability
|
|
1816
1929
|
? 1 - current.getDoubletapness(current.next(0))
|
|
1817
1930
|
: 1;
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1931
|
+
// Cap deltatime to the OD 300 hitwindow.
|
|
1932
|
+
// 0.63 is derived from making sure 200 BPM 1/4 OD8 streams aren't nerfed harshly, whilst 0.92 limits the effect of the cap.
|
|
1933
|
+
strainTime /= osuBase.MathUtils.clamp(strainTime / current.hitWindowFor(osuBase.HitResult.Great) / 0.63, 0.92, 1);
|
|
1934
|
+
// speedBonus will be 0 for BPM < 200
|
|
1935
|
+
let speedBonus = 0;
|
|
1936
|
+
// Add additional scaling bonus for streams/bursts higher than 200bpm
|
|
1937
|
+
if (osuBase.MathUtils.millisecondsToBPM(strainTime) > this.minSpeedBonus) {
|
|
1938
|
+
speedBonus =
|
|
1821
1939
|
0.75 *
|
|
1822
1940
|
Math.pow(osuBase.ErrorFunction.erf((osuBase.MathUtils.bpmToMilliseconds(this.minSpeedBonus) -
|
|
1823
|
-
|
|
1941
|
+
strainTime) /
|
|
1824
1942
|
40), 2);
|
|
1825
1943
|
}
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1944
|
+
// Base difficulty with all bonuses
|
|
1945
|
+
let difficulty = ((1 + speedBonus) * 1000) / strainTime;
|
|
1946
|
+
difficulty *= this.highBpmBonus(current.strainTime);
|
|
1947
|
+
// Apply penalty if there's doubletappable doubles
|
|
1948
|
+
return difficulty * doubletapness;
|
|
1829
1949
|
}
|
|
1830
1950
|
static highBpmBonus(ms) {
|
|
1831
1951
|
return 1 / (1 - Math.pow(0.3, ms / 1000));
|
|
@@ -2493,6 +2613,19 @@ class DifficultyHitObject {
|
|
|
2493
2613
|
get angle() {
|
|
2494
2614
|
return this.angleSigned !== null ? Math.abs(this.angleSigned) : null;
|
|
2495
2615
|
}
|
|
2616
|
+
/**
|
|
2617
|
+
* Whether this hitobject is a 2B slider.
|
|
2618
|
+
*/
|
|
2619
|
+
get is2BSlider() {
|
|
2620
|
+
if (!(this.object instanceof osuBase.Slider)) {
|
|
2621
|
+
return false;
|
|
2622
|
+
}
|
|
2623
|
+
const next = this.next(0);
|
|
2624
|
+
if (!next) {
|
|
2625
|
+
return false;
|
|
2626
|
+
}
|
|
2627
|
+
return this.endTime - this.startTime > next.strainTime;
|
|
2628
|
+
}
|
|
2496
2629
|
/**
|
|
2497
2630
|
* The normalized diameter of the hitobject.
|
|
2498
2631
|
*/
|
|
@@ -3390,15 +3523,16 @@ class DroidScoreUtils {
|
|
|
3390
3523
|
/**
|
|
3391
3524
|
* Calculates the maximum possible spinner bonus for a given beatmap.
|
|
3392
3525
|
*
|
|
3393
|
-
* @param beatmap The
|
|
3526
|
+
* @param beatmap The `Beatmap` to calculate the maximum spinner bonus for.
|
|
3527
|
+
* @param playableBeatmap The `PlayableBeatmap` to calculate the maximum spinner bonus for.
|
|
3394
3528
|
* @returns The maximum spinner bonus.
|
|
3395
3529
|
*/
|
|
3396
|
-
static calculateMaximumSpinnerBonus(beatmap) {
|
|
3397
|
-
const { hitObjects } =
|
|
3530
|
+
static calculateMaximumSpinnerBonus(beatmap, playableBeatmap) {
|
|
3531
|
+
const { hitObjects } = playableBeatmap;
|
|
3398
3532
|
if (hitObjects.spinners === 0) {
|
|
3399
3533
|
return 0;
|
|
3400
3534
|
}
|
|
3401
|
-
const scoreMultiplier = osuBase.
|
|
3535
|
+
const scoreMultiplier = new osuBase.DroidScoreMultiplierCalculator(beatmap.difficulty).calculateFor(playableBeatmap.mods.values());
|
|
3402
3536
|
let bonus = 0;
|
|
3403
3537
|
// In osu!droid, there is no time-based limit to spinner RPM, since the limit is
|
|
3404
3538
|
// π/2 rad/*frame* and not rad/second.
|
|
@@ -3407,7 +3541,7 @@ class DroidScoreUtils {
|
|
|
3407
3541
|
// the actual maximum spinner bonus.
|
|
3408
3542
|
const maximumRotationsPerSecond = (Math.PI / 2) * 120;
|
|
3409
3543
|
// Taken from https://github.com/osudroid/osu-droid/blob/45ae4d66ce275382c5de037245ceca8704b3ae75/src/ru/nsu/ccfit/zuev/osu/game/GameScene.java#L1640.
|
|
3410
|
-
const minimumRotationsPerSecond = 2 + (2 *
|
|
3544
|
+
const minimumRotationsPerSecond = 2 + (2 * playableBeatmap.difficulty.od) / 10;
|
|
3411
3545
|
for (const obj of hitObjects.objects) {
|
|
3412
3546
|
if (!(obj instanceof osuBase.Spinner)) {
|
|
3413
3547
|
continue;
|
|
@@ -3450,8 +3584,9 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
3450
3584
|
attributes.overallDifficulty = playableBeatmap.difficulty.od;
|
|
3451
3585
|
// Cap at 32-bit signed integer since that's the maximum score that can be submitted
|
|
3452
3586
|
// to the game's leaderboards.
|
|
3453
|
-
attributes.maximumScore =
|
|
3454
|
-
|
|
3587
|
+
attributes.maximumScore =
|
|
3588
|
+
beatmap.maxDroidScore(playableBeatmap.mods) +
|
|
3589
|
+
DroidScoreUtils.calculateMaximumSpinnerBonus(beatmap, playableBeatmap);
|
|
3455
3590
|
this.populateAimAttributes(attributes, skills, objects);
|
|
3456
3591
|
this.populateTapAttributes(attributes, skills, objects);
|
|
3457
3592
|
this.populateRhythmAttributes(attributes, skills);
|
|
@@ -5026,7 +5161,7 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
5026
5161
|
1.3 +
|
|
5027
5162
|
this.totalHits *
|
|
5028
5163
|
(0.0016 / (1 + 2 * this._effectiveMissCount)) *
|
|
5029
|
-
Math.pow(this.computedAccuracy.value
|
|
5164
|
+
Math.pow(this.computedAccuracy.value, 16) *
|
|
5030
5165
|
(1 -
|
|
5031
5166
|
0.003 *
|
|
5032
5167
|
Math.pow(this.difficultyAttributes.drainRate, 2));
|
|
@@ -5037,7 +5172,7 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
5037
5172
|
this.calculateTraceableBonus(this.difficultyAttributes.sliderFactor);
|
|
5038
5173
|
}
|
|
5039
5174
|
// Scale the aim value with accuracy.
|
|
5040
|
-
aimValue *= this.computedAccuracy.value
|
|
5175
|
+
aimValue *= this.computedAccuracy.value;
|
|
5041
5176
|
return aimValue;
|
|
5042
5177
|
}
|
|
5043
5178
|
/**
|
|
@@ -5086,7 +5221,7 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
5086
5221
|
// Considering to use derivation from perfect accuracy in a probabilistic manner - assume normal distribution
|
|
5087
5222
|
let accuracyValue = Math.pow(1.52163, this.overallDifficulty) *
|
|
5088
5223
|
// It is possible to reach a negative accuracy with this formula. Cap it at zero - zero points.
|
|
5089
|
-
Math.pow(realAccuracy.n300 < 0 ? 0 : realAccuracy.value
|
|
5224
|
+
Math.pow(realAccuracy.n300 < 0 ? 0 : realAccuracy.value, 24) *
|
|
5090
5225
|
2.83;
|
|
5091
5226
|
// Bonus for many hitcircles - it's harder to keep good accuracy up for longer.
|
|
5092
5227
|
accuracyValue *= Math.pow(ncircles / 1000, ncircles < 1000 ? 0.3 : 0.1);
|
|
@@ -5120,7 +5255,7 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
5120
5255
|
Math.pow(this.effectiveMissCount / this.totalHits, 0.775), Math.pow(this.effectiveMissCount, 0.875));
|
|
5121
5256
|
}
|
|
5122
5257
|
// Scale the flashlight value with accuracy slightly.
|
|
5123
|
-
flashlightValue *= 0.5 + this.computedAccuracy.value
|
|
5258
|
+
flashlightValue *= 0.5 + this.computedAccuracy.value / 2;
|
|
5124
5259
|
return flashlightValue;
|
|
5125
5260
|
}
|
|
5126
5261
|
/**
|
|
@@ -5133,7 +5268,7 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
5133
5268
|
readingValue *= this.calculateMissPenalty(this.effectiveMissCount + aimEstimatedSliderBreaks, this.difficultyAttributes.readingDifficultNoteCount);
|
|
5134
5269
|
}
|
|
5135
5270
|
// Scale the reading value with accuracy _harshly_.
|
|
5136
|
-
readingValue *= Math.pow(this.computedAccuracy.value
|
|
5271
|
+
readingValue *= Math.pow(this.computedAccuracy.value, 3);
|
|
5137
5272
|
return readingValue;
|
|
5138
5273
|
}
|
|
5139
5274
|
/**
|
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.97",
|
|
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.97"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "0d77ee41c1b0eca8e46c118e942417483c4a9452"
|
|
42
42
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -130,6 +130,10 @@ declare abstract class DifficultyHitObject {
|
|
|
130
130
|
* The beatmap clock rate.
|
|
131
131
|
*/
|
|
132
132
|
readonly clockRate: number;
|
|
133
|
+
/**
|
|
134
|
+
* Whether this hitobject is a 2B slider.
|
|
135
|
+
*/
|
|
136
|
+
get is2BSlider(): boolean;
|
|
133
137
|
/**
|
|
134
138
|
* Selective bonus for beatmaps with higher circle size.
|
|
135
139
|
*/
|
|
@@ -446,6 +450,34 @@ declare abstract class Skill {
|
|
|
446
450
|
protected abstract processInternal(current: DifficultyHitObject): number;
|
|
447
451
|
}
|
|
448
452
|
|
|
453
|
+
/**
|
|
454
|
+
* Wraps a `DifficultyAttributes` object and adds a time value for which the attribute is valid.
|
|
455
|
+
*
|
|
456
|
+
* Output by `DifficultyCalculator.calculateTimed` methods.
|
|
457
|
+
*/
|
|
458
|
+
interface TimedDifficultyAttributes<TAttributes extends DifficultyAttributes> {
|
|
459
|
+
/**
|
|
460
|
+
* The non-clock-adjusted time value at which the attributes take effect.
|
|
461
|
+
*/
|
|
462
|
+
readonly time: number;
|
|
463
|
+
/**
|
|
464
|
+
* The attributes.
|
|
465
|
+
*/
|
|
466
|
+
readonly attributes: TAttributes;
|
|
467
|
+
/**
|
|
468
|
+
* The number of sliders in the beatmap up to this point.
|
|
469
|
+
*/
|
|
470
|
+
readonly sliderCount: number;
|
|
471
|
+
/**
|
|
472
|
+
* The number of slider ticks in the beatmap up to this point.
|
|
473
|
+
*/
|
|
474
|
+
readonly sliderTickCount: number;
|
|
475
|
+
/**
|
|
476
|
+
* The number of slider repeats in the beatmap up to this point.
|
|
477
|
+
*/
|
|
478
|
+
readonly sliderRepeatCount: number;
|
|
479
|
+
}
|
|
480
|
+
|
|
449
481
|
/**
|
|
450
482
|
* The base of a difficulty calculator.
|
|
451
483
|
*/
|
|
@@ -484,6 +516,15 @@ declare abstract class DifficultyCalculator<TBeatmap extends PlayableBeatmap, TH
|
|
|
484
516
|
* @returns The strain peaks of the `Beatmap`.
|
|
485
517
|
*/
|
|
486
518
|
calculateStrainPeaks(beatmap: Beatmap, mods?: ModMap): StrainPeaks;
|
|
519
|
+
/**
|
|
520
|
+
* Calculates the difficulty of a `Beatmap` with specific `Mod`s and returns a set of
|
|
521
|
+
* `TimedDifficultyAttributes` representing the difficulty at every relevant time value in the `Beatmap`.
|
|
522
|
+
*
|
|
523
|
+
* @param beatmap The `Beatmap` whose difficulty is to be calculated.
|
|
524
|
+
* @param mods The `Mod`s to apply to the `Beatmap`.
|
|
525
|
+
* @return The set of `TimedDifficultyAttributes`.
|
|
526
|
+
*/
|
|
527
|
+
calculateTimed(beatmap: Beatmap, mods?: ModMap): TimedDifficultyAttributes<TAttributes>[];
|
|
487
528
|
/**
|
|
488
529
|
* Creates the `Skill`s to calculate the difficulty of a `PlayableBeatmap`.
|
|
489
530
|
*
|
|
@@ -2045,4 +2086,4 @@ declare class OsuSpeed extends HarmonicSkill {
|
|
|
2045
2086
|
}
|
|
2046
2087
|
|
|
2047
2088
|
export { DifficultyAttributes, DifficultyCalculator, DifficultyHitObject, DroidAgilityEvaluator, DroidAim, DroidDifficultyAttributes, DroidDifficultyCalculator, DroidDifficultyHitObject, DroidFlashlight, DroidFlashlightEvaluator, DroidFlowAimEvaluator, DroidPerformanceCalculator, DroidReading, DroidReadingEvaluator, DroidRhythm, DroidRhythmEvaluator, DroidSnapAimEvaluator, DroidTap, DroidTapEvaluator, ExtendedDroidDifficultyAttributes, OsuAgilityEvaluator, OsuAim, OsuDifficultyAttributes, OsuDifficultyCalculator, OsuDifficultyHitObject, OsuFlashlight, OsuFlashlightEvaluator, OsuFlowAimEvaluator, OsuPerformanceCalculator, OsuReading, OsuReadingEvaluator, OsuRhythmEvaluator, OsuSnapAimEvaluator, OsuSpeed, OsuSpeedEvaluator, PerformanceCalculator };
|
|
2048
|
-
export type { CacheableDifficultyAttributes, DifficultSlider, HighStrainSection, IDifficultyAttributes, IDroidDifficultyAttributes, IExtendedDroidDifficultyAttributes, IOsuDifficultyAttributes, PerformanceCalculationOptions, StrainPeaks, TimedStrainPeak };
|
|
2089
|
+
export type { CacheableDifficultyAttributes, DifficultSlider, HighStrainSection, IDifficultyAttributes, IDroidDifficultyAttributes, IExtendedDroidDifficultyAttributes, IOsuDifficultyAttributes, PerformanceCalculationOptions, StrainPeaks, TimedDifficultyAttributes, TimedStrainPeak };
|