mirror of
https://github.com/ppy/osu
synced 2025-02-09 14:47:33 +00:00
Use IBeatmapDifficultyInfo.(Inverse)DifficultyRange()
instead of local reimplementations
Also adds explicit references to places from where the magic constants were lifted.
This commit is contained in:
parent
24e31f7d91
commit
fd1c72bf74
@ -15,6 +15,7 @@ using osu.Game.Rulesets.Catch.Beatmaps;
|
|||||||
using osu.Game.Rulesets.Catch.Difficulty;
|
using osu.Game.Rulesets.Catch.Difficulty;
|
||||||
using osu.Game.Rulesets.Catch.Edit;
|
using osu.Game.Rulesets.Catch.Edit;
|
||||||
using osu.Game.Rulesets.Catch.Mods;
|
using osu.Game.Rulesets.Catch.Mods;
|
||||||
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Catch.Replays;
|
using osu.Game.Rulesets.Catch.Replays;
|
||||||
using osu.Game.Rulesets.Catch.Scoring;
|
using osu.Game.Rulesets.Catch.Scoring;
|
||||||
using osu.Game.Rulesets.Catch.Skinning.Argon;
|
using osu.Game.Rulesets.Catch.Skinning.Argon;
|
||||||
@ -236,17 +237,14 @@ namespace osu.Game.Rulesets.Catch
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <seealso cref="CatchHitObject.ApplyDefaultsToSelf"/>
|
||||||
public override BeatmapDifficulty GetRateAdjustedDisplayDifficulty(IBeatmapDifficultyInfo difficulty, double rate)
|
public override BeatmapDifficulty GetRateAdjustedDisplayDifficulty(IBeatmapDifficultyInfo difficulty, double rate)
|
||||||
{
|
{
|
||||||
BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty);
|
BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty);
|
||||||
|
|
||||||
double preempt = adjustedDifficulty.ApproachRate < 6
|
double preempt = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.ApproachRate, 1800, 1200, 450);
|
||||||
? 1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5
|
|
||||||
: 1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5;
|
|
||||||
|
|
||||||
preempt /= rate;
|
preempt /= rate;
|
||||||
|
adjustedDifficulty.ApproachRate = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(preempt, 1800, 1200, 450);
|
||||||
adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? (1800 - preempt) / 120 : (1200 - preempt) / 150 + 5);
|
|
||||||
|
|
||||||
return adjustedDifficulty;
|
return adjustedDifficulty;
|
||||||
}
|
}
|
||||||
|
@ -332,23 +332,19 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
|
|
||||||
public override RulesetSetupSection CreateEditorSetupSection() => new OsuSetupSection();
|
public override RulesetSetupSection CreateEditorSetupSection() => new OsuSetupSection();
|
||||||
|
|
||||||
|
/// <seealso cref="OsuHitObject.ApplyDefaultsToSelf"/>
|
||||||
|
/// <seealso cref="OsuHitWindows"/>
|
||||||
public override BeatmapDifficulty GetRateAdjustedDisplayDifficulty(IBeatmapDifficultyInfo difficulty, double rate)
|
public override BeatmapDifficulty GetRateAdjustedDisplayDifficulty(IBeatmapDifficultyInfo difficulty, double rate)
|
||||||
{
|
{
|
||||||
BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty);
|
BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty);
|
||||||
|
|
||||||
double preempt = adjustedDifficulty.ApproachRate < 5
|
double preempt = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.ApproachRate, 1800, 1200, 450);
|
||||||
? 1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5
|
|
||||||
: 1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5;
|
|
||||||
|
|
||||||
preempt /= rate;
|
preempt /= rate;
|
||||||
|
adjustedDifficulty.ApproachRate = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(preempt, 1800, 1200, 450);
|
||||||
|
|
||||||
adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? (1800 - preempt) / 120 : (1200 - preempt) / 150 + 5);
|
double greatHitWindow = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.OverallDifficulty, 80, 50, 20);
|
||||||
|
greatHitWindow /= rate;
|
||||||
double hitwindow = 80.0 - 6 * adjustedDifficulty.OverallDifficulty;
|
adjustedDifficulty.OverallDifficulty = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(greatHitWindow, 80, 50, 20);
|
||||||
|
|
||||||
hitwindow /= rate;
|
|
||||||
|
|
||||||
adjustedDifficulty.OverallDifficulty = (float)(80.0 - hitwindow) / 6;
|
|
||||||
|
|
||||||
return adjustedDifficulty;
|
return adjustedDifficulty;
|
||||||
}
|
}
|
||||||
|
@ -265,15 +265,14 @@ namespace osu.Game.Rulesets.Taiko
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <seealso cref="TaikoHitWindows"/>
|
||||||
public override BeatmapDifficulty GetRateAdjustedDisplayDifficulty(IBeatmapDifficultyInfo difficulty, double rate)
|
public override BeatmapDifficulty GetRateAdjustedDisplayDifficulty(IBeatmapDifficultyInfo difficulty, double rate)
|
||||||
{
|
{
|
||||||
BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty);
|
BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty);
|
||||||
|
|
||||||
double hitWindow = 35.0 - 15.0 * (adjustedDifficulty.OverallDifficulty - 5) / 5;
|
double greatHitWindow = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.OverallDifficulty, 50, 35, 20);
|
||||||
|
greatHitWindow /= rate;
|
||||||
hitWindow /= rate;
|
adjustedDifficulty.OverallDifficulty = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(greatHitWindow, 50, 35, 20);
|
||||||
|
|
||||||
adjustedDifficulty.OverallDifficulty = (float)(5 * (35 - hitWindow) / 15 + 5);
|
|
||||||
|
|
||||||
return adjustedDifficulty;
|
return adjustedDifficulty;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user