1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

fixed code quality issues

This commit is contained in:
Xexxar 2021-08-19 20:11:18 +00:00
parent 5b2cfcc2ff
commit d36eb269b4
2 changed files with 11 additions and 11 deletions

View File

@ -190,15 +190,14 @@ namespace osu.Game.Rulesets.Osu.Difficulty
double m300 = 79.5 - 6.0 * Attributes.OverallDifficulty;
double m100 = 139.5 - 8.0 * Attributes.OverallDifficulty;
double m50 = 199.5 - 10.0 * Attributes.OverallDifficulty;
double acc = p300 + 1.0 / 3.0 * p100 + 1.0 / 6.0 * p50;
double variance = p300 * Math.Pow(m300 / 2.0, 2.0) +
p100 * Math.Pow((m300 + m100) / 2.0, 2.0) +
p50 * Math.Pow((m100 + m50) / 2.0, 2.0) +
pm * Math.Pow(229.5 - 11 * Attributes.OverallDifficulty, 2.0);
p100 * Math.Pow((m300 + m100) / 2.0, 2.0) +
p50 * Math.Pow((m100 + m50) / 2.0, 2.0) +
pm * Math.Pow(229.5 - 11 * Attributes.OverallDifficulty, 2.0);
double accuracyValue = 2.83 * Math.Pow(1.52163, (79.5 - 2 * Math.Sqrt(variance)) / 6.0)
* Math.Pow(Math.Log(1.0 + (Math.E - 1.0) * (Math.Min(amountHitObjectsWithAccuracy, 1600) / 1000.0)), 0.5);
* Math.Pow(Math.Log(1.0 + (Math.E - 1.0) * (Math.Min(amountHitObjectsWithAccuracy, 1600) / 1000.0)), 0.5);
if (mods.Any(m => m is OsuModHidden))

View File

@ -20,8 +20,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
private const double pi_over_4 = Math.PI / 4;
private const double pi_over_2 = Math.PI / 2;
private const double rhythmMultiplier = 2.0;
private const int HistoryTimeMax = 3000; // 3 seconds of calculatingRhythmBonus max.
private const double rhythm_multiplier = 2.0;
private const int history_time_max = 3000; // 3 seconds of calculatingRhythmBonus max.
private double skillMultiplier => 1375;
private double strainDecayBase => 0.3;
@ -65,11 +65,12 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
for (int i = Previous.Count - 1; i > 0; i--)
{
double currHistoricalDecay = Math.Max(0, (HistoryTimeMax - (current.StartTime - Previous[i - 1].StartTime))) / HistoryTimeMax; // scales note 0 to 1 from history to now
double currHistoricalDecay = Math.Max(0, (history_time_max - (current.StartTime - Previous[i - 1].StartTime))) / history_time_max; // scales note 0 to 1 from history to now
if (currHistoricalDecay != 0)
{
currHistoricalDecay = Math.Max(currHistoricalDecay, (Previous.Count - i) / Previous.Count); // either we're limited by time or limited by object count.
// below was bugged in initial version. fixed now, but will change values, will do more testing
// currHistoricalDecay = Math.Min(currHistoricalDecay, (double)(Previous.Count - i) / Previous.Count); // either we're limited by time or limited by object count.
double currDelta = ((OsuDifficultyHitObject)Previous[i - 1]).StrainTime;
double prevDelta = ((OsuDifficultyHitObject)Previous[i]).StrainTime;
@ -120,7 +121,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
}
}
return Math.Sqrt(4 + rhythmComplexitySum * rhythmMultiplier) / 2; //produces multiplier that can be applied to strain. range [1, infinity)
return Math.Sqrt(4 + rhythmComplexitySum * rhythm_multiplier) / 2; //produces multiplier that can be applied to strain. range [1, infinity)
}
private double tapStrainOf(DifficultyHitObject current, double speedBonus)
@ -151,7 +152,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
if (angle < pi_over_2)
angleBonus = 1.25;
else if (angle < angle_bonus_begin)
angleBonus = 1 + Math.Pow(Math.Sin(1.5 * (angle_bonus_begin - angle)), 2) / 4;
angleBonus = 1 + Math.Pow(Math.Sin(1.5 * (angle_bonus_begin - angle)), 2) / 4;
}