@rian8337/osu-base 1.0.2 → 1.2.1

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.
@@ -114,7 +114,7 @@ class APIRequestBuilder {
114
114
  class DroidAPIRequestBuilder extends APIRequestBuilder {
115
115
  constructor() {
116
116
  super(...arguments);
117
- this.host = "http://ops.dgsrz.com/api/";
117
+ this.host = "https://osudroid.moe/api/";
118
118
  this.APIkey = process.env
119
119
  .DROID_API_KEY;
120
120
  this.APIkeyParam = `apiKey=${this.APIkey}&`;
@@ -192,13 +192,8 @@ class MapStats {
192
192
  * @param statisticsMultiplier The statistics multiplier to calculate from map-changing nonspeed-changing mods.
193
193
  */
194
194
  static modifyOD(baseOD, speedMultiplier, statisticsMultiplier) {
195
- let od = baseOD;
196
- od *= statisticsMultiplier;
197
- let odMS = this.OD0_MS - Math.ceil(this.OD_MS_STEP * od);
198
- odMS = Math.min(this.OD0_MS, Math.max(this.OD10_MS, odMS));
199
- odMS /= speedMultiplier;
200
- od = (this.OD0_MS - odMS) / this.OD_MS_STEP;
201
- return od;
195
+ const hitWindowGreat = new HitWindow_1.OsuHitWindow(Math.min(10, baseOD * statisticsMultiplier)).hitWindowFor300() / speedMultiplier;
196
+ return (this.OD0_MS - hitWindowGreat) / this.OD_MS_STEP;
202
197
  }
203
198
  }
204
199
  exports.MapStats = MapStats;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-base",
3
- "version": "1.0.2",
3
+ "version": "1.2.1",
4
4
  "description": "Base module for all osu! related modules.",
5
5
  "keywords": [
6
6
  "osu",
@@ -41,5 +41,5 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "34e161583bc0e9beb122e91f2b51ea6706e38736"
44
+ "gitHead": "8c08cf8f2c3af4b9a306f9fe9ffedfe339b9b046"
45
45
  }
@@ -141,9 +141,9 @@ declare module "@rian8337/osu-base" {
141
141
  get maxCombo(): number;
142
142
  /**
143
143
  * Returns a time combined with beatmap-wide time offset.
144
- *
144
+ *
145
145
  * BeatmapVersion 4 and lower had an incorrect offset. Stable has this set as 24ms off.
146
- *
146
+ *
147
147
  * @param time The time.
148
148
  */
149
149
  getOffsetTime(time: number): number;
@@ -165,7 +165,10 @@ declare module "@rian8337/osu-base" {
165
165
  * @param time The time.
166
166
  * @param list The timing points to search in.
167
167
  */
168
- private getTimingPoint<T extends TimingPoint>(time: number, list: T[]): T;
168
+ private getTimingPoint<T extends TimingPoint>(
169
+ time: number,
170
+ list: T[]
171
+ ): T;
169
172
  /**
170
173
  * Returns a string representative of the class.
171
174
  */
@@ -265,7 +268,7 @@ declare module "@rian8337/osu-base" {
265
268
  /**
266
269
  * Represents the headcircle of a slider (sliderhead).
267
270
  */
268
- export class HeadCircle extends Circle { }
271
+ export class HeadCircle extends Circle {}
269
272
 
270
273
  /**
271
274
  * Represents a hitobject in a beatmap.
@@ -643,7 +646,7 @@ declare module "@rian8337/osu-base" {
643
646
  });
644
647
  /**
645
648
  * Calculates map statistics.
646
- *
649
+ *
647
650
  * This can only be called once for an instance.
648
651
  */
649
652
  calculate(params?: {
@@ -1564,7 +1567,7 @@ declare module "@rian8337/osu-base" {
1564
1567
  /**
1565
1568
  * Represents the tailcircle of a slider (sliderend).
1566
1569
  */
1567
- export class TailCircle extends Circle { }
1570
+ export class TailCircle extends Circle {}
1568
1571
 
1569
1572
  /**
1570
1573
  * Represents a timing point that changes the beatmap's BPM.
@@ -1882,7 +1885,7 @@ declare module "@rian8337/osu-base" {
1882
1885
  buildURL(): string;
1883
1886
  /**
1884
1887
  * Sends a request to the API using built parameters.
1885
- *
1888
+ *
1886
1889
  * If the request fails, it will be redone 5 times.
1887
1890
  */
1888
1891
  sendRequest(): Promise<RequestResponse>;