@rian8337/osu-rebalance-difficulty-calculator 1.2.8 → 1.2.9

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.
@@ -53,7 +53,10 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
53
53
  const calculatedAR = this.mapStatistics.ar;
54
54
  this.aim = this.baseValue(Math.pow(this.stars.aim, 0.8));
55
55
  if (this.effectiveMissCount > 0) {
56
- this.aim *= this.calculateMissPenalty(this.stars.attributes.aimDifficultStrainCount);
56
+ // Penalize misses by assessing # of misses relative to the total # of objects. Default a 3% reduction for any # of misses.
57
+ this.aim *=
58
+ 0.97 *
59
+ Math.pow(1 - Math.pow(this.effectiveMissCount / objectCount, 0.775), this.effectiveMissCount);
57
60
  }
58
61
  // Combo scaling
59
62
  this.aim *= this.comboPenalty;
@@ -101,7 +104,10 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
101
104
  const calculatedAR = this.mapStatistics.ar;
102
105
  this.tap = this.baseValue(this.stars.tap);
103
106
  if (this.effectiveMissCount > 0) {
104
- this.tap *= this.calculateMissPenalty(this.stars.attributes.speedDifficultStrainCount);
107
+ // Penalize misses by assessing # of misses relative to the total # of objects. Default a 3% reduction for any # of misses.
108
+ this.tap *=
109
+ 0.97 *
110
+ Math.pow(1 - Math.pow(this.effectiveMissCount / objectCount, 0.775), Math.pow(this.effectiveMissCount, 0.875));
105
111
  }
106
112
  // Combo scaling
107
113
  this.tap *= this.comboPenalty;
@@ -223,19 +229,5 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
223
229
  this.flashlight.toFixed(2) +
224
230
  " flashlight)");
225
231
  }
226
- /**
227
- * Calculates miss penalty.
228
- *
229
- * @param difficultStrainCount Difficult strain count from calculation.
230
- * @returns The miss penalty.
231
- */
232
- calculateMissPenalty(difficultStrainCount) {
233
- // Miss penalty assumes that a player will miss on the hardest parts of a map,
234
- // so we use the amount of relatively difficult sections to adjust miss penalty
235
- // to make it more punishing on maps with lower amount of hard sections.
236
- return (0.97 /
237
- (this.effectiveMissCount / (2 * Math.sqrt(difficultStrainCount)) +
238
- 1));
239
- }
240
232
  }
241
233
  exports.DroidPerformanceCalculator = DroidPerformanceCalculator;
@@ -167,11 +167,6 @@ class DroidStarRating extends StarRating_1.StarRating {
167
167
  this.starValue(aimSkillWithoutSliders.difficultyValue()) /
168
168
  this.aim;
169
169
  }
170
- const objectStrains = this.objects.map((v) => v.aimStrainWithSliders);
171
- const maxStrain = Math.max(...objectStrains);
172
- if (maxStrain) {
173
- this.attributes.aimDifficultStrainCount = objectStrains.reduce((a, v) => a + Math.pow(v / maxStrain, 4), 0);
174
- }
175
170
  }
176
171
  /**
177
172
  * Called after tap skill calculation.
@@ -191,7 +186,6 @@ class DroidStarRating extends StarRating_1.StarRating {
191
186
  const maxStrain = Math.max(...objectStrains);
192
187
  if (maxStrain) {
193
188
  this.attributes.speedNoteCount = objectStrains.reduce((total, next) => total + 1 / (1 + Math.exp(-((next / maxStrain) * 12 - 6))), 0);
194
- this.attributes.speedDifficultStrainCount = objectStrains.reduce((a, v) => a + Math.pow(v / maxStrain, 4), 0);
195
189
  }
196
190
  }
197
191
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-rebalance-difficulty-calculator",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
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",
@@ -30,10 +30,10 @@
30
30
  "url": "https://github.com/Rian8337/osu-droid-module/issues"
31
31
  },
32
32
  "dependencies": {
33
- "@rian8337/osu-base": "^1.2.8"
33
+ "@rian8337/osu-base": "^1.2.9"
34
34
  },
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "3e633e510be04aca9c46b9361524251442049621"
38
+ "gitHead": "4bb4b0c00cf07d5624e1af644a01685697b2832c"
39
39
  }
@@ -276,13 +276,6 @@ declare module "@rian8337/osu-rebalance-difficulty-calculator" {
276
276
  */
277
277
  private calculateFlashlightValue(): void;
278
278
  override toString(): string;
279
- /**
280
- * Calculates miss penalty.
281
- *
282
- * @param difficultStrainCount Difficult strain count from calculation.
283
- * @returns The miss penalty.
284
- */
285
- private calculateMissPenalty(difficultStrainCount: number): number;
286
279
  }
287
280
 
288
281
  /**