Convert slider velocity to scroll speed in taiko beatmap conversion

This commit is contained in:
sw1tchbl4d3 2022-10-11 22:43:47 +02:00
parent cc0ca470f1
commit 0a0d699308

View File

@ -57,6 +57,29 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
Beatmap<TaikoHitObject> converted = base.ConvertBeatmap(original, cancellationToken);
if (original.BeatmapInfo.Ruleset.OnlineID == 0)
{
// Post processing step to transform standard slider velocity changes into scroll speed changes
double lastScrollSpeed = 1;
foreach (HitObject hitObject in original.HitObjects)
{
double nextScrollSpeed = hitObject.DifficultyControlPoint.SliderVelocity;
if (!Precision.AlmostEquals(lastScrollSpeed, nextScrollSpeed))
{
EffectControlPoint currentControlPoint = converted.ControlPointInfo.EffectPointAt(hitObject.StartTime);
if (Precision.AlmostEquals(currentControlPoint.Time, hitObject.StartTime))
currentControlPoint.ScrollSpeed = nextScrollSpeed;
else
converted.ControlPointInfo.Add(hitObject.StartTime, new EffectControlPoint { ScrollSpeed = nextScrollSpeed });
lastScrollSpeed = nextScrollSpeed;
}
}
}
if (original.BeatmapInfo.Ruleset.OnlineID == 3)
{
// Post processing step to transform mania hit objects with the same start time into strong hits