This commit is contained in:
咕谷酱
2025-08-18 17:15:43 +08:00
10 changed files with 280 additions and 27 deletions

View File

@@ -207,3 +207,11 @@ def mod_to_save(mods: list[APIMod]) -> list[str]:
s = list({mod["acronym"] for mod in mods})
s.sort()
return s
def get_speed_rate(mods: list[APIMod]):
rate = 1.0
for mod in mods:
if mod["acronym"] in {"DT", "NC", "HT", "DC"}:
rate *= mod.get("settings", {}).get("speed_change", 1.0) # pyright: ignore[reportOperatorIssue]
return rate

View File

@@ -159,6 +159,13 @@ class HitResult(str, Enum):
HitResult.MISS,
)
def is_scorable(self) -> bool:
return self not in (
HitResult.NONE,
HitResult.IGNORE_HIT,
HitResult.IGNORE_MISS,
)
class LeaderboardType(Enum):
GLOBAL = "global"