Skip to content

Commit

Permalink
Change Opacity function to take in absolute map time rather than rela…
Browse files Browse the repository at this point in the history
…tive time
  • Loading branch information
MBmasher committed Nov 30, 2021
1 parent 383bf7c commit b0dc8bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ public OsuDifficultyHitObject(HitObject hitObject, HitObject lastLastObject, Hit
setDistances(clockRate);
}

public double Opacity(double ms, bool hidden)
public double Opacity(double T, bool hidden)
{
double ms = (BaseObject.StartTime - T) / clockRate;
if (ms < 0)
return 0.0;
double preemptTime = BaseObject.TimePreempt / clockRate;
double fadeInTime = BaseObject.TimeFadeIn / clockRate;

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(osuPreviousHitObject.StartTime, hidden));

result += Math.Pow(0.8, i) * stackNerf * opacityBonus * scalingFactor * jumpDistance / cumulativeStrainTime;
}
Expand Down

0 comments on commit b0dc8bf

Please sign in to comment.