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

only compute flashlight in osu! difficulty calculations when required

This commit is contained in:
tsunyoku 2024-02-10 15:25:03 +00:00
parent 4b847b68a2
commit c5f392c17d

View File

@ -40,7 +40,11 @@ namespace osu.Game.Rulesets.Osu.Difficulty
double aimRatingNoSliders = Math.Sqrt(skills[1].DifficultyValue()) * difficulty_multiplier; double aimRatingNoSliders = Math.Sqrt(skills[1].DifficultyValue()) * difficulty_multiplier;
double speedRating = Math.Sqrt(skills[2].DifficultyValue()) * difficulty_multiplier; double speedRating = Math.Sqrt(skills[2].DifficultyValue()) * difficulty_multiplier;
double speedNotes = ((Speed)skills[2]).RelevantNoteCount(); 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; 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) 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, true),
new Aim(mods, false), new Aim(mods, false),
new Speed(mods), new Speed(mods)
new Flashlight(mods)
}; };
if (mods.Any(h => h is OsuModFlashlight))
skills.Add(new Flashlight(mods));
return skills.ToArray();
} }
protected override Mod[] DifficultyAdjustmentMods => new Mod[] protected override Mod[] DifficultyAdjustmentMods => new Mod[]