@rian8337/osu-difficulty-calculator 4.0.0-beta.18 → 4.0.0-beta.19
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/package.json +3 -3
- package/typings/index.d.ts +1105 -0
package/typings/index.d.ts
CHANGED
|
@@ -1,55 +1,199 @@
|
|
|
1
1
|
import { Mod, PlaceableHitObject, Modes, Beatmap, DifficultyStatisticsCalculatorResult, Accuracy } from '@rian8337/osu-base';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* An evaluator for calculating aim skill.
|
|
5
|
+
*
|
|
6
|
+
* This class should be considered an "evaluating" class and not persisted.
|
|
7
|
+
*/
|
|
3
8
|
declare abstract class AimEvaluator {
|
|
4
9
|
protected static readonly wideAngleMultiplier: number;
|
|
5
10
|
protected static readonly acuteAngleMultiplier: number;
|
|
6
11
|
protected static readonly sliderMultiplier: number;
|
|
7
12
|
protected static readonly velocityChangeMultiplier: number;
|
|
13
|
+
/**
|
|
14
|
+
* Calculates the bonus of wide angles.
|
|
15
|
+
*/
|
|
8
16
|
protected static calculateWideAngleBonus(angle: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* Calculates the bonus of acute angles.
|
|
19
|
+
*/
|
|
9
20
|
protected static calculateAcuteAngleBonus(angle: number): number;
|
|
10
21
|
}
|
|
11
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Holds data that can be used to calculate performance points.
|
|
25
|
+
*/
|
|
12
26
|
interface DifficultyAttributes {
|
|
27
|
+
/**
|
|
28
|
+
* The mods which were applied to the beatmap.
|
|
29
|
+
*/
|
|
13
30
|
mods: Mod[];
|
|
31
|
+
/**
|
|
32
|
+
* The combined star rating of all skills.
|
|
33
|
+
*/
|
|
14
34
|
starRating: number;
|
|
35
|
+
/**
|
|
36
|
+
* The maximum achievable combo.
|
|
37
|
+
*/
|
|
15
38
|
maxCombo: number;
|
|
39
|
+
/**
|
|
40
|
+
* The difficulty corresponding to the aim skill.
|
|
41
|
+
*/
|
|
16
42
|
aimDifficulty: number;
|
|
43
|
+
/**
|
|
44
|
+
* The difficulty corresponding to the flashlight skill.
|
|
45
|
+
*/
|
|
17
46
|
flashlightDifficulty: number;
|
|
47
|
+
/**
|
|
48
|
+
* The number of clickable objects weighted by difficulty.
|
|
49
|
+
*
|
|
50
|
+
* Related to speed/tap difficulty.
|
|
51
|
+
*/
|
|
18
52
|
speedNoteCount: number;
|
|
53
|
+
/**
|
|
54
|
+
* Describes how much of aim difficulty is contributed to by hitcircles or sliders.
|
|
55
|
+
*
|
|
56
|
+
* A value closer to 1 indicates most of aim difficulty is contributed by hitcircles.
|
|
57
|
+
*
|
|
58
|
+
* A value closer to 0 indicates most of aim difficulty is contributed by sliders.
|
|
59
|
+
*/
|
|
19
60
|
sliderFactor: number;
|
|
61
|
+
/**
|
|
62
|
+
* The overall clock rate that was applied to the beatmap.
|
|
63
|
+
*/
|
|
20
64
|
clockRate: number;
|
|
65
|
+
/**
|
|
66
|
+
* The perceived approach rate inclusive of rate-adjusting mods (DT/HT/etc).
|
|
67
|
+
*
|
|
68
|
+
* Rate-adjusting mods don't directly affect the approach rate difficulty value, but have a perceived effect as a result of adjusting audio timing.
|
|
69
|
+
*/
|
|
21
70
|
approachRate: number;
|
|
71
|
+
/**
|
|
72
|
+
* The perceived overall difficulty inclusive of rate-adjusting mods (DT/HT/etc), based on osu!standard judgement.
|
|
73
|
+
*
|
|
74
|
+
* Rate-adjusting mods don't directly affect the overall difficulty value, but have a perceived effect as a result of adjusting audio timing.
|
|
75
|
+
*/
|
|
22
76
|
overallDifficulty: number;
|
|
77
|
+
/**
|
|
78
|
+
* The number of hitcircles in the beatmap.
|
|
79
|
+
*/
|
|
23
80
|
hitCircleCount: number;
|
|
81
|
+
/**
|
|
82
|
+
* The number of sliders in the beatmap.
|
|
83
|
+
*/
|
|
24
84
|
sliderCount: number;
|
|
85
|
+
/**
|
|
86
|
+
* The number of spinners in the beatmap.
|
|
87
|
+
*/
|
|
25
88
|
spinnerCount: number;
|
|
26
89
|
}
|
|
27
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Represents difficulty attributes that can be cached.
|
|
93
|
+
*/
|
|
28
94
|
type CacheableDifficultyAttributes<T extends DifficultyAttributes> = Omit<T, "mods"> & {
|
|
95
|
+
/**
|
|
96
|
+
* The mods which were applied to the beatmap.
|
|
97
|
+
*/
|
|
29
98
|
mods: string;
|
|
30
99
|
};
|
|
31
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Represents options for difficulty calculation.
|
|
103
|
+
*/
|
|
32
104
|
interface DifficultyCalculationOptions {
|
|
105
|
+
/**
|
|
106
|
+
* The modifications to apply.
|
|
107
|
+
*/
|
|
33
108
|
readonly mods?: Mod[];
|
|
109
|
+
/**
|
|
110
|
+
* The custom speed multiplier to apply. Defaults to 1.
|
|
111
|
+
*/
|
|
34
112
|
readonly customSpeedMultiplier?: number;
|
|
35
113
|
}
|
|
36
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Represents a hit object with difficulty calculation values.
|
|
117
|
+
*/
|
|
37
118
|
declare abstract class DifficultyHitObject {
|
|
119
|
+
/**
|
|
120
|
+
* The underlying hitobject.
|
|
121
|
+
*/
|
|
38
122
|
readonly object: PlaceableHitObject;
|
|
123
|
+
/**
|
|
124
|
+
* The index of this hitobject in the list of all hitobjects.
|
|
125
|
+
*
|
|
126
|
+
* This is one less than the actual index of the hitobject in the beatmap.
|
|
127
|
+
*/
|
|
39
128
|
readonly index: number;
|
|
129
|
+
/**
|
|
130
|
+
* The aim strain generated by the hitobject if sliders are considered.
|
|
131
|
+
*/
|
|
40
132
|
aimStrainWithSliders: number;
|
|
133
|
+
/**
|
|
134
|
+
* The aim strain generated by the hitobject if sliders are not considered.
|
|
135
|
+
*/
|
|
41
136
|
aimStrainWithoutSliders: number;
|
|
137
|
+
/**
|
|
138
|
+
* The rhythm multiplier generated by the hitobject. This is used to alter tap strain.
|
|
139
|
+
*/
|
|
42
140
|
rhythmMultiplier: number;
|
|
141
|
+
/**
|
|
142
|
+
* The normalized distance from the "lazy" end position of the previous hitobject to the start position of this hitobject.
|
|
143
|
+
*
|
|
144
|
+
* The "lazy" end position is the position at which the cursor ends up if the previous hitobject is followed with as minimal movement as possible (i.e. on the edge of slider follow circles).
|
|
145
|
+
*/
|
|
43
146
|
lazyJumpDistance: number;
|
|
147
|
+
/**
|
|
148
|
+
* The normalized shortest distance to consider for a jump between the previous hitobject and this hitobject.
|
|
149
|
+
*
|
|
150
|
+
* This is bounded from above by `lazyJumpDistance`, and is smaller than the former if a more natural path is able to be taken through the previous hitobject.
|
|
151
|
+
*
|
|
152
|
+
* Suppose a linear slider - circle pattern. Following the slider lazily (see: `lazyJumpDistance`) will result in underestimating the true end position of the slider as being closer towards the start position.
|
|
153
|
+
* As a result, `lazyJumpDistance` overestimates the jump distance because the player is able to take a more natural path by following through the slider to its end,
|
|
154
|
+
* such that the jump is felt as only starting from the slider's true end position.
|
|
155
|
+
*
|
|
156
|
+
* Now consider a slider - circle pattern where the circle is stacked along the path inside the slider.
|
|
157
|
+
* In this case, the lazy end position correctly estimates the true end position of the slider and provides the more natural movement path.
|
|
158
|
+
*/
|
|
44
159
|
minimumJumpDistance: number;
|
|
160
|
+
/**
|
|
161
|
+
* The time taken to travel through `minimumJumpDistance`, with a minimum value of 25ms.
|
|
162
|
+
*/
|
|
45
163
|
minimumJumpTime: number;
|
|
164
|
+
/**
|
|
165
|
+
* The normalized distance between the start and end position of this hitobject.
|
|
166
|
+
*/
|
|
46
167
|
travelDistance: number;
|
|
168
|
+
/**
|
|
169
|
+
* The time taken to travel through `travelDistance`, with a minimum value of 25ms for sliders.
|
|
170
|
+
*/
|
|
47
171
|
travelTime: number;
|
|
172
|
+
/**
|
|
173
|
+
* Angle the player has to take to hit this hitobject.
|
|
174
|
+
*
|
|
175
|
+
* Calculated as the angle between the circles (current-2, current-1, current).
|
|
176
|
+
*/
|
|
48
177
|
angle: number | null;
|
|
178
|
+
/**
|
|
179
|
+
* The amount of milliseconds elapsed between this hitobject and the last hitobject.
|
|
180
|
+
*/
|
|
49
181
|
readonly deltaTime: number;
|
|
182
|
+
/**
|
|
183
|
+
* The amount of milliseconds elapsed since the start time of the previous hitobject, with a minimum of 25ms.
|
|
184
|
+
*/
|
|
50
185
|
readonly strainTime: number;
|
|
186
|
+
/**
|
|
187
|
+
* Adjusted start time of the hitobject, taking speed multiplier into account.
|
|
188
|
+
*/
|
|
51
189
|
readonly startTime: number;
|
|
190
|
+
/**
|
|
191
|
+
* Adjusted end time of the hitobject, taking speed multiplier into account.
|
|
192
|
+
*/
|
|
52
193
|
readonly endTime: number;
|
|
194
|
+
/**
|
|
195
|
+
* Other hitobjects in the beatmap, including this hitobject.
|
|
196
|
+
*/
|
|
53
197
|
protected readonly hitObjects: readonly DifficultyHitObject[];
|
|
54
198
|
protected abstract readonly mode: Modes;
|
|
55
199
|
protected readonly normalizedRadius = 50;
|
|
@@ -58,10 +202,56 @@ declare abstract class DifficultyHitObject {
|
|
|
58
202
|
protected readonly minDeltaTime = 25;
|
|
59
203
|
private readonly lastObject;
|
|
60
204
|
private readonly lastLastObject;
|
|
205
|
+
/**
|
|
206
|
+
* Note: You **must** call `computeProperties` at some point due to how TypeScript handles
|
|
207
|
+
* overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue.).
|
|
208
|
+
*
|
|
209
|
+
* @param object The underlying hitobject.
|
|
210
|
+
* @param lastObject The hitobject before this hitobject.
|
|
211
|
+
* @param lastLastObject The hitobject before the last hitobject.
|
|
212
|
+
* @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
|
|
213
|
+
* @param clockRate The clock rate of the beatmap.
|
|
214
|
+
* @param timePreempt The time preempt with clock rate.
|
|
215
|
+
* @param isForceAR Whether force AR is enabled.
|
|
216
|
+
* @param mode The gamemode to compute properties for.
|
|
217
|
+
*/
|
|
61
218
|
protected constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, lastLastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number);
|
|
219
|
+
/**
|
|
220
|
+
* Computes the properties of this hitobject.
|
|
221
|
+
*
|
|
222
|
+
* @param clockRate The clock rate of the beatmap.
|
|
223
|
+
* @param hitObjects The hitobjects in the beatmap.
|
|
224
|
+
*/
|
|
62
225
|
computeProperties(clockRate: number, hitObjects: readonly PlaceableHitObject[]): void;
|
|
226
|
+
/**
|
|
227
|
+
* Gets the difficulty hitobject at a specific index with respect to the current
|
|
228
|
+
* difficulty hitobject's index.
|
|
229
|
+
*
|
|
230
|
+
* Will return `null` if the index is out of range.
|
|
231
|
+
*
|
|
232
|
+
* @param backwardsIndex The index to move backwards for.
|
|
233
|
+
* @returns The difficulty hitobject at the index with respect to the current
|
|
234
|
+
* difficulty hitobject's index, `null` if the index is out of range.
|
|
235
|
+
*/
|
|
63
236
|
previous(backwardsIndex: number): this | null;
|
|
237
|
+
/**
|
|
238
|
+
* Gets the difficulty hitobject at a specific index with respect to the current
|
|
239
|
+
* difficulty hitobject's index.
|
|
240
|
+
*
|
|
241
|
+
* Will return `null` if the index is out of range.
|
|
242
|
+
*
|
|
243
|
+
* @param forwardsIndex The index to move forwards for.
|
|
244
|
+
* @returns The difficulty hitobject at the index with respect to the current
|
|
245
|
+
* difficulty hitobject's index, `null` if the index is out of range.
|
|
246
|
+
*/
|
|
64
247
|
next(forwardsIndex: number): this | null;
|
|
248
|
+
/**
|
|
249
|
+
* Calculates the opacity of the hitobject at a given time.
|
|
250
|
+
*
|
|
251
|
+
* @param time The time to calculate the hitobject's opacity at.
|
|
252
|
+
* @param isHidden Whether Hidden mod is used.
|
|
253
|
+
* @returns The opacity of the hitobject at the given time.
|
|
254
|
+
*/
|
|
65
255
|
opacityAt(time: number, isHidden: boolean): number;
|
|
66
256
|
protected abstract get scalingFactor(): number;
|
|
67
257
|
protected setDistances(clockRate: number): void;
|
|
@@ -69,95 +259,343 @@ declare abstract class DifficultyHitObject {
|
|
|
69
259
|
private getEndCursorPosition;
|
|
70
260
|
}
|
|
71
261
|
|
|
262
|
+
/**
|
|
263
|
+
* Represents the strain peaks of various calculated difficulties.
|
|
264
|
+
*/
|
|
72
265
|
interface StrainPeaks {
|
|
266
|
+
/**
|
|
267
|
+
* The strain peaks of aim difficulty if sliders are considered.
|
|
268
|
+
*/
|
|
73
269
|
aimWithSliders: number[];
|
|
270
|
+
/**
|
|
271
|
+
* The strain peaks of aim difficulty if sliders are not considered.
|
|
272
|
+
*/
|
|
74
273
|
aimWithoutSliders: number[];
|
|
274
|
+
/**
|
|
275
|
+
* The strain peaks of speed difficulty.
|
|
276
|
+
*/
|
|
75
277
|
speed: number[];
|
|
278
|
+
/**
|
|
279
|
+
* The strain peaks of flashlight difficulty.
|
|
280
|
+
*/
|
|
76
281
|
flashlight: number[];
|
|
77
282
|
}
|
|
78
283
|
|
|
284
|
+
/**
|
|
285
|
+
* A bare minimal abstract skill for fully custom skill implementations.
|
|
286
|
+
*
|
|
287
|
+
* This class should be considered a "processing" class and not persisted.
|
|
288
|
+
*/
|
|
79
289
|
declare abstract class Skill {
|
|
290
|
+
/**
|
|
291
|
+
* The mods that this skill processes.
|
|
292
|
+
*/
|
|
80
293
|
protected readonly mods: Mod[];
|
|
81
294
|
constructor(mods: Mod[]);
|
|
295
|
+
/**
|
|
296
|
+
* Processes a hitobject.
|
|
297
|
+
*
|
|
298
|
+
* @param current The hitobject to process.
|
|
299
|
+
*/
|
|
82
300
|
abstract process(current: DifficultyHitObject): void;
|
|
301
|
+
/**
|
|
302
|
+
* Returns the calculated difficulty value representing all hitobjects that have been processed up to this point.
|
|
303
|
+
*/
|
|
83
304
|
abstract difficultyValue(): number;
|
|
84
305
|
}
|
|
85
306
|
|
|
307
|
+
/**
|
|
308
|
+
* The base of a difficulty calculator.
|
|
309
|
+
*/
|
|
86
310
|
declare abstract class DifficultyCalculator<THitObject extends DifficultyHitObject, TAttributes extends DifficultyAttributes> {
|
|
311
|
+
/**
|
|
312
|
+
* The calculated beatmap.
|
|
313
|
+
*/
|
|
87
314
|
readonly beatmap: Beatmap;
|
|
315
|
+
/**
|
|
316
|
+
* The difficulty objects of the beatmap.
|
|
317
|
+
*/
|
|
88
318
|
readonly objects: THitObject[];
|
|
319
|
+
/**
|
|
320
|
+
* The modifications applied.
|
|
321
|
+
*/
|
|
89
322
|
mods: Mod[];
|
|
323
|
+
/**
|
|
324
|
+
* The total star rating of the beatmap.
|
|
325
|
+
*/
|
|
90
326
|
get total(): number;
|
|
327
|
+
/**
|
|
328
|
+
* The difficulty statistics of the beatmap after modifications are applied.
|
|
329
|
+
*/
|
|
91
330
|
difficultyStatistics: DifficultyStatisticsCalculatorResult<number, number, number, number>;
|
|
331
|
+
/**
|
|
332
|
+
* The strain peaks of various calculated difficulties.
|
|
333
|
+
*/
|
|
92
334
|
readonly strainPeaks: StrainPeaks;
|
|
335
|
+
/**
|
|
336
|
+
* The difficulty attributes that can be used to calculate performance points.
|
|
337
|
+
*/
|
|
93
338
|
abstract readonly attributes: TAttributes;
|
|
339
|
+
/**
|
|
340
|
+
* The difficulty attributes that can be cached. It can also be used to calculate performance points.
|
|
341
|
+
*/
|
|
94
342
|
abstract get cacheableAttributes(): CacheableDifficultyAttributes<TAttributes>;
|
|
95
343
|
protected abstract readonly difficultyMultiplier: number;
|
|
96
344
|
protected abstract readonly mode: Modes;
|
|
345
|
+
/**
|
|
346
|
+
* Constructs a new instance of the calculator.
|
|
347
|
+
*
|
|
348
|
+
* @param beatmap The beatmap to calculate. This beatmap will be deep-cloned to prevent reference changes.
|
|
349
|
+
*/
|
|
97
350
|
constructor(beatmap: Beatmap);
|
|
351
|
+
/**
|
|
352
|
+
* Calculates the star rating of the specified beatmap.
|
|
353
|
+
*
|
|
354
|
+
* The beatmap is analyzed in chunks of `sectionLength` duration.
|
|
355
|
+
* For each chunk the highest hitobject strains are added to
|
|
356
|
+
* a list which is then collapsed into a weighted sum, much
|
|
357
|
+
* like scores are weighted on a user's profile.
|
|
358
|
+
*
|
|
359
|
+
* For subsequent chunks, the initial max strain is calculated
|
|
360
|
+
* by decaying the previous hitobject's strain until the
|
|
361
|
+
* beginning of the new chunk.
|
|
362
|
+
*
|
|
363
|
+
* @param options Options for the difficulty calculation.
|
|
364
|
+
* @returns The current instance.
|
|
365
|
+
*/
|
|
98
366
|
calculate(options?: DifficultyCalculationOptions): this;
|
|
367
|
+
/**
|
|
368
|
+
* Generates difficulty hitobjects for this calculator.
|
|
369
|
+
*
|
|
370
|
+
* @param beatmap The beatmap to generate difficulty hitobjects from.
|
|
371
|
+
*/
|
|
99
372
|
protected abstract generateDifficultyHitObjects(beatmap: Beatmap): THitObject[];
|
|
373
|
+
/**
|
|
374
|
+
* Computes the difficulty statistics of the original beatmap with respect to the used options.
|
|
375
|
+
*
|
|
376
|
+
* @param options The options to use for the difficulty statistics calculation.
|
|
377
|
+
* @returns The computed difficulty statistics.
|
|
378
|
+
*/
|
|
100
379
|
protected abstract computeDifficultyStatistics(options?: DifficultyCalculationOptions): DifficultyStatisticsCalculatorResult<number, number, number, number>;
|
|
380
|
+
/**
|
|
381
|
+
* Calculates the skills provided.
|
|
382
|
+
*
|
|
383
|
+
* @param skills The skills to calculate.
|
|
384
|
+
*/
|
|
101
385
|
protected calculateSkills(...skills: Skill[]): void;
|
|
386
|
+
/**
|
|
387
|
+
* Calculates the total star rating of the beatmap and stores it in this instance.
|
|
388
|
+
*/
|
|
102
389
|
abstract calculateTotal(): void;
|
|
390
|
+
/**
|
|
391
|
+
* Calculates every star rating of the beatmap and stores it in this instance.
|
|
392
|
+
*/
|
|
103
393
|
abstract calculateAll(): void;
|
|
394
|
+
/**
|
|
395
|
+
* Returns a string representative of the class.
|
|
396
|
+
*/
|
|
104
397
|
abstract toString(): string;
|
|
398
|
+
/**
|
|
399
|
+
* Creates skills to be calculated.
|
|
400
|
+
*/
|
|
105
401
|
protected abstract createSkills(): Skill[];
|
|
402
|
+
/**
|
|
403
|
+
* Populates the stored difficulty attributes with necessary data.
|
|
404
|
+
*/
|
|
106
405
|
protected populateDifficultyAttributes(): void;
|
|
406
|
+
/**
|
|
407
|
+
* Calculates the star rating value of a difficulty.
|
|
408
|
+
*
|
|
409
|
+
* @param difficulty The difficulty to calculate.
|
|
410
|
+
*/
|
|
107
411
|
protected starValue(difficulty: number): number;
|
|
412
|
+
/**
|
|
413
|
+
* Calculates the base performance value of a difficulty rating.
|
|
414
|
+
*
|
|
415
|
+
* @param rating The difficulty rating.
|
|
416
|
+
*/
|
|
108
417
|
protected basePerformanceValue(rating: number): number;
|
|
109
418
|
}
|
|
110
419
|
|
|
420
|
+
/**
|
|
421
|
+
* Represents a slider that is considered difficult.
|
|
422
|
+
*
|
|
423
|
+
* This structure is a part of difficulty attributes and can be cached.
|
|
424
|
+
*/
|
|
111
425
|
interface DifficultSlider {
|
|
426
|
+
/**
|
|
427
|
+
* The index of the slider in the beatmap.
|
|
428
|
+
*/
|
|
112
429
|
readonly index: number;
|
|
430
|
+
/**
|
|
431
|
+
* The difficulty rating of this slider compared to other sliders, based on the velocity of the slider.
|
|
432
|
+
*
|
|
433
|
+
* A value closer to 1 indicates that this slider is more difficult compared to most sliders.
|
|
434
|
+
*
|
|
435
|
+
* A value closer to 0 indicates that this slider is easier compared to most sliders.
|
|
436
|
+
*/
|
|
113
437
|
readonly difficultyRating: number;
|
|
114
438
|
}
|
|
115
439
|
|
|
440
|
+
/**
|
|
441
|
+
* Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
|
|
442
|
+
* and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
|
|
443
|
+
*/
|
|
116
444
|
declare abstract class StrainSkill extends Skill {
|
|
445
|
+
/**
|
|
446
|
+
* Strain peaks are stored here.
|
|
447
|
+
*/
|
|
117
448
|
readonly strainPeaks: number[];
|
|
449
|
+
/**
|
|
450
|
+
* The number of sections with the highest strains, which the peak strain reductions will apply to.
|
|
451
|
+
* This is done in order to decrease their impact on the overall difficulty of the map for this skill.
|
|
452
|
+
*/
|
|
118
453
|
protected abstract readonly reducedSectionCount: number;
|
|
454
|
+
/**
|
|
455
|
+
* The baseline multiplier applied to the section with the biggest strain.
|
|
456
|
+
*/
|
|
119
457
|
protected abstract readonly reducedSectionBaseline: number;
|
|
458
|
+
/**
|
|
459
|
+
* Determines how quickly strain decays for the given skill.
|
|
460
|
+
*
|
|
461
|
+
* For example, a value of 0.15 indicates that strain decays to 15% of its original value in one second.
|
|
462
|
+
*/
|
|
120
463
|
protected abstract readonly strainDecayBase: number;
|
|
121
464
|
private readonly sectionLength;
|
|
122
465
|
private currentStrain;
|
|
123
466
|
private currentSectionPeak;
|
|
124
467
|
private currentSectionEnd;
|
|
125
468
|
process(current: DifficultyHitObject): void;
|
|
469
|
+
/**
|
|
470
|
+
* Saves the current peak strain level to the list of strain peaks, which will be used to calculate an overall difficulty.
|
|
471
|
+
*/
|
|
126
472
|
saveCurrentPeak(): void;
|
|
473
|
+
/**
|
|
474
|
+
* Calculates strain decay for a specified time frame.
|
|
475
|
+
*
|
|
476
|
+
* @param ms The time frame to calculate.
|
|
477
|
+
*/
|
|
127
478
|
protected strainDecay(ms: number): number;
|
|
479
|
+
/**
|
|
480
|
+
* Calculates the strain value at a hitobject.
|
|
481
|
+
*
|
|
482
|
+
* @param current The hitobject to calculate.
|
|
483
|
+
*/
|
|
128
484
|
protected abstract strainValueAt(current: DifficultyHitObject): number;
|
|
485
|
+
/**
|
|
486
|
+
* Saves the current strain to a hitobject.
|
|
487
|
+
*/
|
|
129
488
|
protected abstract saveToHitObject(current: DifficultyHitObject): void;
|
|
489
|
+
/**
|
|
490
|
+
* Retrieves the peak strain at a point in time.
|
|
491
|
+
*
|
|
492
|
+
* @param time The time to retrieve the peak strain at.
|
|
493
|
+
* @param current The current hit object.
|
|
494
|
+
* @returns The peak strain.
|
|
495
|
+
*/
|
|
130
496
|
protected abstract calculateInitialStrain(time: number, current: DifficultyHitObject): number;
|
|
497
|
+
/**
|
|
498
|
+
* Sets the initial strain level for a new section.
|
|
499
|
+
*
|
|
500
|
+
* @param time The beginning of the new section in milliseconds.
|
|
501
|
+
* @param current The current hitobject.
|
|
502
|
+
*/
|
|
131
503
|
private startNewSectionFrom;
|
|
132
504
|
}
|
|
133
505
|
|
|
506
|
+
/**
|
|
507
|
+
* Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
|
|
508
|
+
* and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
|
|
509
|
+
*/
|
|
134
510
|
declare abstract class DroidSkill extends StrainSkill {
|
|
511
|
+
/**
|
|
512
|
+
* The bonus multiplier that is given for a sequence of notes of equal difficulty.
|
|
513
|
+
*/
|
|
135
514
|
protected abstract readonly starsPerDouble: number;
|
|
136
515
|
difficultyValue(): number;
|
|
137
516
|
}
|
|
138
517
|
|
|
518
|
+
/**
|
|
519
|
+
* Represents an osu!droid hit object with difficulty calculation values.
|
|
520
|
+
*/
|
|
139
521
|
declare class DroidDifficultyHitObject extends DifficultyHitObject {
|
|
522
|
+
/**
|
|
523
|
+
* The tap strain generated by the hitobject.
|
|
524
|
+
*/
|
|
140
525
|
tapStrain: number;
|
|
526
|
+
/**
|
|
527
|
+
* The tap strain generated by the hitobject if `strainTime` isn't modified by
|
|
528
|
+
* OD. This is used in three-finger detection.
|
|
529
|
+
*/
|
|
141
530
|
originalTapStrain: number;
|
|
531
|
+
/**
|
|
532
|
+
* The rhythm strain generated by the hitobject.
|
|
533
|
+
*/
|
|
142
534
|
rhythmStrain: number;
|
|
535
|
+
/**
|
|
536
|
+
* The flashlight strain generated by the hitobject if sliders are considered.
|
|
537
|
+
*/
|
|
143
538
|
flashlightStrainWithSliders: number;
|
|
539
|
+
/**
|
|
540
|
+
* The flashlight strain generated by the hitobject if sliders are not considered.
|
|
541
|
+
*/
|
|
144
542
|
flashlightStrainWithoutSliders: number;
|
|
543
|
+
/**
|
|
544
|
+
* The visual strain generated by the hitobject if sliders are considered.
|
|
545
|
+
*/
|
|
145
546
|
visualStrainWithSliders: number;
|
|
547
|
+
/**
|
|
548
|
+
* The visual strain generated by the hitobject if sliders are not considered.
|
|
549
|
+
*/
|
|
146
550
|
visualStrainWithoutSliders: number;
|
|
551
|
+
/**
|
|
552
|
+
* The note density of the hitobject.
|
|
553
|
+
*/
|
|
147
554
|
noteDensity: number;
|
|
555
|
+
/**
|
|
556
|
+
* The overlapping factor of the hitobject.
|
|
557
|
+
*
|
|
558
|
+
* This is used to scale visual skill.
|
|
559
|
+
*/
|
|
148
560
|
overlappingFactor: number;
|
|
561
|
+
/**
|
|
562
|
+
* Adjusted preempt time of the hitobject, taking speed multiplier into account.
|
|
563
|
+
*/
|
|
149
564
|
readonly timePreempt: number;
|
|
150
565
|
private readonly radiusBuffThreshold;
|
|
151
566
|
protected readonly mode = Modes.droid;
|
|
152
567
|
protected readonly maximumSliderRadius: number;
|
|
153
568
|
protected get scalingFactor(): number;
|
|
569
|
+
/**
|
|
570
|
+
* Note: You **must** call `computeProperties` at some point due to how TypeScript handles
|
|
571
|
+
* overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue.).
|
|
572
|
+
*
|
|
573
|
+
* @param object The underlying hitobject.
|
|
574
|
+
* @param lastObject The hitobject before this hitobject.
|
|
575
|
+
* @param lastLastObject The hitobject before the last hitobject.
|
|
576
|
+
* @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
|
|
577
|
+
* @param clockRate The clock rate of the beatmap.
|
|
578
|
+
* @param isForceAR Whether force AR is enabled.
|
|
579
|
+
*/
|
|
154
580
|
constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, lastLastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number, isForceAR: boolean);
|
|
155
581
|
computeProperties(clockRate: number, hitObjects: readonly PlaceableHitObject[]): void;
|
|
582
|
+
/**
|
|
583
|
+
* Determines whether this hitobject is considered overlapping with the hitobject before it.
|
|
584
|
+
*
|
|
585
|
+
* Keep in mind that "overlapping" in this case is overlapping to the point where both hitobjects
|
|
586
|
+
* can be hit with just a single tap in osu!droid.
|
|
587
|
+
*
|
|
588
|
+
* @param considerDistance Whether to consider the distance between both hitobjects.
|
|
589
|
+
* @returns Whether the hitobject is considered overlapping.
|
|
590
|
+
*/
|
|
156
591
|
isOverlapping(considerDistance: boolean): boolean;
|
|
157
592
|
private setVisuals;
|
|
158
593
|
private applyToOverlappingFactor;
|
|
159
594
|
}
|
|
160
595
|
|
|
596
|
+
/**
|
|
597
|
+
* Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
|
|
598
|
+
*/
|
|
161
599
|
declare class DroidAim extends DroidSkill {
|
|
162
600
|
protected readonly strainDecayBase: number;
|
|
163
601
|
protected readonly reducedSectionCount: number;
|
|
@@ -169,66 +607,204 @@ declare class DroidAim extends DroidSkill {
|
|
|
169
607
|
constructor(mods: Mod[], withSliders: boolean);
|
|
170
608
|
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
171
609
|
protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
|
|
610
|
+
/**
|
|
611
|
+
* @param current The hitobject to save to.
|
|
612
|
+
*/
|
|
172
613
|
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
173
614
|
}
|
|
174
615
|
|
|
616
|
+
/**
|
|
617
|
+
* An evaluator for calculating osu!droid Aim skill.
|
|
618
|
+
*/
|
|
175
619
|
declare abstract class DroidAimEvaluator extends AimEvaluator {
|
|
176
620
|
protected static readonly wideAngleMultiplier: number;
|
|
177
621
|
protected static readonly sliderMultiplier: number;
|
|
178
622
|
protected static readonly velocityChangeMultiplier: number;
|
|
179
623
|
private static readonly singleSpacingThreshold;
|
|
180
624
|
private static readonly minSpeedBonus;
|
|
625
|
+
/**
|
|
626
|
+
* Evaluates the difficulty of aiming the current object, based on:
|
|
627
|
+
*
|
|
628
|
+
* - cursor velocity to the current object,
|
|
629
|
+
* - angle difficulty,
|
|
630
|
+
* - sharp velocity increases,
|
|
631
|
+
* - and slider difficulty.
|
|
632
|
+
*
|
|
633
|
+
* @param current The current object.
|
|
634
|
+
* @param withSliders Whether to take slider difficulty into account.
|
|
635
|
+
*/
|
|
181
636
|
static evaluateDifficultyOf(current: DroidDifficultyHitObject, withSliders: boolean): number;
|
|
637
|
+
/**
|
|
638
|
+
* Calculates the snap aim strain of a hitobject.
|
|
639
|
+
*/
|
|
182
640
|
private static snapAimStrainOf;
|
|
641
|
+
/**
|
|
642
|
+
* Calculates the flow aim strain of a hitobject.
|
|
643
|
+
*/
|
|
183
644
|
private static flowAimStrainOf;
|
|
184
645
|
}
|
|
185
646
|
|
|
647
|
+
/**
|
|
648
|
+
* Holds data that can be used to calculate osu!droid performance points.
|
|
649
|
+
*/
|
|
186
650
|
interface DroidDifficultyAttributes extends DifficultyAttributes {
|
|
651
|
+
/**
|
|
652
|
+
* The difficulty corresponding to the tap skill.
|
|
653
|
+
*/
|
|
187
654
|
tapDifficulty: number;
|
|
655
|
+
/**
|
|
656
|
+
* The difficulty corresponding to the rhythm skill.
|
|
657
|
+
*/
|
|
188
658
|
rhythmDifficulty: number;
|
|
659
|
+
/**
|
|
660
|
+
* The difficulty corresponding to the visual skill.
|
|
661
|
+
*/
|
|
189
662
|
visualDifficulty: number;
|
|
663
|
+
/**
|
|
664
|
+
* The amount of strains that are considered difficult with respect to the aim skill.
|
|
665
|
+
*/
|
|
190
666
|
aimDifficultStrainCount: number;
|
|
667
|
+
/**
|
|
668
|
+
* The amount of strains that are considered difficult with respect to the tap skill.
|
|
669
|
+
*/
|
|
191
670
|
tapDifficultStrainCount: number;
|
|
671
|
+
/**
|
|
672
|
+
* The amount of strains that are considered difficult with respect to the flashlight skill.
|
|
673
|
+
*/
|
|
192
674
|
flashlightDifficultStrainCount: number;
|
|
675
|
+
/**
|
|
676
|
+
* The amount of strains that are considered difficult with respect to the visual skill.
|
|
677
|
+
*/
|
|
193
678
|
visualDifficultStrainCount: number;
|
|
679
|
+
/**
|
|
680
|
+
* The average delta time of speed objects.
|
|
681
|
+
*/
|
|
194
682
|
averageSpeedDeltaTime: number;
|
|
195
683
|
}
|
|
196
684
|
|
|
685
|
+
/**
|
|
686
|
+
* Represents options for osu!droid difficulty calculation.
|
|
687
|
+
*/
|
|
197
688
|
interface DroidDifficultyCalculationOptions extends DifficultyCalculationOptions {
|
|
689
|
+
/**
|
|
690
|
+
* Whether to calculate for old statistics (1.6.7 and older). Defaults to `false`.
|
|
691
|
+
*/
|
|
198
692
|
readonly oldStatistics?: boolean;
|
|
199
693
|
}
|
|
200
694
|
|
|
695
|
+
/**
|
|
696
|
+
* Represents a beatmap section at which the strains of objects are considerably high.
|
|
697
|
+
*/
|
|
201
698
|
interface HighStrainSection {
|
|
699
|
+
/**
|
|
700
|
+
* The index of the first object in this section with respect to the full beatmap.
|
|
701
|
+
*/
|
|
202
702
|
readonly firstObjectIndex: number;
|
|
703
|
+
/**
|
|
704
|
+
* The index of the last object in this section with respect to the full beatmap.
|
|
705
|
+
*/
|
|
203
706
|
readonly lastObjectIndex: number;
|
|
707
|
+
/**
|
|
708
|
+
* The summed strain of this section.
|
|
709
|
+
*/
|
|
204
710
|
readonly sumStrain: number;
|
|
205
711
|
}
|
|
206
712
|
|
|
713
|
+
/**
|
|
714
|
+
* Holds data that can be used to calculate osu!droid performance points as well
|
|
715
|
+
* as doing some analysis using the replay of a score.
|
|
716
|
+
*/
|
|
207
717
|
interface ExtendedDroidDifficultyAttributes extends DroidDifficultyAttributes {
|
|
718
|
+
/**
|
|
719
|
+
* The mode of the difficulty calculation.
|
|
720
|
+
*/
|
|
208
721
|
mode: "live";
|
|
722
|
+
/**
|
|
723
|
+
* Possible sections at which the player can use three fingers on.
|
|
724
|
+
*/
|
|
209
725
|
possibleThreeFingeredSections: HighStrainSection[];
|
|
726
|
+
/**
|
|
727
|
+
* Sliders that are considered difficult.
|
|
728
|
+
*/
|
|
210
729
|
difficultSliders: DifficultSlider[];
|
|
730
|
+
/**
|
|
731
|
+
* The number of clickable objects weighted by difficulty.
|
|
732
|
+
*
|
|
733
|
+
* Related to aim difficulty.
|
|
734
|
+
*/
|
|
211
735
|
aimNoteCount: number;
|
|
736
|
+
/**
|
|
737
|
+
* Describes how much of flashlight difficulty is contributed to by hitcircles or sliders.
|
|
738
|
+
*
|
|
739
|
+
* A value closer to 1 indicates most of flashlight difficulty is contributed by hitcircles.
|
|
740
|
+
*
|
|
741
|
+
* A value closer to 0 indicates most of flashlight difficulty is contributed by sliders.
|
|
742
|
+
*/
|
|
212
743
|
flashlightSliderFactor: number;
|
|
744
|
+
/**
|
|
745
|
+
* Describes how much of visual difficulty is contributed to by hitcircles or sliders.
|
|
746
|
+
*
|
|
747
|
+
* A value closer to 1 indicates most of visual difficulty is contributed by hitcircles.
|
|
748
|
+
*
|
|
749
|
+
* A value closer to 0 indicates most of visual difficulty is contributed by sliders.
|
|
750
|
+
*/
|
|
213
751
|
visualSliderFactor: number;
|
|
214
752
|
}
|
|
215
753
|
|
|
754
|
+
/**
|
|
755
|
+
* A difficulty calculator for osu!droid gamemode.
|
|
756
|
+
*/
|
|
216
757
|
declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidDifficultyHitObject, DroidDifficultyAttributes> {
|
|
758
|
+
/**
|
|
759
|
+
* The aim star rating of the beatmap.
|
|
760
|
+
*/
|
|
217
761
|
get aim(): number;
|
|
762
|
+
/**
|
|
763
|
+
* The tap star rating of the beatmap.
|
|
764
|
+
*/
|
|
218
765
|
get tap(): number;
|
|
766
|
+
/**
|
|
767
|
+
* The rhythm star rating of the beatmap.
|
|
768
|
+
*/
|
|
219
769
|
get rhythm(): number;
|
|
770
|
+
/**
|
|
771
|
+
* The flashlight star rating of the beatmap.
|
|
772
|
+
*/
|
|
220
773
|
get flashlight(): number;
|
|
774
|
+
/**
|
|
775
|
+
* The visual star rating of the beatmap.
|
|
776
|
+
*/
|
|
221
777
|
get visual(): number;
|
|
778
|
+
/**
|
|
779
|
+
* The strain threshold to start detecting for possible three-fingered section.
|
|
780
|
+
*
|
|
781
|
+
* Increasing this number will result in less sections being flagged.
|
|
782
|
+
*/
|
|
222
783
|
static readonly threeFingerStrainThreshold = 175;
|
|
223
784
|
readonly attributes: ExtendedDroidDifficultyAttributes;
|
|
224
785
|
get cacheableAttributes(): CacheableDifficultyAttributes<DroidDifficultyAttributes>;
|
|
225
786
|
protected readonly difficultyMultiplier = 0.18;
|
|
226
787
|
protected readonly mode = Modes.droid;
|
|
227
788
|
calculate(options?: DroidDifficultyCalculationOptions): this;
|
|
789
|
+
/**
|
|
790
|
+
* Calculates the aim star rating of the beatmap and stores it in this instance.
|
|
791
|
+
*/
|
|
228
792
|
calculateAim(): void;
|
|
793
|
+
/**
|
|
794
|
+
* Calculates the tap star rating of the beatmap and stores it in this instance.
|
|
795
|
+
*/
|
|
229
796
|
calculateTap(): void;
|
|
797
|
+
/**
|
|
798
|
+
* Calculates the rhythm star rating of the beatmap and stores it in this instance.
|
|
799
|
+
*/
|
|
230
800
|
calculateRhythm(): void;
|
|
801
|
+
/**
|
|
802
|
+
* Calculates the flashlight star rating of the beatmap and stores it in this instance.
|
|
803
|
+
*/
|
|
231
804
|
calculateFlashlight(): void;
|
|
805
|
+
/**
|
|
806
|
+
* Calculates the visual star rating of the beatmap and stores it in this instance.
|
|
807
|
+
*/
|
|
232
808
|
calculateVisual(): void;
|
|
233
809
|
calculateTotal(): void;
|
|
234
810
|
calculateAll(): void;
|
|
@@ -236,16 +812,60 @@ declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidDiffic
|
|
|
236
812
|
protected generateDifficultyHitObjects(beatmap: Beatmap): DroidDifficultyHitObject[];
|
|
237
813
|
protected computeDifficultyStatistics(options?: DroidDifficultyCalculationOptions): DifficultyStatisticsCalculatorResult<number, number, number, number>;
|
|
238
814
|
protected createSkills(): DroidSkill[];
|
|
815
|
+
/**
|
|
816
|
+
* Called after aim skill calculation.
|
|
817
|
+
*
|
|
818
|
+
* @param aimSkill The aim skill that considers sliders.
|
|
819
|
+
* @param aimSkillWithoutSliders The aim skill that doesn't consider sliders.
|
|
820
|
+
*/
|
|
239
821
|
private postCalculateAim;
|
|
822
|
+
/**
|
|
823
|
+
* Calculates aim-related attributes.
|
|
824
|
+
*/
|
|
240
825
|
private calculateAimAttributes;
|
|
826
|
+
/**
|
|
827
|
+
* Called after tap skill calculation.
|
|
828
|
+
*
|
|
829
|
+
* @param tapSkillCheese The tap skill that considers cheesing.
|
|
830
|
+
*/
|
|
241
831
|
private postCalculateTap;
|
|
832
|
+
/**
|
|
833
|
+
* Calculates tap-related attributes.
|
|
834
|
+
*/
|
|
242
835
|
private calculateTapAttributes;
|
|
836
|
+
/**
|
|
837
|
+
* Calculates the sum of strains for possible three-fingered sections.
|
|
838
|
+
*
|
|
839
|
+
* @param firstObjectIndex The index of the first object in the section.
|
|
840
|
+
* @param lastObjectIndex The index of the last object in the section.
|
|
841
|
+
* @returns The summed strain of the section.
|
|
842
|
+
*/
|
|
243
843
|
private calculateThreeFingerSummedStrain;
|
|
844
|
+
/**
|
|
845
|
+
* Called after rhythm skill calculation.
|
|
846
|
+
*
|
|
847
|
+
* @param rhythmSkill The rhythm skill.
|
|
848
|
+
*/
|
|
244
849
|
private postCalculateRhythm;
|
|
850
|
+
/**
|
|
851
|
+
* Called after flashlight skill calculation.
|
|
852
|
+
*
|
|
853
|
+
* @param flashlightSkill The flashlight skill that considers sliders.
|
|
854
|
+
* @param flashlightSkillWithoutSliders The flashlight skill that doesn't consider sliders.
|
|
855
|
+
*/
|
|
245
856
|
private postCalculateFlashlight;
|
|
857
|
+
/**
|
|
858
|
+
* Called after visual skill calculation.
|
|
859
|
+
*
|
|
860
|
+
* @param visualSkillWithSliders The visual skill that considers sliders.
|
|
861
|
+
* @param visualSkillWithoutSliders The visual skill that doesn't consider sliders.
|
|
862
|
+
*/
|
|
246
863
|
private postCalculateVisual;
|
|
247
864
|
}
|
|
248
865
|
|
|
866
|
+
/**
|
|
867
|
+
* Represents the skill required to memorize and hit every object in a beatmap with the Flashlight mod enabled.
|
|
868
|
+
*/
|
|
249
869
|
declare class DroidFlashlight extends DroidSkill {
|
|
250
870
|
protected readonly strainDecayBase: number;
|
|
251
871
|
protected readonly reducedSectionCount: number;
|
|
@@ -262,6 +882,11 @@ declare class DroidFlashlight extends DroidSkill {
|
|
|
262
882
|
difficultyValue(): number;
|
|
263
883
|
}
|
|
264
884
|
|
|
885
|
+
/**
|
|
886
|
+
* An evaluator for calculating flashlight skill.
|
|
887
|
+
*
|
|
888
|
+
* This class should be considered an "evaluating" class and not persisted.
|
|
889
|
+
*/
|
|
265
890
|
declare abstract class FlashlightEvaluator {
|
|
266
891
|
protected static readonly maxOpacityBonus: number;
|
|
267
892
|
protected static readonly hiddenBonus: number;
|
|
@@ -270,53 +895,208 @@ declare abstract class FlashlightEvaluator {
|
|
|
270
895
|
protected static readonly minAngleMultiplier: number;
|
|
271
896
|
}
|
|
272
897
|
|
|
898
|
+
/**
|
|
899
|
+
* An evaluator for calculating osu!droid Flashlight skill.
|
|
900
|
+
*/
|
|
273
901
|
declare abstract class DroidFlashlightEvaluator extends FlashlightEvaluator {
|
|
902
|
+
/**
|
|
903
|
+
* Evaluates the difficulty of memorizing and hitting the current object, based on:
|
|
904
|
+
*
|
|
905
|
+
* - distance between a number of previous objects and the current object,
|
|
906
|
+
* - the visual opacity of the current object,
|
|
907
|
+
* - the angle made by the current object,
|
|
908
|
+
* - length and speed of the current object (for sliders),
|
|
909
|
+
* - and whether Hidden mod is enabled.
|
|
910
|
+
*
|
|
911
|
+
* @param current The current object.
|
|
912
|
+
* @param isHiddenMod Whether the Hidden mod is enabled.
|
|
913
|
+
* @param withSliders Whether to take slider difficulty into account.
|
|
914
|
+
*/
|
|
274
915
|
static evaluateDifficultyOf(current: DroidDifficultyHitObject, isHiddenMod: boolean, withSliders: boolean): number;
|
|
275
916
|
}
|
|
276
917
|
|
|
918
|
+
/**
|
|
919
|
+
* Represents options for performance calculation.
|
|
920
|
+
*/
|
|
277
921
|
interface PerformanceCalculationOptions {
|
|
922
|
+
/**
|
|
923
|
+
* The maximum combo achieved in the score.
|
|
924
|
+
*/
|
|
278
925
|
combo?: number;
|
|
926
|
+
/**
|
|
927
|
+
* The accuracy achieved in the score.
|
|
928
|
+
*/
|
|
279
929
|
accPercent?: Accuracy | number;
|
|
930
|
+
/**
|
|
931
|
+
* The amount of misses achieved in the score.
|
|
932
|
+
*/
|
|
280
933
|
miss?: number;
|
|
934
|
+
/**
|
|
935
|
+
* The tap penalty to apply for penalized scores. Only used when using `DroidPerformanceCalculator`.
|
|
936
|
+
*/
|
|
281
937
|
tapPenalty?: number;
|
|
938
|
+
/**
|
|
939
|
+
* The aim slider cheese penalty to apply for penalized scores. Only used when using `DroidPerformanceCalculator`.
|
|
940
|
+
*/
|
|
282
941
|
aimSliderCheesePenalty?: number;
|
|
942
|
+
/**
|
|
943
|
+
* The flashlight slider cheese penalty to apply for penalized scores. Only used when using `DroidPerformanceCalculator`.
|
|
944
|
+
*/
|
|
283
945
|
flashlightSliderCheesePenalty?: number;
|
|
946
|
+
/**
|
|
947
|
+
* The visual slider cheese penalty to apply for penalized scores. Only used when using `DroidPerformanceCalculator`.
|
|
948
|
+
*/
|
|
284
949
|
visualSliderCheesePenalty?: number;
|
|
285
950
|
}
|
|
286
951
|
|
|
952
|
+
/**
|
|
953
|
+
* The base class of performance calculators.
|
|
954
|
+
*/
|
|
287
955
|
declare abstract class PerformanceCalculator<T extends DifficultyAttributes> {
|
|
956
|
+
/**
|
|
957
|
+
* The overall performance value.
|
|
958
|
+
*/
|
|
288
959
|
total: number;
|
|
960
|
+
/**
|
|
961
|
+
* The calculated accuracy.
|
|
962
|
+
*/
|
|
289
963
|
computedAccuracy: Accuracy;
|
|
964
|
+
/**
|
|
965
|
+
* The difficulty attributes that is being calculated.
|
|
966
|
+
*/
|
|
290
967
|
readonly difficultyAttributes: T;
|
|
968
|
+
/**
|
|
969
|
+
* Penalty for combo breaks.
|
|
970
|
+
*/
|
|
291
971
|
protected comboPenalty: number;
|
|
972
|
+
/**
|
|
973
|
+
* The global multiplier to be applied to the final performance value.
|
|
974
|
+
*
|
|
975
|
+
* This is being adjusted to keep the final value scaled around what it used to be when changing things.
|
|
976
|
+
*/
|
|
292
977
|
protected abstract finalMultiplier: number;
|
|
978
|
+
/**
|
|
979
|
+
* The gamemode to calculate for.
|
|
980
|
+
*/
|
|
293
981
|
protected abstract readonly mode: Modes;
|
|
982
|
+
/**
|
|
983
|
+
* The amount of misses that are filtered out from sliderbreaks.
|
|
984
|
+
*/
|
|
294
985
|
protected effectiveMissCount: number;
|
|
986
|
+
/**
|
|
987
|
+
* Nerf factor used for nerfing beatmaps with very likely dropped sliderends.
|
|
988
|
+
*/
|
|
295
989
|
protected sliderNerfFactor: number;
|
|
990
|
+
/**
|
|
991
|
+
* @param difficultyAttributes The difficulty attributes to calculate.
|
|
992
|
+
*/
|
|
296
993
|
constructor(difficultyAttributes: T | CacheableDifficultyAttributes<T>);
|
|
994
|
+
/**
|
|
995
|
+
* Calculates the performance points of the beatmap.
|
|
996
|
+
*
|
|
997
|
+
* @param options Options for performance calculation.
|
|
998
|
+
* @returns The current instance.
|
|
999
|
+
*/
|
|
297
1000
|
calculate(options?: PerformanceCalculationOptions): this;
|
|
1001
|
+
/**
|
|
1002
|
+
* Returns a string representative of the class.
|
|
1003
|
+
*/
|
|
298
1004
|
abstract toString(): string;
|
|
1005
|
+
/**
|
|
1006
|
+
* Calculates all values that will be used for calculating the total
|
|
1007
|
+
* performance value of the beatmap and stores them in this instance.
|
|
1008
|
+
*/
|
|
299
1009
|
protected abstract calculateValues(): void;
|
|
1010
|
+
/**
|
|
1011
|
+
* Calculates the total performance value of the beatmap and stores it in this instance.
|
|
1012
|
+
*/
|
|
300
1013
|
protected abstract calculateTotalValue(): number;
|
|
1014
|
+
/**
|
|
1015
|
+
* The total hits that can be done in the beatmap.
|
|
1016
|
+
*/
|
|
301
1017
|
protected get totalHits(): number;
|
|
1018
|
+
/**
|
|
1019
|
+
* The total hits that were successfully done.
|
|
1020
|
+
*/
|
|
302
1021
|
protected get totalSuccessfulHits(): number;
|
|
1022
|
+
/**
|
|
1023
|
+
* Calculates the base performance value of a star rating.
|
|
1024
|
+
*/
|
|
303
1025
|
protected baseValue(stars: number): number;
|
|
1026
|
+
/**
|
|
1027
|
+
* Processes given options for usage in performance calculation.
|
|
1028
|
+
*
|
|
1029
|
+
* @param options Options for performance calculation.
|
|
1030
|
+
*/
|
|
304
1031
|
protected handleOptions(options?: PerformanceCalculationOptions): void;
|
|
1032
|
+
/**
|
|
1033
|
+
* Calculates the amount of misses + sliderbreaks from combo.
|
|
1034
|
+
*/
|
|
305
1035
|
private calculateEffectiveMissCount;
|
|
1036
|
+
/**
|
|
1037
|
+
* Determines whether an attribute is a cacheable attribute.
|
|
1038
|
+
*
|
|
1039
|
+
* @param attributes The attributes to check.
|
|
1040
|
+
* @returns Whether the attributes are cacheable.
|
|
1041
|
+
*/
|
|
306
1042
|
private isCacheableAttribute;
|
|
307
1043
|
}
|
|
308
1044
|
|
|
1045
|
+
/**
|
|
1046
|
+
* A performance points calculator that calculates performance points for osu!droid gamemode.
|
|
1047
|
+
*/
|
|
309
1048
|
declare class DroidPerformanceCalculator extends PerformanceCalculator<DroidDifficultyAttributes> {
|
|
1049
|
+
/**
|
|
1050
|
+
* The aim performance value.
|
|
1051
|
+
*/
|
|
310
1052
|
aim: number;
|
|
1053
|
+
/**
|
|
1054
|
+
* The tap performance value.
|
|
1055
|
+
*/
|
|
311
1056
|
tap: number;
|
|
1057
|
+
/**
|
|
1058
|
+
* The accuracy performance value.
|
|
1059
|
+
*/
|
|
312
1060
|
accuracy: number;
|
|
1061
|
+
/**
|
|
1062
|
+
* The flashlight performance value.
|
|
1063
|
+
*/
|
|
313
1064
|
flashlight: number;
|
|
1065
|
+
/**
|
|
1066
|
+
* The visual performance value.
|
|
1067
|
+
*/
|
|
314
1068
|
visual: number;
|
|
1069
|
+
/**
|
|
1070
|
+
* The penalty used to penalize the tap performance value.
|
|
1071
|
+
*
|
|
1072
|
+
* Can be properly obtained by analyzing the replay associated with the score.
|
|
1073
|
+
*/
|
|
315
1074
|
get tapPenalty(): number;
|
|
1075
|
+
/**
|
|
1076
|
+
* The estimated deviation of the score.
|
|
1077
|
+
*/
|
|
316
1078
|
get deviation(): number;
|
|
1079
|
+
/**
|
|
1080
|
+
* The estimated tap deviation of the score.
|
|
1081
|
+
*/
|
|
317
1082
|
get tapDeviation(): number;
|
|
1083
|
+
/**
|
|
1084
|
+
* The penalty used to penalize the aim performance value.
|
|
1085
|
+
*
|
|
1086
|
+
* Can be properly obtained by analyzing the replay associated with the score.
|
|
1087
|
+
*/
|
|
318
1088
|
get aimSliderCheesePenalty(): number;
|
|
1089
|
+
/**
|
|
1090
|
+
* The penalty used to penalize the flashlight performance value.
|
|
1091
|
+
*
|
|
1092
|
+
* Can be properly obtained by analyzing the replay associated with the score.
|
|
1093
|
+
*/
|
|
319
1094
|
get flashlightSliderCheesePenalty(): number;
|
|
1095
|
+
/**
|
|
1096
|
+
* The penalty used to penalize the visual performance value.
|
|
1097
|
+
*
|
|
1098
|
+
* Can be properly obtained by analyzing the replay associated with the score.
|
|
1099
|
+
*/
|
|
320
1100
|
get visualSliderCheesePenalty(): number;
|
|
321
1101
|
protected finalMultiplier: number;
|
|
322
1102
|
protected readonly mode: Modes;
|
|
@@ -326,26 +1106,110 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator<DroidDiff
|
|
|
326
1106
|
private _tapPenalty;
|
|
327
1107
|
private _deviation;
|
|
328
1108
|
private _tapDeviation;
|
|
1109
|
+
/**
|
|
1110
|
+
* Applies a tap penalty value to this calculator.
|
|
1111
|
+
*
|
|
1112
|
+
* The tap and total performance value will be recalculated afterwards.
|
|
1113
|
+
*
|
|
1114
|
+
* @param value The tap penalty value. Must be greater than or equal to 1.
|
|
1115
|
+
*/
|
|
329
1116
|
applyTapPenalty(value: number): void;
|
|
1117
|
+
/**
|
|
1118
|
+
* Applies an aim slider cheese penalty value to this calculator.
|
|
1119
|
+
*
|
|
1120
|
+
* The aim and total performance value will be recalculated afterwards.
|
|
1121
|
+
*
|
|
1122
|
+
* @param value The slider cheese penalty value. Must be between than 0 and 1.
|
|
1123
|
+
*/
|
|
330
1124
|
applyAimSliderCheesePenalty(value: number): void;
|
|
1125
|
+
/**
|
|
1126
|
+
* Applies a flashlight slider cheese penalty value to this calculator.
|
|
1127
|
+
*
|
|
1128
|
+
* The flashlight and total performance value will be recalculated afterwards.
|
|
1129
|
+
*
|
|
1130
|
+
* @param value The slider cheese penalty value. Must be between 0 and 1.
|
|
1131
|
+
*/
|
|
331
1132
|
applyFlashlightSliderCheesePenalty(value: number): void;
|
|
1133
|
+
/**
|
|
1134
|
+
* Applies a visual slider cheese penalty value to this calculator.
|
|
1135
|
+
*
|
|
1136
|
+
* The visual and total performance value will be recalculated afterwards.
|
|
1137
|
+
*
|
|
1138
|
+
* @param value The slider cheese penalty value. Must be between 0 and 1.
|
|
1139
|
+
*/
|
|
332
1140
|
applyVisualSliderCheesePenalty(value: number): void;
|
|
333
1141
|
protected calculateValues(): void;
|
|
334
1142
|
protected calculateTotalValue(): number;
|
|
335
1143
|
protected handleOptions(options?: PerformanceCalculationOptions): void;
|
|
1144
|
+
/**
|
|
1145
|
+
* Calculates the aim performance value of the beatmap.
|
|
1146
|
+
*/
|
|
336
1147
|
private calculateAimValue;
|
|
1148
|
+
/**
|
|
1149
|
+
* Calculates the tap performance value of the beatmap.
|
|
1150
|
+
*/
|
|
337
1151
|
private calculateTapValue;
|
|
1152
|
+
/**
|
|
1153
|
+
* Calculates the accuracy performance value of the beatmap.
|
|
1154
|
+
*/
|
|
338
1155
|
private calculateAccuracyValue;
|
|
1156
|
+
/**
|
|
1157
|
+
* Calculates the flashlight performance value of the beatmap.
|
|
1158
|
+
*/
|
|
339
1159
|
private calculateFlashlightValue;
|
|
1160
|
+
/**
|
|
1161
|
+
* Calculates the visual performance value of the beatmap.
|
|
1162
|
+
*/
|
|
340
1163
|
private calculateVisualValue;
|
|
1164
|
+
/**
|
|
1165
|
+
* Calculates a strain-based miss penalty.
|
|
1166
|
+
*
|
|
1167
|
+
* Strain-based miss penalty assumes that a player will miss on the hardest parts of a map,
|
|
1168
|
+
* so we use the amount of relatively difficult sections to adjust miss penalty
|
|
1169
|
+
* to make it more punishing on maps with lower amount of hard sections.
|
|
1170
|
+
*/
|
|
341
1171
|
private calculateStrainBasedMissPenalty;
|
|
1172
|
+
/**
|
|
1173
|
+
* The object-based proportional miss penalty.
|
|
1174
|
+
*/
|
|
342
1175
|
private get proportionalMissPenalty();
|
|
1176
|
+
/**
|
|
1177
|
+
* Calculates the object-based length scaling based on the deviation of a player for a full
|
|
1178
|
+
* combo in this beatmap, taking retries into account.
|
|
1179
|
+
*
|
|
1180
|
+
* @param objectCount The amount of objects to be considered. Defaults to the amount of
|
|
1181
|
+
* objects in this beatmap.
|
|
1182
|
+
* @param punishForMemorization Whether to punish the deviation for memorization. Defaults to `false`.
|
|
1183
|
+
*/
|
|
343
1184
|
private calculateDeviationBasedLengthScaling;
|
|
1185
|
+
/**
|
|
1186
|
+
* Estimates the player's tap deviation based on the OD, number of circles and sliders,
|
|
1187
|
+
* and number of 300s, 100s, 50s, and misses, assuming the player's mean hit error is 0.
|
|
1188
|
+
*
|
|
1189
|
+
* The estimation is consistent in that two SS scores on the same map
|
|
1190
|
+
* with the same settings will always return the same deviation.
|
|
1191
|
+
*
|
|
1192
|
+
* Sliders are treated as circles with a 50 hit window.
|
|
1193
|
+
*
|
|
1194
|
+
* Misses are ignored because they are usually due to misaiming, and 50s
|
|
1195
|
+
* are grouped with 100s since they are usually due to misreading.
|
|
1196
|
+
*
|
|
1197
|
+
* Inaccuracies are capped to the number of circles in the map.
|
|
1198
|
+
*/
|
|
344
1199
|
private calculateDeviation;
|
|
1200
|
+
/**
|
|
1201
|
+
* Does the same as {@link calculateDeviation}, but only for notes and inaccuracies that are relevant to tap difficulty.
|
|
1202
|
+
*
|
|
1203
|
+
* Treats all difficult speed notes as circles, so this method can sometimes return a lower deviation than {@link calculateDeviation}.
|
|
1204
|
+
* This is fine though, since this method is only used to scale tap pp.
|
|
1205
|
+
*/
|
|
345
1206
|
private calculateTapDeviation;
|
|
346
1207
|
toString(): string;
|
|
347
1208
|
}
|
|
348
1209
|
|
|
1210
|
+
/**
|
|
1211
|
+
* Represents the skill required to properly follow a beatmap's rhythm.
|
|
1212
|
+
*/
|
|
349
1213
|
declare class DroidRhythm extends DroidSkill {
|
|
350
1214
|
protected readonly reducedSectionCount: number;
|
|
351
1215
|
protected readonly reducedSectionBaseline: number;
|
|
@@ -360,15 +1224,33 @@ declare class DroidRhythm extends DroidSkill {
|
|
|
360
1224
|
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
361
1225
|
}
|
|
362
1226
|
|
|
1227
|
+
/**
|
|
1228
|
+
* An evaluator for calculating rhythm skill.
|
|
1229
|
+
*
|
|
1230
|
+
* This class should be considered an "evaluating" class and not persisted.
|
|
1231
|
+
*/
|
|
363
1232
|
declare abstract class RhythmEvaluator {
|
|
364
1233
|
protected static readonly rhythmMultiplier: number;
|
|
365
1234
|
protected static readonly historyTimeMax: number;
|
|
366
1235
|
}
|
|
367
1236
|
|
|
1237
|
+
/**
|
|
1238
|
+
* An evaluator for calculating osu!droid Rhythm skill.
|
|
1239
|
+
*/
|
|
368
1240
|
declare abstract class DroidRhythmEvaluator extends RhythmEvaluator {
|
|
1241
|
+
/**
|
|
1242
|
+
* Calculates a rhythm multiplier for the difficulty of the tap associated
|
|
1243
|
+
* with historic data of the current object.
|
|
1244
|
+
*
|
|
1245
|
+
* @param current The current object.
|
|
1246
|
+
* @param greatWindow The great hit window of the current object.
|
|
1247
|
+
*/
|
|
369
1248
|
static evaluateDifficultyOf(current: DroidDifficultyHitObject, greatWindow: number): number;
|
|
370
1249
|
}
|
|
371
1250
|
|
|
1251
|
+
/**
|
|
1252
|
+
* Represents the skill required to press keys or tap with regards to keeping up with the speed at which objects need to be hit.
|
|
1253
|
+
*/
|
|
372
1254
|
declare class DroidTap extends DroidSkill {
|
|
373
1255
|
protected readonly reducedSectionCount: number;
|
|
374
1256
|
protected readonly reducedSectionBaseline: number;
|
|
@@ -382,17 +1264,42 @@ declare class DroidTap extends DroidSkill {
|
|
|
382
1264
|
constructor(mods: Mod[], overallDifficulty: number, considerCheesability: boolean);
|
|
383
1265
|
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
384
1266
|
protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
|
|
1267
|
+
/**
|
|
1268
|
+
* @param current The hitobject to save to.
|
|
1269
|
+
*/
|
|
385
1270
|
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
386
1271
|
}
|
|
387
1272
|
|
|
1273
|
+
/**
|
|
1274
|
+
* An evaluator for calculating speed or tap skill.
|
|
1275
|
+
*
|
|
1276
|
+
* This class should be considered an "evaluating" class and not persisted.
|
|
1277
|
+
*/
|
|
388
1278
|
declare abstract class SpeedEvaluator {
|
|
389
1279
|
protected static readonly minSpeedBonus: number;
|
|
390
1280
|
}
|
|
391
1281
|
|
|
1282
|
+
/**
|
|
1283
|
+
* An evaluator for calculating osu!droid tap skill.
|
|
1284
|
+
*/
|
|
392
1285
|
declare abstract class DroidTapEvaluator extends SpeedEvaluator {
|
|
1286
|
+
/**
|
|
1287
|
+
* Evaluates the difficulty of tapping the current object, based on:
|
|
1288
|
+
*
|
|
1289
|
+
* - time between pressing the previous and current object,
|
|
1290
|
+
* - distance between those objects,
|
|
1291
|
+
* - and how easily they can be cheesed.
|
|
1292
|
+
*
|
|
1293
|
+
* @param current The current object.
|
|
1294
|
+
* @param greatWindow The great hit window of the current object.
|
|
1295
|
+
* @param considerCheesability Whether to consider cheesability.
|
|
1296
|
+
*/
|
|
393
1297
|
static evaluateDifficultyOf(current: DroidDifficultyHitObject, greatWindow: number, considerCheesability: boolean): number;
|
|
394
1298
|
}
|
|
395
1299
|
|
|
1300
|
+
/**
|
|
1301
|
+
* Represents the skill required to read every object in the map.
|
|
1302
|
+
*/
|
|
396
1303
|
declare class DroidVisual extends DroidSkill {
|
|
397
1304
|
protected readonly starsPerDouble: number;
|
|
398
1305
|
protected readonly reducedSectionCount: number;
|
|
@@ -409,26 +1316,81 @@ declare class DroidVisual extends DroidSkill {
|
|
|
409
1316
|
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
410
1317
|
}
|
|
411
1318
|
|
|
1319
|
+
/**
|
|
1320
|
+
* An evaluator for calculating osu!droid Visual skill.
|
|
1321
|
+
*/
|
|
412
1322
|
declare abstract class DroidVisualEvaluator {
|
|
1323
|
+
/**
|
|
1324
|
+
* Evaluates the difficulty of reading the current object, based on:
|
|
1325
|
+
*
|
|
1326
|
+
* - note density of the current object,
|
|
1327
|
+
* - overlapping factor of the current object,
|
|
1328
|
+
* - the preempt time of the current object,
|
|
1329
|
+
* - the visual opacity of the current object,
|
|
1330
|
+
* - the velocity of the current object if it's a slider,
|
|
1331
|
+
* - past objects' velocity if they are sliders,
|
|
1332
|
+
* - and whether the Hidden mod is enabled.
|
|
1333
|
+
*
|
|
1334
|
+
* @param current The current object.
|
|
1335
|
+
* @param isHiddenMod Whether the Hidden mod is enabled.
|
|
1336
|
+
* @param withSliders Whether to take slider difficulty into account.
|
|
1337
|
+
*/
|
|
413
1338
|
static evaluateDifficultyOf(current: DroidDifficultyHitObject, isHiddenMod: boolean, withSliders: boolean): number;
|
|
414
1339
|
}
|
|
415
1340
|
|
|
1341
|
+
/**
|
|
1342
|
+
* Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
|
|
1343
|
+
* and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
|
|
1344
|
+
*/
|
|
416
1345
|
declare abstract class OsuSkill extends StrainSkill {
|
|
1346
|
+
/**
|
|
1347
|
+
* The default multiplier applied to the final difficulty value after all other calculations.
|
|
1348
|
+
*
|
|
1349
|
+
* May be overridden via {@link difficultyMultiplier}.
|
|
1350
|
+
*/
|
|
417
1351
|
static readonly defaultDifficultyMultiplier: number;
|
|
1352
|
+
/**
|
|
1353
|
+
* The final multiplier to be applied to the final difficulty value after all other calculations.
|
|
1354
|
+
*/
|
|
418
1355
|
protected readonly difficultyMultiplier: number;
|
|
1356
|
+
/**
|
|
1357
|
+
* The weight by which each strain value decays.
|
|
1358
|
+
*/
|
|
419
1359
|
protected abstract readonly decayWeight: number;
|
|
420
1360
|
difficultyValue(): number;
|
|
421
1361
|
}
|
|
422
1362
|
|
|
1363
|
+
/**
|
|
1364
|
+
* Represents an osu!standard hit object with difficulty calculation values.
|
|
1365
|
+
*/
|
|
423
1366
|
declare class OsuDifficultyHitObject extends DifficultyHitObject {
|
|
1367
|
+
/**
|
|
1368
|
+
* The speed strain generated by the hitobject.
|
|
1369
|
+
*/
|
|
424
1370
|
speedStrain: number;
|
|
1371
|
+
/**
|
|
1372
|
+
* The flashlight strain generated by this hitobject.
|
|
1373
|
+
*/
|
|
425
1374
|
flashlightStrain: number;
|
|
426
1375
|
private readonly radiusBuffThreshold;
|
|
427
1376
|
protected readonly mode = Modes.osu;
|
|
428
1377
|
protected get scalingFactor(): number;
|
|
1378
|
+
/**
|
|
1379
|
+
* Note: You **must** call `computeProperties` at some point due to how TypeScript handles
|
|
1380
|
+
* overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue.).
|
|
1381
|
+
*
|
|
1382
|
+
* @param object The underlying hitobject.
|
|
1383
|
+
* @param lastObject The hitobject before this hitobject.
|
|
1384
|
+
* @param lastLastObject The hitobject before the last hitobject.
|
|
1385
|
+
* @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
|
|
1386
|
+
* @param clockRate The clock rate of the beatmap.
|
|
1387
|
+
*/
|
|
429
1388
|
constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, lastLastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number);
|
|
430
1389
|
}
|
|
431
1390
|
|
|
1391
|
+
/**
|
|
1392
|
+
* Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
|
|
1393
|
+
*/
|
|
432
1394
|
declare class OsuAim extends OsuSkill {
|
|
433
1395
|
protected readonly strainDecayBase: number;
|
|
434
1396
|
protected readonly reducedSectionCount: number;
|
|
@@ -440,27 +1402,71 @@ declare class OsuAim extends OsuSkill {
|
|
|
440
1402
|
constructor(mods: Mod[], withSliders: boolean);
|
|
441
1403
|
protected strainValueAt(current: OsuDifficultyHitObject): number;
|
|
442
1404
|
protected calculateInitialStrain(time: number, current: OsuDifficultyHitObject): number;
|
|
1405
|
+
/**
|
|
1406
|
+
* @param current The hitobject to save to.
|
|
1407
|
+
*/
|
|
443
1408
|
protected saveToHitObject(current: OsuDifficultyHitObject): void;
|
|
444
1409
|
}
|
|
445
1410
|
|
|
1411
|
+
/**
|
|
1412
|
+
* An evaluator for calculating osu!standard Aim skill.
|
|
1413
|
+
*/
|
|
446
1414
|
declare abstract class OsuAimEvaluator extends AimEvaluator {
|
|
1415
|
+
/**
|
|
1416
|
+
* Evaluates the difficulty of aiming the current object, based on:
|
|
1417
|
+
*
|
|
1418
|
+
* - cursor velocity to the current object,
|
|
1419
|
+
* - angle difficulty,
|
|
1420
|
+
* - sharp velocity increases,
|
|
1421
|
+
* - and slider difficulty.
|
|
1422
|
+
*
|
|
1423
|
+
* @param current The current object.
|
|
1424
|
+
* @param withSliders Whether to take slider difficulty into account.
|
|
1425
|
+
*/
|
|
447
1426
|
static evaluateDifficultyOf(current: OsuDifficultyHitObject, withSliders: boolean): number;
|
|
448
1427
|
}
|
|
449
1428
|
|
|
1429
|
+
/**
|
|
1430
|
+
* Holds data that can be used to calculate osu!standard performance points.
|
|
1431
|
+
*/
|
|
450
1432
|
interface OsuDifficultyAttributes extends DifficultyAttributes {
|
|
1433
|
+
/**
|
|
1434
|
+
* The difficulty corresponding to the speed skill.
|
|
1435
|
+
*/
|
|
451
1436
|
speedDifficulty: number;
|
|
452
1437
|
}
|
|
453
1438
|
|
|
1439
|
+
/**
|
|
1440
|
+
* A difficulty calculator for osu!standard gamemode.
|
|
1441
|
+
*/
|
|
454
1442
|
declare class OsuDifficultyCalculator extends DifficultyCalculator<OsuDifficultyHitObject, OsuDifficultyAttributes> {
|
|
1443
|
+
/**
|
|
1444
|
+
* The aim star rating of the beatmap.
|
|
1445
|
+
*/
|
|
455
1446
|
get aim(): number;
|
|
1447
|
+
/**
|
|
1448
|
+
* The speed star rating of the beatmap.
|
|
1449
|
+
*/
|
|
456
1450
|
get speed(): number;
|
|
1451
|
+
/**
|
|
1452
|
+
* The flashlight star rating of the beatmap.
|
|
1453
|
+
*/
|
|
457
1454
|
get flashlight(): number;
|
|
458
1455
|
readonly attributes: OsuDifficultyAttributes;
|
|
459
1456
|
get cacheableAttributes(): CacheableDifficultyAttributes<OsuDifficultyAttributes>;
|
|
460
1457
|
protected readonly difficultyMultiplier = 0.0675;
|
|
461
1458
|
protected readonly mode = Modes.osu;
|
|
1459
|
+
/**
|
|
1460
|
+
* Calculates the aim star rating of the beatmap and stores it in this instance.
|
|
1461
|
+
*/
|
|
462
1462
|
calculateAim(): void;
|
|
1463
|
+
/**
|
|
1464
|
+
* Calculates the speed star rating of the beatmap and stores it in this instance.
|
|
1465
|
+
*/
|
|
463
1466
|
calculateSpeed(): void;
|
|
1467
|
+
/**
|
|
1468
|
+
* Calculates the flashlight star rating of the beatmap and stores it in this instance.
|
|
1469
|
+
*/
|
|
464
1470
|
calculateFlashlight(): void;
|
|
465
1471
|
calculateTotal(): void;
|
|
466
1472
|
calculateAll(): void;
|
|
@@ -468,12 +1474,34 @@ declare class OsuDifficultyCalculator extends DifficultyCalculator<OsuDifficulty
|
|
|
468
1474
|
protected generateDifficultyHitObjects(): OsuDifficultyHitObject[];
|
|
469
1475
|
protected computeDifficultyStatistics(options?: DifficultyCalculationOptions): DifficultyStatisticsCalculatorResult<number, number, number, number>;
|
|
470
1476
|
protected createSkills(): OsuSkill[];
|
|
1477
|
+
/**
|
|
1478
|
+
* Called after aim skill calculation.
|
|
1479
|
+
*
|
|
1480
|
+
* @param aimSkill The aim skill that considers sliders.
|
|
1481
|
+
* @param aimSkillWithoutSliders The aim skill that doesn't consider sliders.
|
|
1482
|
+
*/
|
|
471
1483
|
private postCalculateAim;
|
|
1484
|
+
/**
|
|
1485
|
+
* Called after speed skill calculation.
|
|
1486
|
+
*
|
|
1487
|
+
* @param speedSkill The speed skill.
|
|
1488
|
+
*/
|
|
472
1489
|
private postCalculateSpeed;
|
|
1490
|
+
/**
|
|
1491
|
+
* Calculates speed-related attributes.
|
|
1492
|
+
*/
|
|
473
1493
|
private calculateSpeedAttributes;
|
|
1494
|
+
/**
|
|
1495
|
+
* Called after flashlight skill calculation.
|
|
1496
|
+
*
|
|
1497
|
+
* @param flashlightSkill The flashlight skill.
|
|
1498
|
+
*/
|
|
474
1499
|
private postCalculateFlashlight;
|
|
475
1500
|
}
|
|
476
1501
|
|
|
1502
|
+
/**
|
|
1503
|
+
* Represents the skill required to memorize and hit every object in a beatmap with the Flashlight mod enabled.
|
|
1504
|
+
*/
|
|
477
1505
|
declare class OsuFlashlight extends OsuSkill {
|
|
478
1506
|
protected readonly strainDecayBase: number;
|
|
479
1507
|
protected readonly reducedSectionCount: number;
|
|
@@ -488,30 +1516,85 @@ declare class OsuFlashlight extends OsuSkill {
|
|
|
488
1516
|
protected saveToHitObject(current: OsuDifficultyHitObject): void;
|
|
489
1517
|
}
|
|
490
1518
|
|
|
1519
|
+
/**
|
|
1520
|
+
* An evaluator for calculating osu!standard Flashlight skill.
|
|
1521
|
+
*/
|
|
491
1522
|
declare abstract class OsuFlashlightEvaluator extends FlashlightEvaluator {
|
|
1523
|
+
/**
|
|
1524
|
+
* Evaluates the difficulty of memorizing and hitting the current object, based on:
|
|
1525
|
+
*
|
|
1526
|
+
* - distance between a number of previous objects and the current object,
|
|
1527
|
+
* - the visual opacity of the current object,
|
|
1528
|
+
* - the angle made by the current object,
|
|
1529
|
+
* - length and speed of the current object (for sliders),
|
|
1530
|
+
* - and whether Hidden mod is enabled.
|
|
1531
|
+
*
|
|
1532
|
+
* @param current The current object.
|
|
1533
|
+
* @param isHiddenMod Whether the Hidden mod is enabled.
|
|
1534
|
+
*/
|
|
492
1535
|
static evaluateDifficultyOf(current: OsuDifficultyHitObject, isHiddenMod: boolean): number;
|
|
493
1536
|
}
|
|
494
1537
|
|
|
1538
|
+
/**
|
|
1539
|
+
* A performance points calculator that calculates performance points for osu!standard gamemode.
|
|
1540
|
+
*/
|
|
495
1541
|
declare class OsuPerformanceCalculator extends PerformanceCalculator<OsuDifficultyAttributes> {
|
|
1542
|
+
/**
|
|
1543
|
+
* The aim performance value.
|
|
1544
|
+
*/
|
|
496
1545
|
aim: number;
|
|
1546
|
+
/**
|
|
1547
|
+
* The speed performance value.
|
|
1548
|
+
*/
|
|
497
1549
|
speed: number;
|
|
1550
|
+
/**
|
|
1551
|
+
* The accuracy performance value.
|
|
1552
|
+
*/
|
|
498
1553
|
accuracy: number;
|
|
1554
|
+
/**
|
|
1555
|
+
* The flashlight performance value.
|
|
1556
|
+
*/
|
|
499
1557
|
flashlight: number;
|
|
500
1558
|
protected finalMultiplier: number;
|
|
501
1559
|
protected readonly mode: Modes;
|
|
502
1560
|
protected calculateValues(): void;
|
|
503
1561
|
protected calculateTotalValue(): number;
|
|
1562
|
+
/**
|
|
1563
|
+
* Calculates the aim performance value of the beatmap.
|
|
1564
|
+
*/
|
|
504
1565
|
private calculateAimValue;
|
|
1566
|
+
/**
|
|
1567
|
+
* Calculates the speed performance value of the beatmap.
|
|
1568
|
+
*/
|
|
505
1569
|
private calculateSpeedValue;
|
|
1570
|
+
/**
|
|
1571
|
+
* Calculates the accuracy performance value of the beatmap.
|
|
1572
|
+
*/
|
|
506
1573
|
private calculateAccuracyValue;
|
|
1574
|
+
/**
|
|
1575
|
+
* Calculates the flashlight performance value of the beatmap.
|
|
1576
|
+
*/
|
|
507
1577
|
private calculateFlashlightValue;
|
|
508
1578
|
toString(): string;
|
|
509
1579
|
}
|
|
510
1580
|
|
|
1581
|
+
/**
|
|
1582
|
+
* An evaluator for calculating osu!standard Rhythm skill.
|
|
1583
|
+
*/
|
|
511
1584
|
declare abstract class OsuRhythmEvaluator extends RhythmEvaluator {
|
|
1585
|
+
/**
|
|
1586
|
+
* Calculates a rhythm multiplier for the difficulty of the tap associated
|
|
1587
|
+
* with historic data of the current object.
|
|
1588
|
+
*
|
|
1589
|
+
* @param current The current object.
|
|
1590
|
+
* @param greatWindow The great hit window of the current object.
|
|
1591
|
+
*/
|
|
512
1592
|
static evaluateDifficultyOf(current: OsuDifficultyHitObject, greatWindow: number): number;
|
|
513
1593
|
}
|
|
514
1594
|
|
|
1595
|
+
/**
|
|
1596
|
+
* Represents the skill required to press keys or tap with regards to keeping up with the speed at which objects need to be hit.
|
|
1597
|
+
*/
|
|
515
1598
|
declare class OsuSpeed extends OsuSkill {
|
|
516
1599
|
protected readonly strainDecayBase = 0.3;
|
|
517
1600
|
protected readonly reducedSectionCount = 5;
|
|
@@ -523,13 +1606,35 @@ declare class OsuSpeed extends OsuSkill {
|
|
|
523
1606
|
private readonly skillMultiplier;
|
|
524
1607
|
private readonly greatWindow;
|
|
525
1608
|
constructor(mods: Mod[], overallDifficulty: number);
|
|
1609
|
+
/**
|
|
1610
|
+
* @param current The hitobject to calculate.
|
|
1611
|
+
*/
|
|
526
1612
|
protected strainValueAt(current: OsuDifficultyHitObject): number;
|
|
527
1613
|
protected calculateInitialStrain(time: number, current: OsuDifficultyHitObject): number;
|
|
1614
|
+
/**
|
|
1615
|
+
* @param current The hitobject to save to.
|
|
1616
|
+
*/
|
|
528
1617
|
protected saveToHitObject(current: OsuDifficultyHitObject): void;
|
|
529
1618
|
}
|
|
530
1619
|
|
|
1620
|
+
/**
|
|
1621
|
+
* An evaluator for calculating osu!standard speed skill.
|
|
1622
|
+
*/
|
|
531
1623
|
declare abstract class OsuSpeedEvaluator extends SpeedEvaluator {
|
|
1624
|
+
/**
|
|
1625
|
+
* Spacing threshold for a single hitobject spacing.
|
|
1626
|
+
*/
|
|
532
1627
|
private static readonly SINGLE_SPACING_THRESHOLD;
|
|
1628
|
+
/**
|
|
1629
|
+
* Evaluates the difficulty of tapping the current object, based on:
|
|
1630
|
+
*
|
|
1631
|
+
* - time between pressing the previous and current object,
|
|
1632
|
+
* - distance between those objects,
|
|
1633
|
+
* - and how easily they can be cheesed.
|
|
1634
|
+
*
|
|
1635
|
+
* @param current The current object.
|
|
1636
|
+
* @param greatWindow The great hit window of the current object.
|
|
1637
|
+
*/
|
|
533
1638
|
static evaluateDifficultyOf(current: OsuDifficultyHitObject, greatWindow: number): number;
|
|
534
1639
|
}
|
|
535
1640
|
|