mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 02:22:56 +08:00
Remove SliderVelocityAt, compute it manually inside hit objects.
This commit is contained in:
parent
ffe4d0ae4a
commit
74bd427997
@ -14,6 +14,11 @@ namespace osu.Game.Modes.Osu.Objects
|
||||
{
|
||||
public class Slider : OsuHitObject, IHasCurve
|
||||
{
|
||||
/// <summary>
|
||||
/// Scoring distance with a speed-adjusted beat length of 1 second.
|
||||
/// </summary>
|
||||
private const float base_scoring_distance = 100;
|
||||
|
||||
public IHasCurve CurveObject { get; set; }
|
||||
|
||||
public SliderCurve Curve => CurveObject.Curve;
|
||||
@ -51,13 +56,10 @@ namespace osu.Game.Modes.Osu.Objects
|
||||
{
|
||||
base.ApplyDefaults(timing, difficulty);
|
||||
|
||||
ControlPoint overridePoint;
|
||||
ControlPoint timingPoint = timing.TimingPointAt(StartTime, out overridePoint);
|
||||
var velocityAdjustment = overridePoint?.VelocityAdjustment ?? 1;
|
||||
var baseVelocity = 100 * difficulty.SliderMultiplier / velocityAdjustment;
|
||||
double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier / timing.SpeedMultiplierAt(StartTime);
|
||||
|
||||
Velocity = baseVelocity / timingPoint.BeatLength;
|
||||
TickDistance = baseVelocity / difficulty.SliderTickRate;
|
||||
Velocity = scoringDistance / timing.BeatLengthAt(StartTime);
|
||||
TickDistance = scoringDistance / difficulty.SliderTickRate;
|
||||
}
|
||||
|
||||
public IEnumerable<SliderTick> Ticks
|
||||
|
@ -13,6 +13,11 @@ namespace osu.Game.Modes.Taiko.Objects
|
||||
{
|
||||
public class DrumRoll : TaikoHitObject, IHasDistance
|
||||
{
|
||||
/// <summary>
|
||||
/// Drum roll distance that results in a duration of 1 speed-adjusted beat length.
|
||||
/// </summary>
|
||||
private const float base_distance = 100;
|
||||
|
||||
public double EndTime => StartTime + Distance / Velocity;
|
||||
|
||||
public double Duration => EndTime - StartTime;
|
||||
@ -59,7 +64,7 @@ namespace osu.Game.Modes.Taiko.Objects
|
||||
{
|
||||
base.ApplyDefaults(timing, difficulty);
|
||||
|
||||
Velocity = timing.SliderVelocityAt(StartTime) * difficulty.SliderMultiplier / 1000;
|
||||
Velocity = base_distance * difficulty.SliderMultiplier * difficulty.SliderTickRate * timing.BeatLengthAt(StartTime) * timing.SpeedMultiplierAt(StartTime);
|
||||
TickTimeDistance = timing.BeatLengthAt(StartTime);
|
||||
|
||||
//TODO: move this to legacy conversion code to allow for direct division without special case.
|
||||
|
@ -14,6 +14,11 @@ namespace osu.Game.Modes.Taiko.Objects
|
||||
/// </summary>
|
||||
public const float CIRCLE_RADIUS = 42f;
|
||||
|
||||
/// <summary>
|
||||
/// Time (in milliseconds) to scroll in the hit object with a speed-adjusted beat length of 1 second.
|
||||
/// </summary>
|
||||
private const double base_scroll_time = 6000;
|
||||
|
||||
/// <summary>
|
||||
/// The time to scroll in the HitObject.
|
||||
/// </summary>
|
||||
@ -34,7 +39,7 @@ namespace osu.Game.Modes.Taiko.Objects
|
||||
{
|
||||
base.ApplyDefaults(timing, difficulty);
|
||||
|
||||
PreEmpt = 600 / (timing.SliderVelocityAt(StartTime) * difficulty.SliderMultiplier) * 1000;
|
||||
PreEmpt = base_scroll_time / difficulty.SliderMultiplier * timing.BeatLengthAt(StartTime) * timing.SpeedMultiplierAt(StartTime) / 1000;
|
||||
|
||||
ControlPoint overridePoint;
|
||||
Kiai = timing.TimingPointAt(StartTime, out overridePoint).KiaiMode;
|
||||
|
@ -76,21 +76,5 @@ namespace osu.Game.Beatmaps.Timing
|
||||
|
||||
return timingPoint ?? ControlPoint.Default;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds the slider velocity at a time.
|
||||
/// </summary>
|
||||
/// <param name="time">The time to find the slider velocity at.</param>
|
||||
/// <returns>The slider velocity in milliseconds.</returns>
|
||||
public double SliderVelocityAt(double time)
|
||||
{
|
||||
const double base_scoring_distance = 100;
|
||||
|
||||
double beatDistance = BeatDistanceAt(time);
|
||||
|
||||
if (beatDistance > 0)
|
||||
return base_scoring_distance / beatDistance * 1000;
|
||||
return base_scoring_distance;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user