@rian8337/osu-difficulty-calculator 4.0.0-beta.100 → 4.0.0-beta.102

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -2099,7 +2099,7 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
2099
2099
  }
2100
2100
  handleOptions(options) {
2101
2101
  var _a, _b;
2102
- this._tapPenalty = osuBase.MathUtils.clamp((_a = options === null || options === void 0 ? void 0 : options.tapPenalty) !== null && _a !== void 0 ? _a : 1, 0, 1);
2102
+ this._tapPenalty = Math.max((_a = options === null || options === void 0 ? void 0 : options.tapPenalty) !== null && _a !== void 0 ? _a : 1, 1);
2103
2103
  this._sliderCheesePenalty = osuBase.MathUtils.clamp((_b = options === null || options === void 0 ? void 0 : options.sliderCheesePenalty) !== null && _b !== void 0 ? _b : 1, 0, 1);
2104
2104
  this._totalScore =
2105
2105
  (options === null || options === void 0 ? void 0 : options.totalScore) !== undefined
@@ -3461,14 +3461,12 @@ class DroidScoreUtils {
3461
3461
  // For scores that were set in a higher refresh rate, this estimation will underestimate
3462
3462
  // the actual maximum spinner bonus.
3463
3463
  const maximumRotationsPerSecond = (Math.PI / 2) * 120;
3464
- // Taken from https://github.com/osudroid/osu-droid/blob/45ae4d66ce275382c5de037245ceca8704b3ae75/src/ru/nsu/ccfit/zuev/osu/game/GameScene.java#L1640.
3465
- const minimumRotationsPerSecond = 2 + (2 * playableBeatmap.difficulty.od) / 10;
3466
3464
  for (const obj of hitObjects.objects) {
3467
3465
  if (!(obj instanceof osuBase.Spinner)) {
3468
3466
  continue;
3469
3467
  }
3470
3468
  const secondsDuration = obj.duration / 1000;
3471
- const spinsRequiredBeforeBonus = secondsDuration * minimumRotationsPerSecond;
3469
+ const spinsRequiredBeforeBonus = obj.spinsRequired;
3472
3470
  const totalPossibleSpins = secondsDuration * maximumRotationsPerSecond;
3473
3471
  // In osu!droid, spinner bonus points are awarded for each full rotation every nth spin after the required spins.
3474
3472
  // For example, if a spinner requires 5.6 spins before bonus, the first bonus will be awarded at 6 spins instead
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-difficulty-calculator",
3
- "version": "4.0.0-beta.100",
3
+ "version": "4.0.0-beta.102",
4
4
  "description": "A module for calculating osu!standard beatmap difficulty and performance value with respect to the current 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.100"
36
+ "@rian8337/osu-base": "4.0.0-beta.102"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "b99083d44f14ca2af1d38ad294b361aad6ebc647"
41
+ "gitHead": "e93f9512ed8a9b0ab2747fc75e047ffd53a35d29"
42
42
  }