Skip to content

Commit

Permalink
Fix fuwwy accuracy threshold being int instead of float
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsMestro committed Nov 3, 2023
1 parent 06802d9 commit 1fb2667
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions osu/fuwwy.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class FuwwyBeatmapIDs(Enum):
FuwwyBeatmapIDs.TECH: {"name": "Beans", "stage": "Stage 4"},
}

FUWWY_ACC_THRESHOLD = 98
FUWWY_ACC_THRESHOLD = 0.98
FUWWY_GRADE_THRESHOLD = OsuGrade.A
FUWWY_GRADES = [OsuGrade.A, OsuGrade.S, OsuGrade.SH, OsuGrade.SS, OsuGrade.SSH]

Expand Down Expand Up @@ -318,9 +318,9 @@ async def requirements_embed(self, ctx: commands.Context) -> discord.Embed:
name="You have two options for becoming eligible as a member.",
value="\n".join(
[
f"- Get and {bold(FUWWY_GRADE_THRESHOLD)} on the full "
f"- Get an {bold(FUWWY_GRADE_THRESHOLD.value)} on the full "
f"{inline(FUWWY_BEATMAP_STAGES[FuwwyBeatmapIDs.FULL]['name'])} ",
f"- {bold('Get an average accuracy')} of {bold(f'{FUWWY_ACC_THRESHOLD}%')} on three of the four stage maps.",
f"- {bold('Get an average accuracy')} of {bold('{:.2%}'.format(FUWWY_ACC_THRESHOLD))} on three of the four stage maps.",
]
),
inline=False,
Expand Down Expand Up @@ -439,16 +439,16 @@ async def new_member_scores_embed(
if submitted_stages == 4:
if accuracy / 3 < FUWWY_ACC_THRESHOLD:
text_list.append(
f"get {bold(f'{round(accuracy / 3, 2)}%')} higher average accuracy"
f"get {bold('{:.2%}'.format(accuracy / 3))} higher average accuracy"
)
text_add1 = f"{bold(f'{round(accuracy / 3, 2)}%')} with "
text_add1 = f"{bold('{:.2%}'.format(accuracy / 3))} with "
f"{bold('4')} stages submitted."
else:
if accuracy / submitted_stages < FUWWY_ACC_THRESHOLD:
text_list.append(
f"get {bold(f'{round(accuracy / submitted_stages, 2)}%')} higher average accuracy"
f"get {bold('{:.2%}'.format(accuracy / submitted_stages))} higher average accuracy"
)
text_add1 = f"{bold(f'{round(accuracy / submitted_stages, 2)}%')} on "
text_add1 = f"{bold('{:.2%}'.format(accuracy / submitted_stages))} on "
f"{bold(str(submitted_stages))} stage{'s' if len(submitted_stages) > 1 else ''}."

text_add2 = " and ".join(text_list)
Expand All @@ -460,13 +460,11 @@ async def new_member_scores_embed(
]
)

reference = await self.osu_config.fuwwy_clan()

embed.set_footer(
f"Entry requirements: Get more than "
f"{humanize_number(reference['score'])} on "
f"Entry requirements: Get an "
f"{FUWWY_GRADE_THRESHOLD.value} on "
f"{fuwwy_to_stage_string(FuwwyBeatmapIDs.FULL)} "
f"or {FUWWY_ACC_THRESHOLD}% average accuracy on 3 of the 4 stages"
f"or {'{:.2%}'.format(FUWWY_ACC_THRESHOLD)} average accuracy on 3 of the 4 stages"
)

async def fuwwy_leaderboard_embed(
Expand Down Expand Up @@ -672,7 +670,7 @@ async def submit_command(self, ctx: commands.Context) -> None:
ctx,
"\n".join(
[
f"Your score doesn't have at least an {bold(FUWWY_GRADE_THRESHOLD)} rank.",
f"Your score doesn't have at least an {bold(FUWWY_GRADE_THRESHOLD.value)} rank.",
"Try again and see if you can improve!",
]
),
Expand Down Expand Up @@ -919,7 +917,7 @@ async def submit_command(self, ctx: commands.Context) -> None:
return await del_message(
f"Your score on the map was improved but "
f"the accuracy got worse and submitting it "
f"would drop you below the {FUWWY_ACC_THRESHOLD}% "
f"would drop you below the {'{:.2%}'.format(FUWWY_ACC_THRESHOLD)} "
f"average accuracy threshold."
)

Expand All @@ -946,7 +944,7 @@ async def submit_command(self, ctx: commands.Context) -> None:
return await del_message(
f"Your score on the map was improved but "
f"the accuracy got worse and submitting it "
f"would drop you below the {FUWWY_ACC_THRESHOLD}% "
f"would drop you below the {'{:.2%}'.format(FUWWY_ACC_THRESHOLD)} "
f"average accuracy threshold."
)

Expand Down

0 comments on commit 1fb2667

Please sign in to comment.