1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 16:32:54 +08:00

Cleaning up code

This commit is contained in:
MBmasher 2021-11-21 23:53:40 +11:00
parent a57c277a58
commit e9a4ee6800
2 changed files with 3 additions and 2 deletions

View File

@ -71,9 +71,10 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
setDistances(clockRate);
}
public double opacity(double ms, bool hidden)
public double Opacity(double ms, bool hidden)
{
double preemptTime = BaseObject.TimePreempt / clockRate;
if (hidden)
return Math.Clamp(Math.Min((1 - ms / preemptTime) * 2.5, (ms / preemptTime) * (1.0 / 0.3)), 0.0, 1.0);
else

View File

@ -70,7 +70,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
double stackNerf = Math.Min(1.0, (osuPrevious.JumpDistance / scalingFactor) / 25.0);
// Bonus based on how visible the object is.
double opacityBonus = 1.0 + max_opacity_bonus * (1.0 - osuCurrent.opacity(cumulativeStrainTime, hidden));
double opacityBonus = 1.0 + max_opacity_bonus * (1.0 - osuCurrent.Opacity(cumulativeStrainTime, hidden));
result += Math.Pow(0.8, i) * stackNerf * opacityBonus * scalingFactor * jumpDistance / cumulativeStrainTime;
}