mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 20:32:55 +08:00
Invert condition to reduce nesting
This commit is contained in:
parent
bf4ca7f489
commit
0dc31a476f
@ -190,16 +190,15 @@ namespace osu.Game.Rulesets.Osu.Difficulty
|
|||||||
|
|
||||||
private double computeFlashlightValue()
|
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;
|
double rawFlashlight = Attributes.FlashlightStrain;
|
||||||
|
|
||||||
if (mods.Any(m => m is OsuModTouchDevice))
|
if (mods.Any(m => m is OsuModTouchDevice))
|
||||||
rawFlashlight = Math.Pow(rawFlashlight, 0.8);
|
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.
|
// Add an additional bonus for HDFL.
|
||||||
if (mods.Any(h => h is OsuModHidden))
|
if (mods.Any(h => h is OsuModHidden))
|
||||||
@ -221,7 +220,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty
|
|||||||
flashlightValue *= 0.5 + accuracy / 2.0;
|
flashlightValue *= 0.5 + accuracy / 2.0;
|
||||||
// It is important to also consider accuracy difficulty when doing that.
|
// It is important to also consider accuracy difficulty when doing that.
|
||||||
flashlightValue *= 0.98 + Math.Pow(Attributes.OverallDifficulty, 2) / 2500;
|
flashlightValue *= 0.98 + Math.Pow(Attributes.OverallDifficulty, 2) / 2500;
|
||||||
}
|
|
||||||
|
|
||||||
return flashlightValue;
|
return flashlightValue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user