mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09: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
|
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 IHasCurve CurveObject { get; set; }
|
||||||
|
|
||||||
public SliderCurve Curve => CurveObject.Curve;
|
public SliderCurve Curve => CurveObject.Curve;
|
||||||
@ -51,13 +56,10 @@ namespace osu.Game.Modes.Osu.Objects
|
|||||||
{
|
{
|
||||||
base.ApplyDefaults(timing, difficulty);
|
base.ApplyDefaults(timing, difficulty);
|
||||||
|
|
||||||
ControlPoint overridePoint;
|
double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier / timing.SpeedMultiplierAt(StartTime);
|
||||||
ControlPoint timingPoint = timing.TimingPointAt(StartTime, out overridePoint);
|
|
||||||
var velocityAdjustment = overridePoint?.VelocityAdjustment ?? 1;
|
|
||||||
var baseVelocity = 100 * difficulty.SliderMultiplier / velocityAdjustment;
|
|
||||||
|
|
||||||
Velocity = baseVelocity / timingPoint.BeatLength;
|
Velocity = scoringDistance / timing.BeatLengthAt(StartTime);
|
||||||
TickDistance = baseVelocity / difficulty.SliderTickRate;
|
TickDistance = scoringDistance / difficulty.SliderTickRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<SliderTick> Ticks
|
public IEnumerable<SliderTick> Ticks
|
||||||
|
@ -13,6 +13,11 @@ namespace osu.Game.Modes.Taiko.Objects
|
|||||||
{
|
{
|
||||||
public class DrumRoll : TaikoHitObject, IHasDistance
|
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 EndTime => StartTime + Distance / Velocity;
|
||||||
|
|
||||||
public double Duration => EndTime - StartTime;
|
public double Duration => EndTime - StartTime;
|
||||||
@ -59,7 +64,7 @@ namespace osu.Game.Modes.Taiko.Objects
|
|||||||
{
|
{
|
||||||
base.ApplyDefaults(timing, difficulty);
|
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);
|
TickTimeDistance = timing.BeatLengthAt(StartTime);
|
||||||
|
|
||||||
//TODO: move this to legacy conversion code to allow for direct division without special case.
|
//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>
|
/// </summary>
|
||||||
public const float CIRCLE_RADIUS = 42f;
|
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>
|
/// <summary>
|
||||||
/// The time to scroll in the HitObject.
|
/// The time to scroll in the HitObject.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -34,7 +39,7 @@ namespace osu.Game.Modes.Taiko.Objects
|
|||||||
{
|
{
|
||||||
base.ApplyDefaults(timing, difficulty);
|
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;
|
ControlPoint overridePoint;
|
||||||
Kiai = timing.TimingPointAt(StartTime, out overridePoint).KiaiMode;
|
Kiai = timing.TimingPointAt(StartTime, out overridePoint).KiaiMode;
|
||||||
|
@ -76,21 +76,5 @@ namespace osu.Game.Beatmaps.Timing
|
|||||||
|
|
||||||
return timingPoint ?? ControlPoint.Default;
|
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…
x
Reference in New Issue
Block a user