@rian8337/osu-difficulty-calculator 4.0.0-beta.7 → 4.0.0-beta.70
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 +2524 -2143
- package/package.json +9 -6
- package/typings/index.d.ts +702 -642
- package/dist/index.js.map +0 -1
package/typings/index.d.ts
CHANGED
|
@@ -1,43 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* An evaluator for calculating aim skill.
|
|
5
|
-
*
|
|
6
|
-
* This class should be considered an "evaluating" class and not persisted.
|
|
7
|
-
*/
|
|
8
|
-
declare abstract class AimEvaluator {
|
|
9
|
-
protected static readonly wideAngleMultiplier: number;
|
|
10
|
-
protected static readonly acuteAngleMultiplier: number;
|
|
11
|
-
protected static readonly sliderMultiplier: number;
|
|
12
|
-
protected static readonly velocityChangeMultiplier: number;
|
|
13
|
-
/**
|
|
14
|
-
* Calculates the bonus of wide angles.
|
|
15
|
-
*/
|
|
16
|
-
protected static calculateWideAngleBonus(angle: number): number;
|
|
17
|
-
/**
|
|
18
|
-
* Calculates the bonus of acute angles.
|
|
19
|
-
*/
|
|
20
|
-
protected static calculateAcuteAngleBonus(angle: number): number;
|
|
21
|
-
}
|
|
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
|
-
}
|
|
1
|
+
import { ModMap, SerializedMod, PlaceableHitObject, Vector2, Modes, PlayableBeatmap, Mod, Beatmap, DroidPlayableBeatmap, Accuracy, OsuPlayableBeatmap } from '@rian8337/osu-base';
|
|
32
2
|
|
|
33
3
|
/**
|
|
34
4
|
* Holds data that can be used to calculate performance points.
|
|
35
5
|
*/
|
|
36
|
-
interface
|
|
6
|
+
interface IDifficultyAttributes {
|
|
37
7
|
/**
|
|
38
8
|
* The mods which were applied to the beatmap.
|
|
39
9
|
*/
|
|
40
|
-
mods:
|
|
10
|
+
mods: ModMap;
|
|
41
11
|
/**
|
|
42
12
|
* The combined star rating of all skills.
|
|
43
13
|
*/
|
|
@@ -69,11 +39,9 @@ interface DifficultyAttributes {
|
|
|
69
39
|
*/
|
|
70
40
|
sliderFactor: number;
|
|
71
41
|
/**
|
|
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.
|
|
42
|
+
* The overall clock rate that was applied to the beatmap.
|
|
75
43
|
*/
|
|
76
|
-
|
|
44
|
+
clockRate: number;
|
|
77
45
|
/**
|
|
78
46
|
* The perceived overall difficulty inclusive of rate-adjusting mods (DT/HT/etc), based on osu!standard judgement.
|
|
79
47
|
*
|
|
@@ -92,22 +60,61 @@ interface DifficultyAttributes {
|
|
|
92
60
|
* The number of spinners in the beatmap.
|
|
93
61
|
*/
|
|
94
62
|
spinnerCount: number;
|
|
63
|
+
/**
|
|
64
|
+
* The number of sliders weighted by difficulty.
|
|
65
|
+
*/
|
|
66
|
+
aimDifficultSliderCount: number;
|
|
67
|
+
/**
|
|
68
|
+
* The amount of strains that are considered difficult with respect to the aim skill.
|
|
69
|
+
*/
|
|
70
|
+
aimDifficultStrainCount: number;
|
|
95
71
|
}
|
|
96
72
|
|
|
97
73
|
/**
|
|
98
|
-
* Represents
|
|
74
|
+
* Represents difficulty attributes that can be cached.
|
|
75
|
+
*/
|
|
76
|
+
type CacheableDifficultyAttributes<T extends IDifficultyAttributes> = Omit<T, "mods" | "toCacheableAttributes"> & {
|
|
77
|
+
/**
|
|
78
|
+
* The mods which were applied to the beatmap.
|
|
79
|
+
*/
|
|
80
|
+
mods: SerializedMod[];
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Holds data that can be used to calculate performance points.
|
|
99
85
|
*/
|
|
100
|
-
|
|
86
|
+
declare abstract class DifficultyAttributes implements IDifficultyAttributes {
|
|
87
|
+
mods: ModMap;
|
|
88
|
+
starRating: number;
|
|
89
|
+
maxCombo: number;
|
|
90
|
+
aimDifficulty: number;
|
|
91
|
+
flashlightDifficulty: number;
|
|
92
|
+
speedNoteCount: number;
|
|
93
|
+
sliderFactor: number;
|
|
94
|
+
clockRate: number;
|
|
95
|
+
overallDifficulty: number;
|
|
96
|
+
hitCircleCount: number;
|
|
97
|
+
sliderCount: number;
|
|
98
|
+
spinnerCount: number;
|
|
99
|
+
aimDifficultSliderCount: number;
|
|
100
|
+
aimDifficultStrainCount: number;
|
|
101
|
+
constructor(cacheableAttributes?: CacheableDifficultyAttributes<IDifficultyAttributes>);
|
|
101
102
|
/**
|
|
102
|
-
*
|
|
103
|
+
* Converts this `DifficultyAttributes` instance to an attribute structure that can be cached.
|
|
104
|
+
*
|
|
105
|
+
* @returns The cacheable attributes.
|
|
103
106
|
*/
|
|
104
|
-
|
|
107
|
+
toCacheableAttributes(): CacheableDifficultyAttributes<this>;
|
|
108
|
+
/**
|
|
109
|
+
* Returns a string representation of the difficulty attributes.
|
|
110
|
+
*/
|
|
111
|
+
toString(): string;
|
|
105
112
|
}
|
|
106
113
|
|
|
107
114
|
/**
|
|
108
|
-
* Represents
|
|
115
|
+
* Represents a hit object with difficulty calculation values.
|
|
109
116
|
*/
|
|
110
|
-
declare class DifficultyHitObject {
|
|
117
|
+
declare abstract class DifficultyHitObject {
|
|
111
118
|
/**
|
|
112
119
|
* The underlying hitobject.
|
|
113
120
|
*/
|
|
@@ -117,19 +124,7 @@ declare class DifficultyHitObject {
|
|
|
117
124
|
*
|
|
118
125
|
* This is one less than the actual index of the hitobject in the beatmap.
|
|
119
126
|
*/
|
|
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;
|
|
127
|
+
readonly index: number;
|
|
133
128
|
/**
|
|
134
129
|
* The aim strain generated by the hitobject if sliders are considered.
|
|
135
130
|
*/
|
|
@@ -138,41 +133,10 @@ declare class DifficultyHitObject {
|
|
|
138
133
|
* The aim strain generated by the hitobject if sliders are not considered.
|
|
139
134
|
*/
|
|
140
135
|
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
136
|
/**
|
|
153
137
|
* The rhythm multiplier generated by the hitobject. This is used to alter tap strain.
|
|
154
138
|
*/
|
|
155
139
|
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
140
|
/**
|
|
177
141
|
* The normalized distance from the "lazy" end position of the previous hitobject to the start position of this hitobject.
|
|
178
142
|
*
|
|
@@ -204,6 +168,21 @@ declare class DifficultyHitObject {
|
|
|
204
168
|
* The time taken to travel through `travelDistance`, with a minimum value of 25ms for sliders.
|
|
205
169
|
*/
|
|
206
170
|
travelTime: number;
|
|
171
|
+
/**
|
|
172
|
+
* The position of the cursor at the point of completion of this hitobject if it was hit
|
|
173
|
+
* with as few movements as possible.
|
|
174
|
+
*/
|
|
175
|
+
lazyEndPosition?: Vector2;
|
|
176
|
+
/**
|
|
177
|
+
* The distance travelled by the cursor upon completion of this hitobject if it was hit
|
|
178
|
+
* with as few movements as possible.
|
|
179
|
+
*/
|
|
180
|
+
lazyTravelDistance: number;
|
|
181
|
+
/**
|
|
182
|
+
* The time taken by the cursor upon completion of this hitobject if it was hit with
|
|
183
|
+
* as few movements as possible.
|
|
184
|
+
*/
|
|
185
|
+
lazyTravelTime: number;
|
|
207
186
|
/**
|
|
208
187
|
* Angle the player has to take to hit this hitobject.
|
|
209
188
|
*
|
|
@@ -213,42 +192,63 @@ declare class DifficultyHitObject {
|
|
|
213
192
|
/**
|
|
214
193
|
* The amount of milliseconds elapsed between this hitobject and the last hitobject.
|
|
215
194
|
*/
|
|
216
|
-
deltaTime: number;
|
|
195
|
+
readonly deltaTime: number;
|
|
217
196
|
/**
|
|
218
197
|
* The amount of milliseconds elapsed since the start time of the previous hitobject, with a minimum of 25ms.
|
|
219
198
|
*/
|
|
220
|
-
strainTime: number;
|
|
199
|
+
readonly strainTime: number;
|
|
221
200
|
/**
|
|
222
201
|
* Adjusted start time of the hitobject, taking speed multiplier into account.
|
|
223
202
|
*/
|
|
224
|
-
startTime: number;
|
|
203
|
+
readonly startTime: number;
|
|
225
204
|
/**
|
|
226
205
|
* Adjusted end time of the hitobject, taking speed multiplier into account.
|
|
227
206
|
*/
|
|
228
|
-
endTime: number;
|
|
207
|
+
readonly endTime: number;
|
|
229
208
|
/**
|
|
230
|
-
* The
|
|
209
|
+
* The full great window of the hitobject.
|
|
231
210
|
*/
|
|
232
|
-
|
|
211
|
+
readonly fullGreatWindow: number;
|
|
233
212
|
/**
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
* This is used to scale visual skill.
|
|
213
|
+
* Other hitobjects in the beatmap, including this hitobject.
|
|
237
214
|
*/
|
|
238
|
-
|
|
215
|
+
protected readonly hitObjects: readonly DifficultyHitObject[];
|
|
239
216
|
/**
|
|
240
|
-
*
|
|
217
|
+
* The normalized radius of the hitobject.
|
|
241
218
|
*/
|
|
242
|
-
|
|
219
|
+
static readonly normalizedRadius: number;
|
|
243
220
|
/**
|
|
244
|
-
*
|
|
221
|
+
* The normalized diameter of the hitobject.
|
|
245
222
|
*/
|
|
246
|
-
|
|
223
|
+
static get normalizedDiameter(): number;
|
|
224
|
+
protected abstract readonly mode: Modes;
|
|
225
|
+
protected readonly maximumSliderRadius: number;
|
|
226
|
+
protected readonly assumedSliderRadius: number;
|
|
247
227
|
/**
|
|
228
|
+
* The lowest possible delta time value.
|
|
229
|
+
*/
|
|
230
|
+
static readonly minDeltaTime = 25;
|
|
231
|
+
private readonly lastObject;
|
|
232
|
+
private readonly lastDifficultyObject;
|
|
233
|
+
private readonly lastLastDifficultyObject;
|
|
234
|
+
/**
|
|
235
|
+
* Note: You **must** call `computeProperties` at some point due to how TypeScript handles
|
|
236
|
+
* overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue).
|
|
237
|
+
*
|
|
248
238
|
* @param object The underlying hitobject.
|
|
249
|
-
* @param
|
|
239
|
+
* @param lastObject The hitobject before this hitobject.
|
|
240
|
+
* @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
|
|
241
|
+
* @param clockRate The clock rate of the beatmap.
|
|
242
|
+
* @param index The index of this hitobject in the list of all hitobjects.
|
|
243
|
+
*/
|
|
244
|
+
constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number, index: number);
|
|
245
|
+
/**
|
|
246
|
+
* Computes the properties of this hitobject.
|
|
247
|
+
*
|
|
248
|
+
* @param clockRate The clock rate of the beatmap.
|
|
249
|
+
* @param hitObjects The hitobjects in the beatmap.
|
|
250
250
|
*/
|
|
251
|
-
|
|
251
|
+
computeProperties(clockRate: number, hitObjects: readonly PlaceableHitObject[]): void;
|
|
252
252
|
/**
|
|
253
253
|
* Gets the difficulty hitobject at a specific index with respect to the current
|
|
254
254
|
* difficulty hitobject's index.
|
|
@@ -259,7 +259,7 @@ declare class DifficultyHitObject {
|
|
|
259
259
|
* @returns The difficulty hitobject at the index with respect to the current
|
|
260
260
|
* difficulty hitobject's index, `null` if the index is out of range.
|
|
261
261
|
*/
|
|
262
|
-
previous(backwardsIndex: number):
|
|
262
|
+
previous(backwardsIndex: number): this | null;
|
|
263
263
|
/**
|
|
264
264
|
* Gets the difficulty hitobject at a specific index with respect to the current
|
|
265
265
|
* difficulty hitobject's index.
|
|
@@ -270,26 +270,26 @@ declare class DifficultyHitObject {
|
|
|
270
270
|
* @returns The difficulty hitobject at the index with respect to the current
|
|
271
271
|
* difficulty hitobject's index, `null` if the index is out of range.
|
|
272
272
|
*/
|
|
273
|
-
next(forwardsIndex: number):
|
|
273
|
+
next(forwardsIndex: number): this | null;
|
|
274
274
|
/**
|
|
275
275
|
* Calculates the opacity of the hitobject at a given time.
|
|
276
276
|
*
|
|
277
277
|
* @param time The time to calculate the hitobject's opacity at.
|
|
278
|
-
* @param
|
|
279
|
-
* @param mode The gamemode to calculate the opacity for.
|
|
278
|
+
* @param mods The mods used.
|
|
280
279
|
* @returns The opacity of the hitobject at the given time.
|
|
281
280
|
*/
|
|
282
|
-
opacityAt(time: number,
|
|
281
|
+
opacityAt(time: number, mods: ModMap): number;
|
|
283
282
|
/**
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
* Keep in mind that "overlapping" in this case is overlapping to the point where both hitobjects
|
|
287
|
-
* can be hit with just a single tap in osu!droid.
|
|
283
|
+
* How possible is it to doubletap this object together with the next one and get perfect
|
|
284
|
+
* judgement in range from 0 to 1.
|
|
288
285
|
*
|
|
289
|
-
*
|
|
290
|
-
* @returns Whether the hitobject is considered overlapping.
|
|
286
|
+
* A value closer to 1 indicates a higher possibility.
|
|
291
287
|
*/
|
|
292
|
-
|
|
288
|
+
get doubletapness(): number;
|
|
289
|
+
protected abstract get scalingFactor(): number;
|
|
290
|
+
protected setDistances(clockRate: number): void;
|
|
291
|
+
private calculateSliderCursorPosition;
|
|
292
|
+
private getEndCursorPosition;
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
/**
|
|
@@ -301,8 +301,8 @@ declare abstract class Skill {
|
|
|
301
301
|
/**
|
|
302
302
|
* The mods that this skill processes.
|
|
303
303
|
*/
|
|
304
|
-
protected readonly mods:
|
|
305
|
-
constructor(mods:
|
|
304
|
+
protected readonly mods: ModMap;
|
|
305
|
+
constructor(mods: ModMap);
|
|
306
306
|
/**
|
|
307
307
|
* Processes a hitobject.
|
|
308
308
|
*
|
|
@@ -316,18 +316,32 @@ declare abstract class Skill {
|
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
/**
|
|
319
|
-
*
|
|
320
|
-
* and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
|
|
319
|
+
* Represents the strain peaks of various calculated difficulties.
|
|
321
320
|
*/
|
|
322
|
-
|
|
321
|
+
interface StrainPeaks {
|
|
322
|
+
/**
|
|
323
|
+
* The strain peaks of aim difficulty if sliders are considered.
|
|
324
|
+
*/
|
|
325
|
+
aimWithSliders: number[];
|
|
323
326
|
/**
|
|
324
|
-
* The strain of
|
|
327
|
+
* The strain peaks of aim difficulty if sliders are not considered.
|
|
325
328
|
*/
|
|
326
|
-
|
|
329
|
+
aimWithoutSliders: number[];
|
|
327
330
|
/**
|
|
328
|
-
* The
|
|
331
|
+
* The strain peaks of speed difficulty.
|
|
329
332
|
*/
|
|
330
|
-
|
|
333
|
+
speed: number[];
|
|
334
|
+
/**
|
|
335
|
+
* The strain peaks of flashlight difficulty.
|
|
336
|
+
*/
|
|
337
|
+
flashlight: number[];
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
|
|
342
|
+
* and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
|
|
343
|
+
*/
|
|
344
|
+
declare abstract class StrainSkill extends Skill {
|
|
331
345
|
/**
|
|
332
346
|
* Strain peaks are stored here.
|
|
333
347
|
*/
|
|
@@ -341,248 +355,272 @@ declare abstract class StrainSkill extends Skill {
|
|
|
341
355
|
* The baseline multiplier applied to the section with the biggest strain.
|
|
342
356
|
*/
|
|
343
357
|
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
358
|
/**
|
|
349
359
|
* Determines how quickly strain decays for the given skill.
|
|
350
360
|
*
|
|
351
361
|
* For example, a value of 0.15 indicates that strain decays to 15% of its original value in one second.
|
|
352
362
|
*/
|
|
353
363
|
protected abstract readonly strainDecayBase: number;
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
private isFirstObject;
|
|
364
|
+
protected readonly _objectStrains: number[];
|
|
365
|
+
protected difficulty: number;
|
|
357
366
|
/**
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
* @param current The hitobject to process.
|
|
367
|
+
* The strains of hitobjects.
|
|
361
368
|
*/
|
|
369
|
+
get objectStrains(): readonly number[];
|
|
370
|
+
private readonly sectionLength;
|
|
371
|
+
private currentStrain;
|
|
372
|
+
private currentSectionPeak;
|
|
373
|
+
private currentSectionEnd;
|
|
362
374
|
process(current: DifficultyHitObject): void;
|
|
363
375
|
/**
|
|
364
376
|
* Saves the current peak strain level to the list of strain peaks, which will be used to calculate an overall difficulty.
|
|
365
377
|
*/
|
|
366
378
|
saveCurrentPeak(): void;
|
|
379
|
+
/**
|
|
380
|
+
* Returns the number of strains weighed against the top strain.
|
|
381
|
+
*
|
|
382
|
+
* The result is scaled by clock rate as it affects the total number of strains.
|
|
383
|
+
*/
|
|
384
|
+
countDifficultStrains(): number;
|
|
367
385
|
/**
|
|
368
386
|
* Calculates strain decay for a specified time frame.
|
|
369
387
|
*
|
|
370
388
|
* @param ms The time frame to calculate.
|
|
371
389
|
*/
|
|
372
390
|
protected strainDecay(ms: number): number;
|
|
391
|
+
/**
|
|
392
|
+
* Calculates the starting time of a strain section at an object.
|
|
393
|
+
*
|
|
394
|
+
* @param current The object at which the strain section starts.
|
|
395
|
+
* @returns The start time of the strain section.
|
|
396
|
+
*/
|
|
397
|
+
protected calculateCurrentSectionStart(current: DifficultyHitObject): number;
|
|
373
398
|
/**
|
|
374
399
|
* Calculates the strain value at a hitobject.
|
|
400
|
+
*
|
|
401
|
+
* @param current The hitobject to calculate.
|
|
375
402
|
*/
|
|
376
403
|
protected abstract strainValueAt(current: DifficultyHitObject): number;
|
|
377
404
|
/**
|
|
378
405
|
* Saves the current strain to a hitobject.
|
|
379
406
|
*/
|
|
380
407
|
protected abstract saveToHitObject(current: DifficultyHitObject): void;
|
|
408
|
+
/**
|
|
409
|
+
* Retrieves the peak strain at a point in time.
|
|
410
|
+
*
|
|
411
|
+
* @param time The time to retrieve the peak strain at.
|
|
412
|
+
* @param current The current hit object.
|
|
413
|
+
* @returns The peak strain.
|
|
414
|
+
*/
|
|
415
|
+
protected abstract calculateInitialStrain(time: number, current: DifficultyHitObject): number;
|
|
381
416
|
/**
|
|
382
417
|
* Sets the initial strain level for a new section.
|
|
383
418
|
*
|
|
384
|
-
* @param
|
|
419
|
+
* @param time The beginning of the new section in milliseconds.
|
|
385
420
|
* @param current The current hitobject.
|
|
386
421
|
*/
|
|
387
422
|
private startNewSectionFrom;
|
|
388
423
|
}
|
|
389
424
|
|
|
390
425
|
/**
|
|
391
|
-
*
|
|
426
|
+
* The base of a difficulty calculator.
|
|
392
427
|
*/
|
|
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 {
|
|
416
|
-
/**
|
|
417
|
-
* The calculated beatmap.
|
|
418
|
-
*/
|
|
419
|
-
readonly beatmap: Beatmap;
|
|
420
|
-
/**
|
|
421
|
-
* The difficulty objects of the beatmap.
|
|
422
|
-
*/
|
|
423
|
-
readonly objects: DifficultyHitObject[];
|
|
424
|
-
/**
|
|
425
|
-
* The modifications applied.
|
|
426
|
-
*/
|
|
427
|
-
mods: Mod[];
|
|
428
|
+
declare abstract class DifficultyCalculator<TBeatmap extends PlayableBeatmap, THitObject extends DifficultyHitObject, TAttributes extends DifficultyAttributes> {
|
|
429
|
+
protected abstract readonly difficultyMultiplier: number;
|
|
428
430
|
/**
|
|
429
|
-
*
|
|
431
|
+
* `Mod`s that adjust the difficulty of a beatmap.
|
|
430
432
|
*/
|
|
431
|
-
|
|
433
|
+
protected readonly difficultyAdjustmentMods: (typeof Mod)[];
|
|
432
434
|
/**
|
|
433
|
-
*
|
|
435
|
+
* Retains `Mod`s that adjust a beatmap's difficulty from the specified mods.
|
|
436
|
+
*
|
|
437
|
+
* @param mods The mods to retain the difficulty adjustment mods from.
|
|
438
|
+
* @returns The retained difficulty adjustment mods.
|
|
434
439
|
*/
|
|
435
|
-
|
|
440
|
+
abstract retainDifficultyAdjustmentMods(mods: Mod[]): Mod[];
|
|
436
441
|
/**
|
|
437
|
-
*
|
|
442
|
+
* Calculates the difficulty of a `PlayableBeatmap`.
|
|
443
|
+
*
|
|
444
|
+
* @param beatmap The `PlayableBeatmap` whose difficulty is to be calculated.
|
|
445
|
+
* @returns A `DifficultyAttributes` object describing the difficulty of the `Beatmap`.
|
|
438
446
|
*/
|
|
439
|
-
|
|
447
|
+
calculate(beatmap: TBeatmap): TAttributes;
|
|
440
448
|
/**
|
|
441
|
-
*
|
|
449
|
+
* Calculates the difficulty of a `Beatmap` with specific `Mod`s.
|
|
450
|
+
*
|
|
451
|
+
* @param beatmap The `Beatmap` whose difficulty is to be calculated.
|
|
452
|
+
* @param mods The `Mod`s to apply to the beatmap. Defaults to No Mod.
|
|
453
|
+
* @returns A `DifficultyAttributes` object describing the difficulty of the `Beatmap`.
|
|
442
454
|
*/
|
|
443
|
-
|
|
444
|
-
protected readonly sectionLength: number;
|
|
445
|
-
protected abstract readonly difficultyMultiplier: number;
|
|
446
|
-
protected abstract readonly mode: Modes;
|
|
455
|
+
calculate(beatmap: Beatmap, mods?: ModMap): TAttributes;
|
|
447
456
|
/**
|
|
448
|
-
*
|
|
457
|
+
* Obtains the strain peaks of a `PlayableBeatmap`.
|
|
449
458
|
*
|
|
450
|
-
* @param beatmap The
|
|
459
|
+
* @param beatmap The `PlayableBeatmap` whose strain peaks are to be calculated.
|
|
460
|
+
* @returns The strain peaks of the `PlayableBeatmap`.
|
|
451
461
|
*/
|
|
452
|
-
|
|
462
|
+
calculateStrainPeaks(beatmap: TBeatmap): StrainPeaks;
|
|
453
463
|
/**
|
|
454
|
-
*
|
|
455
|
-
*
|
|
456
|
-
* The beatmap is analyzed in chunks of `sectionLength` duration.
|
|
457
|
-
* For each chunk the highest hitobject strains are added to
|
|
458
|
-
* a list which is then collapsed into a weighted sum, much
|
|
459
|
-
* like scores are weighted on a user's profile.
|
|
464
|
+
* Obtains the strain peaks of a `Beatmap` with specific `Mod`s.
|
|
460
465
|
*
|
|
461
|
-
*
|
|
462
|
-
*
|
|
463
|
-
*
|
|
464
|
-
*
|
|
465
|
-
* @param options Options for the difficulty calculation.
|
|
466
|
-
* @returns The current instance.
|
|
466
|
+
* @param beatmap The `Beatmap` whose strain peaks are to be calculated.
|
|
467
|
+
* @param mods The `Mod`s to apply to the beatmap. Defaults to No Mod.
|
|
468
|
+
* @returns The strain peaks of the `Beatmap`.
|
|
467
469
|
*/
|
|
468
|
-
|
|
470
|
+
calculateStrainPeaks(beatmap: Beatmap, mods?: ModMap): StrainPeaks;
|
|
469
471
|
/**
|
|
470
|
-
*
|
|
472
|
+
* Creates the `Skill`s to calculate the difficulty of a `PlayableBeatmap`.
|
|
473
|
+
*
|
|
474
|
+
* @param beatmap The `PlayableBeatmap` whose difficulty will be calculated.
|
|
475
|
+
* @return The `Skill`s.
|
|
471
476
|
*/
|
|
472
|
-
|
|
477
|
+
protected abstract createSkills(beatmap: TBeatmap): Skill[];
|
|
473
478
|
/**
|
|
474
|
-
*
|
|
479
|
+
* Creates the `Skill`s to obtain the strain peaks of a `PlayableBeatmap`.
|
|
480
|
+
*
|
|
481
|
+
* @param beatmap
|
|
475
482
|
*/
|
|
476
|
-
protected
|
|
483
|
+
protected abstract createStrainPeakSkills(beatmap: TBeatmap): StrainSkill[];
|
|
477
484
|
/**
|
|
478
|
-
*
|
|
485
|
+
* Creates difficulty hitobjects for this calculator.
|
|
479
486
|
*
|
|
480
|
-
* @param
|
|
487
|
+
* @param beatmap The beatmap to generate difficulty hitobjects from.
|
|
488
|
+
* @returns The generated difficulty hitobjects.
|
|
481
489
|
*/
|
|
482
|
-
protected
|
|
490
|
+
protected abstract createDifficultyHitObjects(beatmap: TBeatmap): THitObject[];
|
|
483
491
|
/**
|
|
484
|
-
*
|
|
492
|
+
* Creates a `DifficultyAttributes` object to describe a `PlayableBeatmap`'s difficulty.
|
|
493
|
+
*
|
|
494
|
+
* @param beatmap The `PlayableBeatmap` whose difficulty was calculated.
|
|
495
|
+
* @param skills The `Skill`s which processed the `PlayableBeatmap`.
|
|
496
|
+
* @param objects The `DifficultyHitObject`s which were processed.
|
|
497
|
+
* @returns The `DifficultyAttributes` object.
|
|
485
498
|
*/
|
|
486
|
-
abstract
|
|
499
|
+
protected abstract createDifficultyAttributes(beatmap: TBeatmap, skills: Skill[], objects: THitObject[]): TAttributes;
|
|
487
500
|
/**
|
|
488
|
-
*
|
|
501
|
+
* Constructs a `PlayableBeatmap` from a `Beatmap` with specific `Mod`s.
|
|
502
|
+
*
|
|
503
|
+
* @param beatmap The `Beatmap` to create a `PlayableBeatmap` from.
|
|
504
|
+
* @param mods The `Mod`s to apply to the `Beatmap`.
|
|
505
|
+
* @returns The `PlayableBeatmap`.
|
|
489
506
|
*/
|
|
490
|
-
abstract
|
|
507
|
+
protected abstract createPlayableBeatmap(beatmap: Beatmap, mods?: ModMap): TBeatmap;
|
|
491
508
|
/**
|
|
492
|
-
*
|
|
509
|
+
* Calculates the base rating of a `Skill`.
|
|
510
|
+
*
|
|
511
|
+
* @param skill The `Skill` to calculate the rating of.
|
|
512
|
+
* @returns The rating of the `Skill`.
|
|
493
513
|
*/
|
|
494
|
-
|
|
514
|
+
protected calculateRating(skill: Skill): number;
|
|
495
515
|
/**
|
|
496
|
-
*
|
|
516
|
+
* Calculates the base performance value of a difficulty rating.
|
|
517
|
+
*
|
|
518
|
+
* @param rating The difficulty rating.
|
|
497
519
|
*/
|
|
498
|
-
protected
|
|
520
|
+
protected basePerformanceValue(rating: number): number;
|
|
521
|
+
private createPlayableBeatmapWithDifficultyAdjustmentMods;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Represents a slider that is considered difficult.
|
|
526
|
+
*
|
|
527
|
+
* This structure is a part of difficulty attributes and can be cached.
|
|
528
|
+
*/
|
|
529
|
+
interface DifficultSlider {
|
|
499
530
|
/**
|
|
500
|
-
*
|
|
531
|
+
* The index of the slider in the beatmap.
|
|
501
532
|
*/
|
|
502
|
-
|
|
533
|
+
readonly index: number;
|
|
503
534
|
/**
|
|
504
|
-
*
|
|
535
|
+
* The difficulty rating of this slider compared to other sliders, based on the velocity of the slider.
|
|
505
536
|
*
|
|
506
|
-
*
|
|
507
|
-
*/
|
|
508
|
-
protected starValue(difficulty: number): number;
|
|
509
|
-
/**
|
|
510
|
-
* Calculates the base performance value of a difficulty rating.
|
|
537
|
+
* A value closer to 1 indicates that this slider is more difficult compared to most sliders.
|
|
511
538
|
*
|
|
512
|
-
*
|
|
539
|
+
* A value closer to 0 indicates that this slider is easier compared to most sliders.
|
|
513
540
|
*/
|
|
514
|
-
|
|
541
|
+
readonly difficultyRating: number;
|
|
515
542
|
}
|
|
516
543
|
|
|
517
544
|
/**
|
|
518
|
-
*
|
|
545
|
+
* Represents an osu!droid hit object with difficulty calculation values.
|
|
519
546
|
*/
|
|
520
|
-
declare class
|
|
547
|
+
declare class DroidDifficultyHitObject extends DifficultyHitObject {
|
|
521
548
|
/**
|
|
522
|
-
* The
|
|
549
|
+
* The tap strain generated by the hitobject.
|
|
523
550
|
*/
|
|
524
|
-
|
|
551
|
+
tapStrain: number;
|
|
525
552
|
/**
|
|
526
|
-
* The
|
|
553
|
+
* The tap strain generated by the hitobject if `strainTime` isn't modified by
|
|
554
|
+
* OD. This is used in three-finger detection.
|
|
527
555
|
*/
|
|
528
|
-
|
|
556
|
+
originalTapStrain: number;
|
|
529
557
|
/**
|
|
530
|
-
* The
|
|
558
|
+
* The rhythm strain generated by the hitobject.
|
|
531
559
|
*/
|
|
532
|
-
|
|
560
|
+
rhythmStrain: number;
|
|
533
561
|
/**
|
|
534
|
-
* The
|
|
562
|
+
* The flashlight strain generated by the hitobject if sliders are considered.
|
|
535
563
|
*/
|
|
536
|
-
|
|
537
|
-
private maximumSliderRadius;
|
|
538
|
-
private readonly assumedSliderRadius;
|
|
539
|
-
private readonly minDeltaTime;
|
|
564
|
+
flashlightStrainWithSliders: number;
|
|
540
565
|
/**
|
|
541
|
-
*
|
|
566
|
+
* The flashlight strain generated by the hitobject if sliders are not considered.
|
|
542
567
|
*/
|
|
543
|
-
|
|
544
|
-
objects: readonly HitObject[];
|
|
545
|
-
circleSize: number;
|
|
546
|
-
mods: Mod[];
|
|
547
|
-
speedMultiplier: number;
|
|
548
|
-
mode: Modes;
|
|
549
|
-
preempt?: number;
|
|
550
|
-
}): DifficultyHitObject[];
|
|
568
|
+
flashlightStrainWithoutSliders: number;
|
|
551
569
|
/**
|
|
552
|
-
*
|
|
570
|
+
* The visual strain generated by the hitobject if sliders are considered.
|
|
553
571
|
*/
|
|
554
|
-
|
|
572
|
+
visualStrainWithSliders: number;
|
|
573
|
+
/**
|
|
574
|
+
* The visual strain generated by the hitobject if sliders are not considered.
|
|
575
|
+
*/
|
|
576
|
+
visualStrainWithoutSliders: number;
|
|
577
|
+
/**
|
|
578
|
+
* The note density of the hitobject.
|
|
579
|
+
*/
|
|
580
|
+
noteDensity: number;
|
|
555
581
|
/**
|
|
556
|
-
*
|
|
582
|
+
* The overlapping factor of the hitobject.
|
|
557
583
|
*
|
|
558
|
-
*
|
|
584
|
+
* This is used to scale visual skill.
|
|
559
585
|
*/
|
|
560
|
-
|
|
586
|
+
overlappingFactor: number;
|
|
561
587
|
/**
|
|
562
|
-
*
|
|
588
|
+
* Adjusted preempt time of the hitobject, taking speed multiplier into account.
|
|
563
589
|
*/
|
|
564
|
-
|
|
565
|
-
private
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
* Represents a slider that is considered difficult.
|
|
570
|
-
*
|
|
571
|
-
* This structure is a part of difficulty attributes and can be cached.
|
|
572
|
-
*/
|
|
573
|
-
interface DifficultSlider {
|
|
590
|
+
readonly timePreempt: number;
|
|
591
|
+
private readonly radiusBuffThreshold;
|
|
592
|
+
protected readonly mode = Modes.droid;
|
|
593
|
+
protected readonly maximumSliderRadius: number;
|
|
594
|
+
protected get scalingFactor(): number;
|
|
574
595
|
/**
|
|
575
|
-
*
|
|
596
|
+
* Note: You **must** call `computeProperties` at some point due to how TypeScript handles
|
|
597
|
+
* overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue).
|
|
598
|
+
*
|
|
599
|
+
* @param object The underlying hitobject.
|
|
600
|
+
* @param lastObject The hitobject before this hitobject.
|
|
601
|
+
* @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
|
|
602
|
+
* @param clockRate The clock rate of the beatmap.
|
|
576
603
|
*/
|
|
577
|
-
readonly index: number;
|
|
604
|
+
constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number, index: number);
|
|
605
|
+
computeProperties(clockRate: number, hitObjects: readonly PlaceableHitObject[]): void;
|
|
606
|
+
opacityAt(time: number, mods: ModMap): number;
|
|
607
|
+
previous(backwardsIndex: number): this | null;
|
|
608
|
+
next(forwardsIndex: number): this | null;
|
|
578
609
|
/**
|
|
579
|
-
*
|
|
610
|
+
* Determines whether this hitobject is considered overlapping with the hitobject before it.
|
|
580
611
|
*
|
|
581
|
-
*
|
|
612
|
+
* Keep in mind that "overlapping" in this case is overlapping to the point where both hitobjects
|
|
613
|
+
* can be hit with just a single tap in osu!droid.
|
|
582
614
|
*
|
|
583
|
-
*
|
|
615
|
+
* In the case of sliders, it is considered overlapping if all nested hitobjects can be hit with
|
|
616
|
+
* one aim motion.
|
|
617
|
+
*
|
|
618
|
+
* @param considerDistance Whether to consider the distance between both hitobjects.
|
|
619
|
+
* @returns Whether the hitobject is considered overlapping.
|
|
584
620
|
*/
|
|
585
|
-
|
|
621
|
+
isOverlapping(considerDistance: boolean): boolean;
|
|
622
|
+
private setVisuals;
|
|
623
|
+
private applyToOverlappingFactor;
|
|
586
624
|
}
|
|
587
625
|
|
|
588
626
|
/**
|
|
@@ -594,41 +632,54 @@ declare abstract class DroidSkill extends StrainSkill {
|
|
|
594
632
|
* The bonus multiplier that is given for a sequence of notes of equal difficulty.
|
|
595
633
|
*/
|
|
596
634
|
protected abstract readonly starsPerDouble: number;
|
|
635
|
+
process(current: DifficultyHitObject): void;
|
|
597
636
|
difficultyValue(): number;
|
|
637
|
+
/**
|
|
638
|
+
* Gets the strain of a hitobject.
|
|
639
|
+
*
|
|
640
|
+
* @param current The hitobject to get the strain from.
|
|
641
|
+
* @returns The strain of the hitobject.
|
|
642
|
+
*/
|
|
643
|
+
protected abstract getObjectStrain(current: DifficultyHitObject): number;
|
|
644
|
+
protected calculateCurrentSectionStart(current: DifficultyHitObject): number;
|
|
598
645
|
}
|
|
599
646
|
|
|
600
647
|
/**
|
|
601
648
|
* Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
|
|
602
649
|
*/
|
|
603
650
|
declare class DroidAim extends DroidSkill {
|
|
604
|
-
protected readonly
|
|
605
|
-
protected readonly
|
|
606
|
-
protected readonly
|
|
607
|
-
protected readonly
|
|
608
|
-
|
|
609
|
-
private
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
651
|
+
protected readonly strainDecayBase = 0.15;
|
|
652
|
+
protected readonly reducedSectionCount = 10;
|
|
653
|
+
protected readonly reducedSectionBaseline = 0.75;
|
|
654
|
+
protected readonly starsPerDouble = 1.05;
|
|
655
|
+
private readonly skillMultiplier;
|
|
656
|
+
private currentAimStrain;
|
|
657
|
+
private readonly sliderStrains;
|
|
658
|
+
readonly withSliders: boolean;
|
|
659
|
+
constructor(mods: ModMap, withSliders: boolean);
|
|
660
|
+
/**
|
|
661
|
+
* Obtains the amount of sliders that are considered difficult in terms of relative strain.
|
|
662
|
+
*/
|
|
663
|
+
countDifficultSliders(): number;
|
|
664
|
+
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
665
|
+
protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
|
|
666
|
+
protected getObjectStrain(): number;
|
|
615
667
|
/**
|
|
616
668
|
* @param current The hitobject to save to.
|
|
617
669
|
*/
|
|
618
|
-
protected saveToHitObject(current:
|
|
670
|
+
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
619
671
|
}
|
|
620
672
|
|
|
621
673
|
/**
|
|
622
674
|
* An evaluator for calculating osu!droid Aim skill.
|
|
623
675
|
*/
|
|
624
|
-
declare abstract class DroidAimEvaluator
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
private static readonly SINGLE_SPACING_THRESHOLD;
|
|
676
|
+
declare abstract class DroidAimEvaluator {
|
|
677
|
+
private static readonly wideAngleMultiplier;
|
|
678
|
+
private static readonly acuteAngleMultiplier;
|
|
679
|
+
private static readonly sliderMultiplier;
|
|
680
|
+
private static readonly velocityChangeMultiplier;
|
|
681
|
+
private static readonly wiggleMultiplier;
|
|
682
|
+
private static readonly singleSpacingThreshold;
|
|
632
683
|
private static readonly minSpeedBonus;
|
|
633
684
|
/**
|
|
634
685
|
* Evaluates the difficulty of aiming the current object, based on:
|
|
@@ -641,21 +692,23 @@ declare abstract class DroidAimEvaluator extends AimEvaluator {
|
|
|
641
692
|
* @param current The current object.
|
|
642
693
|
* @param withSliders Whether to take slider difficulty into account.
|
|
643
694
|
*/
|
|
644
|
-
static evaluateDifficultyOf(current:
|
|
695
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, withSliders: boolean): number;
|
|
645
696
|
/**
|
|
646
|
-
* Calculates the aim strain of a hitobject.
|
|
697
|
+
* Calculates the snap aim strain of a hitobject.
|
|
647
698
|
*/
|
|
648
|
-
private static
|
|
699
|
+
private static snapAimStrainOf;
|
|
649
700
|
/**
|
|
650
|
-
* Calculates the
|
|
701
|
+
* Calculates the flow aim strain of a hitobject.
|
|
651
702
|
*/
|
|
652
|
-
private static
|
|
703
|
+
private static flowAimStrainOf;
|
|
704
|
+
private static calculateWideAngleBonus;
|
|
705
|
+
private static calculateAcuteAngleBonus;
|
|
653
706
|
}
|
|
654
707
|
|
|
655
708
|
/**
|
|
656
709
|
* Holds data that can be used to calculate osu!droid performance points.
|
|
657
710
|
*/
|
|
658
|
-
interface
|
|
711
|
+
interface IDroidDifficultyAttributes extends IDifficultyAttributes {
|
|
659
712
|
/**
|
|
660
713
|
* The difficulty corresponding to the tap skill.
|
|
661
714
|
*/
|
|
@@ -668,6 +721,46 @@ interface DroidDifficultyAttributes extends DifficultyAttributes {
|
|
|
668
721
|
* The difficulty corresponding to the visual skill.
|
|
669
722
|
*/
|
|
670
723
|
visualDifficulty: number;
|
|
724
|
+
/**
|
|
725
|
+
* The amount of strains that are considered difficult with respect to the tap skill.
|
|
726
|
+
*/
|
|
727
|
+
tapDifficultStrainCount: number;
|
|
728
|
+
/**
|
|
729
|
+
* The amount of strains that are considered difficult with respect to the flashlight skill.
|
|
730
|
+
*/
|
|
731
|
+
flashlightDifficultStrainCount: number;
|
|
732
|
+
/**
|
|
733
|
+
* The amount of strains that are considered difficult with respect to the visual skill.
|
|
734
|
+
*/
|
|
735
|
+
visualDifficultStrainCount: number;
|
|
736
|
+
/**
|
|
737
|
+
* The average delta time of speed objects.
|
|
738
|
+
*/
|
|
739
|
+
averageSpeedDeltaTime: number;
|
|
740
|
+
/**
|
|
741
|
+
* Describes how much of tap difficulty is contributed by notes that are "vibroable".
|
|
742
|
+
*
|
|
743
|
+
* A value closer to 1 indicates most of tap difficulty is contributed by notes that are not "vibroable".
|
|
744
|
+
*
|
|
745
|
+
* A value closer to 0 indicates most of tap difficulty is contributed by notes that are "vibroable".
|
|
746
|
+
*/
|
|
747
|
+
vibroFactor: number;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* Holds data that can be used to calculate osu!droid performance points.
|
|
752
|
+
*/
|
|
753
|
+
declare class DroidDifficultyAttributes extends DifficultyAttributes implements IDroidDifficultyAttributes {
|
|
754
|
+
tapDifficulty: number;
|
|
755
|
+
rhythmDifficulty: number;
|
|
756
|
+
visualDifficulty: number;
|
|
757
|
+
tapDifficultStrainCount: number;
|
|
758
|
+
flashlightDifficultStrainCount: number;
|
|
759
|
+
visualDifficultStrainCount: number;
|
|
760
|
+
averageSpeedDeltaTime: number;
|
|
761
|
+
vibroFactor: number;
|
|
762
|
+
constructor(cacheableAttributes?: CacheableDifficultyAttributes<IDroidDifficultyAttributes>);
|
|
763
|
+
toString(): string;
|
|
671
764
|
}
|
|
672
765
|
|
|
673
766
|
/**
|
|
@@ -692,7 +785,11 @@ interface HighStrainSection {
|
|
|
692
785
|
* Holds data that can be used to calculate osu!droid performance points as well
|
|
693
786
|
* as doing some analysis using the replay of a score.
|
|
694
787
|
*/
|
|
695
|
-
interface
|
|
788
|
+
interface IExtendedDroidDifficultyAttributes extends IDroidDifficultyAttributes {
|
|
789
|
+
/**
|
|
790
|
+
* The mode of the difficulty calculation.
|
|
791
|
+
*/
|
|
792
|
+
mode: "live";
|
|
696
793
|
/**
|
|
697
794
|
* Possible sections at which the player can use three fingers on.
|
|
698
795
|
*/
|
|
@@ -725,151 +822,75 @@ interface ExtendedDroidDifficultyAttributes extends DroidDifficultyAttributes {
|
|
|
725
822
|
visualSliderFactor: number;
|
|
726
823
|
}
|
|
727
824
|
|
|
825
|
+
/**
|
|
826
|
+
* Holds data that can be used to calculate osu!droid performance points as well
|
|
827
|
+
* as doing some analysis using the replay of a score.
|
|
828
|
+
*/
|
|
829
|
+
declare class ExtendedDroidDifficultyAttributes extends DroidDifficultyAttributes implements IExtendedDroidDifficultyAttributes {
|
|
830
|
+
mode: "live";
|
|
831
|
+
possibleThreeFingeredSections: HighStrainSection[];
|
|
832
|
+
difficultSliders: DifficultSlider[];
|
|
833
|
+
aimNoteCount: number;
|
|
834
|
+
flashlightSliderFactor: number;
|
|
835
|
+
visualSliderFactor: number;
|
|
836
|
+
constructor(cacheableAttributes?: CacheableDifficultyAttributes<IExtendedDroidDifficultyAttributes>);
|
|
837
|
+
}
|
|
838
|
+
|
|
728
839
|
/**
|
|
729
840
|
* A difficulty calculator for osu!droid gamemode.
|
|
730
841
|
*/
|
|
731
|
-
declare class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
732
|
-
/**
|
|
733
|
-
* The aim star rating of the beatmap.
|
|
734
|
-
*/
|
|
735
|
-
aim: number;
|
|
736
|
-
/**
|
|
737
|
-
* The tap star rating of the beatmap.
|
|
738
|
-
*/
|
|
739
|
-
tap: number;
|
|
740
|
-
/**
|
|
741
|
-
* The rhythm star rating of the beatmap.
|
|
742
|
-
*/
|
|
743
|
-
rhythm: number;
|
|
744
|
-
/**
|
|
745
|
-
* The flashlight star rating of the beatmap.
|
|
746
|
-
*/
|
|
747
|
-
flashlight: number;
|
|
748
|
-
/**
|
|
749
|
-
* The visual star rating of the beatmap.
|
|
750
|
-
*/
|
|
751
|
-
visual: number;
|
|
842
|
+
declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidPlayableBeatmap, DroidDifficultyHitObject, ExtendedDroidDifficultyAttributes> {
|
|
752
843
|
/**
|
|
753
844
|
* The strain threshold to start detecting for possible three-fingered section.
|
|
754
845
|
*
|
|
755
846
|
* Increasing this number will result in less sections being flagged.
|
|
756
847
|
*/
|
|
757
|
-
static readonly threeFingerStrainThreshold
|
|
758
|
-
readonly
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
*/
|
|
772
|
-
calculateRhythm(): void;
|
|
773
|
-
/**
|
|
774
|
-
* Calculates the flashlight star rating of the beatmap and stores it in this instance.
|
|
775
|
-
*/
|
|
776
|
-
calculateFlashlight(): void;
|
|
777
|
-
/**
|
|
778
|
-
* Calculates the visual star rating of the beatmap and stores it in this instance.
|
|
779
|
-
*/
|
|
780
|
-
calculateVisual(): void;
|
|
781
|
-
calculateTotal(): void;
|
|
782
|
-
calculateAll(): void;
|
|
783
|
-
toString(): string;
|
|
784
|
-
protected preProcess(): void;
|
|
785
|
-
protected createSkills(): DroidSkill[];
|
|
786
|
-
/**
|
|
787
|
-
* Called after aim skill calculation.
|
|
788
|
-
*
|
|
789
|
-
* @param aimSkill The aim skill that considers sliders.
|
|
790
|
-
* @param aimSkillWithoutSliders The aim skill that doesn't consider sliders.
|
|
791
|
-
*/
|
|
792
|
-
private postCalculateAim;
|
|
793
|
-
/**
|
|
794
|
-
* Calculates aim-related attributes.
|
|
795
|
-
*/
|
|
796
|
-
private calculateAimAttributes;
|
|
797
|
-
/**
|
|
798
|
-
* Called after tap skill calculation.
|
|
799
|
-
*
|
|
800
|
-
* @param tapSkill The tap skill.
|
|
801
|
-
*/
|
|
802
|
-
private postCalculateTap;
|
|
803
|
-
/**
|
|
804
|
-
* Calculates speed-related attributes.
|
|
805
|
-
*/
|
|
806
|
-
private calculateSpeedAttributes;
|
|
807
|
-
/**
|
|
808
|
-
* Calculates the sum of strains for possible three-fingered sections.
|
|
809
|
-
*
|
|
810
|
-
* @param firstObjectIndex The index of the first object in the section.
|
|
811
|
-
* @param lastObjectIndex The index of the last object in the section.
|
|
812
|
-
* @returns The summed strain of the section.
|
|
813
|
-
*/
|
|
814
|
-
private calculateThreeFingerSummedStrain;
|
|
815
|
-
/**
|
|
816
|
-
* Called after rhythm skill calculation.
|
|
817
|
-
*
|
|
818
|
-
* @param rhythmSkill The rhythm skill.
|
|
819
|
-
*/
|
|
820
|
-
private postCalculateRhythm;
|
|
821
|
-
/**
|
|
822
|
-
* Called after flashlight skill calculation.
|
|
823
|
-
*
|
|
824
|
-
* @param flashlightSkill The flashlight skill that considers sliders.
|
|
825
|
-
* @param flashlightSkillWithoutSliders The flashlight skill that doesn't consider sliders.
|
|
826
|
-
*/
|
|
827
|
-
private postCalculateFlashlight;
|
|
828
|
-
/**
|
|
829
|
-
* Called after visual skill calculation.
|
|
830
|
-
*
|
|
831
|
-
* @param visualSkillWithSliders The visual skill that considers sliders.
|
|
832
|
-
* @param visualSkillWithoutSliders The visual skill that doesn't consider sliders.
|
|
833
|
-
*/
|
|
834
|
-
private postCalculateVisual;
|
|
848
|
+
static readonly threeFingerStrainThreshold = 175;
|
|
849
|
+
protected readonly difficultyMultiplier = 0.18;
|
|
850
|
+
constructor();
|
|
851
|
+
retainDifficultyAdjustmentMods(mods: Mod[]): Mod[];
|
|
852
|
+
protected createDifficultyAttributes(beatmap: DroidPlayableBeatmap, skills: Skill[], objects: DroidDifficultyHitObject[]): ExtendedDroidDifficultyAttributes;
|
|
853
|
+
protected createPlayableBeatmap(beatmap: Beatmap, mods?: ModMap): DroidPlayableBeatmap;
|
|
854
|
+
protected createDifficultyHitObjects(beatmap: DroidPlayableBeatmap): DroidDifficultyHitObject[];
|
|
855
|
+
protected createSkills(beatmap: DroidPlayableBeatmap): DroidSkill[];
|
|
856
|
+
protected createStrainPeakSkills(beatmap: DroidPlayableBeatmap): StrainSkill[];
|
|
857
|
+
private populateAimAttributes;
|
|
858
|
+
private populateTapAttributes;
|
|
859
|
+
private populateRhythmAttributes;
|
|
860
|
+
private populateFlashlightAttributes;
|
|
861
|
+
private populateVisualAttributes;
|
|
835
862
|
}
|
|
836
863
|
|
|
837
864
|
/**
|
|
838
865
|
* Represents the skill required to memorize and hit every object in a beatmap with the Flashlight mod enabled.
|
|
839
866
|
*/
|
|
840
867
|
declare class DroidFlashlight extends DroidSkill {
|
|
841
|
-
protected readonly
|
|
842
|
-
protected readonly
|
|
843
|
-
protected readonly
|
|
844
|
-
protected readonly
|
|
845
|
-
|
|
846
|
-
private
|
|
847
|
-
|
|
848
|
-
constructor(mods:
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
protected
|
|
853
|
-
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
/**
|
|
857
|
-
* An evaluator for calculating flashlight skill.
|
|
858
|
-
*
|
|
859
|
-
* This class should be considered an "evaluating" class and not persisted.
|
|
860
|
-
*/
|
|
861
|
-
declare abstract class FlashlightEvaluator {
|
|
862
|
-
protected static readonly maxOpacityBonus: number;
|
|
863
|
-
protected static readonly hiddenBonus: number;
|
|
864
|
-
protected static readonly minVelocity: number;
|
|
865
|
-
protected static readonly sliderMultiplier: number;
|
|
866
|
-
protected static readonly minAngleMultiplier: number;
|
|
868
|
+
protected readonly strainDecayBase = 0.15;
|
|
869
|
+
protected readonly reducedSectionCount = 0;
|
|
870
|
+
protected readonly reducedSectionBaseline = 1;
|
|
871
|
+
protected readonly starsPerDouble = 1.06;
|
|
872
|
+
private readonly skillMultiplier;
|
|
873
|
+
private currentFlashlightStrain;
|
|
874
|
+
readonly withSliders: boolean;
|
|
875
|
+
constructor(mods: ModMap, withSliders: boolean);
|
|
876
|
+
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
877
|
+
protected calculateInitialStrain(time: number, current: DifficultyHitObject): number;
|
|
878
|
+
protected getObjectStrain(): number;
|
|
879
|
+
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
880
|
+
difficultyValue(): number;
|
|
867
881
|
}
|
|
868
882
|
|
|
869
883
|
/**
|
|
870
884
|
* An evaluator for calculating osu!droid Flashlight skill.
|
|
871
885
|
*/
|
|
872
|
-
declare abstract class DroidFlashlightEvaluator
|
|
886
|
+
declare abstract class DroidFlashlightEvaluator {
|
|
887
|
+
private static readonly maxOpacityBonus;
|
|
888
|
+
private static readonly hiddenBonus;
|
|
889
|
+
private static readonly traceableCircleBonus;
|
|
890
|
+
private static readonly traceableObjectBonus;
|
|
891
|
+
private static readonly minVelocity;
|
|
892
|
+
private static readonly sliderMultiplier;
|
|
893
|
+
private static readonly minAngleMultiplier;
|
|
873
894
|
/**
|
|
874
895
|
* Evaluates the difficulty of memorizing and hitting the current object, based on:
|
|
875
896
|
*
|
|
@@ -880,10 +901,10 @@ declare abstract class DroidFlashlightEvaluator extends FlashlightEvaluator {
|
|
|
880
901
|
* - and whether Hidden mod is enabled.
|
|
881
902
|
*
|
|
882
903
|
* @param current The current object.
|
|
883
|
-
* @param
|
|
904
|
+
* @param mods The mods used.
|
|
884
905
|
* @param withSliders Whether to take slider difficulty into account.
|
|
885
906
|
*/
|
|
886
|
-
static evaluateDifficultyOf(current:
|
|
907
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, mods: ModMap, withSliders: boolean): number;
|
|
887
908
|
}
|
|
888
909
|
|
|
889
910
|
/**
|
|
@@ -923,7 +944,7 @@ interface PerformanceCalculationOptions {
|
|
|
923
944
|
/**
|
|
924
945
|
* The base class of performance calculators.
|
|
925
946
|
*/
|
|
926
|
-
declare abstract class PerformanceCalculator {
|
|
947
|
+
declare abstract class PerformanceCalculator<T extends IDifficultyAttributes> {
|
|
927
948
|
/**
|
|
928
949
|
* The overall performance value.
|
|
929
950
|
*/
|
|
@@ -935,11 +956,11 @@ declare abstract class PerformanceCalculator {
|
|
|
935
956
|
/**
|
|
936
957
|
* The difficulty attributes that is being calculated.
|
|
937
958
|
*/
|
|
938
|
-
|
|
959
|
+
readonly difficultyAttributes: T | CacheableDifficultyAttributes<T>;
|
|
939
960
|
/**
|
|
940
|
-
*
|
|
961
|
+
* The mods that were used.
|
|
941
962
|
*/
|
|
942
|
-
protected
|
|
963
|
+
protected readonly mods: ModMap;
|
|
943
964
|
/**
|
|
944
965
|
* The global multiplier to be applied to the final performance value.
|
|
945
966
|
*
|
|
@@ -958,6 +979,10 @@ declare abstract class PerformanceCalculator {
|
|
|
958
979
|
* Nerf factor used for nerfing beatmaps with very likely dropped sliderends.
|
|
959
980
|
*/
|
|
960
981
|
protected sliderNerfFactor: number;
|
|
982
|
+
/**
|
|
983
|
+
* @param difficultyAttributes The difficulty attributes to calculate.
|
|
984
|
+
*/
|
|
985
|
+
constructor(difficultyAttributes: T | CacheableDifficultyAttributes<T>);
|
|
961
986
|
/**
|
|
962
987
|
* Calculates the performance points of the beatmap.
|
|
963
988
|
*
|
|
@@ -977,7 +1002,7 @@ declare abstract class PerformanceCalculator {
|
|
|
977
1002
|
/**
|
|
978
1003
|
* Calculates the total performance value of the beatmap and stores it in this instance.
|
|
979
1004
|
*/
|
|
980
|
-
protected abstract calculateTotalValue():
|
|
1005
|
+
protected abstract calculateTotalValue(): number;
|
|
981
1006
|
/**
|
|
982
1007
|
* The total hits that can be done in the beatmap.
|
|
983
1008
|
*/
|
|
@@ -986,6 +1011,10 @@ declare abstract class PerformanceCalculator {
|
|
|
986
1011
|
* The total hits that were successfully done.
|
|
987
1012
|
*/
|
|
988
1013
|
protected get totalSuccessfulHits(): number;
|
|
1014
|
+
/**
|
|
1015
|
+
* The total of imperfect hits (100s, 50s, misses).
|
|
1016
|
+
*/
|
|
1017
|
+
protected get totalImperfectHits(): number;
|
|
989
1018
|
/**
|
|
990
1019
|
* Calculates the base performance value of a star rating.
|
|
991
1020
|
*/
|
|
@@ -996,16 +1025,31 @@ declare abstract class PerformanceCalculator {
|
|
|
996
1025
|
* @param options Options for performance calculation.
|
|
997
1026
|
*/
|
|
998
1027
|
protected handleOptions(options?: PerformanceCalculationOptions): void;
|
|
1028
|
+
/**
|
|
1029
|
+
* Calculates a strain-based miss penalty.
|
|
1030
|
+
*
|
|
1031
|
+
* Strain-based miss penalty assumes that a player will miss on the hardest parts of a map,
|
|
1032
|
+
* so we use the amount of relatively difficult sections to adjust miss penalty
|
|
1033
|
+
* to make it more punishing on maps with lower amount of hard sections.
|
|
1034
|
+
*/
|
|
1035
|
+
protected calculateStrainBasedMissPenalty(difficultStrainCount: number): number;
|
|
999
1036
|
/**
|
|
1000
1037
|
* Calculates the amount of misses + sliderbreaks from combo.
|
|
1001
1038
|
*/
|
|
1002
1039
|
private calculateEffectiveMissCount;
|
|
1040
|
+
/**
|
|
1041
|
+
* Determines whether an attribute is a cacheable attribute.
|
|
1042
|
+
*
|
|
1043
|
+
* @param attributes The attributes to check.
|
|
1044
|
+
* @returns Whether the attributes are cacheable.
|
|
1045
|
+
*/
|
|
1046
|
+
private isCacheableAttribute;
|
|
1003
1047
|
}
|
|
1004
1048
|
|
|
1005
1049
|
/**
|
|
1006
1050
|
* A performance points calculator that calculates performance points for osu!droid gamemode.
|
|
1007
1051
|
*/
|
|
1008
|
-
declare class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
1052
|
+
declare class DroidPerformanceCalculator extends PerformanceCalculator<IDroidDifficultyAttributes> {
|
|
1009
1053
|
/**
|
|
1010
1054
|
* The aim performance value.
|
|
1011
1055
|
*/
|
|
@@ -1058,19 +1102,14 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
1058
1102
|
* Can be properly obtained by analyzing the replay associated with the score.
|
|
1059
1103
|
*/
|
|
1060
1104
|
get visualSliderCheesePenalty(): number;
|
|
1061
|
-
readonly difficultyAttributes: DroidDifficultyAttributes;
|
|
1062
1105
|
protected finalMultiplier: number;
|
|
1063
|
-
protected readonly mode
|
|
1106
|
+
protected readonly mode = Modes.droid;
|
|
1064
1107
|
private _aimSliderCheesePenalty;
|
|
1065
1108
|
private _flashlightSliderCheesePenalty;
|
|
1066
1109
|
private _visualSliderCheesePenalty;
|
|
1067
1110
|
private _tapPenalty;
|
|
1068
1111
|
private _deviation;
|
|
1069
1112
|
private _tapDeviation;
|
|
1070
|
-
/**
|
|
1071
|
-
* @param difficultyAttributes The difficulty attributes to calculate.
|
|
1072
|
-
*/
|
|
1073
|
-
constructor(difficultyAttributes: DroidDifficultyAttributes);
|
|
1074
1113
|
/**
|
|
1075
1114
|
* Applies a tap penalty value to this calculator.
|
|
1076
1115
|
*
|
|
@@ -1104,7 +1143,7 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
1104
1143
|
*/
|
|
1105
1144
|
applyVisualSliderCheesePenalty(value: number): void;
|
|
1106
1145
|
protected calculateValues(): void;
|
|
1107
|
-
protected calculateTotalValue():
|
|
1146
|
+
protected calculateTotalValue(): number;
|
|
1108
1147
|
protected handleOptions(options?: PerformanceCalculationOptions): void;
|
|
1109
1148
|
/**
|
|
1110
1149
|
* Calculates the aim performance value of the beatmap.
|
|
@@ -1126,6 +1165,19 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
1126
1165
|
* Calculates the visual performance value of the beatmap.
|
|
1127
1166
|
*/
|
|
1128
1167
|
private calculateVisualValue;
|
|
1168
|
+
/**
|
|
1169
|
+
* The object-based proportional miss penalty.
|
|
1170
|
+
*/
|
|
1171
|
+
private get proportionalMissPenalty();
|
|
1172
|
+
/**
|
|
1173
|
+
* Calculates the object-based length scaling based on the deviation of a player for a full
|
|
1174
|
+
* combo in this beatmap, taking retries into account.
|
|
1175
|
+
*
|
|
1176
|
+
* @param objectCount The amount of objects to be considered. Defaults to the amount of
|
|
1177
|
+
* objects in this beatmap.
|
|
1178
|
+
* @param punishForMemorization Whether to punish the deviation for memorization. Defaults to `false`.
|
|
1179
|
+
*/
|
|
1180
|
+
private calculateDeviationBasedLengthScaling;
|
|
1129
1181
|
/**
|
|
1130
1182
|
* Estimates the player's tap deviation based on the OD, number of circles and sliders,
|
|
1131
1183
|
* and number of 300s, 100s, 50s, and misses, assuming the player's mean hit error is 0.
|
|
@@ -1148,6 +1200,7 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
1148
1200
|
* This is fine though, since this method is only used to scale tap pp.
|
|
1149
1201
|
*/
|
|
1150
1202
|
private calculateTapDeviation;
|
|
1203
|
+
private getConvertedHitWindow;
|
|
1151
1204
|
toString(): string;
|
|
1152
1205
|
}
|
|
1153
1206
|
|
|
@@ -1155,110 +1208,116 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
1155
1208
|
* Represents the skill required to properly follow a beatmap's rhythm.
|
|
1156
1209
|
*/
|
|
1157
1210
|
declare class DroidRhythm extends DroidSkill {
|
|
1158
|
-
protected readonly
|
|
1159
|
-
protected readonly
|
|
1160
|
-
protected readonly
|
|
1161
|
-
protected readonly
|
|
1162
|
-
|
|
1163
|
-
private
|
|
1164
|
-
private
|
|
1165
|
-
constructor(mods:
|
|
1166
|
-
protected strainValueAt(current:
|
|
1167
|
-
protected
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
/**
|
|
1171
|
-
* An evaluator for calculating rhythm skill.
|
|
1172
|
-
*
|
|
1173
|
-
* This class should be considered an "evaluating" class and not persisted.
|
|
1174
|
-
*/
|
|
1175
|
-
declare abstract class RhythmEvaluator {
|
|
1176
|
-
protected static readonly rhythmMultiplier: number;
|
|
1177
|
-
protected static readonly historyTimeMax: number;
|
|
1211
|
+
protected readonly reducedSectionCount = 5;
|
|
1212
|
+
protected readonly reducedSectionBaseline = 0.75;
|
|
1213
|
+
protected readonly strainDecayBase = 0.3;
|
|
1214
|
+
protected readonly starsPerDouble = 1.75;
|
|
1215
|
+
private readonly useSliderAccuracy;
|
|
1216
|
+
private currentRhythmStrain;
|
|
1217
|
+
private currentRhythmMultiplier;
|
|
1218
|
+
constructor(mods: ModMap);
|
|
1219
|
+
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
1220
|
+
protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
|
|
1221
|
+
protected getObjectStrain(): number;
|
|
1222
|
+
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
1178
1223
|
}
|
|
1179
1224
|
|
|
1180
1225
|
/**
|
|
1181
1226
|
* An evaluator for calculating osu!droid Rhythm skill.
|
|
1182
1227
|
*/
|
|
1183
|
-
declare abstract class DroidRhythmEvaluator
|
|
1228
|
+
declare abstract class DroidRhythmEvaluator {
|
|
1229
|
+
private static readonly historyTimeMax;
|
|
1230
|
+
private static readonly historyObjectsMax;
|
|
1231
|
+
private static readonly rhythmOverallMultiplier;
|
|
1232
|
+
private static readonly rhythmRatioMultiplier;
|
|
1184
1233
|
/**
|
|
1185
1234
|
* Calculates a rhythm multiplier for the difficulty of the tap associated
|
|
1186
1235
|
* with historic data of the current object.
|
|
1187
1236
|
*
|
|
1188
1237
|
* @param current The current object.
|
|
1189
|
-
* @param
|
|
1238
|
+
* @param useSliderAccuracy Whether to use slider accuracy.
|
|
1190
1239
|
*/
|
|
1191
|
-
static evaluateDifficultyOf(current:
|
|
1240
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, useSliderAccuracy: boolean): number;
|
|
1192
1241
|
}
|
|
1193
1242
|
|
|
1194
1243
|
/**
|
|
1195
1244
|
* Represents the skill required to press keys or tap with regards to keeping up with the speed at which objects need to be hit.
|
|
1196
1245
|
*/
|
|
1197
1246
|
declare class DroidTap extends DroidSkill {
|
|
1198
|
-
protected readonly
|
|
1199
|
-
protected readonly
|
|
1200
|
-
protected readonly
|
|
1201
|
-
protected readonly
|
|
1202
|
-
protected readonly starsPerDouble: number;
|
|
1247
|
+
protected readonly reducedSectionCount = 10;
|
|
1248
|
+
protected readonly reducedSectionBaseline = 0.75;
|
|
1249
|
+
protected readonly strainDecayBase = 0.3;
|
|
1250
|
+
protected readonly starsPerDouble = 1.1;
|
|
1203
1251
|
private currentTapStrain;
|
|
1204
|
-
private
|
|
1205
|
-
private readonly
|
|
1206
|
-
|
|
1252
|
+
private currentRhythmMultiplier;
|
|
1253
|
+
private readonly skillMultiplier;
|
|
1254
|
+
private readonly _objectDeltaTimes;
|
|
1207
1255
|
/**
|
|
1208
|
-
*
|
|
1256
|
+
* The delta time of hitobjects.
|
|
1257
|
+
*/
|
|
1258
|
+
get objectDeltaTimes(): readonly number[];
|
|
1259
|
+
readonly considerCheesability: boolean;
|
|
1260
|
+
private readonly strainTimeCap?;
|
|
1261
|
+
constructor(mods: ModMap, considerCheesability: boolean, strainTimeCap?: number);
|
|
1262
|
+
/**
|
|
1263
|
+
* The amount of notes that are relevant to the difficulty.
|
|
1264
|
+
*/
|
|
1265
|
+
relevantNoteCount(): number;
|
|
1266
|
+
/**
|
|
1267
|
+
* The delta time relevant to the difficulty.
|
|
1209
1268
|
*/
|
|
1210
|
-
|
|
1269
|
+
relevantDeltaTime(): number;
|
|
1270
|
+
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
1271
|
+
protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
|
|
1272
|
+
protected getObjectStrain(): number;
|
|
1211
1273
|
/**
|
|
1212
1274
|
* @param current The hitobject to save to.
|
|
1213
1275
|
*/
|
|
1214
|
-
protected saveToHitObject(current:
|
|
1215
|
-
}
|
|
1216
|
-
|
|
1217
|
-
/**
|
|
1218
|
-
* An evaluator for calculating speed or tap skill.
|
|
1219
|
-
*
|
|
1220
|
-
* This class should be considered an "evaluating" class and not persisted.
|
|
1221
|
-
*/
|
|
1222
|
-
declare abstract class SpeedEvaluator {
|
|
1223
|
-
protected static readonly minSpeedBonus: number;
|
|
1276
|
+
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
1224
1277
|
}
|
|
1225
1278
|
|
|
1226
1279
|
/**
|
|
1227
1280
|
* An evaluator for calculating osu!droid tap skill.
|
|
1228
1281
|
*/
|
|
1229
|
-
declare abstract class DroidTapEvaluator
|
|
1282
|
+
declare abstract class DroidTapEvaluator {
|
|
1283
|
+
private static readonly minSpeedBonus;
|
|
1230
1284
|
/**
|
|
1231
1285
|
* Evaluates the difficulty of tapping the current object, based on:
|
|
1232
1286
|
*
|
|
1233
1287
|
* - time between pressing the previous and current object,
|
|
1234
1288
|
* - distance between those objects,
|
|
1235
|
-
* -
|
|
1289
|
+
* - how easily they can be cheesed,
|
|
1290
|
+
* - and the strain time cap.
|
|
1236
1291
|
*
|
|
1237
1292
|
* @param current The current object.
|
|
1238
1293
|
* @param greatWindow The great hit window of the current object.
|
|
1239
1294
|
* @param considerCheesability Whether to consider cheesability.
|
|
1295
|
+
* @param strainTimeCap The strain time to cap the object's strain time to.
|
|
1240
1296
|
*/
|
|
1241
|
-
static evaluateDifficultyOf(current:
|
|
1297
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, considerCheesability: boolean, strainTimeCap?: number): number;
|
|
1242
1298
|
}
|
|
1243
1299
|
|
|
1244
1300
|
/**
|
|
1245
1301
|
* Represents the skill required to read every object in the map.
|
|
1246
1302
|
*/
|
|
1247
1303
|
declare class DroidVisual extends DroidSkill {
|
|
1248
|
-
protected readonly starsPerDouble
|
|
1249
|
-
protected readonly reducedSectionCount
|
|
1250
|
-
protected readonly reducedSectionBaseline
|
|
1251
|
-
protected readonly
|
|
1252
|
-
|
|
1253
|
-
private
|
|
1254
|
-
private readonly
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
protected
|
|
1304
|
+
protected readonly starsPerDouble = 1.025;
|
|
1305
|
+
protected readonly reducedSectionCount = 10;
|
|
1306
|
+
protected readonly reducedSectionBaseline = 0.75;
|
|
1307
|
+
protected readonly strainDecayBase = 0.1;
|
|
1308
|
+
private currentVisualStrain;
|
|
1309
|
+
private currentRhythmMultiplier;
|
|
1310
|
+
private readonly skillMultiplier;
|
|
1311
|
+
readonly withSliders: boolean;
|
|
1312
|
+
constructor(mods: ModMap, withSliders: boolean);
|
|
1313
|
+
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
1314
|
+
protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
|
|
1315
|
+
protected getObjectStrain(): number;
|
|
1316
|
+
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
1258
1317
|
}
|
|
1259
1318
|
|
|
1260
1319
|
/**
|
|
1261
|
-
* An evaluator for calculating osu!droid
|
|
1320
|
+
* An evaluator for calculating osu!droid visual skill.
|
|
1262
1321
|
*/
|
|
1263
1322
|
declare abstract class DroidVisualEvaluator {
|
|
1264
1323
|
/**
|
|
@@ -1273,156 +1332,95 @@ declare abstract class DroidVisualEvaluator {
|
|
|
1273
1332
|
* - and whether the Hidden mod is enabled.
|
|
1274
1333
|
*
|
|
1275
1334
|
* @param current The current object.
|
|
1276
|
-
* @param
|
|
1335
|
+
* @param mods The mods used.
|
|
1277
1336
|
* @param withSliders Whether to take slider difficulty into account.
|
|
1278
1337
|
*/
|
|
1279
|
-
static evaluateDifficultyOf(current:
|
|
1338
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, mods: ModMap, withSliders: boolean): number;
|
|
1280
1339
|
}
|
|
1281
1340
|
|
|
1282
1341
|
/**
|
|
1283
|
-
*
|
|
1284
|
-
* and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
|
|
1342
|
+
* Holds data that can be used to calculate osu!standard performance points.
|
|
1285
1343
|
*/
|
|
1286
|
-
|
|
1344
|
+
interface IOsuDifficultyAttributes extends IDifficultyAttributes {
|
|
1287
1345
|
/**
|
|
1288
|
-
* The
|
|
1346
|
+
* The perceived approach rate inclusive of rate-adjusting mods (DT/HT/etc).
|
|
1289
1347
|
*
|
|
1290
|
-
*
|
|
1291
|
-
*/
|
|
1292
|
-
static readonly defaultDifficultyMultiplier: number;
|
|
1293
|
-
/**
|
|
1294
|
-
* The final multiplier to be applied to the final difficulty value after all other calculations.
|
|
1295
|
-
*/
|
|
1296
|
-
protected readonly difficultyMultiplier: number;
|
|
1297
|
-
/**
|
|
1298
|
-
* The weight by which each strain value decays.
|
|
1348
|
+
* Rate-adjusting mods don't directly affect the approach rate difficulty value, but have a perceived effect as a result of adjusting audio timing.
|
|
1299
1349
|
*/
|
|
1300
|
-
|
|
1301
|
-
difficultyValue(): number;
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
/**
|
|
1305
|
-
* Holds data that can be used to calculate osu!standard performance points.
|
|
1306
|
-
*/
|
|
1307
|
-
interface OsuDifficultyAttributes extends DifficultyAttributes {
|
|
1350
|
+
approachRate: number;
|
|
1308
1351
|
/**
|
|
1309
1352
|
* The difficulty corresponding to the speed skill.
|
|
1310
1353
|
*/
|
|
1311
1354
|
speedDifficulty: number;
|
|
1355
|
+
/**
|
|
1356
|
+
* The amount of strains that are considered difficult with respect to the speed skill.
|
|
1357
|
+
*/
|
|
1358
|
+
speedDifficultStrainCount: number;
|
|
1312
1359
|
}
|
|
1313
1360
|
|
|
1314
1361
|
/**
|
|
1315
|
-
*
|
|
1362
|
+
* Represents an osu!standard hit object with difficulty calculation values.
|
|
1316
1363
|
*/
|
|
1317
|
-
declare class
|
|
1318
|
-
/**
|
|
1319
|
-
* The aim star rating of the beatmap.
|
|
1320
|
-
*/
|
|
1321
|
-
aim: number;
|
|
1322
|
-
/**
|
|
1323
|
-
* The speed star rating of the beatmap.
|
|
1324
|
-
*/
|
|
1325
|
-
speed: number;
|
|
1326
|
-
/**
|
|
1327
|
-
* The flashlight star rating of the beatmap.
|
|
1328
|
-
*/
|
|
1329
|
-
flashlight: number;
|
|
1330
|
-
readonly attributes: OsuDifficultyAttributes;
|
|
1331
|
-
protected readonly difficultyMultiplier: number;
|
|
1332
|
-
protected readonly mode: Modes;
|
|
1333
|
-
/**
|
|
1334
|
-
* Calculates the aim star rating of the beatmap and stores it in this instance.
|
|
1335
|
-
*/
|
|
1336
|
-
calculateAim(): void;
|
|
1337
|
-
/**
|
|
1338
|
-
* Calculates the speed star rating of the beatmap and stores it in this instance.
|
|
1339
|
-
*/
|
|
1340
|
-
calculateSpeed(): void;
|
|
1341
|
-
/**
|
|
1342
|
-
* Calculates the flashlight star rating of the beatmap and stores it in this instance.
|
|
1343
|
-
*/
|
|
1344
|
-
calculateFlashlight(): void;
|
|
1345
|
-
calculateTotal(): void;
|
|
1346
|
-
calculateAll(): void;
|
|
1347
|
-
toString(): string;
|
|
1348
|
-
protected preProcess(): void;
|
|
1349
|
-
protected createSkills(): OsuSkill[];
|
|
1350
|
-
/**
|
|
1351
|
-
* Called after aim skill calculation.
|
|
1352
|
-
*
|
|
1353
|
-
* @param aimSkill The aim skill that considers sliders.
|
|
1354
|
-
* @param aimSkillWithoutSliders The aim skill that doesn't consider sliders.
|
|
1355
|
-
*/
|
|
1356
|
-
private postCalculateAim;
|
|
1364
|
+
declare class OsuDifficultyHitObject extends DifficultyHitObject {
|
|
1357
1365
|
/**
|
|
1358
|
-
*
|
|
1359
|
-
*
|
|
1360
|
-
* @param speedSkill The speed skill.
|
|
1361
|
-
*/
|
|
1362
|
-
private postCalculateSpeed;
|
|
1363
|
-
/**
|
|
1364
|
-
* Calculates speed-related attributes.
|
|
1366
|
+
* The speed strain generated by the hitobject.
|
|
1365
1367
|
*/
|
|
1366
|
-
|
|
1368
|
+
speedStrain: number;
|
|
1367
1369
|
/**
|
|
1368
|
-
*
|
|
1369
|
-
*
|
|
1370
|
-
* @param flashlightSkill The flashlight skill.
|
|
1370
|
+
* The flashlight strain generated by this hitobject.
|
|
1371
1371
|
*/
|
|
1372
|
-
|
|
1372
|
+
flashlightStrain: number;
|
|
1373
|
+
private readonly radiusBuffThreshold;
|
|
1374
|
+
protected readonly mode = Modes.osu;
|
|
1375
|
+
protected get scalingFactor(): number;
|
|
1373
1376
|
}
|
|
1374
1377
|
|
|
1375
1378
|
/**
|
|
1376
|
-
*
|
|
1379
|
+
* Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
|
|
1380
|
+
* and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
|
|
1377
1381
|
*/
|
|
1378
|
-
declare class
|
|
1379
|
-
/**
|
|
1380
|
-
* The osu!droid difficulty calculator of the beatmap.
|
|
1381
|
-
*/
|
|
1382
|
-
readonly droid: DroidDifficultyCalculator;
|
|
1383
|
-
/**
|
|
1384
|
-
* The osu!standard difficulty calculator of the beatmap.
|
|
1385
|
-
*/
|
|
1386
|
-
readonly osu: OsuDifficultyCalculator;
|
|
1387
|
-
/**
|
|
1388
|
-
* Constructs this instance and calculates the given beatmap's osu!droid and osu!standard difficulty.
|
|
1389
|
-
*
|
|
1390
|
-
* @param beatmap The beatmap to calculate.
|
|
1391
|
-
* @param options Options for the difficulty calculation.
|
|
1392
|
-
*/
|
|
1393
|
-
constructor(beatmap: Beatmap, options?: DifficultyCalculationOptions);
|
|
1382
|
+
declare abstract class OsuSkill extends StrainSkill {
|
|
1394
1383
|
/**
|
|
1395
|
-
*
|
|
1384
|
+
* The weight by which each strain value decays.
|
|
1396
1385
|
*/
|
|
1397
|
-
|
|
1386
|
+
protected abstract readonly decayWeight: number;
|
|
1387
|
+
difficultyValue(): number;
|
|
1398
1388
|
}
|
|
1399
1389
|
|
|
1400
1390
|
/**
|
|
1401
1391
|
* Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
|
|
1402
1392
|
*/
|
|
1403
1393
|
declare class OsuAim extends OsuSkill {
|
|
1404
|
-
protected readonly
|
|
1405
|
-
protected readonly
|
|
1406
|
-
protected readonly
|
|
1407
|
-
protected readonly
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
private readonly
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1394
|
+
protected readonly strainDecayBase = 0.15;
|
|
1395
|
+
protected readonly reducedSectionCount = 10;
|
|
1396
|
+
protected readonly reducedSectionBaseline = 0.75;
|
|
1397
|
+
protected readonly decayWeight = 0.9;
|
|
1398
|
+
private currentAimStrain;
|
|
1399
|
+
private readonly skillMultiplier;
|
|
1400
|
+
private readonly sliderStrains;
|
|
1401
|
+
readonly withSliders: boolean;
|
|
1402
|
+
constructor(mods: ModMap, withSliders: boolean);
|
|
1403
|
+
/**
|
|
1404
|
+
* Obtains the amount of sliders that are considered difficult in terms of relative strain.
|
|
1405
|
+
*/
|
|
1406
|
+
countDifficultSliders(): number;
|
|
1407
|
+
protected strainValueAt(current: OsuDifficultyHitObject): number;
|
|
1408
|
+
protected calculateInitialStrain(time: number, current: OsuDifficultyHitObject): number;
|
|
1416
1409
|
/**
|
|
1417
1410
|
* @param current The hitobject to save to.
|
|
1418
1411
|
*/
|
|
1419
|
-
protected saveToHitObject(current:
|
|
1412
|
+
protected saveToHitObject(current: OsuDifficultyHitObject): void;
|
|
1420
1413
|
}
|
|
1421
1414
|
|
|
1422
1415
|
/**
|
|
1423
1416
|
* An evaluator for calculating osu!standard Aim skill.
|
|
1424
1417
|
*/
|
|
1425
|
-
declare abstract class OsuAimEvaluator
|
|
1418
|
+
declare abstract class OsuAimEvaluator {
|
|
1419
|
+
private static readonly wideAngleMultiplier;
|
|
1420
|
+
private static readonly acuteAngleMultiplier;
|
|
1421
|
+
private static readonly sliderMultiplier;
|
|
1422
|
+
private static readonly velocityChangeMultiplier;
|
|
1423
|
+
private static readonly wiggleMultiplier;
|
|
1426
1424
|
/**
|
|
1427
1425
|
* Evaluates the difficulty of aiming the current object, based on:
|
|
1428
1426
|
*
|
|
@@ -1434,31 +1432,64 @@ declare abstract class OsuAimEvaluator extends AimEvaluator {
|
|
|
1434
1432
|
* @param current The current object.
|
|
1435
1433
|
* @param withSliders Whether to take slider difficulty into account.
|
|
1436
1434
|
*/
|
|
1437
|
-
static evaluateDifficultyOf(current:
|
|
1435
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject, withSliders: boolean): number;
|
|
1436
|
+
private static calculateWideAngleBonus;
|
|
1437
|
+
private static calculateAcuteAngleBonus;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
/**
|
|
1441
|
+
* Holds data that can be used to calculate osu!standard performance points.
|
|
1442
|
+
*/
|
|
1443
|
+
declare class OsuDifficultyAttributes extends DifficultyAttributes implements IOsuDifficultyAttributes {
|
|
1444
|
+
approachRate: number;
|
|
1445
|
+
speedDifficulty: number;
|
|
1446
|
+
speedDifficultStrainCount: number;
|
|
1447
|
+
constructor(cacheableAttributes?: CacheableDifficultyAttributes<IOsuDifficultyAttributes>);
|
|
1448
|
+
toString(): string;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
/**
|
|
1452
|
+
* A difficulty calculator for osu!standard gamemode.
|
|
1453
|
+
*/
|
|
1454
|
+
declare class OsuDifficultyCalculator extends DifficultyCalculator<OsuPlayableBeatmap, OsuDifficultyHitObject, OsuDifficultyAttributes> {
|
|
1455
|
+
protected readonly difficultyMultiplier = 0.0675;
|
|
1456
|
+
constructor();
|
|
1457
|
+
retainDifficultyAdjustmentMods(mods: Mod[]): Mod[];
|
|
1458
|
+
protected createDifficultyAttributes(beatmap: OsuPlayableBeatmap, skills: Skill[]): OsuDifficultyAttributes;
|
|
1459
|
+
protected createPlayableBeatmap(beatmap: Beatmap, mods?: ModMap): OsuPlayableBeatmap;
|
|
1460
|
+
protected createDifficultyHitObjects(beatmap: OsuPlayableBeatmap): OsuDifficultyHitObject[];
|
|
1461
|
+
protected createSkills(beatmap: OsuPlayableBeatmap): OsuSkill[];
|
|
1462
|
+
protected createStrainPeakSkills(beatmap: OsuPlayableBeatmap): StrainSkill[];
|
|
1463
|
+
private populateAimAttributes;
|
|
1464
|
+
private populateSpeedAttributes;
|
|
1465
|
+
private populateFlashlightAttributes;
|
|
1438
1466
|
}
|
|
1439
1467
|
|
|
1440
1468
|
/**
|
|
1441
1469
|
* Represents the skill required to memorize and hit every object in a beatmap with the Flashlight mod enabled.
|
|
1442
1470
|
*/
|
|
1443
1471
|
declare class OsuFlashlight extends OsuSkill {
|
|
1444
|
-
protected readonly
|
|
1445
|
-
protected readonly
|
|
1446
|
-
protected readonly
|
|
1447
|
-
protected readonly
|
|
1448
|
-
|
|
1449
|
-
private readonly
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
protected strainValueAt(current: DifficultyHitObject): number;
|
|
1455
|
-
protected saveToHitObject(current: DifficultyHitObject): void;
|
|
1472
|
+
protected readonly strainDecayBase = 0.15;
|
|
1473
|
+
protected readonly reducedSectionCount = 0;
|
|
1474
|
+
protected readonly reducedSectionBaseline = 1;
|
|
1475
|
+
protected readonly decayWeight = 1;
|
|
1476
|
+
private currentFlashlightStrain;
|
|
1477
|
+
private readonly skillMultiplier;
|
|
1478
|
+
difficultyValue(): number;
|
|
1479
|
+
protected strainValueAt(current: OsuDifficultyHitObject): number;
|
|
1480
|
+
protected calculateInitialStrain(time: number, current: OsuDifficultyHitObject): number;
|
|
1481
|
+
protected saveToHitObject(current: OsuDifficultyHitObject): void;
|
|
1456
1482
|
}
|
|
1457
1483
|
|
|
1458
1484
|
/**
|
|
1459
1485
|
* An evaluator for calculating osu!standard Flashlight skill.
|
|
1460
1486
|
*/
|
|
1461
|
-
declare abstract class OsuFlashlightEvaluator
|
|
1487
|
+
declare abstract class OsuFlashlightEvaluator {
|
|
1488
|
+
private static readonly maxOpacityBonus;
|
|
1489
|
+
private static readonly hiddenBonus;
|
|
1490
|
+
private static readonly minVelocity;
|
|
1491
|
+
private static readonly sliderMultiplier;
|
|
1492
|
+
private static readonly minAngleMultiplier;
|
|
1462
1493
|
/**
|
|
1463
1494
|
* Evaluates the difficulty of memorizing and hitting the current object, based on:
|
|
1464
1495
|
*
|
|
@@ -1469,15 +1500,15 @@ declare abstract class OsuFlashlightEvaluator extends FlashlightEvaluator {
|
|
|
1469
1500
|
* - and whether Hidden mod is enabled.
|
|
1470
1501
|
*
|
|
1471
1502
|
* @param current The current object.
|
|
1472
|
-
* @param
|
|
1503
|
+
* @param mods The mods used.
|
|
1473
1504
|
*/
|
|
1474
|
-
static evaluateDifficultyOf(current:
|
|
1505
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject, mods: ModMap): number;
|
|
1475
1506
|
}
|
|
1476
1507
|
|
|
1477
1508
|
/**
|
|
1478
1509
|
* A performance points calculator that calculates performance points for osu!standard gamemode.
|
|
1479
1510
|
*/
|
|
1480
|
-
declare class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
1511
|
+
declare class OsuPerformanceCalculator extends PerformanceCalculator<IOsuDifficultyAttributes> {
|
|
1481
1512
|
/**
|
|
1482
1513
|
* The aim performance value.
|
|
1483
1514
|
*/
|
|
@@ -1494,15 +1525,13 @@ declare class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
1494
1525
|
* The flashlight performance value.
|
|
1495
1526
|
*/
|
|
1496
1527
|
flashlight: number;
|
|
1497
|
-
readonly difficultyAttributes: OsuDifficultyAttributes;
|
|
1498
1528
|
protected finalMultiplier: number;
|
|
1499
|
-
protected readonly mode
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
*/
|
|
1503
|
-
constructor(difficultyAttributes: OsuDifficultyAttributes);
|
|
1529
|
+
protected readonly mode = Modes.osu;
|
|
1530
|
+
private comboPenalty;
|
|
1531
|
+
private speedDeviation;
|
|
1504
1532
|
protected calculateValues(): void;
|
|
1505
|
-
protected calculateTotalValue():
|
|
1533
|
+
protected calculateTotalValue(): number;
|
|
1534
|
+
protected handleOptions(options?: PerformanceCalculationOptions): void;
|
|
1506
1535
|
/**
|
|
1507
1536
|
* Calculates the aim performance value of the beatmap.
|
|
1508
1537
|
*/
|
|
@@ -1519,55 +1548,86 @@ declare class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
1519
1548
|
* Calculates the flashlight performance value of the beatmap.
|
|
1520
1549
|
*/
|
|
1521
1550
|
private calculateFlashlightValue;
|
|
1551
|
+
/**
|
|
1552
|
+
* Estimates a player's deviation on speed notes using {@link calculateDeviation}, assuming worst-case.
|
|
1553
|
+
*
|
|
1554
|
+
* Treats all speed notes as hit circles.
|
|
1555
|
+
*/
|
|
1556
|
+
private calculateSpeedDeviation;
|
|
1557
|
+
/**
|
|
1558
|
+
* Estimates the player's tap deviation based on the OD, given number of greats, oks, mehs and misses,
|
|
1559
|
+
* assuming the player's mean hit error is 0. The estimation is consistent in that two SS scores on the
|
|
1560
|
+
* same map with the same settings will always return the same deviation.
|
|
1561
|
+
*
|
|
1562
|
+
* Misses are ignored because they are usually due to misaiming.
|
|
1563
|
+
*
|
|
1564
|
+
* Greats and oks are assumed to follow a normal distribution, whereas mehs are assumed to follow a uniform distribution.
|
|
1565
|
+
*/
|
|
1566
|
+
private calculateDeviation;
|
|
1567
|
+
/**
|
|
1568
|
+
* Calculates multiplier for speed to account for improper tapping based on the deviation and speed difficulty.
|
|
1569
|
+
*
|
|
1570
|
+
* [Graph](https://www.desmos.com/calculator/dmogdhzofn)
|
|
1571
|
+
*/
|
|
1572
|
+
private calculateSpeedHighDeviationNerf;
|
|
1522
1573
|
toString(): string;
|
|
1523
1574
|
}
|
|
1524
1575
|
|
|
1525
1576
|
/**
|
|
1526
1577
|
* An evaluator for calculating osu!standard Rhythm skill.
|
|
1527
1578
|
*/
|
|
1528
|
-
declare abstract class OsuRhythmEvaluator
|
|
1579
|
+
declare abstract class OsuRhythmEvaluator {
|
|
1580
|
+
private static readonly historyTimeMax;
|
|
1581
|
+
private static readonly historyObjectsMax;
|
|
1582
|
+
private static readonly rhythmOverallMultiplier;
|
|
1583
|
+
private static readonly rhythmRatioMultiplier;
|
|
1529
1584
|
/**
|
|
1530
1585
|
* Calculates a rhythm multiplier for the difficulty of the tap associated
|
|
1531
1586
|
* with historic data of the current object.
|
|
1532
1587
|
*
|
|
1533
1588
|
* @param current The current object.
|
|
1534
|
-
* @param greatWindow The great hit window of the current object.
|
|
1535
1589
|
*/
|
|
1536
|
-
static evaluateDifficultyOf(current:
|
|
1590
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject): number;
|
|
1537
1591
|
}
|
|
1538
1592
|
|
|
1539
1593
|
/**
|
|
1540
1594
|
* Represents the skill required to press keys or tap with regards to keeping up with the speed at which objects need to be hit.
|
|
1541
1595
|
*/
|
|
1542
1596
|
declare class OsuSpeed extends OsuSkill {
|
|
1543
|
-
protected readonly
|
|
1544
|
-
protected readonly
|
|
1545
|
-
protected readonly
|
|
1546
|
-
protected readonly
|
|
1547
|
-
protected readonly difficultyMultiplier: number;
|
|
1548
|
-
protected readonly decayWeight: number;
|
|
1597
|
+
protected readonly strainDecayBase = 0.3;
|
|
1598
|
+
protected readonly reducedSectionCount = 5;
|
|
1599
|
+
protected readonly reducedSectionBaseline = 0.75;
|
|
1600
|
+
protected readonly decayWeight = 0.9;
|
|
1549
1601
|
private currentSpeedStrain;
|
|
1550
1602
|
private currentRhythm;
|
|
1551
|
-
private readonly
|
|
1552
|
-
|
|
1603
|
+
private readonly skillMultiplier;
|
|
1604
|
+
/**
|
|
1605
|
+
* The amount of notes that are relevant to the difficulty.
|
|
1606
|
+
*/
|
|
1607
|
+
relevantNoteCount(): number;
|
|
1553
1608
|
/**
|
|
1554
1609
|
* @param current The hitobject to calculate.
|
|
1555
1610
|
*/
|
|
1556
|
-
protected strainValueAt(current:
|
|
1611
|
+
protected strainValueAt(current: OsuDifficultyHitObject): number;
|
|
1612
|
+
protected calculateInitialStrain(time: number, current: OsuDifficultyHitObject): number;
|
|
1557
1613
|
/**
|
|
1558
1614
|
* @param current The hitobject to save to.
|
|
1559
1615
|
*/
|
|
1560
|
-
protected saveToHitObject(current:
|
|
1616
|
+
protected saveToHitObject(current: OsuDifficultyHitObject): void;
|
|
1561
1617
|
}
|
|
1562
1618
|
|
|
1563
1619
|
/**
|
|
1564
1620
|
* An evaluator for calculating osu!standard speed skill.
|
|
1565
1621
|
*/
|
|
1566
|
-
declare abstract class OsuSpeedEvaluator
|
|
1622
|
+
declare abstract class OsuSpeedEvaluator {
|
|
1567
1623
|
/**
|
|
1568
1624
|
* Spacing threshold for a single hitobject spacing.
|
|
1625
|
+
*
|
|
1626
|
+
* About 1.25 circles distance between hitobject centers.
|
|
1569
1627
|
*/
|
|
1570
1628
|
private static readonly SINGLE_SPACING_THRESHOLD;
|
|
1629
|
+
private static readonly minSpeedBonus;
|
|
1630
|
+
private static readonly DISTANCE_MULTIPLIER;
|
|
1571
1631
|
/**
|
|
1572
1632
|
* Evaluates the difficulty of tapping the current object, based on:
|
|
1573
1633
|
*
|
|
@@ -1576,9 +1636,9 @@ declare abstract class OsuSpeedEvaluator extends SpeedEvaluator {
|
|
|
1576
1636
|
* - and how easily they can be cheesed.
|
|
1577
1637
|
*
|
|
1578
1638
|
* @param current The current object.
|
|
1579
|
-
* @param
|
|
1639
|
+
* @param mods The mods applied.
|
|
1580
1640
|
*/
|
|
1581
|
-
static evaluateDifficultyOf(current:
|
|
1641
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject, mods: ModMap): number;
|
|
1582
1642
|
}
|
|
1583
1643
|
|
|
1584
|
-
export {
|
|
1644
|
+
export { type CacheableDifficultyAttributes, type DifficultSlider, DifficultyAttributes, DifficultyCalculator, DifficultyHitObject, DroidAim, DroidAimEvaluator, DroidDifficultyAttributes, DroidDifficultyCalculator, DroidDifficultyHitObject, DroidFlashlight, DroidFlashlightEvaluator, DroidPerformanceCalculator, DroidRhythm, DroidRhythmEvaluator, DroidTap, DroidTapEvaluator, DroidVisual, DroidVisualEvaluator, ExtendedDroidDifficultyAttributes, type HighStrainSection, type IDifficultyAttributes, type IDroidDifficultyAttributes, type IExtendedDroidDifficultyAttributes, type IOsuDifficultyAttributes, OsuAim, OsuAimEvaluator, OsuDifficultyAttributes, OsuDifficultyCalculator, OsuDifficultyHitObject, OsuFlashlight, OsuFlashlightEvaluator, OsuPerformanceCalculator, OsuRhythmEvaluator, OsuSpeed, OsuSpeedEvaluator, type PerformanceCalculationOptions, PerformanceCalculator, type StrainPeaks };
|