@rian8337/osu-rebalance-difficulty-calculator 4.0.0-beta.20 → 4.0.0-beta.22

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
@@ -367,6 +367,15 @@ class DifficultyHitObject {
367
367
  if (slider.lazyEndPosition) {
368
368
  return;
369
369
  }
370
+ if (this.mode === osuBase.Modes.droid) {
371
+ // Temporary lazy end position until a real result can be derived.
372
+ slider.lazyEndPosition = slider.getStackedPosition(this.mode);
373
+ // Stop here if the slider has too short duration, allowing the player to essentially
374
+ // complete the slider without movement, making travel distance and time irrelevant.
375
+ if (osuBase.Precision.almostEqualsNumber(slider.startTime, slider.endTime)) {
376
+ return;
377
+ }
378
+ }
370
379
  // Not using slider.endTime due to legacy last tick offset.
371
380
  slider.lazyTravelTime =
372
381
  slider.nestedHitObjects.at(-1).startTime - slider.startTime;
@@ -1755,10 +1764,10 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
1755
1764
  this.visual.toFixed(2) +
1756
1765
  " visual)");
1757
1766
  }
1758
- generateDifficultyHitObjects(beatmap) {
1767
+ generateDifficultyHitObjects(convertedBeatmap) {
1759
1768
  var _a, _b;
1760
1769
  const difficultyObjects = [];
1761
- const { objects } = beatmap.hitObjects;
1770
+ const { objects } = convertedBeatmap.hitObjects;
1762
1771
  const difficultyAdjustMod = this.mods.find((m) => m instanceof osuBase.ModDifficultyAdjust);
1763
1772
  for (let i = 0; i < objects.length; ++i) {
1764
1773
  const difficultyObject = new DroidDifficultyHitObject(objects[i], (_a = objects[i - 1]) !== null && _a !== void 0 ? _a : null, (_b = objects[i - 2]) !== null && _b !== void 0 ? _b : null, difficultyObjects, this.difficultyStatistics.overallSpeedMultiplier, (difficultyAdjustMod === null || difficultyAdjustMod === void 0 ? void 0 : difficultyAdjustMod.ar) !== undefined);
@@ -3362,10 +3371,10 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
3362
3371
  this.flashlight.toFixed(2) +
3363
3372
  " flashlight)");
3364
3373
  }
3365
- generateDifficultyHitObjects(beatmap) {
3374
+ generateDifficultyHitObjects(convertedBeatmap) {
3366
3375
  var _a, _b;
3367
3376
  const difficultyObjects = [];
3368
- const { objects } = beatmap.hitObjects;
3377
+ const { objects } = convertedBeatmap.hitObjects;
3369
3378
  for (let i = 0; i < objects.length; ++i) {
3370
3379
  const difficultyObject = new OsuDifficultyHitObject(objects[i], (_a = objects[i - 1]) !== null && _a !== void 0 ? _a : null, (_b = objects[i - 2]) !== null && _b !== void 0 ? _b : null, difficultyObjects, this.difficultyStatistics.overallSpeedMultiplier);
3371
3380
  difficultyObject.computeProperties(this.difficultyStatistics.overallSpeedMultiplier, objects);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-rebalance-difficulty-calculator",
3
- "version": "4.0.0-beta.20",
3
+ "version": "4.0.0-beta.22",
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",
@@ -38,5 +38,5 @@
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "8e6d7449a4a949f0158f10b9130378e7368bd8aa"
41
+ "gitHead": "d8b62a07a4f862cf83bf106a46f67c6c6562c545"
42
42
  }
@@ -363,9 +363,9 @@ declare abstract class DifficultyCalculator<THitObject extends DifficultyHitObje
363
363
  /**
364
364
  * Generates difficulty hitobjects for this calculator.
365
365
  *
366
- * @param beatmap The beatmap to generate difficulty hitobjects from.
366
+ * @param convertedBeatmap The beatmap to generate difficulty hitobjects from.
367
367
  */
368
- protected abstract generateDifficultyHitObjects(beatmap: Beatmap): THitObject[];
368
+ protected abstract generateDifficultyHitObjects(convertedBeatmap: Beatmap): THitObject[];
369
369
  /**
370
370
  * Computes the difficulty statistics of the original beatmap with respect to the used options.
371
371
  *
@@ -840,7 +840,7 @@ declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidDiffic
840
840
  calculateTotal(): void;
841
841
  calculateAll(): void;
842
842
  toString(): string;
843
- protected generateDifficultyHitObjects(beatmap: Beatmap): DroidDifficultyHitObject[];
843
+ protected generateDifficultyHitObjects(convertedBeatmap: Beatmap): DroidDifficultyHitObject[];
844
844
  protected computeDifficultyStatistics(options?: DroidDifficultyCalculationOptions): DifficultyStatisticsCalculatorResult<number, number, number, number>;
845
845
  protected createSkills(): DroidSkill[];
846
846
  /**
@@ -1515,7 +1515,7 @@ declare class OsuDifficultyCalculator extends DifficultyCalculator<OsuDifficulty
1515
1515
  calculateTotal(): void;
1516
1516
  calculateAll(): void;
1517
1517
  toString(): string;
1518
- protected generateDifficultyHitObjects(beatmap: Beatmap): OsuDifficultyHitObject[];
1518
+ protected generateDifficultyHitObjects(convertedBeatmap: Beatmap): OsuDifficultyHitObject[];
1519
1519
  protected computeDifficultyStatistics(options?: DifficultyCalculationOptions): DifficultyStatisticsCalculatorResult<number, number, number, number>;
1520
1520
  protected createSkills(): OsuSkill[];
1521
1521
  /**