@rian8337/osu-base 4.0.0-beta.55 → 4.0.0-beta.56

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
@@ -2721,7 +2721,7 @@ class ModDifficultyAdjust extends Mod {
2721
2721
  get osuScoreMultiplier() {
2722
2722
  return 0.5;
2723
2723
  }
2724
- applyToDifficultyWithSettings(mode, difficulty, mods) {
2724
+ applyToDifficultyWithSettings(_, difficulty, mods) {
2725
2725
  var _a, _b, _c, _d;
2726
2726
  difficulty.cs = (_a = this.cs) !== null && _a !== void 0 ? _a : difficulty.cs;
2727
2727
  difficulty.ar = (_b = this.ar) !== null && _b !== void 0 ? _b : difficulty.ar;
@@ -2735,15 +2735,18 @@ class ModDifficultyAdjust extends Mod {
2735
2735
  difficulty.ar = BeatmapDifficulty.inverseDifficultyRange(preempt * trackRate, HitObject.preemptMax, HitObject.preemptMid, HitObject.preemptMin);
2736
2736
  }
2737
2737
  }
2738
- applyToHitObjectWithSettings(mode, hitObject, mods) {
2738
+ applyToHitObjectWithSettings(_, hitObject, mods) {
2739
2739
  // Special case for force AR, where the AR value is kept constant with respect to game time.
2740
2740
  // This makes the player perceive the fade in animation as is under all speed multipliers.
2741
2741
  if (this.ar === undefined) {
2742
2742
  return;
2743
2743
  }
2744
- // IMPORTANT: This does not use `ModUtil.calculateRateWithMods` to avoid circular dependency.
2745
- const trackRate = this.calculateTrackRate(mods);
2746
- hitObject.timeFadeIn *= trackRate;
2744
+ this.applyFadeAdjustment(hitObject, mods);
2745
+ if (hitObject instanceof Slider) {
2746
+ for (const nested of hitObject.nestedHitObjects) {
2747
+ this.applyFadeAdjustment(nested, mods);
2748
+ }
2749
+ }
2747
2750
  }
2748
2751
  serializeSettings() {
2749
2752
  if (this.cs === undefined &&
@@ -2767,6 +2770,15 @@ class ModDifficultyAdjust extends Mod {
2767
2770
  }
2768
2771
  return settings;
2769
2772
  }
2773
+ applyFadeAdjustment(hitObject, mods) {
2774
+ // IMPORTANT: These do not use `ModUtil.calculateRateWithMods` to avoid circular dependency.
2775
+ const initialTrackRate = this.calculateTrackRate(mods);
2776
+ const currentTrackRate = this.calculateTrackRate(mods, hitObject.startTime);
2777
+ // Cancel the rate that was initially applied to timePreempt (via applyToDifficulty above and
2778
+ // HitObject.applyDefaults) and apply the current one.
2779
+ hitObject.timePreempt *= currentTrackRate / initialTrackRate;
2780
+ hitObject.timeFadeIn *= currentTrackRate;
2781
+ }
2770
2782
  calculateTrackRate(mods, time = 0) {
2771
2783
  // IMPORTANT: This does not use `ModUtil.calculateRateWithMods` to avoid circular dependency.
2772
2784
  return mods.reduce((rate, mod) => mod.isApplicableToTrackRate()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-base",
3
- "version": "4.0.0-beta.55",
3
+ "version": "4.0.0-beta.56",
4
4
  "description": "Base module for all osu! related modules.",
5
5
  "keywords": [
6
6
  "osu",
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "f653b9f0de6a0b0c6d8176b223352cbf24a97640"
38
+ "gitHead": "330ca82968253d60fd3cb8ed0d769718028a8688"
39
39
  }
@@ -4184,9 +4184,10 @@ declare class ModDifficultyAdjust extends Mod implements IModApplicableToDroid,
4184
4184
  calculateDroidScoreMultiplier(difficulty: BeatmapDifficulty): number;
4185
4185
  get isOsuRelevant(): boolean;
4186
4186
  get osuScoreMultiplier(): number;
4187
- applyToDifficultyWithSettings(mode: Modes, difficulty: BeatmapDifficulty, mods: Mod[]): void;
4188
- applyToHitObjectWithSettings(mode: Modes, hitObject: HitObject, mods: Mod[]): void;
4187
+ applyToDifficultyWithSettings(_: Modes, difficulty: BeatmapDifficulty, mods: Mod[]): void;
4188
+ applyToHitObjectWithSettings(_: Modes, hitObject: HitObject, mods: Mod[]): void;
4189
4189
  protected serializeSettings(): Record<string, unknown> | null;
4190
+ private applyFadeAdjustment;
4190
4191
  private calculateTrackRate;
4191
4192
  toString(): string;
4192
4193
  }