Add preempt adjustment and fade in first end circle with slider to match stable

This commit is contained in:
Dean Herbert 2020-10-02 15:21:52 +09:00
parent 2975ea9210
commit ad4cac13ac
4 changed files with 30 additions and 6 deletions

View File

@ -174,10 +174,9 @@ namespace osu.Game.Rulesets.Osu.Objects
// we need to use the LegacyLastTick here for compatibility reasons (difficulty). // we need to use the LegacyLastTick here for compatibility reasons (difficulty).
// it is *okay* to use this because the TailCircle is not used for any meaningful purpose in gameplay. // it is *okay* to use this because the TailCircle is not used for any meaningful purpose in gameplay.
// if this is to change, we should revisit this. // if this is to change, we should revisit this.
AddNested(TailCircle = new SliderTailCircle AddNested(TailCircle = new SliderTailCircle(this)
{ {
RepeatIndex = e.SpanIndex, RepeatIndex = e.SpanIndex,
SpanDuration = SpanDuration,
StartTime = e.Time, StartTime = e.Time,
Position = EndPosition, Position = EndPosition,
StackHeight = StackHeight StackHeight = StackHeight
@ -185,10 +184,9 @@ namespace osu.Game.Rulesets.Osu.Objects
break; break;
case SliderEventType.Repeat: case SliderEventType.Repeat:
AddNested(new SliderRepeat AddNested(new SliderRepeat(this)
{ {
RepeatIndex = e.SpanIndex, RepeatIndex = e.SpanIndex,
SpanDuration = SpanDuration,
StartTime = StartTime + (e.SpanIndex + 1) * SpanDuration, StartTime = StartTime + (e.SpanIndex + 1) * SpanDuration,
Position = Position + Path.PositionAt(e.PathProgress), Position = Position + Path.PositionAt(e.PathProgress),
StackHeight = StackHeight, StackHeight = StackHeight,

View File

@ -8,12 +8,20 @@ using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Osu.Objects namespace osu.Game.Rulesets.Osu.Objects
{ {
/// <summary> /// <summary>
/// A hitcircle which is at the end of a slider path (either repeat or final tail). /// A hit circle which is at the end of a slider path (either repeat or final tail).
/// </summary> /// </summary>
public abstract class SliderEndCircle : HitCircle public abstract class SliderEndCircle : HitCircle
{ {
private readonly Slider slider;
protected SliderEndCircle(Slider slider)
{
this.slider = slider;
}
public int RepeatIndex { get; set; } public int RepeatIndex { get; set; }
public double SpanDuration { get; set; }
public double SpanDuration => slider.SpanDuration;
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty) protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
{ {
@ -27,6 +35,14 @@ namespace osu.Game.Rulesets.Osu.Objects
// The next end circle should appear exactly after the previous circle (on the same end) is hit. // The next end circle should appear exactly after the previous circle (on the same end) is hit.
TimePreempt = SpanDuration * 2; TimePreempt = SpanDuration * 2;
} }
else
{
// taken from osu-stable
const float first_end_circle_preempt_adjust = 2 / 3f;
// The first end circle should fade in with the slider.
TimePreempt = (StartTime - slider.StartTime) + slider.TimePreempt * first_end_circle_preempt_adjust;
}
} }
protected override HitWindows CreateHitWindows() => HitWindows.Empty; protected override HitWindows CreateHitWindows() => HitWindows.Empty;

View File

@ -9,6 +9,11 @@ namespace osu.Game.Rulesets.Osu.Objects
{ {
public class SliderRepeat : SliderEndCircle public class SliderRepeat : SliderEndCircle
{ {
public SliderRepeat(Slider slider)
: base(slider)
{
}
public override Judgement CreateJudgement() => new SliderRepeatJudgement(); public override Judgement CreateJudgement() => new SliderRepeatJudgement();
public class SliderRepeatJudgement : OsuJudgement public class SliderRepeatJudgement : OsuJudgement

View File

@ -14,6 +14,11 @@ namespace osu.Game.Rulesets.Osu.Objects
/// </summary> /// </summary>
public class SliderTailCircle : SliderEndCircle public class SliderTailCircle : SliderEndCircle
{ {
public SliderTailCircle(Slider slider)
: base(slider)
{
}
public override Judgement CreateJudgement() => new SliderTailJudgement(); public override Judgement CreateJudgement() => new SliderTailJudgement();
public class SliderTailJudgement : OsuJudgement public class SliderTailJudgement : OsuJudgement