chore(mods): update default ranked mods
Make AL & SG ranked https://osu.ppy.sh/home/changelog/tachyon/2025.1121.0
This commit is contained in:
@@ -3,7 +3,7 @@ from copy import deepcopy
|
||||
from typing import TYPE_CHECKING, ClassVar
|
||||
|
||||
from app.calculator import clamp
|
||||
from app.models.mods import APIMod, parse_enum_to_str
|
||||
from app.models.mods import APIMod
|
||||
from app.models.performance import (
|
||||
DifficultyAttributes,
|
||||
ManiaPerformanceAttributes,
|
||||
@@ -47,6 +47,26 @@ DIFFICULTY_CLASS = {
|
||||
GameMode.TAIKO: TaikoDifficultyAttributes,
|
||||
}
|
||||
|
||||
_enum_to_str = {
|
||||
0: {
|
||||
"MR": {"reflection"},
|
||||
"AC": {"accuracy_judge_mode"},
|
||||
"BR": {"direction"},
|
||||
"AD": {"style"},
|
||||
},
|
||||
1: {"AC": {"accuracy_judge_mode"}},
|
||||
2: {"AC": {"accuracy_judge_mode"}},
|
||||
3: {"AC": {"accuracy_judge_mode"}},
|
||||
}
|
||||
|
||||
|
||||
def _parse_enum_to_str(ruleset_id: int, mods: list[APIMod]):
|
||||
for mod in mods:
|
||||
if mod["acronym"] in _enum_to_str.get(ruleset_id, {}):
|
||||
for setting in mod.get("settings", {}):
|
||||
if setting in _enum_to_str[ruleset_id][mod["acronym"]]:
|
||||
mod["settings"][setting] = str(mod["settings"][setting]) # pyright: ignore[reportTypedDictNotRequiredAccess]
|
||||
|
||||
|
||||
class RosuPerformanceCalculator(BasePerformanceCalculator):
|
||||
SUPPORT_MODES: ClassVar[set[GameMode]] = {
|
||||
@@ -125,7 +145,7 @@ class RosuPerformanceCalculator(BasePerformanceCalculator):
|
||||
try:
|
||||
map = rosu.Beatmap(content=beatmap_raw)
|
||||
mods = deepcopy(score.mods.copy())
|
||||
parse_enum_to_str(int(score.gamemode), mods)
|
||||
_parse_enum_to_str(int(score.gamemode), mods)
|
||||
map.convert(self._to_rosu_mode(score.gamemode), mods) # pyright: ignore[reportArgumentType]
|
||||
perf = rosu.Performance(
|
||||
mods=mods,
|
||||
|
||||
Reference in New Issue
Block a user