Clearer slider Velocity and TickDistance calculations.

This commit is contained in:
Damnae
2017-02-15 18:55:49 +01:00
parent e2fae24ad5
commit b7fca88b4f
2 changed files with 27 additions and 19 deletions

View File

@ -4,6 +4,7 @@
using OpenTK;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Samples;
using osu.Game.Beatmaps.Timing;
using System;
using System.Collections.Generic;
@ -53,11 +54,13 @@ namespace osu.Game.Modes.Osu.Objects
var baseDifficulty = beatmap.BeatmapInfo.BaseDifficulty;
var startBeatLength = beatmap.BeatLengthAt(StartTime);
var multipliedStartBeatLength = beatmap.BeatLengthAt(StartTime, true);
ControlPoint overridePoint;
ControlPoint timingPoint = beatmap.TimingPointAt(StartTime, out overridePoint);
var velocityAdjustment = overridePoint?.VelocityAdjustment ?? 1;
var baseVelocity = 100 * baseDifficulty.SliderMultiplier;
Velocity = 100 / multipliedStartBeatLength * baseDifficulty.SliderMultiplier;
TickDistance = (100 * baseDifficulty.SliderMultiplier) / baseDifficulty.SliderTickRate / (multipliedStartBeatLength / startBeatLength);
Velocity = baseVelocity / (timingPoint.BeatLength * velocityAdjustment);
TickDistance = baseVelocity / (baseDifficulty.SliderTickRate * velocityAdjustment);
}
public int RepeatCount = 1;