Skip to content

Commit

Permalink
Cleaning up code
Browse files Browse the repository at this point in the history
  • Loading branch information
MBmasher committed Nov 21, 2021
1 parent a57c277 commit e9a4ee6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ public OsuDifficultyHitObject(HitObject hitObject, HitObject lastLastObject, Hit
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
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Osu/Difficulty/Skills/Flashlight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private double strainValueOf(DifficultyHitObject current)
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;
}
Expand Down

0 comments on commit e9a4ee6

Please sign in to comment.