Skip to content

Commit

Permalink
Revert "Merge pull request ppy#15867 from MBmasher/fl-cumulative-strain"
Browse files Browse the repository at this point in the history
This reverts commit 05b79f8, reversing
changes made to a53c67b.
  • Loading branch information
smoogipoo committed Jan 17, 2022
1 parent 55c0e5e commit 490bdf4
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions osu.Game.Rulesets.Osu/Difficulty/Skills/Flashlight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,26 @@ private double strainValueOf(DifficultyHitObject current)

double result = 0.0;

OsuDifficultyHitObject lastObj = osuCurrent;

// This is iterating backwards in time from the current object.
for (int i = 0; i < Previous.Count; i++)
{
var currentObj = (OsuDifficultyHitObject)Previous[i];
var currentHitObject = (OsuHitObject)(currentObj.BaseObject);
var osuPrevious = (OsuDifficultyHitObject)Previous[i];
var osuPreviousHitObject = (OsuHitObject)(osuPrevious.BaseObject);

if (!(currentObj.BaseObject is Spinner))
if (!(osuPrevious.BaseObject is Spinner))
{
double jumpDistance = (osuHitObject.StackedPosition - currentHitObject.EndPosition).Length;
double jumpDistance = (osuHitObject.StackedPosition - osuPreviousHitObject.EndPosition).Length;

cumulativeStrainTime += lastObj.StrainTime;
cumulativeStrainTime += osuPrevious.StrainTime;

// We want to nerf objects that can be easily seen within the Flashlight circle radius.
if (i == 0)
smallDistNerf = Math.Min(1.0, jumpDistance / 75.0);

// We also want to nerf stacks so that only the first object of the stack is accounted for.
double stackNerf = Math.Min(1.0, (currentObj.LazyJumpDistance / scalingFactor) / 25.0);
double stackNerf = Math.Min(1.0, (osuPrevious.LazyJumpDistance / scalingFactor) / 25.0);

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

lastObj = currentObj;
}

return Math.Pow(smallDistNerf * result, 2.0);
Expand Down

0 comments on commit 490bdf4

Please sign in to comment.