@rian8337/osu-base 4.0.0-beta.89 → 4.0.0-beta.90

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
@@ -2636,8 +2636,7 @@ class ModRateAdjust extends Mod {
2636
2636
  * The generic osu!droid score multiplier of this `Mod`.
2637
2637
  */
2638
2638
  get droidScoreMultiplier() {
2639
- return new ModRateAdjustHelper(this.trackRateMultiplier.value)
2640
- .droidScoreMultiplier;
2639
+ return new ModRateAdjustHelper(this.rate).droidScoreMultiplier;
2641
2640
  }
2642
2641
  /**
2643
2642
  * The generic osu!droid migration score multiplier of this `Mod`.
@@ -2649,18 +2648,10 @@ class ModRateAdjust extends Mod {
2649
2648
  * Generic getter to determine if this `ModRateAdjust` is relevant.
2650
2649
  */
2651
2650
  get isRelevant() {
2652
- return this.trackRateMultiplier.value !== 1;
2653
- }
2654
- constructor(trackRateMultiplier = 1) {
2655
- super();
2656
- /**
2657
- * The multiplier for the track's playback rate after applying this `Mod`.
2658
- */
2659
- this.trackRateMultiplier = new DecimalModSetting("Track rate multiplier", "rateMultiplier", "The multiplier for the track's playback rate after applying this mod.", 1, 0.5, 2, 0.05, 2);
2660
- this.trackRateMultiplier.value = trackRateMultiplier;
2651
+ return this.rate !== 1;
2661
2652
  }
2662
2653
  applyToRate(_, rate) {
2663
- return rate * this.trackRateMultiplier.value;
2654
+ return rate * this.rate;
2664
2655
  }
2665
2656
  }
2666
2657
 
@@ -2670,12 +2661,8 @@ class ModRateAdjust extends Mod {
2670
2661
  * This is a replacement `Mod` for speed modify in osu!droid and custom rates in osu!lazer.
2671
2662
  */
2672
2663
  class ModCustomSpeed extends ModRateAdjust {
2673
- constructor() {
2674
- super(...arguments);
2675
- this.acronym = "CS";
2676
- this.name = "Custom Speed";
2677
- this.droidRanked = true;
2678
- this.osuRanked = false;
2664
+ get rate() {
2665
+ return this.trackRateMultiplier.value;
2679
2666
  }
2680
2667
  get isDroidRelevant() {
2681
2668
  return this.isRelevant;
@@ -2698,6 +2685,18 @@ class ModCustomSpeed extends ModRateAdjust {
2698
2685
  ? 1 + value / 5
2699
2686
  : 0.6 + value;
2700
2687
  }
2688
+ constructor(trackRateMultiplier = 1) {
2689
+ super();
2690
+ this.acronym = "CS";
2691
+ this.name = "Custom Speed";
2692
+ /**
2693
+ * The setting to change the multiplier for the track's playback rate after applying this `ModCustomSpeed`.
2694
+ */
2695
+ this.trackRateMultiplier = new DecimalModSetting("Track rate multiplier", "rateMultiplier", "The multiplier for the track's playback rate after applying this mod.", 1, 0.5, 2, 0.05, 2);
2696
+ this.droidRanked = true;
2697
+ this.osuRanked = false;
2698
+ this.trackRateMultiplier.value = trackRateMultiplier;
2699
+ }
2701
2700
  toString() {
2702
2701
  return `${super.toString()} (${this.trackRateMultiplier.toDisplayString()}x)`;
2703
2702
  }
@@ -4551,13 +4550,14 @@ class ModDifficultyAdjust extends Mod {
4551
4550
  */
4552
4551
  class ModNightCore extends ModRateAdjust {
4553
4552
  constructor() {
4554
- super(1.5);
4553
+ super();
4555
4554
  this.acronym = "NC";
4556
4555
  this.name = "NightCore";
4557
4556
  this.droidRanked = true;
4558
4557
  this.osuRanked = true;
4559
4558
  this.osuScoreMultiplier = 1.12;
4560
4559
  this.bitwise = 1 << 9;
4560
+ this.rate = 1.5;
4561
4561
  this.incompatibleMods.add(ModDoubleTime).add(ModHalfTime);
4562
4562
  }
4563
4563
  get isDroidRelevant() {
@@ -4579,13 +4579,14 @@ class ModNightCore extends ModRateAdjust {
4579
4579
  */
4580
4580
  class ModHalfTime extends ModRateAdjust {
4581
4581
  constructor() {
4582
- super(0.75);
4582
+ super();
4583
4583
  this.acronym = "HT";
4584
4584
  this.name = "HalfTime";
4585
4585
  this.droidRanked = true;
4586
4586
  this.osuRanked = true;
4587
4587
  this.osuScoreMultiplier = 0.3;
4588
4588
  this.bitwise = 1 << 8;
4589
+ this.rate = 0.75;
4589
4590
  this.incompatibleMods.add(ModDoubleTime).add(ModNightCore);
4590
4591
  }
4591
4592
  get isDroidRelevant() {
@@ -4607,13 +4608,14 @@ class ModHalfTime extends ModRateAdjust {
4607
4608
  */
4608
4609
  class ModDoubleTime extends ModRateAdjust {
4609
4610
  constructor() {
4610
- super(1.5);
4611
+ super();
4611
4612
  this.acronym = "DT";
4612
4613
  this.name = "DoubleTime";
4613
4614
  this.droidRanked = true;
4614
4615
  this.osuRanked = true;
4615
4616
  this.osuScoreMultiplier = 1.12;
4616
4617
  this.bitwise = 1 << 6;
4618
+ this.rate = 1.5;
4617
4619
  this.incompatibleMods.add(ModHalfTime).add(ModNightCore);
4618
4620
  }
4619
4621
  get isDroidRelevant() {
@@ -5564,8 +5566,7 @@ class ModUtil {
5564
5566
  mod.applyFromBeatmapDifficulty(difficulty);
5565
5567
  }
5566
5568
  if (mode === exports.Modes.droid && mod instanceof ModRateAdjust) {
5567
- totalRateAdjustTrackRateMultiplier *=
5568
- mod.trackRateMultiplier.value;
5569
+ totalRateAdjustTrackRateMultiplier *= mod.rate;
5569
5570
  }
5570
5571
  else {
5571
5572
  const multiplierValue = modSelector(mod);
@@ -11823,8 +11824,8 @@ DroidLegacyModConverter.legacyStorableMods = new Map([
11823
11824
  */
11824
11825
  class ModOldNightCore extends ModNightCore {
11825
11826
  constructor() {
11826
- super();
11827
- this.trackRateMultiplier.value = (44.1 * 1.5) / 48;
11827
+ super(...arguments);
11828
+ this.rate = (44.1 * 1.5) / 48;
11828
11829
  }
11829
11830
  get droidScoreMultiplier() {
11830
11831
  return 1.12;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-base",
3
- "version": "4.0.0-beta.89",
3
+ "version": "4.0.0-beta.90",
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": "70d91858f02b78f847d784609bae069c8e1679c9"
38
+ "gitHead": "3fe8f54f39183d5a42041d0fc48d8bd58e71fe41"
39
39
  }
@@ -4529,7 +4529,7 @@ declare abstract class ModRateAdjust extends Mod implements IModApplicableToTrac
4529
4529
  /**
4530
4530
  * The multiplier for the track's playback rate after applying this `Mod`.
4531
4531
  */
4532
- readonly trackRateMultiplier: DecimalModSetting;
4532
+ abstract rate: number;
4533
4533
  /**
4534
4534
  * The generic osu!droid score multiplier of this `Mod`.
4535
4535
  */
@@ -4542,7 +4542,6 @@ declare abstract class ModRateAdjust extends Mod implements IModApplicableToTrac
4542
4542
  * Generic getter to determine if this `ModRateAdjust` is relevant.
4543
4543
  */
4544
4544
  protected get isRelevant(): boolean;
4545
- constructor(trackRateMultiplier?: number);
4546
4545
  applyToRate(_: number, rate: number): number;
4547
4546
  }
4548
4547
 
@@ -4554,6 +4553,11 @@ declare abstract class ModRateAdjust extends Mod implements IModApplicableToTrac
4554
4553
  declare class ModCustomSpeed extends ModRateAdjust implements IModApplicableToDroid, IModApplicableToOsu {
4555
4554
  readonly acronym = "CS";
4556
4555
  readonly name = "Custom Speed";
4556
+ get rate(): number;
4557
+ /**
4558
+ * The setting to change the multiplier for the track's playback rate after applying this `ModCustomSpeed`.
4559
+ */
4560
+ readonly trackRateMultiplier: DecimalModSetting;
4557
4561
  readonly droidRanked = true;
4558
4562
  readonly osuRanked = false;
4559
4563
  get isDroidRelevant(): boolean;
@@ -4561,6 +4565,7 @@ declare class ModCustomSpeed extends ModRateAdjust implements IModApplicableToDr
4561
4565
  get migrationDroidScoreMultiplier(): number;
4562
4566
  get isOsuRelevant(): boolean;
4563
4567
  get osuScoreMultiplier(): number;
4568
+ constructor(trackRateMultiplier?: number);
4564
4569
  toString(): string;
4565
4570
  }
4566
4571
 
@@ -4694,6 +4699,7 @@ declare class ModDoubleTime extends ModRateAdjust implements IModApplicableToDro
4694
4699
  readonly osuRanked = true;
4695
4700
  readonly osuScoreMultiplier = 1.12;
4696
4701
  readonly bitwise: number;
4702
+ readonly rate = 1.5;
4697
4703
  constructor();
4698
4704
  get isDroidRelevant(): boolean;
4699
4705
  get droidScoreMultiplier(): number;
@@ -4807,6 +4813,7 @@ declare class ModHalfTime extends ModRateAdjust implements IModApplicableToDroid
4807
4813
  readonly osuRanked = true;
4808
4814
  readonly osuScoreMultiplier = 0.3;
4809
4815
  readonly bitwise: number;
4816
+ readonly rate = 0.75;
4810
4817
  constructor();
4811
4818
  get isDroidRelevant(): boolean;
4812
4819
  get droidScoreMultiplier(): number;
@@ -4959,6 +4966,7 @@ declare class ModNightCore extends ModRateAdjust implements IModApplicableToDroi
4959
4966
  readonly osuRanked = true;
4960
4967
  readonly osuScoreMultiplier = 1.12;
4961
4968
  readonly bitwise: number;
4969
+ readonly rate: number;
4962
4970
  constructor();
4963
4971
  get isDroidRelevant(): boolean;
4964
4972
  get droidScoreMultiplier(): number;
@@ -5008,7 +5016,7 @@ declare class ModNoFail extends Mod implements IModApplicableToDroid, IModApplic
5008
5016
  * sufficient for the purpose it serves.
5009
5017
  */
5010
5018
  declare class ModOldNightCore extends ModNightCore {
5011
- constructor();
5019
+ readonly rate: number;
5012
5020
  get droidScoreMultiplier(): number;
5013
5021
  get migrationDroidScoreMultiplier(): number;
5014
5022
  }