@rian8337/osu-base 4.0.0-beta.41 → 4.0.0-beta.42
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 +78 -72
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2837,6 +2837,78 @@ class BeatmapConverter {
|
|
|
2837
2837
|
}
|
|
2838
2838
|
}
|
|
2839
2839
|
|
|
2840
|
+
/**
|
|
2841
|
+
* Represents a mod.
|
|
2842
|
+
*/
|
|
2843
|
+
class Mod {
|
|
2844
|
+
/**
|
|
2845
|
+
* Whether this `Mod` can be applied to osu!droid.
|
|
2846
|
+
*/
|
|
2847
|
+
isApplicableToDroid() {
|
|
2848
|
+
return "droidRanked" in this;
|
|
2849
|
+
}
|
|
2850
|
+
/**
|
|
2851
|
+
* Whether this `Mod` can be applied to osu!standard.
|
|
2852
|
+
*/
|
|
2853
|
+
isApplicableToOsu() {
|
|
2854
|
+
return "pcRanked" in this;
|
|
2855
|
+
}
|
|
2856
|
+
/**
|
|
2857
|
+
* Whether this `Mod` can be applied to a `Beatmap`.
|
|
2858
|
+
*/
|
|
2859
|
+
isApplicableToBeatmap() {
|
|
2860
|
+
return "applyToBeatmap" in this;
|
|
2861
|
+
}
|
|
2862
|
+
/**
|
|
2863
|
+
* Whether this `Mod` can be applied to a `BeatmapDifficulty`.
|
|
2864
|
+
*/
|
|
2865
|
+
isApplicableToDifficulty() {
|
|
2866
|
+
return "applyToDifficulty" in this;
|
|
2867
|
+
}
|
|
2868
|
+
/**
|
|
2869
|
+
* Whether this `Mod` can be applied to a `BeatmapDifficulty` relative to other `Mod`s and settings.
|
|
2870
|
+
*/
|
|
2871
|
+
isApplicableToDifficultyWithSettings() {
|
|
2872
|
+
return "applyToDifficultyWithSettings" in this;
|
|
2873
|
+
}
|
|
2874
|
+
/**
|
|
2875
|
+
* Whether this `Mod` can be applied to a `HitObject`.
|
|
2876
|
+
*/
|
|
2877
|
+
isApplicableToHitObject() {
|
|
2878
|
+
return "applyToHitObject" in this;
|
|
2879
|
+
}
|
|
2880
|
+
/**
|
|
2881
|
+
* Whether this `Mod` can be applied to a `HitObject` relative to other `Mod`s and settings.
|
|
2882
|
+
*/
|
|
2883
|
+
isApplicableToHitObjectWithSettings() {
|
|
2884
|
+
return "applyToHitObjectWithSettings" in this;
|
|
2885
|
+
}
|
|
2886
|
+
/**
|
|
2887
|
+
* Whether this `Mod`s can be applied to a track's playback rate.
|
|
2888
|
+
*/
|
|
2889
|
+
isApplicableToTrackRate() {
|
|
2890
|
+
return "applyToRate" in this;
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
|
|
2894
|
+
/**
|
|
2895
|
+
* Represents the ScoreV2 mod.
|
|
2896
|
+
*/
|
|
2897
|
+
class ModScoreV2 extends Mod {
|
|
2898
|
+
constructor() {
|
|
2899
|
+
super(...arguments);
|
|
2900
|
+
this.acronym = "V2";
|
|
2901
|
+
this.name = "ScoreV2";
|
|
2902
|
+
this.droidRanked = false;
|
|
2903
|
+
this.droidScoreMultiplier = 1;
|
|
2904
|
+
this.droidString = "v";
|
|
2905
|
+
this.isDroidLegacyMod = false;
|
|
2906
|
+
this.pcRanked = false;
|
|
2907
|
+
this.pcScoreMultiplier = 1;
|
|
2908
|
+
this.bitwise = 1 << 29;
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2840
2912
|
/**
|
|
2841
2913
|
* Represents a beatmap with advanced information.
|
|
2842
2914
|
*/
|
|
@@ -2931,6 +3003,9 @@ class Beatmap {
|
|
|
2931
3003
|
else {
|
|
2932
3004
|
scoreMultiplier *= Math.pow(0.3, (1 - customSpeedMultiplier) * 4);
|
|
2933
3005
|
}
|
|
3006
|
+
if (mods.some((m) => m instanceof ModScoreV2)) {
|
|
3007
|
+
return 1e6 * scoreMultiplier;
|
|
3008
|
+
}
|
|
2934
3009
|
const difficultyMultiplier = 1 +
|
|
2935
3010
|
this.difficulty.od / 10 +
|
|
2936
3011
|
this.difficulty.hp / 10 +
|
|
@@ -2973,6 +3048,9 @@ class Beatmap {
|
|
|
2973
3048
|
scoreMultiplier *= mod.pcScoreMultiplier;
|
|
2974
3049
|
}
|
|
2975
3050
|
}
|
|
3051
|
+
if (mods.some((m) => m instanceof ModScoreV2)) {
|
|
3052
|
+
return 1e6 * scoreMultiplier;
|
|
3053
|
+
}
|
|
2976
3054
|
switch (true) {
|
|
2977
3055
|
case accumulatedDiffPoints <= 5:
|
|
2978
3056
|
difficultyMultiplier = 2;
|
|
@@ -7958,60 +8036,6 @@ class MapInfo {
|
|
|
7958
8036
|
}
|
|
7959
8037
|
}
|
|
7960
8038
|
|
|
7961
|
-
/**
|
|
7962
|
-
* Represents a mod.
|
|
7963
|
-
*/
|
|
7964
|
-
class Mod {
|
|
7965
|
-
/**
|
|
7966
|
-
* Whether this `Mod` can be applied to osu!droid.
|
|
7967
|
-
*/
|
|
7968
|
-
isApplicableToDroid() {
|
|
7969
|
-
return "droidRanked" in this;
|
|
7970
|
-
}
|
|
7971
|
-
/**
|
|
7972
|
-
* Whether this `Mod` can be applied to osu!standard.
|
|
7973
|
-
*/
|
|
7974
|
-
isApplicableToOsu() {
|
|
7975
|
-
return "pcRanked" in this;
|
|
7976
|
-
}
|
|
7977
|
-
/**
|
|
7978
|
-
* Whether this `Mod` can be applied to a `Beatmap`.
|
|
7979
|
-
*/
|
|
7980
|
-
isApplicableToBeatmap() {
|
|
7981
|
-
return "applyToBeatmap" in this;
|
|
7982
|
-
}
|
|
7983
|
-
/**
|
|
7984
|
-
* Whether this `Mod` can be applied to a `BeatmapDifficulty`.
|
|
7985
|
-
*/
|
|
7986
|
-
isApplicableToDifficulty() {
|
|
7987
|
-
return "applyToDifficulty" in this;
|
|
7988
|
-
}
|
|
7989
|
-
/**
|
|
7990
|
-
* Whether this `Mod` can be applied to a `BeatmapDifficulty` relative to other `Mod`s and settings.
|
|
7991
|
-
*/
|
|
7992
|
-
isApplicableToDifficultyWithSettings() {
|
|
7993
|
-
return "applyToDifficultyWithSettings" in this;
|
|
7994
|
-
}
|
|
7995
|
-
/**
|
|
7996
|
-
* Whether this `Mod` can be applied to a `HitObject`.
|
|
7997
|
-
*/
|
|
7998
|
-
isApplicableToHitObject() {
|
|
7999
|
-
return "applyToHitObject" in this;
|
|
8000
|
-
}
|
|
8001
|
-
/**
|
|
8002
|
-
* Whether this `Mod` can be applied to a `HitObject` relative to other `Mod`s and settings.
|
|
8003
|
-
*/
|
|
8004
|
-
isApplicableToHitObjectWithSettings() {
|
|
8005
|
-
return "applyToHitObjectWithSettings" in this;
|
|
8006
|
-
}
|
|
8007
|
-
/**
|
|
8008
|
-
* Whether this `Mod`s can be applied to a track's playback rate.
|
|
8009
|
-
*/
|
|
8010
|
-
isApplicableToTrackRate() {
|
|
8011
|
-
return "applyToRate" in this;
|
|
8012
|
-
}
|
|
8013
|
-
}
|
|
8014
|
-
|
|
8015
8039
|
/**
|
|
8016
8040
|
* Represents the Auto mod.
|
|
8017
8041
|
*/
|
|
@@ -8421,24 +8445,6 @@ class ModRelax extends Mod {
|
|
|
8421
8445
|
}
|
|
8422
8446
|
}
|
|
8423
8447
|
|
|
8424
|
-
/**
|
|
8425
|
-
* Represents the ScoreV2 mod.
|
|
8426
|
-
*/
|
|
8427
|
-
class ModScoreV2 extends Mod {
|
|
8428
|
-
constructor() {
|
|
8429
|
-
super(...arguments);
|
|
8430
|
-
this.acronym = "V2";
|
|
8431
|
-
this.name = "ScoreV2";
|
|
8432
|
-
this.droidRanked = false;
|
|
8433
|
-
this.droidScoreMultiplier = 1;
|
|
8434
|
-
this.droidString = "v";
|
|
8435
|
-
this.isDroidLegacyMod = false;
|
|
8436
|
-
this.pcRanked = false;
|
|
8437
|
-
this.pcScoreMultiplier = 1;
|
|
8438
|
-
this.bitwise = 1 << 29;
|
|
8439
|
-
}
|
|
8440
|
-
}
|
|
8441
|
-
|
|
8442
8448
|
/**
|
|
8443
8449
|
* Represents the SmallCircle mod.
|
|
8444
8450
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rian8337/osu-base",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.42",
|
|
4
4
|
"description": "Base module for all osu! related modules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"osu",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "da82f1504d45b495d1100e93a3f4a6a4f4a03bef"
|
|
46
46
|
}
|