1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 06:33:20 +08:00

Invert condition to reduce nesting

This commit is contained in:
smoogipoo 2021-09-13 16:39:05 +09:00
parent bf4ca7f489
commit 0dc31a476f

View File

@ -190,16 +190,15 @@ namespace osu.Game.Rulesets.Osu.Difficulty
private double computeFlashlightValue()
{
double flashlightValue = 0.0;
if (!mods.Any(h => h is OsuModFlashlight))
return 0.0;
if (mods.Any(h => h is OsuModFlashlight))
{
double rawFlashlight = Attributes.FlashlightStrain;
if (mods.Any(m => m is OsuModTouchDevice))
rawFlashlight = Math.Pow(rawFlashlight, 0.8);
flashlightValue = Math.Pow(rawFlashlight, 2.0) * 25.0;
double flashlightValue = Math.Pow(rawFlashlight, 2.0) * 25.0;
// Add an additional bonus for HDFL.
if (mods.Any(h => h is OsuModHidden))
@ -221,7 +220,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty
flashlightValue *= 0.5 + accuracy / 2.0;
// It is important to also consider accuracy difficulty when doing that.
flashlightValue *= 0.98 + Math.Pow(Attributes.OverallDifficulty, 2) / 2500;
}
return flashlightValue;
}