1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:18:22 +08:00

Merge pull request #27116 from tsunyoku/only-compute-flashlight-when-necessary

Only compute flashlight in osu! difficulty calculations when required
This commit is contained in:
Dan Balasescu 2024-02-13 08:25:59 +09:00 committed by GitHub
commit d3e005d4a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,7 +40,11 @@ namespace osu.Game.Rulesets.Osu.Difficulty
double aimRatingNoSliders = Math.Sqrt(skills[1].DifficultyValue()) * difficulty_multiplier;
double speedRating = Math.Sqrt(skills[2].DifficultyValue()) * difficulty_multiplier;
double speedNotes = ((Speed)skills[2]).RelevantNoteCount();
double flashlightRating = Math.Sqrt(skills[3].DifficultyValue()) * difficulty_multiplier;
double flashlightRating = 0.0;
if (mods.Any(h => h is OsuModFlashlight))
flashlightRating = Math.Sqrt(skills[3].DifficultyValue()) * difficulty_multiplier;
double sliderFactor = aimRating > 0 ? aimRatingNoSliders / aimRating : 1;
@ -126,13 +130,17 @@ namespace osu.Game.Rulesets.Osu.Difficulty
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate)
{
return new Skill[]
var skills = new List<Skill>
{
new Aim(mods, true),
new Aim(mods, false),
new Speed(mods),
new Flashlight(mods)
new Speed(mods)
};
if (mods.Any(h => h is OsuModFlashlight))
skills.Add(new Flashlight(mods));
return skills.ToArray();
}
protected override Mod[] DifficultyAdjustmentMods => new Mod[]