@rian8337/osu-difficulty-calculator 4.0.0-beta.3 → 4.0.0-beta.31
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 +1832 -1589
- package/package.json +9 -6
- package/typings/index.d.ts +591 -497
- package/dist/index.js.map +0 -1
package/typings/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mod, PlaceableHitObject, Modes, Beatmap, Accuracy } from '@rian8337/osu-base';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* An evaluator for calculating aim skill.
|
|
@@ -20,16 +20,6 @@ declare abstract class AimEvaluator {
|
|
|
20
20
|
protected static calculateAcuteAngleBonus(angle: number): number;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
/**
|
|
24
|
-
* The base of calculation options.
|
|
25
|
-
*/
|
|
26
|
-
interface CalculationOptions {
|
|
27
|
-
/**
|
|
28
|
-
* Custom map statistics to apply custom speed multiplier as well as old statistics.
|
|
29
|
-
*/
|
|
30
|
-
stats?: MapStats;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
23
|
/**
|
|
34
24
|
* Holds data that can be used to calculate performance points.
|
|
35
25
|
*/
|
|
@@ -69,11 +59,9 @@ interface DifficultyAttributes {
|
|
|
69
59
|
*/
|
|
70
60
|
sliderFactor: number;
|
|
71
61
|
/**
|
|
72
|
-
* The
|
|
73
|
-
*
|
|
74
|
-
* Rate-adjusting mods don't directly affect the approach rate difficulty value, but have a perceived effect as a result of adjusting audio timing.
|
|
62
|
+
* The overall clock rate that was applied to the beatmap.
|
|
75
63
|
*/
|
|
76
|
-
|
|
64
|
+
clockRate: number;
|
|
77
65
|
/**
|
|
78
66
|
* The perceived overall difficulty inclusive of rate-adjusting mods (DT/HT/etc), based on osu!standard judgement.
|
|
79
67
|
*
|
|
@@ -92,22 +80,40 @@ interface DifficultyAttributes {
|
|
|
92
80
|
* The number of spinners in the beatmap.
|
|
93
81
|
*/
|
|
94
82
|
spinnerCount: number;
|
|
83
|
+
/**
|
|
84
|
+
* The amount of strains that are considered difficult with respect to the aim skill.
|
|
85
|
+
*/
|
|
86
|
+
aimDifficultStrainCount: number;
|
|
95
87
|
}
|
|
96
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Represents difficulty attributes that can be cached.
|
|
91
|
+
*/
|
|
92
|
+
type CacheableDifficultyAttributes<T extends DifficultyAttributes> = Omit<T, "mods"> & {
|
|
93
|
+
/**
|
|
94
|
+
* The mods which were applied to the beatmap.
|
|
95
|
+
*/
|
|
96
|
+
mods: string;
|
|
97
|
+
};
|
|
98
|
+
|
|
97
99
|
/**
|
|
98
100
|
* Represents options for difficulty calculation.
|
|
99
101
|
*/
|
|
100
|
-
interface DifficultyCalculationOptions
|
|
102
|
+
interface DifficultyCalculationOptions {
|
|
101
103
|
/**
|
|
102
104
|
* The modifications to apply.
|
|
103
105
|
*/
|
|
104
|
-
mods?: Mod[];
|
|
106
|
+
readonly mods?: Mod[];
|
|
107
|
+
/**
|
|
108
|
+
* The custom speed multiplier to apply. Defaults to 1.
|
|
109
|
+
*/
|
|
110
|
+
readonly customSpeedMultiplier?: number;
|
|
105
111
|
}
|
|
106
112
|
|
|
107
113
|
/**
|
|
108
|
-
* Represents
|
|
114
|
+
* Represents a hit object with difficulty calculation values.
|
|
109
115
|
*/
|
|
110
|
-
declare class DifficultyHitObject {
|
|
116
|
+
declare abstract class DifficultyHitObject {
|
|
111
117
|
/**
|
|
112
118
|
* The underlying hitobject.
|
|
113
119
|
*/
|
|
@@ -117,19 +123,7 @@ declare class DifficultyHitObject {
|
|
|
117
123
|
*
|
|
118
124
|
* This is one less than the actual index of the hitobject in the beatmap.
|
|
119
125
|
*/
|
|
120
|
-
index: number;
|
|
121
|
-
/**
|
|
122
|
-
* The preempt time of the hitobject.
|
|
123
|
-
*/
|
|
124
|
-
baseTimePreempt: number;
|
|
125
|
-
/**
|
|
126
|
-
* Adjusted preempt time of the hitobject, taking speed multiplier into account.
|
|
127
|
-
*/
|
|
128
|
-
timePreempt: number;
|
|
129
|
-
/**
|
|
130
|
-
* The fade in time of the hitobject.
|
|
131
|
-
*/
|
|
132
|
-
timeFadeIn: number;
|
|
126
|
+
readonly index: number;
|
|
133
127
|
/**
|
|
134
128
|
* The aim strain generated by the hitobject if sliders are considered.
|
|
135
129
|
*/
|
|
@@ -138,41 +132,10 @@ declare class DifficultyHitObject {
|
|
|
138
132
|
* The aim strain generated by the hitobject if sliders are not considered.
|
|
139
133
|
*/
|
|
140
134
|
aimStrainWithoutSliders: number;
|
|
141
|
-
/**
|
|
142
|
-
* The tap strain generated by the hitobject.
|
|
143
|
-
*
|
|
144
|
-
* This is also used for osu!standard as opposed to "speed strain".
|
|
145
|
-
*/
|
|
146
|
-
tapStrain: number;
|
|
147
|
-
/**
|
|
148
|
-
* The tap strain generated by the hitobject if `strainTime` isn't modified by
|
|
149
|
-
* OD. This is used in three-finger detection.
|
|
150
|
-
*/
|
|
151
|
-
originalTapStrain: number;
|
|
152
135
|
/**
|
|
153
136
|
* The rhythm multiplier generated by the hitobject. This is used to alter tap strain.
|
|
154
137
|
*/
|
|
155
138
|
rhythmMultiplier: number;
|
|
156
|
-
/**
|
|
157
|
-
* The rhythm strain generated by the hitobject.
|
|
158
|
-
*/
|
|
159
|
-
rhythmStrain: number;
|
|
160
|
-
/**
|
|
161
|
-
* The flashlight strain generated by the hitobject if sliders are considered.
|
|
162
|
-
*/
|
|
163
|
-
flashlightStrainWithSliders: number;
|
|
164
|
-
/**
|
|
165
|
-
* The flashlight strain generated by the hitobject if sliders are not considered.
|
|
166
|
-
*/
|
|
167
|
-
flashlightStrainWithoutSliders: number;
|
|
168
|
-
/**
|
|
169
|
-
* The visual strain generated by the hitobject if sliders are considered.
|
|
170
|
-
*/
|
|
171
|
-
visualStrainWithSliders: number;
|
|
172
|
-
/**
|
|
173
|
-
* The visual strain generated by the hitobject if sliders are not considered.
|
|
174
|
-
*/
|
|
175
|
-
visualStrainWithoutSliders: number;
|
|
176
139
|
/**
|
|
177
140
|
* The normalized distance from the "lazy" end position of the previous hitobject to the start position of this hitobject.
|
|
178
141
|
*
|
|
@@ -213,42 +176,56 @@ declare class DifficultyHitObject {
|
|
|
213
176
|
/**
|
|
214
177
|
* The amount of milliseconds elapsed between this hitobject and the last hitobject.
|
|
215
178
|
*/
|
|
216
|
-
deltaTime: number;
|
|
179
|
+
readonly deltaTime: number;
|
|
217
180
|
/**
|
|
218
181
|
* The amount of milliseconds elapsed since the start time of the previous hitobject, with a minimum of 25ms.
|
|
219
182
|
*/
|
|
220
|
-
strainTime: number;
|
|
183
|
+
readonly strainTime: number;
|
|
221
184
|
/**
|
|
222
185
|
* Adjusted start time of the hitobject, taking speed multiplier into account.
|
|
223
186
|
*/
|
|
224
|
-
startTime: number;
|
|
187
|
+
readonly startTime: number;
|
|
225
188
|
/**
|
|
226
189
|
* Adjusted end time of the hitobject, taking speed multiplier into account.
|
|
227
190
|
*/
|
|
228
|
-
endTime: number;
|
|
191
|
+
readonly endTime: number;
|
|
229
192
|
/**
|
|
230
|
-
* The
|
|
193
|
+
* The full great window of the hitobject.
|
|
231
194
|
*/
|
|
232
|
-
|
|
195
|
+
readonly fullGreatWindow: number;
|
|
233
196
|
/**
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
* This is used to scale visual skill.
|
|
197
|
+
* Other hitobjects in the beatmap, including this hitobject.
|
|
237
198
|
*/
|
|
238
|
-
|
|
199
|
+
protected readonly hitObjects: readonly DifficultyHitObject[];
|
|
200
|
+
protected abstract readonly mode: Modes;
|
|
201
|
+
protected readonly normalizedRadius = 50;
|
|
202
|
+
protected readonly maximumSliderRadius: number;
|
|
203
|
+
protected readonly assumedSliderRadius: number;
|
|
239
204
|
/**
|
|
240
|
-
*
|
|
205
|
+
* The lowest possible delta time value.
|
|
241
206
|
*/
|
|
242
|
-
|
|
207
|
+
static readonly minDeltaTime = 25;
|
|
208
|
+
private readonly lastObject;
|
|
209
|
+
private readonly lastLastObject;
|
|
243
210
|
/**
|
|
244
|
-
*
|
|
211
|
+
* Note: You **must** call `computeProperties` at some point due to how TypeScript handles
|
|
212
|
+
* overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue).
|
|
213
|
+
*
|
|
214
|
+
* @param object The underlying hitobject.
|
|
215
|
+
* @param lastObject The hitobject before this hitobject.
|
|
216
|
+
* @param lastLastObject The hitobject before the last hitobject.
|
|
217
|
+
* @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
|
|
218
|
+
* @param clockRate The clock rate of the beatmap.
|
|
219
|
+
* @param greatWindow The great window of the hitobject.
|
|
245
220
|
*/
|
|
246
|
-
|
|
221
|
+
constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, lastLastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number, greatWindow: number);
|
|
247
222
|
/**
|
|
248
|
-
*
|
|
249
|
-
*
|
|
223
|
+
* Computes the properties of this hitobject.
|
|
224
|
+
*
|
|
225
|
+
* @param clockRate The clock rate of the beatmap.
|
|
226
|
+
* @param hitObjects The hitobjects in the beatmap.
|
|
250
227
|
*/
|
|
251
|
-
|
|
228
|
+
computeProperties(clockRate: number, hitObjects: readonly PlaceableHitObject[]): void;
|
|
252
229
|
/**
|
|
253
230
|
* Gets the difficulty hitobject at a specific index with respect to the current
|
|
254
231
|
* difficulty hitobject's index.
|
|
@@ -259,7 +236,7 @@ declare class DifficultyHitObject {
|
|
|
259
236
|
* @returns The difficulty hitobject at the index with respect to the current
|
|
260
237
|
* difficulty hitobject's index, `null` if the index is out of range.
|
|
261
238
|
*/
|
|
262
|
-
previous(backwardsIndex: number):
|
|
239
|
+
previous(backwardsIndex: number): this | null;
|
|
263
240
|
/**
|
|
264
241
|
* Gets the difficulty hitobject at a specific index with respect to the current
|
|
265
242
|
* difficulty hitobject's index.
|
|
@@ -270,26 +247,48 @@ declare class DifficultyHitObject {
|
|
|
270
247
|
* @returns The difficulty hitobject at the index with respect to the current
|
|
271
248
|
* difficulty hitobject's index, `null` if the index is out of range.
|
|
272
249
|
*/
|
|
273
|
-
next(forwardsIndex: number):
|
|
250
|
+
next(forwardsIndex: number): this | null;
|
|
274
251
|
/**
|
|
275
252
|
* Calculates the opacity of the hitobject at a given time.
|
|
276
253
|
*
|
|
277
254
|
* @param time The time to calculate the hitobject's opacity at.
|
|
278
255
|
* @param isHidden Whether Hidden mod is used.
|
|
279
|
-
* @param mode The gamemode to calculate the opacity for.
|
|
280
256
|
* @returns The opacity of the hitobject at the given time.
|
|
281
257
|
*/
|
|
282
|
-
opacityAt(time: number, isHidden: boolean
|
|
258
|
+
opacityAt(time: number, isHidden: boolean): number;
|
|
283
259
|
/**
|
|
284
|
-
*
|
|
260
|
+
* How possible is it to doubletap this object together with the next one and get perfect
|
|
261
|
+
* judgement in range from 0 to 1.
|
|
285
262
|
*
|
|
286
|
-
*
|
|
287
|
-
* can be hit with just a single tap in osu!droid.
|
|
288
|
-
*
|
|
289
|
-
* @param considerDistance Whether to consider the distance between both hitobjects.
|
|
290
|
-
* @returns Whether the hitobject is considered overlapping.
|
|
263
|
+
* A value closer to 1 indicates a higher possibility.
|
|
291
264
|
*/
|
|
292
|
-
|
|
265
|
+
get doubletapness(): number;
|
|
266
|
+
protected abstract get scalingFactor(): number;
|
|
267
|
+
protected setDistances(clockRate: number): void;
|
|
268
|
+
private calculateSliderCursorPosition;
|
|
269
|
+
private getEndCursorPosition;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Represents the strain peaks of various calculated difficulties.
|
|
274
|
+
*/
|
|
275
|
+
interface StrainPeaks {
|
|
276
|
+
/**
|
|
277
|
+
* The strain peaks of aim difficulty if sliders are considered.
|
|
278
|
+
*/
|
|
279
|
+
aimWithSliders: number[];
|
|
280
|
+
/**
|
|
281
|
+
* The strain peaks of aim difficulty if sliders are not considered.
|
|
282
|
+
*/
|
|
283
|
+
aimWithoutSliders: number[];
|
|
284
|
+
/**
|
|
285
|
+
* The strain peaks of speed difficulty.
|
|
286
|
+
*/
|
|
287
|
+
speed: number[];
|
|
288
|
+
/**
|
|
289
|
+
* The strain peaks of flashlight difficulty.
|
|
290
|
+
*/
|
|
291
|
+
flashlight: number[];
|
|
293
292
|
}
|
|
294
293
|
|
|
295
294
|
/**
|
|
@@ -316,103 +315,9 @@ declare abstract class Skill {
|
|
|
316
315
|
}
|
|
317
316
|
|
|
318
317
|
/**
|
|
319
|
-
*
|
|
320
|
-
* and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
|
|
321
|
-
*/
|
|
322
|
-
declare abstract class StrainSkill extends Skill {
|
|
323
|
-
/**
|
|
324
|
-
* The strain of currently calculated hitobject.
|
|
325
|
-
*/
|
|
326
|
-
protected currentStrain: number;
|
|
327
|
-
/**
|
|
328
|
-
* The current section's strain peak.
|
|
329
|
-
*/
|
|
330
|
-
protected currentSectionPeak: number;
|
|
331
|
-
/**
|
|
332
|
-
* Strain peaks are stored here.
|
|
333
|
-
*/
|
|
334
|
-
readonly strainPeaks: number[];
|
|
335
|
-
/**
|
|
336
|
-
* The number of sections with the highest strains, which the peak strain reductions will apply to.
|
|
337
|
-
* This is done in order to decrease their impact on the overall difficulty of the map for this skill.
|
|
338
|
-
*/
|
|
339
|
-
protected abstract readonly reducedSectionCount: number;
|
|
340
|
-
/**
|
|
341
|
-
* The baseline multiplier applied to the section with the biggest strain.
|
|
342
|
-
*/
|
|
343
|
-
protected abstract readonly reducedSectionBaseline: number;
|
|
344
|
-
/**
|
|
345
|
-
* Strain values are multiplied by this number for the given skill. Used to balance the value of different skills between each other.
|
|
346
|
-
*/
|
|
347
|
-
protected abstract readonly skillMultiplier: number;
|
|
348
|
-
/**
|
|
349
|
-
* Determines how quickly strain decays for the given skill.
|
|
350
|
-
*
|
|
351
|
-
* For example, a value of 0.15 indicates that strain decays to 15% of its original value in one second.
|
|
352
|
-
*/
|
|
353
|
-
protected abstract readonly strainDecayBase: number;
|
|
354
|
-
private readonly sectionLength;
|
|
355
|
-
private currentSectionEnd;
|
|
356
|
-
private isFirstObject;
|
|
357
|
-
/**
|
|
358
|
-
* Calculates the strain value of a hitobject and stores the value in it. This value is affected by previously processed objects.
|
|
359
|
-
*
|
|
360
|
-
* @param current The hitobject to process.
|
|
361
|
-
*/
|
|
362
|
-
process(current: DifficultyHitObject): void;
|
|
363
|
-
/**
|
|
364
|
-
* Saves the current peak strain level to the list of strain peaks, which will be used to calculate an overall difficulty.
|
|
365
|
-
*/
|
|
366
|
-
saveCurrentPeak(): void;
|
|
367
|
-
/**
|
|
368
|
-
* Calculates strain decay for a specified time frame.
|
|
369
|
-
*
|
|
370
|
-
* @param ms The time frame to calculate.
|
|
371
|
-
*/
|
|
372
|
-
protected strainDecay(ms: number): number;
|
|
373
|
-
/**
|
|
374
|
-
* Calculates the strain value at a hitobject.
|
|
375
|
-
*/
|
|
376
|
-
protected abstract strainValueAt(current: DifficultyHitObject): number;
|
|
377
|
-
/**
|
|
378
|
-
* Saves the current strain to a hitobject.
|
|
379
|
-
*/
|
|
380
|
-
protected abstract saveToHitObject(current: DifficultyHitObject): void;
|
|
381
|
-
/**
|
|
382
|
-
* Sets the initial strain level for a new section.
|
|
383
|
-
*
|
|
384
|
-
* @param offset The beginning of the new section in milliseconds, adjusted by speed multiplier.
|
|
385
|
-
* @param current The current hitobject.
|
|
386
|
-
*/
|
|
387
|
-
private startNewSectionFrom;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* Represents the strain peaks of various calculated difficulties.
|
|
318
|
+
* The base of a difficulty calculator.
|
|
392
319
|
*/
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* The strain peaks of aim difficulty if sliders are considered.
|
|
396
|
-
*/
|
|
397
|
-
aimWithSliders: number[];
|
|
398
|
-
/**
|
|
399
|
-
* The strain peaks of aim difficulty if sliders are not considered.
|
|
400
|
-
*/
|
|
401
|
-
aimWithoutSliders: number[];
|
|
402
|
-
/**
|
|
403
|
-
* The strain peaks of speed difficulty.
|
|
404
|
-
*/
|
|
405
|
-
speed: number[];
|
|
406
|
-
/**
|
|
407
|
-
* The strain peaks of flashlight difficulty.
|
|
408
|
-
*/
|
|
409
|
-
flashlight: number[];
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
/**
|
|
413
|
-
* The base of difficulty calculators.
|
|
414
|
-
*/
|
|
415
|
-
declare abstract class DifficultyCalculator {
|
|
320
|
+
declare abstract class DifficultyCalculator<THitObject extends DifficultyHitObject, TAttributes extends DifficultyAttributes> {
|
|
416
321
|
/**
|
|
417
322
|
* The calculated beatmap.
|
|
418
323
|
*/
|
|
@@ -420,7 +325,11 @@ declare abstract class DifficultyCalculator {
|
|
|
420
325
|
/**
|
|
421
326
|
* The difficulty objects of the beatmap.
|
|
422
327
|
*/
|
|
423
|
-
|
|
328
|
+
private _objects;
|
|
329
|
+
/**
|
|
330
|
+
* The difficulty objects of the beatmap.
|
|
331
|
+
*/
|
|
332
|
+
get objects(): readonly THitObject[];
|
|
424
333
|
/**
|
|
425
334
|
* The modifications applied.
|
|
426
335
|
*/
|
|
@@ -428,26 +337,25 @@ declare abstract class DifficultyCalculator {
|
|
|
428
337
|
/**
|
|
429
338
|
* The total star rating of the beatmap.
|
|
430
339
|
*/
|
|
431
|
-
total: number;
|
|
432
|
-
/**
|
|
433
|
-
* The map statistics of the beatmap after modifications are applied.
|
|
434
|
-
*/
|
|
435
|
-
stats: MapStats;
|
|
340
|
+
get total(): number;
|
|
436
341
|
/**
|
|
437
342
|
* The strain peaks of various calculated difficulties.
|
|
438
343
|
*/
|
|
439
344
|
readonly strainPeaks: StrainPeaks;
|
|
440
345
|
/**
|
|
441
|
-
*
|
|
346
|
+
* The difficulty attributes that can be used to calculate performance points.
|
|
442
347
|
*/
|
|
443
|
-
abstract readonly attributes:
|
|
444
|
-
|
|
348
|
+
abstract readonly attributes: TAttributes;
|
|
349
|
+
/**
|
|
350
|
+
* The difficulty attributes that can be cached. It can also be used to calculate performance points.
|
|
351
|
+
*/
|
|
352
|
+
abstract get cacheableAttributes(): CacheableDifficultyAttributes<TAttributes>;
|
|
445
353
|
protected abstract readonly difficultyMultiplier: number;
|
|
446
354
|
protected abstract readonly mode: Modes;
|
|
447
355
|
/**
|
|
448
356
|
* Constructs a new instance of the calculator.
|
|
449
357
|
*
|
|
450
|
-
* @param beatmap The beatmap to calculate.
|
|
358
|
+
* @param beatmap The beatmap to calculate.
|
|
451
359
|
*/
|
|
452
360
|
constructor(beatmap: Beatmap);
|
|
453
361
|
/**
|
|
@@ -468,14 +376,17 @@ declare abstract class DifficultyCalculator {
|
|
|
468
376
|
calculate(options?: DifficultyCalculationOptions): this;
|
|
469
377
|
/**
|
|
470
378
|
* Generates difficulty hitobjects for this calculator.
|
|
379
|
+
*
|
|
380
|
+
* @param beatmap The beatmap to generate difficulty hitobjects from.
|
|
381
|
+
* @param clockRate The clock rate of the beatmap.
|
|
471
382
|
*/
|
|
472
|
-
generateDifficultyHitObjects():
|
|
383
|
+
protected abstract generateDifficultyHitObjects(beatmap: Beatmap, clockRate: number): THitObject[];
|
|
473
384
|
/**
|
|
474
385
|
* Calculates the skills provided.
|
|
475
386
|
*
|
|
476
387
|
* @param skills The skills to calculate.
|
|
477
388
|
*/
|
|
478
|
-
protected calculateSkills(...skills:
|
|
389
|
+
protected calculateSkills(...skills: Skill[]): void;
|
|
479
390
|
/**
|
|
480
391
|
* Calculates the total star rating of the beatmap and stores it in this instance.
|
|
481
392
|
*/
|
|
@@ -491,11 +402,21 @@ declare abstract class DifficultyCalculator {
|
|
|
491
402
|
/**
|
|
492
403
|
* Creates skills to be calculated.
|
|
493
404
|
*/
|
|
494
|
-
protected abstract createSkills():
|
|
405
|
+
protected abstract createSkills(): Skill[];
|
|
406
|
+
/**
|
|
407
|
+
* Obtains the clock rate of the beatmap.
|
|
408
|
+
*
|
|
409
|
+
* @param options The options to obtain the clock rate with.
|
|
410
|
+
* @returns The clock rate of the beatmap.
|
|
411
|
+
*/
|
|
412
|
+
protected calculateClockRate(options?: DifficultyCalculationOptions): number;
|
|
495
413
|
/**
|
|
496
414
|
* Populates the stored difficulty attributes with necessary data.
|
|
415
|
+
*
|
|
416
|
+
* @param beatmap The beatmap to populate the attributes with.
|
|
417
|
+
* @param clockRate The clock rate of the beatmap.
|
|
497
418
|
*/
|
|
498
|
-
protected populateDifficultyAttributes(): void;
|
|
419
|
+
protected populateDifficultyAttributes(beatmap: Beatmap, clockRate: number): void;
|
|
499
420
|
/**
|
|
500
421
|
* Calculates the star rating value of a difficulty.
|
|
501
422
|
*
|
|
@@ -511,120 +432,241 @@ declare abstract class DifficultyCalculator {
|
|
|
511
432
|
}
|
|
512
433
|
|
|
513
434
|
/**
|
|
514
|
-
*
|
|
435
|
+
* Represents a slider that is considered difficult.
|
|
436
|
+
*
|
|
437
|
+
* This structure is a part of difficulty attributes and can be cached.
|
|
515
438
|
*/
|
|
516
|
-
|
|
439
|
+
interface DifficultSlider {
|
|
440
|
+
/**
|
|
441
|
+
* The index of the slider in the beatmap.
|
|
442
|
+
*/
|
|
443
|
+
readonly index: number;
|
|
444
|
+
/**
|
|
445
|
+
* The difficulty rating of this slider compared to other sliders, based on the velocity of the slider.
|
|
446
|
+
*
|
|
447
|
+
* A value closer to 1 indicates that this slider is more difficult compared to most sliders.
|
|
448
|
+
*
|
|
449
|
+
* A value closer to 0 indicates that this slider is easier compared to most sliders.
|
|
450
|
+
*/
|
|
451
|
+
readonly difficultyRating: number;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
|
|
456
|
+
* and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
|
|
457
|
+
*/
|
|
458
|
+
declare abstract class StrainSkill extends Skill {
|
|
459
|
+
/**
|
|
460
|
+
* Strain peaks are stored here.
|
|
461
|
+
*/
|
|
462
|
+
readonly strainPeaks: number[];
|
|
463
|
+
/**
|
|
464
|
+
* The number of sections with the highest strains, which the peak strain reductions will apply to.
|
|
465
|
+
* This is done in order to decrease their impact on the overall difficulty of the map for this skill.
|
|
466
|
+
*/
|
|
467
|
+
protected abstract readonly reducedSectionCount: number;
|
|
468
|
+
/**
|
|
469
|
+
* The baseline multiplier applied to the section with the biggest strain.
|
|
470
|
+
*/
|
|
471
|
+
protected abstract readonly reducedSectionBaseline: number;
|
|
472
|
+
/**
|
|
473
|
+
* Determines how quickly strain decays for the given skill.
|
|
474
|
+
*
|
|
475
|
+
* For example, a value of 0.15 indicates that strain decays to 15% of its original value in one second.
|
|
476
|
+
*/
|
|
477
|
+
protected abstract readonly strainDecayBase: number;
|
|
478
|
+
protected readonly _objectStrains: number[];
|
|
479
|
+
protected difficulty: number;
|
|
480
|
+
/**
|
|
481
|
+
* The strains of hitobjects.
|
|
482
|
+
*/
|
|
483
|
+
get objectStrains(): readonly number[];
|
|
484
|
+
private readonly sectionLength;
|
|
485
|
+
private currentStrain;
|
|
486
|
+
private currentSectionPeak;
|
|
487
|
+
private currentSectionEnd;
|
|
488
|
+
process(current: DifficultyHitObject): void;
|
|
489
|
+
/**
|
|
490
|
+
* Saves the current peak strain level to the list of strain peaks, which will be used to calculate an overall difficulty.
|
|
491
|
+
*/
|
|
492
|
+
saveCurrentPeak(): void;
|
|
493
|
+
/**
|
|
494
|
+
* Returns the number of strains weighed against the top strain.
|
|
495
|
+
*
|
|
496
|
+
* The result is scaled by clock rate as it affects the total number of strains.
|
|
497
|
+
*/
|
|
498
|
+
countDifficultStrains(): number;
|
|
499
|
+
/**
|
|
500
|
+
* Calculates strain decay for a specified time frame.
|
|
501
|
+
*
|
|
502
|
+
* @param ms The time frame to calculate.
|
|
503
|
+
*/
|
|
504
|
+
protected strainDecay(ms: number): number;
|
|
505
|
+
/**
|
|
506
|
+
* Calculates the starting time of a strain section at an object.
|
|
507
|
+
*
|
|
508
|
+
* @param current The object at which the strain section starts.
|
|
509
|
+
* @returns The start time of the strain section.
|
|
510
|
+
*/
|
|
511
|
+
protected calculateCurrentSectionStart(current: DifficultyHitObject): number;
|
|
512
|
+
/**
|
|
513
|
+
* Calculates the strain value at a hitobject.
|
|
514
|
+
*
|
|
515
|
+
* @param current The hitobject to calculate.
|
|
516
|
+
*/
|
|
517
|
+
protected abstract strainValueAt(current: DifficultyHitObject): number;
|
|
518
|
+
/**
|
|
519
|
+
* Saves the current strain to a hitobject.
|
|
520
|
+
*/
|
|
521
|
+
protected abstract saveToHitObject(current: DifficultyHitObject): void;
|
|
522
|
+
/**
|
|
523
|
+
* Retrieves the peak strain at a point in time.
|
|
524
|
+
*
|
|
525
|
+
* @param time The time to retrieve the peak strain at.
|
|
526
|
+
* @param current The current hit object.
|
|
527
|
+
* @returns The peak strain.
|
|
528
|
+
*/
|
|
529
|
+
protected abstract calculateInitialStrain(time: number, current: DifficultyHitObject): number;
|
|
530
|
+
/**
|
|
531
|
+
* Sets the initial strain level for a new section.
|
|
532
|
+
*
|
|
533
|
+
* @param time The beginning of the new section in milliseconds.
|
|
534
|
+
* @param current The current hitobject.
|
|
535
|
+
*/
|
|
536
|
+
private startNewSectionFrom;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
|
|
541
|
+
* and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
|
|
542
|
+
*/
|
|
543
|
+
declare abstract class DroidSkill extends StrainSkill {
|
|
544
|
+
/**
|
|
545
|
+
* The bonus multiplier that is given for a sequence of notes of equal difficulty.
|
|
546
|
+
*/
|
|
547
|
+
protected abstract readonly starsPerDouble: number;
|
|
548
|
+
process(current: DifficultyHitObject): void;
|
|
549
|
+
difficultyValue(): number;
|
|
550
|
+
/**
|
|
551
|
+
* Gets the strain of a hitobject.
|
|
552
|
+
*
|
|
553
|
+
* @param current The hitobject to get the strain from.
|
|
554
|
+
* @returns The strain of the hitobject.
|
|
555
|
+
*/
|
|
556
|
+
protected abstract getObjectStrain(current: DifficultyHitObject): number;
|
|
557
|
+
protected calculateCurrentSectionStart(current: DifficultyHitObject): number;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* Represents an osu!droid hit object with difficulty calculation values.
|
|
562
|
+
*/
|
|
563
|
+
declare class DroidDifficultyHitObject extends DifficultyHitObject {
|
|
564
|
+
/**
|
|
565
|
+
* The tap strain generated by the hitobject.
|
|
566
|
+
*/
|
|
567
|
+
tapStrain: number;
|
|
568
|
+
/**
|
|
569
|
+
* The tap strain generated by the hitobject if `strainTime` isn't modified by
|
|
570
|
+
* OD. This is used in three-finger detection.
|
|
571
|
+
*/
|
|
572
|
+
originalTapStrain: number;
|
|
517
573
|
/**
|
|
518
|
-
* The
|
|
574
|
+
* The rhythm strain generated by the hitobject.
|
|
519
575
|
*/
|
|
520
|
-
|
|
576
|
+
rhythmStrain: number;
|
|
521
577
|
/**
|
|
522
|
-
* The
|
|
578
|
+
* The flashlight strain generated by the hitobject if sliders are considered.
|
|
523
579
|
*/
|
|
524
|
-
|
|
580
|
+
flashlightStrainWithSliders: number;
|
|
525
581
|
/**
|
|
526
|
-
* The
|
|
582
|
+
* The flashlight strain generated by the hitobject if sliders are not considered.
|
|
527
583
|
*/
|
|
528
|
-
|
|
584
|
+
flashlightStrainWithoutSliders: number;
|
|
529
585
|
/**
|
|
530
|
-
* The
|
|
586
|
+
* The visual strain generated by the hitobject if sliders are considered.
|
|
531
587
|
*/
|
|
532
|
-
|
|
533
|
-
private maximumSliderRadius;
|
|
534
|
-
private readonly assumedSliderRadius;
|
|
535
|
-
private readonly minDeltaTime;
|
|
588
|
+
visualStrainWithSliders: number;
|
|
536
589
|
/**
|
|
537
|
-
*
|
|
590
|
+
* The visual strain generated by the hitobject if sliders are not considered.
|
|
538
591
|
*/
|
|
539
|
-
|
|
540
|
-
objects: readonly HitObject[];
|
|
541
|
-
circleSize: number;
|
|
542
|
-
mods: Mod[];
|
|
543
|
-
speedMultiplier: number;
|
|
544
|
-
mode: Modes;
|
|
545
|
-
preempt?: number;
|
|
546
|
-
}): DifficultyHitObject[];
|
|
592
|
+
visualStrainWithoutSliders: number;
|
|
547
593
|
/**
|
|
548
|
-
*
|
|
594
|
+
* The note density of the hitobject.
|
|
549
595
|
*/
|
|
550
|
-
|
|
596
|
+
noteDensity: number;
|
|
551
597
|
/**
|
|
552
|
-
*
|
|
598
|
+
* The overlapping factor of the hitobject.
|
|
553
599
|
*
|
|
554
|
-
*
|
|
600
|
+
* This is used to scale visual skill.
|
|
555
601
|
*/
|
|
556
|
-
|
|
602
|
+
overlappingFactor: number;
|
|
557
603
|
/**
|
|
558
|
-
*
|
|
604
|
+
* Adjusted preempt time of the hitobject, taking speed multiplier into account.
|
|
559
605
|
*/
|
|
560
|
-
|
|
561
|
-
private
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
* Represents a slider that is considered difficult.
|
|
566
|
-
*
|
|
567
|
-
* This structure is a part of difficulty attributes and can be cached.
|
|
568
|
-
*/
|
|
569
|
-
interface DifficultSlider {
|
|
606
|
+
readonly timePreempt: number;
|
|
607
|
+
private readonly radiusBuffThreshold;
|
|
608
|
+
protected readonly mode = Modes.droid;
|
|
609
|
+
protected readonly maximumSliderRadius: number;
|
|
610
|
+
protected get scalingFactor(): number;
|
|
570
611
|
/**
|
|
571
|
-
*
|
|
612
|
+
* Note: You **must** call `computeProperties` at some point due to how TypeScript handles
|
|
613
|
+
* overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue).
|
|
614
|
+
*
|
|
615
|
+
* @param object The underlying hitobject.
|
|
616
|
+
* @param lastObject The hitobject before this hitobject.
|
|
617
|
+
* @param lastLastObject The hitobject before the last hitobject.
|
|
618
|
+
* @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
|
|
619
|
+
* @param clockRate The clock rate of the beatmap.
|
|
620
|
+
* @param greatWindow The great window of the hitobject.
|
|
572
621
|
*/
|
|
573
|
-
readonly
|
|
622
|
+
constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, lastLastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number, greatWindow: number);
|
|
623
|
+
computeProperties(clockRate: number, hitObjects: readonly PlaceableHitObject[]): void;
|
|
574
624
|
/**
|
|
575
|
-
*
|
|
625
|
+
* Determines whether this hitobject is considered overlapping with the hitobject before it.
|
|
576
626
|
*
|
|
577
|
-
*
|
|
627
|
+
* Keep in mind that "overlapping" in this case is overlapping to the point where both hitobjects
|
|
628
|
+
* can be hit with just a single tap in osu!droid.
|
|
578
629
|
*
|
|
579
|
-
*
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
/**
|
|
585
|
-
* Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
|
|
586
|
-
* and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
|
|
587
|
-
*/
|
|
588
|
-
declare abstract class DroidSkill extends StrainSkill {
|
|
589
|
-
/**
|
|
590
|
-
* The bonus multiplier that is given for a sequence of notes of equal difficulty.
|
|
630
|
+
* In the case of sliders, it is considered overlapping if all nested hitobjects can be hit with
|
|
631
|
+
* one aim motion.
|
|
632
|
+
*
|
|
633
|
+
* @param considerDistance Whether to consider the distance between both hitobjects.
|
|
634
|
+
* @returns Whether the hitobject is considered overlapping.
|
|
591
635
|
*/
|
|
592
|
-
|
|
593
|
-
|
|
636
|
+
isOverlapping(considerDistance: boolean): boolean;
|
|
637
|
+
private setVisuals;
|
|
638
|
+
private applyToOverlappingFactor;
|
|
594
639
|
}
|
|
595
640
|
|
|
596
641
|
/**
|
|
597
642
|
* Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
|
|
598
643
|
*/
|
|
599
644
|
declare class DroidAim extends DroidSkill {
|
|
600
|
-
protected readonly
|
|
601
|
-
protected readonly
|
|
602
|
-
protected readonly
|
|
603
|
-
protected readonly
|
|
604
|
-
|
|
645
|
+
protected readonly strainDecayBase = 0.15;
|
|
646
|
+
protected readonly reducedSectionCount = 10;
|
|
647
|
+
protected readonly reducedSectionBaseline = 0.75;
|
|
648
|
+
protected readonly starsPerDouble = 1.05;
|
|
649
|
+
private readonly skillMultiplier;
|
|
605
650
|
private readonly withSliders;
|
|
651
|
+
private currentAimStrain;
|
|
606
652
|
constructor(mods: Mod[], withSliders: boolean);
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
protected strainValueAt(current: DifficultyHitObject): number;
|
|
653
|
+
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
654
|
+
protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
|
|
655
|
+
protected getObjectStrain(): number;
|
|
611
656
|
/**
|
|
612
657
|
* @param current The hitobject to save to.
|
|
613
658
|
*/
|
|
614
|
-
protected saveToHitObject(current:
|
|
659
|
+
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
615
660
|
}
|
|
616
661
|
|
|
617
662
|
/**
|
|
618
663
|
* An evaluator for calculating osu!droid Aim skill.
|
|
619
664
|
*/
|
|
620
665
|
declare abstract class DroidAimEvaluator extends AimEvaluator {
|
|
621
|
-
protected static readonly wideAngleMultiplier
|
|
622
|
-
protected static readonly sliderMultiplier
|
|
623
|
-
protected static readonly velocityChangeMultiplier
|
|
624
|
-
|
|
625
|
-
* Spacing threshold for a single hitobject spacing.
|
|
626
|
-
*/
|
|
627
|
-
private static readonly SINGLE_SPACING_THRESHOLD;
|
|
666
|
+
protected static readonly wideAngleMultiplier = 1.65;
|
|
667
|
+
protected static readonly sliderMultiplier = 1.5;
|
|
668
|
+
protected static readonly velocityChangeMultiplier = 0.85;
|
|
669
|
+
private static readonly singleSpacingThreshold;
|
|
628
670
|
private static readonly minSpeedBonus;
|
|
629
671
|
/**
|
|
630
672
|
* Evaluates the difficulty of aiming the current object, based on:
|
|
@@ -637,15 +679,15 @@ declare abstract class DroidAimEvaluator extends AimEvaluator {
|
|
|
637
679
|
* @param current The current object.
|
|
638
680
|
* @param withSliders Whether to take slider difficulty into account.
|
|
639
681
|
*/
|
|
640
|
-
static evaluateDifficultyOf(current:
|
|
682
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, withSliders: boolean): number;
|
|
641
683
|
/**
|
|
642
|
-
* Calculates the aim strain of a hitobject.
|
|
684
|
+
* Calculates the snap aim strain of a hitobject.
|
|
643
685
|
*/
|
|
644
|
-
private static
|
|
686
|
+
private static snapAimStrainOf;
|
|
645
687
|
/**
|
|
646
|
-
* Calculates the
|
|
688
|
+
* Calculates the flow aim strain of a hitobject.
|
|
647
689
|
*/
|
|
648
|
-
private static
|
|
690
|
+
private static flowAimStrainOf;
|
|
649
691
|
}
|
|
650
692
|
|
|
651
693
|
/**
|
|
@@ -664,6 +706,40 @@ interface DroidDifficultyAttributes extends DifficultyAttributes {
|
|
|
664
706
|
* The difficulty corresponding to the visual skill.
|
|
665
707
|
*/
|
|
666
708
|
visualDifficulty: number;
|
|
709
|
+
/**
|
|
710
|
+
* The amount of strains that are considered difficult with respect to the tap skill.
|
|
711
|
+
*/
|
|
712
|
+
tapDifficultStrainCount: number;
|
|
713
|
+
/**
|
|
714
|
+
* The amount of strains that are considered difficult with respect to the flashlight skill.
|
|
715
|
+
*/
|
|
716
|
+
flashlightDifficultStrainCount: number;
|
|
717
|
+
/**
|
|
718
|
+
* The amount of strains that are considered difficult with respect to the visual skill.
|
|
719
|
+
*/
|
|
720
|
+
visualDifficultStrainCount: number;
|
|
721
|
+
/**
|
|
722
|
+
* The average delta time of speed objects.
|
|
723
|
+
*/
|
|
724
|
+
averageSpeedDeltaTime: number;
|
|
725
|
+
/**
|
|
726
|
+
* Describes how much of tap difficulty is contributed by notes that are "vibroable".
|
|
727
|
+
*
|
|
728
|
+
* A value closer to 1 indicates most of tap difficulty is contributed by notes that are not "vibroable".
|
|
729
|
+
*
|
|
730
|
+
* A value closer to 0 indicates most of tap difficulty is contributed by notes that are "vibroable".
|
|
731
|
+
*/
|
|
732
|
+
vibroFactor: number;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* Represents options for osu!droid difficulty calculation.
|
|
737
|
+
*/
|
|
738
|
+
interface DroidDifficultyCalculationOptions extends DifficultyCalculationOptions {
|
|
739
|
+
/**
|
|
740
|
+
* Whether to calculate for old statistics (1.6.7 and older). Defaults to `false`.
|
|
741
|
+
*/
|
|
742
|
+
readonly oldStatistics?: boolean;
|
|
667
743
|
}
|
|
668
744
|
|
|
669
745
|
/**
|
|
@@ -689,6 +765,10 @@ interface HighStrainSection {
|
|
|
689
765
|
* as doing some analysis using the replay of a score.
|
|
690
766
|
*/
|
|
691
767
|
interface ExtendedDroidDifficultyAttributes extends DroidDifficultyAttributes {
|
|
768
|
+
/**
|
|
769
|
+
* The mode of the difficulty calculation.
|
|
770
|
+
*/
|
|
771
|
+
mode: "live";
|
|
692
772
|
/**
|
|
693
773
|
* Possible sections at which the player can use three fingers on.
|
|
694
774
|
*/
|
|
@@ -724,36 +804,38 @@ interface ExtendedDroidDifficultyAttributes extends DroidDifficultyAttributes {
|
|
|
724
804
|
/**
|
|
725
805
|
* A difficulty calculator for osu!droid gamemode.
|
|
726
806
|
*/
|
|
727
|
-
declare class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
807
|
+
declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidDifficultyHitObject, DroidDifficultyAttributes> {
|
|
728
808
|
/**
|
|
729
809
|
* The aim star rating of the beatmap.
|
|
730
810
|
*/
|
|
731
|
-
aim: number;
|
|
811
|
+
get aim(): number;
|
|
732
812
|
/**
|
|
733
813
|
* The tap star rating of the beatmap.
|
|
734
814
|
*/
|
|
735
|
-
tap: number;
|
|
815
|
+
get tap(): number;
|
|
736
816
|
/**
|
|
737
817
|
* The rhythm star rating of the beatmap.
|
|
738
818
|
*/
|
|
739
|
-
rhythm: number;
|
|
819
|
+
get rhythm(): number;
|
|
740
820
|
/**
|
|
741
821
|
* The flashlight star rating of the beatmap.
|
|
742
822
|
*/
|
|
743
|
-
flashlight: number;
|
|
823
|
+
get flashlight(): number;
|
|
744
824
|
/**
|
|
745
825
|
* The visual star rating of the beatmap.
|
|
746
826
|
*/
|
|
747
|
-
visual: number;
|
|
827
|
+
get visual(): number;
|
|
748
828
|
/**
|
|
749
829
|
* The strain threshold to start detecting for possible three-fingered section.
|
|
750
830
|
*
|
|
751
831
|
* Increasing this number will result in less sections being flagged.
|
|
752
832
|
*/
|
|
753
|
-
static readonly threeFingerStrainThreshold
|
|
833
|
+
static readonly threeFingerStrainThreshold = 175;
|
|
754
834
|
readonly attributes: ExtendedDroidDifficultyAttributes;
|
|
755
|
-
|
|
756
|
-
protected readonly
|
|
835
|
+
get cacheableAttributes(): CacheableDifficultyAttributes<DroidDifficultyAttributes>;
|
|
836
|
+
protected readonly difficultyMultiplier = 0.18;
|
|
837
|
+
protected readonly mode = Modes.droid;
|
|
838
|
+
calculate(options?: DroidDifficultyCalculationOptions): this;
|
|
757
839
|
/**
|
|
758
840
|
* Calculates the aim star rating of the beatmap and stores it in this instance.
|
|
759
841
|
*/
|
|
@@ -776,14 +858,10 @@ declare class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
776
858
|
calculateVisual(): void;
|
|
777
859
|
calculateTotal(): void;
|
|
778
860
|
calculateAll(): void;
|
|
779
|
-
/**
|
|
780
|
-
* Returns a string representative of the class.
|
|
781
|
-
*/
|
|
782
861
|
toString(): string;
|
|
783
|
-
|
|
784
|
-
* Creates skills to be calculated.
|
|
785
|
-
*/
|
|
862
|
+
protected generateDifficultyHitObjects(beatmap: Beatmap, clockRate: number): DroidDifficultyHitObject[];
|
|
786
863
|
protected createSkills(): DroidSkill[];
|
|
864
|
+
protected calculateClockRate(options?: DroidDifficultyCalculationOptions): number;
|
|
787
865
|
/**
|
|
788
866
|
* Called after aim skill calculation.
|
|
789
867
|
*
|
|
@@ -798,21 +876,14 @@ declare class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
798
876
|
/**
|
|
799
877
|
* Called after tap skill calculation.
|
|
800
878
|
*
|
|
801
|
-
* @param
|
|
879
|
+
* @param tapSkillCheese The tap skill that considers cheesing.
|
|
880
|
+
* @param tapSkillVibro The tap skill that considers vibro.
|
|
802
881
|
*/
|
|
803
882
|
private postCalculateTap;
|
|
804
883
|
/**
|
|
805
|
-
* Calculates
|
|
806
|
-
*/
|
|
807
|
-
private calculateSpeedAttributes;
|
|
808
|
-
/**
|
|
809
|
-
* Calculates the sum of strains for possible three-fingered sections.
|
|
810
|
-
*
|
|
811
|
-
* @param firstObjectIndex The index of the first object in the section.
|
|
812
|
-
* @param lastObjectIndex The index of the last object in the section.
|
|
813
|
-
* @returns The summed strain of the section.
|
|
884
|
+
* Calculates tap-related attributes.
|
|
814
885
|
*/
|
|
815
|
-
private
|
|
886
|
+
private calculateTapAttributes;
|
|
816
887
|
/**
|
|
817
888
|
* Called after rhythm skill calculation.
|
|
818
889
|
*
|
|
@@ -839,19 +910,20 @@ declare class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
839
910
|
* Represents the skill required to memorize and hit every object in a beatmap with the Flashlight mod enabled.
|
|
840
911
|
*/
|
|
841
912
|
declare class DroidFlashlight extends DroidSkill {
|
|
842
|
-
protected readonly
|
|
843
|
-
protected readonly
|
|
844
|
-
protected readonly
|
|
845
|
-
protected readonly
|
|
846
|
-
|
|
913
|
+
protected readonly strainDecayBase = 0.15;
|
|
914
|
+
protected readonly reducedSectionCount = 0;
|
|
915
|
+
protected readonly reducedSectionBaseline = 1;
|
|
916
|
+
protected readonly starsPerDouble = 1.06;
|
|
917
|
+
private readonly skillMultiplier;
|
|
847
918
|
private readonly isHidden;
|
|
848
919
|
private readonly withSliders;
|
|
920
|
+
private currentFlashlightStrain;
|
|
849
921
|
constructor(mods: Mod[], withSliders: boolean);
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
protected
|
|
854
|
-
|
|
922
|
+
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
923
|
+
protected calculateInitialStrain(time: number, current: DifficultyHitObject): number;
|
|
924
|
+
protected getObjectStrain(): number;
|
|
925
|
+
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
926
|
+
difficultyValue(): number;
|
|
855
927
|
}
|
|
856
928
|
|
|
857
929
|
/**
|
|
@@ -884,7 +956,7 @@ declare abstract class DroidFlashlightEvaluator extends FlashlightEvaluator {
|
|
|
884
956
|
* @param isHiddenMod Whether the Hidden mod is enabled.
|
|
885
957
|
* @param withSliders Whether to take slider difficulty into account.
|
|
886
958
|
*/
|
|
887
|
-
static evaluateDifficultyOf(current:
|
|
959
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, isHiddenMod: boolean, withSliders: boolean): number;
|
|
888
960
|
}
|
|
889
961
|
|
|
890
962
|
/**
|
|
@@ -924,7 +996,7 @@ interface PerformanceCalculationOptions {
|
|
|
924
996
|
/**
|
|
925
997
|
* The base class of performance calculators.
|
|
926
998
|
*/
|
|
927
|
-
declare abstract class PerformanceCalculator {
|
|
999
|
+
declare abstract class PerformanceCalculator<T extends DifficultyAttributes> {
|
|
928
1000
|
/**
|
|
929
1001
|
* The overall performance value.
|
|
930
1002
|
*/
|
|
@@ -936,11 +1008,7 @@ declare abstract class PerformanceCalculator {
|
|
|
936
1008
|
/**
|
|
937
1009
|
* The difficulty attributes that is being calculated.
|
|
938
1010
|
*/
|
|
939
|
-
|
|
940
|
-
/**
|
|
941
|
-
* Penalty for combo breaks.
|
|
942
|
-
*/
|
|
943
|
-
protected comboPenalty: number;
|
|
1011
|
+
readonly difficultyAttributes: T;
|
|
944
1012
|
/**
|
|
945
1013
|
* The global multiplier to be applied to the final performance value.
|
|
946
1014
|
*
|
|
@@ -959,6 +1027,10 @@ declare abstract class PerformanceCalculator {
|
|
|
959
1027
|
* Nerf factor used for nerfing beatmaps with very likely dropped sliderends.
|
|
960
1028
|
*/
|
|
961
1029
|
protected sliderNerfFactor: number;
|
|
1030
|
+
/**
|
|
1031
|
+
* @param difficultyAttributes The difficulty attributes to calculate.
|
|
1032
|
+
*/
|
|
1033
|
+
constructor(difficultyAttributes: T | CacheableDifficultyAttributes<T>);
|
|
962
1034
|
/**
|
|
963
1035
|
* Calculates the performance points of the beatmap.
|
|
964
1036
|
*
|
|
@@ -978,7 +1050,7 @@ declare abstract class PerformanceCalculator {
|
|
|
978
1050
|
/**
|
|
979
1051
|
* Calculates the total performance value of the beatmap and stores it in this instance.
|
|
980
1052
|
*/
|
|
981
|
-
protected abstract calculateTotalValue():
|
|
1053
|
+
protected abstract calculateTotalValue(): number;
|
|
982
1054
|
/**
|
|
983
1055
|
* The total hits that can be done in the beatmap.
|
|
984
1056
|
*/
|
|
@@ -997,16 +1069,31 @@ declare abstract class PerformanceCalculator {
|
|
|
997
1069
|
* @param options Options for performance calculation.
|
|
998
1070
|
*/
|
|
999
1071
|
protected handleOptions(options?: PerformanceCalculationOptions): void;
|
|
1072
|
+
/**
|
|
1073
|
+
* Calculates a strain-based miss penalty.
|
|
1074
|
+
*
|
|
1075
|
+
* Strain-based miss penalty assumes that a player will miss on the hardest parts of a map,
|
|
1076
|
+
* so we use the amount of relatively difficult sections to adjust miss penalty
|
|
1077
|
+
* to make it more punishing on maps with lower amount of hard sections.
|
|
1078
|
+
*/
|
|
1079
|
+
protected calculateStrainBasedMissPenalty(difficultStrainCount: number): number;
|
|
1000
1080
|
/**
|
|
1001
1081
|
* Calculates the amount of misses + sliderbreaks from combo.
|
|
1002
1082
|
*/
|
|
1003
1083
|
private calculateEffectiveMissCount;
|
|
1084
|
+
/**
|
|
1085
|
+
* Determines whether an attribute is a cacheable attribute.
|
|
1086
|
+
*
|
|
1087
|
+
* @param attributes The attributes to check.
|
|
1088
|
+
* @returns Whether the attributes are cacheable.
|
|
1089
|
+
*/
|
|
1090
|
+
private isCacheableAttribute;
|
|
1004
1091
|
}
|
|
1005
1092
|
|
|
1006
1093
|
/**
|
|
1007
1094
|
* A performance points calculator that calculates performance points for osu!droid gamemode.
|
|
1008
1095
|
*/
|
|
1009
|
-
declare class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
1096
|
+
declare class DroidPerformanceCalculator extends PerformanceCalculator<DroidDifficultyAttributes> {
|
|
1010
1097
|
/**
|
|
1011
1098
|
* The aim performance value.
|
|
1012
1099
|
*/
|
|
@@ -1059,19 +1146,14 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
1059
1146
|
* Can be properly obtained by analyzing the replay associated with the score.
|
|
1060
1147
|
*/
|
|
1061
1148
|
get visualSliderCheesePenalty(): number;
|
|
1062
|
-
readonly difficultyAttributes: DroidDifficultyAttributes;
|
|
1063
1149
|
protected finalMultiplier: number;
|
|
1064
|
-
protected readonly mode
|
|
1150
|
+
protected readonly mode = Modes.droid;
|
|
1065
1151
|
private _aimSliderCheesePenalty;
|
|
1066
1152
|
private _flashlightSliderCheesePenalty;
|
|
1067
1153
|
private _visualSliderCheesePenalty;
|
|
1068
1154
|
private _tapPenalty;
|
|
1069
1155
|
private _deviation;
|
|
1070
1156
|
private _tapDeviation;
|
|
1071
|
-
/**
|
|
1072
|
-
* @param difficultyAttributes The difficulty attributes to calculate.
|
|
1073
|
-
*/
|
|
1074
|
-
constructor(difficultyAttributes: DroidDifficultyAttributes);
|
|
1075
1157
|
/**
|
|
1076
1158
|
* Applies a tap penalty value to this calculator.
|
|
1077
1159
|
*
|
|
@@ -1105,7 +1187,7 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
1105
1187
|
*/
|
|
1106
1188
|
applyVisualSliderCheesePenalty(value: number): void;
|
|
1107
1189
|
protected calculateValues(): void;
|
|
1108
|
-
protected calculateTotalValue():
|
|
1190
|
+
protected calculateTotalValue(): number;
|
|
1109
1191
|
protected handleOptions(options?: PerformanceCalculationOptions): void;
|
|
1110
1192
|
/**
|
|
1111
1193
|
* Calculates the aim performance value of the beatmap.
|
|
@@ -1127,6 +1209,19 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
1127
1209
|
* Calculates the visual performance value of the beatmap.
|
|
1128
1210
|
*/
|
|
1129
1211
|
private calculateVisualValue;
|
|
1212
|
+
/**
|
|
1213
|
+
* The object-based proportional miss penalty.
|
|
1214
|
+
*/
|
|
1215
|
+
private get proportionalMissPenalty();
|
|
1216
|
+
/**
|
|
1217
|
+
* Calculates the object-based length scaling based on the deviation of a player for a full
|
|
1218
|
+
* combo in this beatmap, taking retries into account.
|
|
1219
|
+
*
|
|
1220
|
+
* @param objectCount The amount of objects to be considered. Defaults to the amount of
|
|
1221
|
+
* objects in this beatmap.
|
|
1222
|
+
* @param punishForMemorization Whether to punish the deviation for memorization. Defaults to `false`.
|
|
1223
|
+
*/
|
|
1224
|
+
private calculateDeviationBasedLengthScaling;
|
|
1130
1225
|
/**
|
|
1131
1226
|
* Estimates the player's tap deviation based on the OD, number of circles and sliders,
|
|
1132
1227
|
* and number of 300s, 100s, 50s, and misses, assuming the player's mean hit error is 0.
|
|
@@ -1156,63 +1251,69 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
1156
1251
|
* Represents the skill required to properly follow a beatmap's rhythm.
|
|
1157
1252
|
*/
|
|
1158
1253
|
declare class DroidRhythm extends DroidSkill {
|
|
1159
|
-
protected readonly
|
|
1160
|
-
protected readonly
|
|
1161
|
-
protected readonly
|
|
1162
|
-
protected readonly
|
|
1163
|
-
|
|
1164
|
-
private
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
protected
|
|
1168
|
-
protected saveToHitObject(current:
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
/**
|
|
1172
|
-
* An evaluator for calculating rhythm skill.
|
|
1173
|
-
*
|
|
1174
|
-
* This class should be considered an "evaluating" class and not persisted.
|
|
1175
|
-
*/
|
|
1176
|
-
declare abstract class RhythmEvaluator {
|
|
1177
|
-
protected static readonly rhythmMultiplier: number;
|
|
1178
|
-
protected static readonly historyTimeMax: number;
|
|
1254
|
+
protected readonly reducedSectionCount = 5;
|
|
1255
|
+
protected readonly reducedSectionBaseline = 0.75;
|
|
1256
|
+
protected readonly strainDecayBase = 0.3;
|
|
1257
|
+
protected readonly starsPerDouble = 1.75;
|
|
1258
|
+
private currentRhythmStrain;
|
|
1259
|
+
private currentRhythmMultiplier;
|
|
1260
|
+
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
1261
|
+
protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
|
|
1262
|
+
protected getObjectStrain(): number;
|
|
1263
|
+
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
1179
1264
|
}
|
|
1180
1265
|
|
|
1181
1266
|
/**
|
|
1182
1267
|
* An evaluator for calculating osu!droid Rhythm skill.
|
|
1183
1268
|
*/
|
|
1184
|
-
declare abstract class DroidRhythmEvaluator
|
|
1269
|
+
declare abstract class DroidRhythmEvaluator {
|
|
1270
|
+
private static readonly historyTimeMax;
|
|
1271
|
+
private static readonly historyObjectsMax;
|
|
1272
|
+
private static readonly rhythmOverallMultiplier;
|
|
1273
|
+
private static readonly rhythmRatioMultiplier;
|
|
1185
1274
|
/**
|
|
1186
1275
|
* Calculates a rhythm multiplier for the difficulty of the tap associated
|
|
1187
1276
|
* with historic data of the current object.
|
|
1188
1277
|
*
|
|
1189
1278
|
* @param current The current object.
|
|
1190
|
-
* @param greatWindow The great hit window of the current object.
|
|
1191
1279
|
*/
|
|
1192
|
-
static evaluateDifficultyOf(current:
|
|
1280
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject): number;
|
|
1193
1281
|
}
|
|
1194
1282
|
|
|
1195
1283
|
/**
|
|
1196
1284
|
* Represents the skill required to press keys or tap with regards to keeping up with the speed at which objects need to be hit.
|
|
1197
1285
|
*/
|
|
1198
1286
|
declare class DroidTap extends DroidSkill {
|
|
1199
|
-
protected readonly
|
|
1200
|
-
protected readonly
|
|
1201
|
-
protected readonly
|
|
1202
|
-
protected readonly
|
|
1203
|
-
protected readonly starsPerDouble: number;
|
|
1287
|
+
protected readonly reducedSectionCount = 10;
|
|
1288
|
+
protected readonly reducedSectionBaseline = 0.75;
|
|
1289
|
+
protected readonly strainDecayBase = 0.3;
|
|
1290
|
+
protected readonly starsPerDouble = 1.1;
|
|
1204
1291
|
private currentTapStrain;
|
|
1205
|
-
private
|
|
1206
|
-
private readonly
|
|
1207
|
-
|
|
1292
|
+
private currentRhythmMultiplier;
|
|
1293
|
+
private readonly skillMultiplier;
|
|
1294
|
+
private readonly considerCheesability;
|
|
1295
|
+
private readonly strainTimeCap?;
|
|
1296
|
+
private readonly _objectDeltaTimes;
|
|
1208
1297
|
/**
|
|
1209
|
-
*
|
|
1298
|
+
* The delta time of hitobjects.
|
|
1299
|
+
*/
|
|
1300
|
+
get objectDeltaTimes(): readonly number[];
|
|
1301
|
+
constructor(mods: Mod[], considerCheesability: boolean, strainTimeCap?: number);
|
|
1302
|
+
/**
|
|
1303
|
+
* The amount of notes that are relevant to the difficulty.
|
|
1304
|
+
*/
|
|
1305
|
+
relevantNoteCount(): number;
|
|
1306
|
+
/**
|
|
1307
|
+
* The delta time relevant to the difficulty.
|
|
1210
1308
|
*/
|
|
1211
|
-
|
|
1309
|
+
relevantDeltaTime(): number;
|
|
1310
|
+
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
1311
|
+
protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
|
|
1312
|
+
protected getObjectStrain(): number;
|
|
1212
1313
|
/**
|
|
1213
1314
|
* @param current The hitobject to save to.
|
|
1214
1315
|
*/
|
|
1215
|
-
protected saveToHitObject(current:
|
|
1316
|
+
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
1216
1317
|
}
|
|
1217
1318
|
|
|
1218
1319
|
/**
|
|
@@ -1233,33 +1334,39 @@ declare abstract class DroidTapEvaluator extends SpeedEvaluator {
|
|
|
1233
1334
|
*
|
|
1234
1335
|
* - time between pressing the previous and current object,
|
|
1235
1336
|
* - distance between those objects,
|
|
1236
|
-
* -
|
|
1337
|
+
* - how easily they can be cheesed,
|
|
1338
|
+
* - and the strain time cap.
|
|
1237
1339
|
*
|
|
1238
1340
|
* @param current The current object.
|
|
1239
1341
|
* @param greatWindow The great hit window of the current object.
|
|
1240
1342
|
* @param considerCheesability Whether to consider cheesability.
|
|
1343
|
+
* @param strainTimeCap The strain time to cap the object's strain time to.
|
|
1241
1344
|
*/
|
|
1242
|
-
static evaluateDifficultyOf(current:
|
|
1345
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, considerCheesability: boolean, strainTimeCap?: number): number;
|
|
1243
1346
|
}
|
|
1244
1347
|
|
|
1245
1348
|
/**
|
|
1246
1349
|
* Represents the skill required to read every object in the map.
|
|
1247
1350
|
*/
|
|
1248
1351
|
declare class DroidVisual extends DroidSkill {
|
|
1249
|
-
protected readonly starsPerDouble
|
|
1250
|
-
protected readonly reducedSectionCount
|
|
1251
|
-
protected readonly reducedSectionBaseline
|
|
1252
|
-
protected readonly
|
|
1253
|
-
protected readonly strainDecayBase: number;
|
|
1352
|
+
protected readonly starsPerDouble = 1.025;
|
|
1353
|
+
protected readonly reducedSectionCount = 10;
|
|
1354
|
+
protected readonly reducedSectionBaseline = 0.75;
|
|
1355
|
+
protected readonly strainDecayBase = 0.1;
|
|
1254
1356
|
private readonly isHidden;
|
|
1255
1357
|
private readonly withSliders;
|
|
1358
|
+
private currentVisualStrain;
|
|
1359
|
+
private currentRhythmMultiplier;
|
|
1360
|
+
private readonly skillMultiplier;
|
|
1256
1361
|
constructor(mods: Mod[], withSliders: boolean);
|
|
1257
|
-
protected strainValueAt(current:
|
|
1258
|
-
protected
|
|
1362
|
+
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
1363
|
+
protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
|
|
1364
|
+
protected getObjectStrain(): number;
|
|
1365
|
+
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
1259
1366
|
}
|
|
1260
1367
|
|
|
1261
1368
|
/**
|
|
1262
|
-
* An evaluator for calculating osu!droid
|
|
1369
|
+
* An evaluator for calculating osu!droid visual skill.
|
|
1263
1370
|
*/
|
|
1264
1371
|
declare abstract class DroidVisualEvaluator {
|
|
1265
1372
|
/**
|
|
@@ -1277,7 +1384,7 @@ declare abstract class DroidVisualEvaluator {
|
|
|
1277
1384
|
* @param isHiddenMod Whether the Hidden mod is enabled.
|
|
1278
1385
|
* @param withSliders Whether to take slider difficulty into account.
|
|
1279
1386
|
*/
|
|
1280
|
-
static evaluateDifficultyOf(current:
|
|
1387
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, isHiddenMod: boolean, withSliders: boolean): number;
|
|
1281
1388
|
}
|
|
1282
1389
|
|
|
1283
1390
|
/**
|
|
@@ -1286,51 +1393,107 @@ declare abstract class DroidVisualEvaluator {
|
|
|
1286
1393
|
*/
|
|
1287
1394
|
declare abstract class OsuSkill extends StrainSkill {
|
|
1288
1395
|
/**
|
|
1289
|
-
* The
|
|
1290
|
-
*
|
|
1291
|
-
* May be overridden via {@link difficultyMultiplier}.
|
|
1396
|
+
* The weight by which each strain value decays.
|
|
1292
1397
|
*/
|
|
1293
|
-
|
|
1398
|
+
protected abstract readonly decayWeight: number;
|
|
1399
|
+
difficultyValue(): number;
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
/**
|
|
1403
|
+
* Represents an osu!standard hit object with difficulty calculation values.
|
|
1404
|
+
*/
|
|
1405
|
+
declare class OsuDifficultyHitObject extends DifficultyHitObject {
|
|
1294
1406
|
/**
|
|
1295
|
-
* The
|
|
1407
|
+
* The speed strain generated by the hitobject.
|
|
1296
1408
|
*/
|
|
1297
|
-
|
|
1409
|
+
speedStrain: number;
|
|
1298
1410
|
/**
|
|
1299
|
-
* The
|
|
1411
|
+
* The flashlight strain generated by this hitobject.
|
|
1300
1412
|
*/
|
|
1301
|
-
|
|
1302
|
-
|
|
1413
|
+
flashlightStrain: number;
|
|
1414
|
+
private readonly radiusBuffThreshold;
|
|
1415
|
+
protected readonly mode = Modes.osu;
|
|
1416
|
+
protected get scalingFactor(): number;
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
/**
|
|
1420
|
+
* Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
|
|
1421
|
+
*/
|
|
1422
|
+
declare class OsuAim extends OsuSkill {
|
|
1423
|
+
protected readonly strainDecayBase = 0.15;
|
|
1424
|
+
protected readonly reducedSectionCount = 10;
|
|
1425
|
+
protected readonly reducedSectionBaseline = 0.75;
|
|
1426
|
+
protected readonly decayWeight = 0.9;
|
|
1427
|
+
private currentAimStrain;
|
|
1428
|
+
private readonly skillMultiplier;
|
|
1429
|
+
private readonly withSliders;
|
|
1430
|
+
constructor(mods: Mod[], withSliders: boolean);
|
|
1431
|
+
protected strainValueAt(current: OsuDifficultyHitObject): number;
|
|
1432
|
+
protected calculateInitialStrain(time: number, current: OsuDifficultyHitObject): number;
|
|
1433
|
+
/**
|
|
1434
|
+
* @param current The hitobject to save to.
|
|
1435
|
+
*/
|
|
1436
|
+
protected saveToHitObject(current: OsuDifficultyHitObject): void;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
/**
|
|
1440
|
+
* An evaluator for calculating osu!standard Aim skill.
|
|
1441
|
+
*/
|
|
1442
|
+
declare abstract class OsuAimEvaluator extends AimEvaluator {
|
|
1443
|
+
/**
|
|
1444
|
+
* Evaluates the difficulty of aiming the current object, based on:
|
|
1445
|
+
*
|
|
1446
|
+
* - cursor velocity to the current object,
|
|
1447
|
+
* - angle difficulty,
|
|
1448
|
+
* - sharp velocity increases,
|
|
1449
|
+
* - and slider difficulty.
|
|
1450
|
+
*
|
|
1451
|
+
* @param current The current object.
|
|
1452
|
+
* @param withSliders Whether to take slider difficulty into account.
|
|
1453
|
+
*/
|
|
1454
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject, withSliders: boolean): number;
|
|
1303
1455
|
}
|
|
1304
1456
|
|
|
1305
1457
|
/**
|
|
1306
1458
|
* Holds data that can be used to calculate osu!standard performance points.
|
|
1307
1459
|
*/
|
|
1308
1460
|
interface OsuDifficultyAttributes extends DifficultyAttributes {
|
|
1461
|
+
/**
|
|
1462
|
+
* The perceived approach rate inclusive of rate-adjusting mods (DT/HT/etc).
|
|
1463
|
+
*
|
|
1464
|
+
* Rate-adjusting mods don't directly affect the approach rate difficulty value, but have a perceived effect as a result of adjusting audio timing.
|
|
1465
|
+
*/
|
|
1466
|
+
approachRate: number;
|
|
1309
1467
|
/**
|
|
1310
1468
|
* The difficulty corresponding to the speed skill.
|
|
1311
1469
|
*/
|
|
1312
1470
|
speedDifficulty: number;
|
|
1471
|
+
/**
|
|
1472
|
+
* The amount of strains that are considered difficult with respect to the speed skill.
|
|
1473
|
+
*/
|
|
1474
|
+
speedDifficultStrainCount: number;
|
|
1313
1475
|
}
|
|
1314
1476
|
|
|
1315
1477
|
/**
|
|
1316
1478
|
* A difficulty calculator for osu!standard gamemode.
|
|
1317
1479
|
*/
|
|
1318
|
-
declare class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
1480
|
+
declare class OsuDifficultyCalculator extends DifficultyCalculator<OsuDifficultyHitObject, OsuDifficultyAttributes> {
|
|
1319
1481
|
/**
|
|
1320
1482
|
* The aim star rating of the beatmap.
|
|
1321
1483
|
*/
|
|
1322
|
-
aim: number;
|
|
1484
|
+
get aim(): number;
|
|
1323
1485
|
/**
|
|
1324
1486
|
* The speed star rating of the beatmap.
|
|
1325
1487
|
*/
|
|
1326
|
-
speed: number;
|
|
1488
|
+
get speed(): number;
|
|
1327
1489
|
/**
|
|
1328
1490
|
* The flashlight star rating of the beatmap.
|
|
1329
1491
|
*/
|
|
1330
|
-
flashlight: number;
|
|
1492
|
+
get flashlight(): number;
|
|
1331
1493
|
readonly attributes: OsuDifficultyAttributes;
|
|
1332
|
-
|
|
1333
|
-
protected readonly
|
|
1494
|
+
get cacheableAttributes(): CacheableDifficultyAttributes<OsuDifficultyAttributes>;
|
|
1495
|
+
protected readonly difficultyMultiplier = 0.0675;
|
|
1496
|
+
protected readonly mode = Modes.osu;
|
|
1334
1497
|
/**
|
|
1335
1498
|
* Calculates the aim star rating of the beatmap and stores it in this instance.
|
|
1336
1499
|
*/
|
|
@@ -1345,14 +1508,10 @@ declare class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
1345
1508
|
calculateFlashlight(): void;
|
|
1346
1509
|
calculateTotal(): void;
|
|
1347
1510
|
calculateAll(): void;
|
|
1348
|
-
/**
|
|
1349
|
-
* Returns a string representative of the class.
|
|
1350
|
-
*/
|
|
1351
1511
|
toString(): string;
|
|
1352
|
-
|
|
1353
|
-
* Creates skills to be calculated.
|
|
1354
|
-
*/
|
|
1512
|
+
protected generateDifficultyHitObjects(beatmap: Beatmap, clockRate: number): OsuDifficultyHitObject[];
|
|
1355
1513
|
protected createSkills(): OsuSkill[];
|
|
1514
|
+
protected populateDifficultyAttributes(beatmap: Beatmap, clockRate: number): void;
|
|
1356
1515
|
/**
|
|
1357
1516
|
* Called after aim skill calculation.
|
|
1358
1517
|
*
|
|
@@ -1378,87 +1537,22 @@ declare class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
1378
1537
|
private postCalculateFlashlight;
|
|
1379
1538
|
}
|
|
1380
1539
|
|
|
1381
|
-
/**
|
|
1382
|
-
* A difficulty calculator that calculates for both osu!droid and osu!standard gamemode.
|
|
1383
|
-
*/
|
|
1384
|
-
declare class MapStars {
|
|
1385
|
-
/**
|
|
1386
|
-
* The osu!droid difficulty calculator of the beatmap.
|
|
1387
|
-
*/
|
|
1388
|
-
readonly droid: DroidDifficultyCalculator;
|
|
1389
|
-
/**
|
|
1390
|
-
* The osu!standard difficulty calculator of the beatmap.
|
|
1391
|
-
*/
|
|
1392
|
-
readonly osu: OsuDifficultyCalculator;
|
|
1393
|
-
/**
|
|
1394
|
-
* Constructs this instance and calculates the given beatmap's osu!droid and osu!standard difficulty.
|
|
1395
|
-
*
|
|
1396
|
-
* @param beatmap The beatmap to calculate.
|
|
1397
|
-
* @param options Options for the difficulty calculation.
|
|
1398
|
-
*/
|
|
1399
|
-
constructor(beatmap: Beatmap, options?: DifficultyCalculationOptions);
|
|
1400
|
-
/**
|
|
1401
|
-
* Returns a string representative of the class.
|
|
1402
|
-
*/
|
|
1403
|
-
toString(): string;
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1406
|
-
/**
|
|
1407
|
-
* Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
|
|
1408
|
-
*/
|
|
1409
|
-
declare class OsuAim extends OsuSkill {
|
|
1410
|
-
protected readonly skillMultiplier: number;
|
|
1411
|
-
protected readonly strainDecayBase: number;
|
|
1412
|
-
protected readonly reducedSectionCount: number;
|
|
1413
|
-
protected readonly reducedSectionBaseline: number;
|
|
1414
|
-
protected readonly difficultyMultiplier: number;
|
|
1415
|
-
protected readonly decayWeight: number;
|
|
1416
|
-
private readonly withSliders;
|
|
1417
|
-
constructor(mods: Mod[], withSliders: boolean);
|
|
1418
|
-
/**
|
|
1419
|
-
* @param current The hitobject to calculate.
|
|
1420
|
-
*/
|
|
1421
|
-
protected strainValueAt(current: DifficultyHitObject): number;
|
|
1422
|
-
/**
|
|
1423
|
-
* @param current The hitobject to save to.
|
|
1424
|
-
*/
|
|
1425
|
-
protected saveToHitObject(current: DifficultyHitObject): void;
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
|
-
/**
|
|
1429
|
-
* An evaluator for calculating osu!standard Aim skill.
|
|
1430
|
-
*/
|
|
1431
|
-
declare abstract class OsuAimEvaluator extends AimEvaluator {
|
|
1432
|
-
/**
|
|
1433
|
-
* Evaluates the difficulty of aiming the current object, based on:
|
|
1434
|
-
*
|
|
1435
|
-
* - cursor velocity to the current object,
|
|
1436
|
-
* - angle difficulty,
|
|
1437
|
-
* - sharp velocity increases,
|
|
1438
|
-
* - and slider difficulty.
|
|
1439
|
-
*
|
|
1440
|
-
* @param current The current object.
|
|
1441
|
-
* @param withSliders Whether to take slider difficulty into account.
|
|
1442
|
-
*/
|
|
1443
|
-
static evaluateDifficultyOf(current: DifficultyHitObject, withSliders: boolean): number;
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
1540
|
/**
|
|
1447
1541
|
* Represents the skill required to memorize and hit every object in a beatmap with the Flashlight mod enabled.
|
|
1448
1542
|
*/
|
|
1449
1543
|
declare class OsuFlashlight extends OsuSkill {
|
|
1450
|
-
protected readonly
|
|
1451
|
-
protected readonly
|
|
1452
|
-
protected readonly
|
|
1453
|
-
protected readonly
|
|
1454
|
-
|
|
1544
|
+
protected readonly strainDecayBase = 0.15;
|
|
1545
|
+
protected readonly reducedSectionCount = 0;
|
|
1546
|
+
protected readonly reducedSectionBaseline = 1;
|
|
1547
|
+
protected readonly decayWeight = 1;
|
|
1548
|
+
private currentFlashlightStrain;
|
|
1549
|
+
private readonly skillMultiplier;
|
|
1455
1550
|
private readonly isHidden;
|
|
1456
1551
|
constructor(mods: Mod[]);
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
protected
|
|
1461
|
-
protected saveToHitObject(current: DifficultyHitObject): void;
|
|
1552
|
+
difficultyValue(): number;
|
|
1553
|
+
protected strainValueAt(current: OsuDifficultyHitObject): number;
|
|
1554
|
+
protected calculateInitialStrain(time: number, current: OsuDifficultyHitObject): number;
|
|
1555
|
+
protected saveToHitObject(current: OsuDifficultyHitObject): void;
|
|
1462
1556
|
}
|
|
1463
1557
|
|
|
1464
1558
|
/**
|
|
@@ -1477,13 +1571,13 @@ declare abstract class OsuFlashlightEvaluator extends FlashlightEvaluator {
|
|
|
1477
1571
|
* @param current The current object.
|
|
1478
1572
|
* @param isHiddenMod Whether the Hidden mod is enabled.
|
|
1479
1573
|
*/
|
|
1480
|
-
static evaluateDifficultyOf(current:
|
|
1574
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject, isHiddenMod: boolean): number;
|
|
1481
1575
|
}
|
|
1482
1576
|
|
|
1483
1577
|
/**
|
|
1484
1578
|
* A performance points calculator that calculates performance points for osu!standard gamemode.
|
|
1485
1579
|
*/
|
|
1486
|
-
declare class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
1580
|
+
declare class OsuPerformanceCalculator extends PerformanceCalculator<OsuDifficultyAttributes> {
|
|
1487
1581
|
/**
|
|
1488
1582
|
* The aim performance value.
|
|
1489
1583
|
*/
|
|
@@ -1500,15 +1594,12 @@ declare class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
1500
1594
|
* The flashlight performance value.
|
|
1501
1595
|
*/
|
|
1502
1596
|
flashlight: number;
|
|
1503
|
-
readonly difficultyAttributes: OsuDifficultyAttributes;
|
|
1504
1597
|
protected finalMultiplier: number;
|
|
1505
|
-
protected readonly mode
|
|
1506
|
-
|
|
1507
|
-
* @param difficultyAttributes The difficulty attributes to calculate.
|
|
1508
|
-
*/
|
|
1509
|
-
constructor(difficultyAttributes: OsuDifficultyAttributes);
|
|
1598
|
+
protected readonly mode = Modes.osu;
|
|
1599
|
+
private comboPenalty;
|
|
1510
1600
|
protected calculateValues(): void;
|
|
1511
|
-
protected calculateTotalValue():
|
|
1601
|
+
protected calculateTotalValue(): number;
|
|
1602
|
+
protected handleOptions(options?: PerformanceCalculationOptions): void;
|
|
1512
1603
|
/**
|
|
1513
1604
|
* Calculates the aim performance value of the beatmap.
|
|
1514
1605
|
*/
|
|
@@ -1531,39 +1622,40 @@ declare class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
1531
1622
|
/**
|
|
1532
1623
|
* An evaluator for calculating osu!standard Rhythm skill.
|
|
1533
1624
|
*/
|
|
1534
|
-
declare abstract class OsuRhythmEvaluator
|
|
1625
|
+
declare abstract class OsuRhythmEvaluator {
|
|
1626
|
+
private static readonly historyTimeMax;
|
|
1627
|
+
private static readonly historyObjectsMax;
|
|
1628
|
+
private static readonly rhythmOverallMultiplier;
|
|
1629
|
+
private static readonly rhythmRatioMultiplier;
|
|
1535
1630
|
/**
|
|
1536
1631
|
* Calculates a rhythm multiplier for the difficulty of the tap associated
|
|
1537
1632
|
* with historic data of the current object.
|
|
1538
1633
|
*
|
|
1539
1634
|
* @param current The current object.
|
|
1540
|
-
* @param greatWindow The great hit window of the current object.
|
|
1541
1635
|
*/
|
|
1542
|
-
static evaluateDifficultyOf(current:
|
|
1636
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject): number;
|
|
1543
1637
|
}
|
|
1544
1638
|
|
|
1545
1639
|
/**
|
|
1546
1640
|
* Represents the skill required to press keys or tap with regards to keeping up with the speed at which objects need to be hit.
|
|
1547
1641
|
*/
|
|
1548
1642
|
declare class OsuSpeed extends OsuSkill {
|
|
1549
|
-
protected readonly
|
|
1550
|
-
protected readonly
|
|
1551
|
-
protected readonly
|
|
1552
|
-
protected readonly
|
|
1553
|
-
protected readonly difficultyMultiplier: number;
|
|
1554
|
-
protected readonly decayWeight: number;
|
|
1643
|
+
protected readonly strainDecayBase = 0.3;
|
|
1644
|
+
protected readonly reducedSectionCount = 5;
|
|
1645
|
+
protected readonly reducedSectionBaseline = 0.75;
|
|
1646
|
+
protected readonly decayWeight = 0.9;
|
|
1555
1647
|
private currentSpeedStrain;
|
|
1556
1648
|
private currentRhythm;
|
|
1557
|
-
private readonly
|
|
1558
|
-
constructor(mods: Mod[], greatWindow: number);
|
|
1649
|
+
private readonly skillMultiplier;
|
|
1559
1650
|
/**
|
|
1560
1651
|
* @param current The hitobject to calculate.
|
|
1561
1652
|
*/
|
|
1562
|
-
protected strainValueAt(current:
|
|
1653
|
+
protected strainValueAt(current: OsuDifficultyHitObject): number;
|
|
1654
|
+
protected calculateInitialStrain(time: number, current: OsuDifficultyHitObject): number;
|
|
1563
1655
|
/**
|
|
1564
1656
|
* @param current The hitobject to save to.
|
|
1565
1657
|
*/
|
|
1566
|
-
protected saveToHitObject(current:
|
|
1658
|
+
protected saveToHitObject(current: OsuDifficultyHitObject): void;
|
|
1567
1659
|
}
|
|
1568
1660
|
|
|
1569
1661
|
/**
|
|
@@ -1572,8 +1664,11 @@ declare class OsuSpeed extends OsuSkill {
|
|
|
1572
1664
|
declare abstract class OsuSpeedEvaluator extends SpeedEvaluator {
|
|
1573
1665
|
/**
|
|
1574
1666
|
* Spacing threshold for a single hitobject spacing.
|
|
1667
|
+
*
|
|
1668
|
+
* About 1.25 circles distance between hitobject centers.
|
|
1575
1669
|
*/
|
|
1576
1670
|
private static readonly SINGLE_SPACING_THRESHOLD;
|
|
1671
|
+
private static readonly DISTANCE_MULTIPLIER;
|
|
1577
1672
|
/**
|
|
1578
1673
|
* Evaluates the difficulty of tapping the current object, based on:
|
|
1579
1674
|
*
|
|
@@ -1582,9 +1677,8 @@ declare abstract class OsuSpeedEvaluator extends SpeedEvaluator {
|
|
|
1582
1677
|
* - and how easily they can be cheesed.
|
|
1583
1678
|
*
|
|
1584
1679
|
* @param current The current object.
|
|
1585
|
-
* @param greatWindow The great hit window of the current object.
|
|
1586
1680
|
*/
|
|
1587
|
-
static evaluateDifficultyOf(current:
|
|
1681
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject): number;
|
|
1588
1682
|
}
|
|
1589
1683
|
|
|
1590
|
-
export { AimEvaluator,
|
|
1684
|
+
export { AimEvaluator, type CacheableDifficultyAttributes, type DifficultSlider, type DifficultyAttributes, type DifficultyCalculationOptions, DifficultyCalculator, DifficultyHitObject, DroidAim, DroidAimEvaluator, type DroidDifficultyAttributes, type DroidDifficultyCalculationOptions, DroidDifficultyCalculator, DroidDifficultyHitObject, DroidFlashlight, DroidFlashlightEvaluator, DroidPerformanceCalculator, DroidRhythm, DroidRhythmEvaluator, DroidTap, DroidTapEvaluator, DroidVisual, DroidVisualEvaluator, type ExtendedDroidDifficultyAttributes, FlashlightEvaluator, type HighStrainSection, OsuAim, OsuAimEvaluator, type OsuDifficultyAttributes, OsuDifficultyCalculator, OsuDifficultyHitObject, OsuFlashlight, OsuFlashlightEvaluator, OsuPerformanceCalculator, OsuRhythmEvaluator, OsuSpeed, OsuSpeedEvaluator, type PerformanceCalculationOptions, PerformanceCalculator, SpeedEvaluator, type StrainPeaks };
|