2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2020-10-02 13:20:55 +08:00
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
2023-11-02 18:27:55 +08:00
|
|
|
|
using osu.Game.Rulesets.Judgements;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Judgements;
|
2020-10-02 13:20:55 +08:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
|
|
2018-03-09 22:12:34 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Osu.Objects
|
|
|
|
|
{
|
2020-10-02 13:20:55 +08:00
|
|
|
|
/// <summary>
|
2020-10-02 14:21:52 +08:00
|
|
|
|
/// A hit circle which is at the end of a slider path (either repeat or final tail).
|
2020-10-02 13:20:55 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
public abstract class SliderEndCircle : HitCircle
|
2018-03-09 22:12:34 +08:00
|
|
|
|
{
|
2024-01-13 08:32:37 +08:00
|
|
|
|
protected readonly Slider Slider;
|
2020-10-02 14:21:52 +08:00
|
|
|
|
|
|
|
|
|
protected SliderEndCircle(Slider slider)
|
|
|
|
|
{
|
2024-01-13 08:32:37 +08:00
|
|
|
|
Slider = slider;
|
2020-10-02 14:21:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-10-02 13:20:55 +08:00
|
|
|
|
public int RepeatIndex { get; set; }
|
2020-10-02 14:21:52 +08:00
|
|
|
|
|
2024-01-13 08:32:37 +08:00
|
|
|
|
public double SpanDuration => Slider.SpanDuration;
|
2020-10-02 13:20:55 +08:00
|
|
|
|
|
2021-10-01 13:56:42 +08:00
|
|
|
|
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty)
|
2020-10-02 13:20:55 +08:00
|
|
|
|
{
|
|
|
|
|
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
|
|
|
|
|
|
|
|
|
if (RepeatIndex > 0)
|
2020-10-02 13:37:07 +08:00
|
|
|
|
{
|
|
|
|
|
// Repeat points after the first span should appear behind the still-visible one.
|
|
|
|
|
TimeFadeIn = 0;
|
|
|
|
|
|
|
|
|
|
// The next end circle should appear exactly after the previous circle (on the same end) is hit.
|
|
|
|
|
TimePreempt = SpanDuration * 2;
|
|
|
|
|
}
|
2020-10-02 14:21:52 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// The first end circle should fade in with the slider.
|
2024-01-13 08:32:37 +08:00
|
|
|
|
TimePreempt += StartTime - Slider.StartTime;
|
2020-10-02 14:21:52 +08:00
|
|
|
|
}
|
2020-10-02 13:20:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
2023-11-02 18:27:55 +08:00
|
|
|
|
|
|
|
|
|
public override Judgement CreateJudgement() => new SliderEndJudgement();
|
|
|
|
|
|
|
|
|
|
public class SliderEndJudgement : OsuJudgement
|
|
|
|
|
{
|
|
|
|
|
public override HitResult MaxResult => HitResult.LargeTickHit;
|
|
|
|
|
}
|
2018-03-09 22:12:34 +08:00
|
|
|
|
}
|
|
|
|
|
}
|