1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-05 03:13:22 +08:00

Adjust daily challenge tier thresholds to match expectations

This commit is contained in:
Hiviexd 2024-11-28 12:49:30 +01:00
parent e0fdcaf523
commit 66093872e8

View File

@ -138,34 +138,32 @@ namespace osu.Game.Overlays.Profile.Header.Components
topFifty.ValueColour = colourProvider.Content2;
}
// reference: https://github.com/ppy/osu-web/blob/adf1e94754ba9625b85eba795f4a310caf169eec/resources/js/profile-page/daily-challenge.tsx#L13-L47
// reference: https://github.com/ppy/osu-web/blob/a97f156014e00ea1aa315140da60542e798a9f06/resources/js/profile-page/daily-challenge.tsx#L13-L47
// Rounding up is needed here to ensure the overlay shows the same colour as osu-web for the play count.
// This is because, for example, 31 / 3 > 10 in JavaScript because floats are used, while here it would
// get truncated to 10 with an integer division and show a lower tier.
public static RankingTier TierForPlayCount(int playCount) => TierForDaily((int)Math.Ceiling(playCount / 3.0d));
// Rounding down is needed here to ensure the overlay shows the same colour as osu-web for the play count.
public static RankingTier TierForPlayCount(int playCount) => TierForDaily((int)Math.Floor(playCount / 3.0d));
public static RankingTier TierForDaily(int daily)
{
if (daily > 360)
if (daily >= 360)
return RankingTier.Lustrous;
if (daily > 240)
if (daily >= 240)
return RankingTier.Radiant;
if (daily > 120)
if (daily >= 120)
return RankingTier.Rhodium;
if (daily > 60)
if (daily >= 60)
return RankingTier.Platinum;
if (daily > 30)
if (daily >= 30)
return RankingTier.Gold;
if (daily > 10)
if (daily >= 10)
return RankingTier.Silver;
if (daily > 5)
if (daily >= 5)
return RankingTier.Bronze;
return RankingTier.Iron;