Merge branch 'main' of https://github.com/GooGuTeam/g0v0-server
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user