1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 06:52:55 +08:00

merge effectivemisscount functions

having two functions was unnecessary
This commit is contained in:
finadoggie 2024-10-20 21:46:12 -07:00
parent 31e0853641
commit e31e10d616
No known key found for this signature in database

View File

@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
{
countSliderEndsDropped = osuAttributes.SliderCount - score.Statistics.GetValueOrDefault(HitResult.SliderTailHit);
countLargeTickMiss = score.Statistics.GetValueOrDefault(HitResult.LargeTickMiss);
effectiveMissCount = calculateEffectiveLazerMissCount(osuAttributes);
effectiveMissCount = calculateEffectiveMissCount(osuAttributes);
}
double multiplier = PERFORMANCE_BASE_MULTIPLIER;
@ -259,36 +259,39 @@ namespace osu.Game.Rulesets.Osu.Difficulty
private double calculateEffectiveMissCount(OsuDifficultyAttributes attributes)
{
// Guess the number of misses + slider breaks from combo
double comboBasedMissCount = 0.0;
if (attributes.SliderCount > 0)
if (usingClassicSliderAccuracy)
{
double fullComboThreshold = attributes.MaxCombo - 0.1 * attributes.SliderCount;
if (scoreMaxCombo < fullComboThreshold)
comboBasedMissCount = fullComboThreshold / Math.Max(1.0, scoreMaxCombo);
// Guess the number of misses + slider breaks from combo
double comboBasedMissCount = 0.0;
if (attributes.SliderCount > 0)
{
double fullComboThreshold = attributes.MaxCombo - 0.1 * attributes.SliderCount;
if (scoreMaxCombo < fullComboThreshold)
comboBasedMissCount = fullComboThreshold / Math.Max(1.0, scoreMaxCombo);
}
// Clamp miss count to maximum amount of possible breaks
comboBasedMissCount = Math.Min(comboBasedMissCount, countOk + countMeh + countMiss);
return Math.Max(countMiss, comboBasedMissCount);
}
// Clamp miss count to maximum amount of possible breaks
comboBasedMissCount = Math.Min(comboBasedMissCount, countOk + countMeh + countMiss);
return Math.Max(countMiss, comboBasedMissCount);
}
private double calculateEffectiveLazerMissCount(OsuDifficultyAttributes attributes)
{
// Cap LargeTickMisses to avoid buzz sliders giving high miss counts
// Uses very similar formula to calculateEffectiveMissCount(), but utilizes osu!lazer's extra data
double comboBasedMissCount = 0.0;
if (attributes.SliderCount > 0)
else
{
comboBasedMissCount = (attributes.MaxCombo - countSliderEndsDropped) / Math.Max(1.0, scoreMaxCombo);
// Cap LargeTickMisses to avoid buzz sliders giving high miss counts
// Uses very similar formula to calculateEffectiveMissCount(), but utilizes osu!lazer's extra data
double comboBasedMissCount = 0.0;
if (attributes.SliderCount > 0)
{
comboBasedMissCount = (attributes.MaxCombo - countSliderEndsDropped) / Math.Max(1.0, scoreMaxCombo);
}
// Clamp miss count to maximum amount of possible breaks
comboBasedMissCount = Math.Min(comboBasedMissCount, countOk + countMeh + countMiss + countLargeTickMiss);
return Math.Max(countMiss, comboBasedMissCount);
}
// Clamp miss count to maximum amount of possible breaks
comboBasedMissCount = Math.Min(comboBasedMissCount, countOk + countMeh + countMiss + countLargeTickMiss);
return Math.Max(countMiss, comboBasedMissCount);
}
// Miss penalty assumes that a player will miss on the hardest parts of a map,