@rian8337/osu-droid-replay-analyzer 4.0.0-beta.25 → 4.0.0-beta.26

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
@@ -327,14 +327,9 @@ class RebalanceThreeFingerChecker {
327
327
  this.beatmap = beatmap;
328
328
  this.data = data;
329
329
  this.difficultyAttributes = difficultyAttributes;
330
- const od = osuBase.calculateDroidDifficultyStatistics({
331
- overallDifficulty: beatmap.difficulty.od,
332
- mods: osuBase.ModUtil.removeSpeedChangingMods(difficultyAttributes.mods),
333
- convertOverallDifficulty: false,
334
- }).overallDifficulty;
335
330
  this.isPrecise = difficultyAttributes.mods.some((m) => m instanceof osuBase.ModPrecise);
336
331
  this.isHardRock = difficultyAttributes.mods.some((m) => m instanceof osuBase.ModHardRock);
337
- this.hitWindow = new osuBase.DroidHitWindow(od);
332
+ this.hitWindow = new osuBase.DroidHitWindow(beatmap.difficulty.od);
338
333
  }
339
334
  /**
340
335
  * Checks whether a beatmap is eligible to be detected for 3-finger.
@@ -799,14 +794,9 @@ class ThreeFingerChecker {
799
794
  this.beatmap = beatmap;
800
795
  this.data = data;
801
796
  this.difficultyAttributes = difficultyAttributes;
802
- const od = osuBase.calculateDroidDifficultyStatistics({
803
- overallDifficulty: beatmap.difficulty.od,
804
- mods: osuBase.ModUtil.removeSpeedChangingMods(difficultyAttributes.mods),
805
- convertOverallDifficulty: false,
806
- }).overallDifficulty;
807
797
  this.isPrecise = difficultyAttributes.mods.some((m) => m instanceof osuBase.ModPrecise);
808
798
  this.isHardRock = difficultyAttributes.mods.some((m) => m instanceof osuBase.ModHardRock);
809
- this.hitWindow = new osuBase.DroidHitWindow(od);
799
+ this.hitWindow = new osuBase.DroidHitWindow(beatmap.difficulty.od);
810
800
  }
811
801
  /**
812
802
  * Checks whether a beatmap is eligible to be detected for 3-finger.
@@ -1205,12 +1195,9 @@ class TwoHandChecker {
1205
1195
  this.indexedHitObjects = [];
1206
1196
  this.calculator = calculator;
1207
1197
  this.data = data;
1208
- const od = osuBase.calculateDroidDifficultyStatistics({
1209
- overallDifficulty: calculator.beatmap.difficulty.od,
1210
- mods: osuBase.ModUtil.removeSpeedChangingMods(calculator.mods),
1211
- convertOverallDifficulty: false,
1212
- }).overallDifficulty;
1213
- this.hitWindow = new osuBase.DroidHitWindow(od);
1198
+ const greatWindow = new osuBase.OsuHitWindow(calculator.attributes.overallDifficulty).hitWindowFor300() * calculator.attributes.clockRate;
1199
+ const isPrecise = calculator.mods.some((m) => m instanceof osuBase.ModPrecise);
1200
+ this.hitWindow = new osuBase.DroidHitWindow(osuBase.DroidHitWindow.hitWindow300ToOD(greatWindow, isPrecise));
1214
1201
  this.hitWindow50 = this.hitWindow.hitWindowFor50(calculator.mods.some((m) => m instanceof osuBase.ModPrecise));
1215
1202
  this.isHardRock = calculator.mods.some((m) => m instanceof osuBase.ModHardRock);
1216
1203
  // this.csvString = `Mods,${
@@ -1806,12 +1793,7 @@ class SliderCheeseChecker {
1806
1793
  this.beatmap = beatmap;
1807
1794
  this.data = data;
1808
1795
  this.difficultyAttributes = difficultyAttributes;
1809
- const od = osuBase.calculateDroidDifficultyStatistics({
1810
- overallDifficulty: beatmap.difficulty.od,
1811
- mods: osuBase.ModUtil.removeSpeedChangingMods(difficultyAttributes.mods),
1812
- convertOverallDifficulty: false,
1813
- }).overallDifficulty;
1814
- this.hitWindow50 = new osuBase.DroidHitWindow(od).hitWindowFor50(difficultyAttributes.mods.some((m) => m instanceof osuBase.ModPrecise));
1796
+ this.hitWindow50 = new osuBase.DroidHitWindow(beatmap.difficulty.od).hitWindowFor50(difficultyAttributes.mods.some((m) => m instanceof osuBase.ModPrecise));
1815
1797
  this.isHardRock = difficultyAttributes.mods.some((m) => m instanceof osuBase.ModHardRock);
1816
1798
  }
1817
1799
  /**
@@ -2173,11 +2155,9 @@ class ReplayAnalyzer {
2173
2155
  const mods = this.data.isReplayV3()
2174
2156
  ? this.data.convertedMods
2175
2157
  : (_b = (_a = this.difficultyAttributes) === null || _a === void 0 ? void 0 : _a.mods.filter((m) => m.isApplicableToDroid())) !== null && _b !== void 0 ? _b : [];
2176
- const od = osuBase.calculateDroidDifficultyStatistics({
2177
- overallDifficulty: beatmap.difficulty.od,
2178
- mods: osuBase.ModUtil.removeSpeedChangingMods(mods),
2179
- }).overallDifficulty;
2180
- const hitWindow50 = new osuBase.DroidHitWindow(od).hitWindowFor50(mods.some((m) => m instanceof osuBase.ModPrecise));
2158
+ const adjustedDifficulty = new osuBase.BeatmapDifficulty(beatmap.difficulty);
2159
+ osuBase.ModUtil.applyModsToBeatmapDifficulty(adjustedDifficulty, osuBase.Modes.droid, mods, this.data.isReplayV4() ? this.data.speedMultiplier : 1);
2160
+ const hitWindow50 = new osuBase.DroidHitWindow(adjustedDifficulty.od).hitWindowFor50(mods.some((m) => m instanceof osuBase.ModPrecise));
2181
2161
  // The accuracy of sliders is set to (50 hit window)ms + 13ms if their head was not hit:
2182
2162
  // https://github.com/osudroid/osu-droid/blob/6306c68e3ffaf671eac794bf45cc95c0f3313a82/src/ru/nsu/ccfit/zuev/osu/game/Slider.java#L821
2183
2163
  //
@@ -2337,26 +2317,24 @@ class ReplayAnalyzer {
2337
2317
  isFullCombo: false,
2338
2318
  maxCombo: 0,
2339
2319
  playerName: "",
2340
- rawMods: "",
2320
+ rawMods: [],
2341
2321
  score: 0,
2342
2322
  time: new Date(0),
2343
2323
  };
2344
2324
  if (resultObject.replayVersion >= 3) {
2345
- resultObject.time = new Date(Number(rawObject[4].readBigUInt64BE(0)));
2325
+ resultObject.time.setTime(Number(rawObject[4].readBigUInt64BE(0)));
2346
2326
  resultObject.hit300k = rawObject[4].readInt32BE(8);
2327
+ resultObject.accuracy.n300 = rawObject[4].readInt32BE(12);
2347
2328
  resultObject.hit100k = rawObject[4].readInt32BE(16);
2329
+ resultObject.accuracy.n100 = rawObject[4].readInt32BE(20);
2330
+ resultObject.accuracy.n50 = rawObject[4].readInt32BE(24);
2331
+ resultObject.accuracy.nmiss = rawObject[4].readInt32BE(28);
2348
2332
  resultObject.score = rawObject[4].readInt32BE(32);
2349
2333
  resultObject.maxCombo = rawObject[4].readInt32BE(36);
2350
- resultObject.accuracy = new osuBase.Accuracy({
2351
- n300: rawObject[4].readInt32BE(12),
2352
- n100: rawObject[4].readInt32BE(20),
2353
- n50: rawObject[4].readInt32BE(24),
2354
- nmiss: rawObject[4].readInt32BE(28),
2355
- });
2356
2334
  resultObject.isFullCombo = !!rawObject[4][44];
2357
2335
  resultObject.playerName = rawObject[5];
2358
- resultObject.rawMods = rawObject[6].elements;
2359
- resultObject.convertedMods = osuBase.ModUtil.droidStringToMods(this.convertDroidMods(rawObject[6].elements));
2336
+ resultObject.rawMods = Object.values(rawObject[6].elements);
2337
+ resultObject.convertedMods = osuBase.ModUtil.droidStringToMods(this.convertDroidMods(resultObject.rawMods));
2360
2338
  resultObject.rank = this.calculateRank(resultObject);
2361
2339
  }
2362
2340
  if (resultObject.replayVersion >= 4) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-droid-replay-analyzer",
3
- "version": "4.0.0-beta.25",
3
+ "version": "4.0.0-beta.26",
4
4
  "description": "A replay analyzer for analyzing osu!droid replay files.",
5
5
  "keywords": [
6
6
  "osu",
@@ -34,9 +34,9 @@
34
34
  "url": "https://github.com/Rian8337/osu-droid-module/issues"
35
35
  },
36
36
  "dependencies": {
37
- "@rian8337/osu-base": "^4.0.0-beta.25",
38
- "@rian8337/osu-difficulty-calculator": "^4.0.0-beta.25",
39
- "@rian8337/osu-rebalance-difficulty-calculator": "^4.0.0-beta.25",
37
+ "@rian8337/osu-base": "^4.0.0-beta.26",
38
+ "@rian8337/osu-difficulty-calculator": "^4.0.0-beta.26",
39
+ "@rian8337/osu-rebalance-difficulty-calculator": "^4.0.0-beta.26",
40
40
  "java-deserialization": "^0.1.0",
41
41
  "unzipper": "^0.10.11"
42
42
  },
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "2d6271ea24c787caad1d24c3d20dbeeaf450359e"
49
+ "gitHead": "1c353ee9455d80a5ca8358762f107899d64f1d5e"
50
50
  }
@@ -415,7 +415,7 @@ interface ReplayInformation {
415
415
  *
416
416
  * Only available in replay v3 or later.
417
417
  */
418
- rawMods: string;
418
+ rawMods: string[];
419
419
  /**
420
420
  * The achieved rank in the play.
421
421
  */
@@ -503,7 +503,7 @@ declare class ReplayV3Data extends ReplayData {
503
503
  /**
504
504
  * Enabled modifications during the play in raw Java object format.
505
505
  */
506
- readonly rawMods: string;
506
+ readonly rawMods: string[];
507
507
  /**
508
508
  * Enabled modifications during the play that have been converted to their respective `Mod` instances.
509
509
  */