Skip to content

Commit

Permalink
Move preempt back to CreateDifficultyAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
MBmasher committed Nov 21, 2021
1 parent afbec94 commit a57c277
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class OsuDifficultyCalculator : DifficultyCalculator
{
private const double difficulty_multiplier = 0.0675;
private double hitWindowGreat;
private double preempt;

public OsuDifficultyCalculator(Ruleset ruleset, WorkingBeatmap beatmap)
: base(ruleset, beatmap)
Expand Down Expand Up @@ -60,6 +59,7 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat

double starRating = basePerformance > 0.00001 ? Math.Cbrt(1.12) * 0.027 * (Math.Cbrt(100000 / Math.Pow(2, 1 / 1.1) * basePerformance) + 4) : 0;

double preempt = IBeatmapDifficultyInfo.DifficultyRange(beatmap.Difficulty.ApproachRate, 1800, 1200, 450) / clockRate;
double drainRate = beatmap.Difficulty.DrainRate;

int maxCombo = beatmap.HitObjects.Count;
Expand Down Expand Up @@ -110,14 +110,12 @@ protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clo

hitWindowGreat = hitWindows.WindowFor(HitResult.Great) / clockRate;

preempt = IBeatmapDifficultyInfo.DifficultyRange(beatmap.Difficulty.ApproachRate, 1800, 1200, 450) / clockRate;

return new Skill[]
{
new Aim(mods, true),
new Aim(mods, false),
new Speed(mods, hitWindowGreat),
new Flashlight(mods, preempt)
new Flashlight(mods)
};
}

Expand Down
4 changes: 1 addition & 3 deletions osu.Game.Rulesets.Osu/Difficulty/Skills/Flashlight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
/// </summary>
public class Flashlight : OsuStrainSkill
{
public Flashlight(Mod[] mods, double preemptTime)
public Flashlight(Mod[] mods)
: base(mods)
{
this.mods = mods;
this.preemptTime = preemptTime;
}

private double skillMultiplier => 0.09;
Expand All @@ -30,7 +29,6 @@ public Flashlight(Mod[] mods, double preemptTime)

private readonly Mod[] mods;
private bool hidden;
private readonly double preemptTime;

private const double max_opacity_bonus = 0.7;
private const double hidden_bonus = 0.5;
Expand Down

0 comments on commit a57c277

Please sign in to comment.