@rian8337/osu-difficulty-calculator 4.0.0-beta.0 → 4.0.0-beta.10

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.
@@ -1,4 +1,4 @@
1
- import { MapStats, Mod, PlaceableHitObject, Modes, Beatmap, HitObject, Accuracy } from '@rian8337/osu-base';
1
+ import { MapStats, Mod, PlaceableHitObject, Beatmap, Modes, HitObject, Accuracy } from '@rian8337/osu-base';
2
2
 
3
3
  /**
4
4
  * An evaluator for calculating aim skill.
@@ -68,6 +68,10 @@ interface DifficultyAttributes {
68
68
  * A value closer to 0 indicates most of aim difficulty is contributed by sliders.
69
69
  */
70
70
  sliderFactor: number;
71
+ /**
72
+ * The overall clock rate that was applied to the beatmap.
73
+ */
74
+ clockRate: number;
71
75
  /**
72
76
  * The perceived approach rate inclusive of rate-adjusting mods (DT/HT/etc).
73
77
  *
@@ -276,10 +280,9 @@ declare class DifficultyHitObject {
276
280
  *
277
281
  * @param time The time to calculate the hitobject's opacity at.
278
282
  * @param isHidden Whether Hidden mod is used.
279
- * @param mode The gamemode to calculate the opacity for.
280
283
  * @returns The opacity of the hitobject at the given time.
281
284
  */
282
- opacityAt(time: number, isHidden: boolean, mode: Modes): number;
285
+ opacityAt(time: number, isHidden: boolean): number;
283
286
  /**
284
287
  * Determines whether this hitobject is considered overlapping with the hitobject before it.
285
288
  *
@@ -353,7 +356,6 @@ declare abstract class StrainSkill extends Skill {
353
356
  protected abstract readonly strainDecayBase: number;
354
357
  private readonly sectionLength;
355
358
  private currentSectionEnd;
356
- private isFirstObject;
357
359
  /**
358
360
  * Calculates the strain value of a hitobject and stores the value in it. This value is affected by previously processed objects.
359
361
  *
@@ -441,7 +443,6 @@ declare abstract class DifficultyCalculator {
441
443
  * Holds data that can be used to calculate performance points.
442
444
  */
443
445
  abstract readonly attributes: DifficultyAttributes;
444
- protected readonly sectionLength: number;
445
446
  protected abstract readonly difficultyMultiplier: number;
446
447
  protected abstract readonly mode: Modes;
447
448
  /**
@@ -470,6 +471,10 @@ declare abstract class DifficultyCalculator {
470
471
  * Generates difficulty hitobjects for this calculator.
471
472
  */
472
473
  generateDifficultyHitObjects(): void;
474
+ /**
475
+ * Performs some pre-processing before proceeding with difficulty calculation.
476
+ */
477
+ protected preProcess(): void;
473
478
  /**
474
479
  * Calculates the skills provided.
475
480
  *
@@ -664,6 +669,26 @@ interface DroidDifficultyAttributes extends DifficultyAttributes {
664
669
  * The difficulty corresponding to the visual skill.
665
670
  */
666
671
  visualDifficulty: number;
672
+ /**
673
+ * The amount of strains that are considered difficult with respect to the aim skill.
674
+ */
675
+ aimDifficultStrainCount: number;
676
+ /**
677
+ * The amount of strains that are considered difficult with respect to the tap skill.
678
+ */
679
+ tapDifficultStrainCount: number;
680
+ /**
681
+ * The amount of strains that are considered difficult with respect to the flashlight skill.
682
+ */
683
+ flashlightDifficultStrainCount: number;
684
+ /**
685
+ * The amount of strains that are considered difficult with respect to the visual skill.
686
+ */
687
+ visualDifficultStrainCount: number;
688
+ /**
689
+ * The average delta time of speed objects.
690
+ */
691
+ averageSpeedDeltaTime: number;
667
692
  }
668
693
 
669
694
  /**
@@ -776,13 +801,8 @@ declare class DroidDifficultyCalculator extends DifficultyCalculator {
776
801
  calculateVisual(): void;
777
802
  calculateTotal(): void;
778
803
  calculateAll(): void;
779
- /**
780
- * Returns a string representative of the class.
781
- */
782
804
  toString(): string;
783
- /**
784
- * Creates skills to be calculated.
785
- */
805
+ protected preProcess(): void;
786
806
  protected createSkills(): DroidSkill[];
787
807
  /**
788
808
  * Called after aim skill calculation.
@@ -852,6 +872,7 @@ declare class DroidFlashlight extends DroidSkill {
852
872
  */
853
873
  protected strainValueAt(current: DifficultyHitObject): number;
854
874
  protected saveToHitObject(current: DifficultyHitObject): void;
875
+ difficultyValue(): number;
855
876
  }
856
877
 
857
878
  /**
@@ -1085,7 +1106,7 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator {
1085
1106
  *
1086
1107
  * The aim and total performance value will be recalculated afterwards.
1087
1108
  *
1088
- * @param value The slider cheese penalty value. Must be between than 0 (exclusive) and 1 (inclusive).
1109
+ * @param value The slider cheese penalty value. Must be between than 0 and 1.
1089
1110
  */
1090
1111
  applyAimSliderCheesePenalty(value: number): void;
1091
1112
  /**
@@ -1093,7 +1114,7 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator {
1093
1114
  *
1094
1115
  * The flashlight and total performance value will be recalculated afterwards.
1095
1116
  *
1096
- * @param value The slider cheese penalty value. Must be between 0 (exclusive) and 1 (inclusive).
1117
+ * @param value The slider cheese penalty value. Must be between 0 and 1.
1097
1118
  */
1098
1119
  applyFlashlightSliderCheesePenalty(value: number): void;
1099
1120
  /**
@@ -1101,7 +1122,7 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator {
1101
1122
  *
1102
1123
  * The visual and total performance value will be recalculated afterwards.
1103
1124
  *
1104
- * @param value The slider cheese penalty value. Must be between 0 (exclusive) and 1 (inclusive).
1125
+ * @param value The slider cheese penalty value. Must be between 0 and 1.
1105
1126
  */
1106
1127
  applyVisualSliderCheesePenalty(value: number): void;
1107
1128
  protected calculateValues(): void;
@@ -1127,6 +1148,14 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator {
1127
1148
  * Calculates the visual performance value of the beatmap.
1128
1149
  */
1129
1150
  private calculateVisualValue;
1151
+ /**
1152
+ * Calculates miss penalty.
1153
+ *
1154
+ * Miss penalty assumes that a player will miss on the hardest parts of a map,
1155
+ * so we use the amount of relatively difficult sections to adjust miss penalty
1156
+ * to make it more punishing on maps with lower amount of hard sections.
1157
+ */
1158
+ private calculateMissPenalty;
1130
1159
  /**
1131
1160
  * Estimates the player's tap deviation based on the OD, number of circles and sliders,
1132
1161
  * and number of 300s, 100s, 50s, and misses, assuming the player's mean hit error is 0.
@@ -1174,6 +1203,7 @@ declare class DroidRhythm extends DroidSkill {
1174
1203
  * This class should be considered an "evaluating" class and not persisted.
1175
1204
  */
1176
1205
  declare abstract class RhythmEvaluator {
1206
+ protected static readonly rhythmMultiplier: number;
1177
1207
  protected static readonly historyTimeMax: number;
1178
1208
  }
1179
1209
 
@@ -1189,12 +1219,6 @@ declare abstract class DroidRhythmEvaluator extends RhythmEvaluator {
1189
1219
  * @param greatWindow The great hit window of the current object.
1190
1220
  */
1191
1221
  static evaluateDifficultyOf(current: DifficultyHitObject, greatWindow: number): number;
1192
- /**
1193
- * Calculates the rhythm multiplier of a given hit window.
1194
- *
1195
- * @param greatWindow The great hit window.
1196
- */
1197
- private static calculateRhythmMultiplier;
1198
1222
  }
1199
1223
 
1200
1224
  /**
@@ -1257,7 +1281,7 @@ declare class DroidVisual extends DroidSkill {
1257
1281
  protected readonly skillMultiplier: number;
1258
1282
  protected readonly strainDecayBase: number;
1259
1283
  private readonly isHidden;
1260
- private readonly withSliders;
1284
+ private readonly withsliders;
1261
1285
  constructor(mods: Mod[], withSliders: boolean);
1262
1286
  protected strainValueAt(current: DifficultyHitObject): number;
1263
1287
  protected saveToHitObject(current: DifficultyHitObject): void;
@@ -1350,13 +1374,8 @@ declare class OsuDifficultyCalculator extends DifficultyCalculator {
1350
1374
  calculateFlashlight(): void;
1351
1375
  calculateTotal(): void;
1352
1376
  calculateAll(): void;
1353
- /**
1354
- * Returns a string representative of the class.
1355
- */
1356
1377
  toString(): string;
1357
- /**
1358
- * Creates skills to be calculated.
1359
- */
1378
+ protected preProcess(): void;
1360
1379
  protected createSkills(): OsuSkill[];
1361
1380
  /**
1362
1381
  * Called after aim skill calculation.
@@ -1537,7 +1556,6 @@ declare class OsuPerformanceCalculator extends PerformanceCalculator {
1537
1556
  * An evaluator for calculating osu!standard Rhythm skill.
1538
1557
  */
1539
1558
  declare abstract class OsuRhythmEvaluator extends RhythmEvaluator {
1540
- private static readonly rhythmMultiplier;
1541
1559
  /**
1542
1560
  * Calculates a rhythm multiplier for the difficulty of the tap associated
1543
1561
  * with historic data of the current object.
@@ -1560,7 +1578,6 @@ declare class OsuSpeed extends OsuSkill {
1560
1578
  protected readonly decayWeight: number;
1561
1579
  private currentSpeedStrain;
1562
1580
  private currentRhythm;
1563
- private readonly minSpeedBonus;
1564
1581
  private readonly greatWindow;
1565
1582
  constructor(mods: Mod[], greatWindow: number);
1566
1583
  /**