@rian8337/osu-rebalance-difficulty-calculator 4.0.0-beta.26 → 4.0.0-beta.28

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 CHANGED
@@ -85,15 +85,14 @@ class DifficultyCalculator {
85
85
  * @returns The current instance.
86
86
  */
87
87
  calculate(options) {
88
- var _a, _b;
88
+ var _a;
89
89
  this.mods = (_a = options === null || options === void 0 ? void 0 : options.mods) !== null && _a !== void 0 ? _a : [];
90
90
  const playableBeatmap = this.beatmap.createPlayableBeatmap({
91
91
  mode: this.mode,
92
92
  mods: this.mods,
93
93
  customSpeedMultiplier: options === null || options === void 0 ? void 0 : options.customSpeedMultiplier,
94
94
  });
95
- const clockRate = osuBase.ModUtil.calculateRateWithMods(this.mods) *
96
- ((_b = options === null || options === void 0 ? void 0 : options.customSpeedMultiplier) !== null && _b !== void 0 ? _b : 1);
95
+ const clockRate = this.calculateClockRate(options);
97
96
  this.populateDifficultyAttributes(playableBeatmap, clockRate);
98
97
  this._objects = this.generateDifficultyHitObjects(playableBeatmap, clockRate);
99
98
  this.calculateAll();
@@ -112,6 +111,17 @@ class DifficultyCalculator {
112
111
  }
113
112
  }
114
113
  }
114
+ /**
115
+ * Obtains the clock rate of the beatmap.
116
+ *
117
+ * @param options The options to obtain the clock rate with.
118
+ * @returns The clock rate of the beatmap.
119
+ */
120
+ calculateClockRate(options) {
121
+ var _a, _b;
122
+ return (osuBase.ModUtil.calculateRateWithMods((_a = options === null || options === void 0 ? void 0 : options.mods) !== null && _a !== void 0 ? _a : []) *
123
+ ((_b = options === null || options === void 0 ? void 0 : options.customSpeedMultiplier) !== null && _b !== void 0 ? _b : 1));
124
+ }
115
125
  /**
116
126
  * Populates the stored difficulty attributes with necessary data.
117
127
  *
@@ -1783,6 +1793,10 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
1783
1793
  get cacheableAttributes() {
1784
1794
  return Object.assign(Object.assign({}, this.attributes), { mods: osuBase.ModUtil.modsToOsuString(this.attributes.mods) });
1785
1795
  }
1796
+ // Override to use DroidDifficultyCalculationOptions
1797
+ calculate(options) {
1798
+ return super.calculate(options);
1799
+ }
1786
1800
  /**
1787
1801
  * Calculates the aim star rating of the beatmap and stores it in this instance.
1788
1802
  */
@@ -1919,6 +1933,10 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
1919
1933
  new DroidVisual(this.mods, false),
1920
1934
  ];
1921
1935
  }
1936
+ calculateClockRate(options) {
1937
+ var _a, _b;
1938
+ return (osuBase.ModUtil.calculateRateWithMods((_a = options === null || options === void 0 ? void 0 : options.mods) !== null && _a !== void 0 ? _a : [], options === null || options === void 0 ? void 0 : options.oldStatistics) * ((_b = options === null || options === void 0 ? void 0 : options.customSpeedMultiplier) !== null && _b !== void 0 ? _b : 1));
1939
+ }
1922
1940
  /**
1923
1941
  * Called after aim skill calculation.
1924
1942
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-rebalance-difficulty-calculator",
3
- "version": "4.0.0-beta.26",
3
+ "version": "4.0.0-beta.28",
4
4
  "description": "A module for calculating osu!standard beatmap difficulty and performance value with respect to the latest osu!lazer difficulty and performance algorithm.",
5
5
  "keywords": [
6
6
  "osu",
@@ -33,10 +33,10 @@
33
33
  "url": "https://github.com/Rian8337/osu-droid-module/issues"
34
34
  },
35
35
  "dependencies": {
36
- "@rian8337/osu-base": "^4.0.0-beta.26"
36
+ "@rian8337/osu-base": "^4.0.0-beta.28"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "1c353ee9455d80a5ca8358762f107899d64f1d5e"
41
+ "gitHead": "c442670959e9f766fab6d2e6238d7bb0e40ef869"
42
42
  }
@@ -402,6 +402,13 @@ declare abstract class DifficultyCalculator<THitObject extends DifficultyHitObje
402
402
  * Creates skills to be calculated.
403
403
  */
404
404
  protected abstract createSkills(): Skill[];
405
+ /**
406
+ * Obtains the clock rate of the beatmap.
407
+ *
408
+ * @param options The options to obtain the clock rate with.
409
+ * @returns The clock rate of the beatmap.
410
+ */
411
+ protected calculateClockRate(options?: DifficultyCalculationOptions): number;
405
412
  /**
406
413
  * Populates the stored difficulty attributes with necessary data.
407
414
  *
@@ -841,6 +848,7 @@ declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidDiffic
841
848
  get cacheableAttributes(): CacheableDifficultyAttributes<DroidDifficultyAttributes>;
842
849
  protected readonly difficultyMultiplier = 0.18;
843
850
  protected readonly mode = Modes.droid;
851
+ calculate(options?: DroidDifficultyCalculationOptions): this;
844
852
  /**
845
853
  * Calculates the aim star rating of the beatmap and stores it in this instance.
846
854
  */
@@ -866,6 +874,7 @@ declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidDiffic
866
874
  toString(): string;
867
875
  protected generateDifficultyHitObjects(beatmap: Beatmap, clockRate: number): DroidDifficultyHitObject[];
868
876
  protected createSkills(): DroidSkill[];
877
+ protected calculateClockRate(options?: DroidDifficultyCalculationOptions): number;
869
878
  /**
870
879
  * Called after aim skill calculation.
871
880
  *