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
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
2018-08-02 19:36:38 +08:00
|
|
|
|
using osu.Game.Rulesets.Judgements;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Judgements;
|
2019-09-06 14:24:00 +08:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Objects
|
|
|
|
|
{
|
2020-03-19 13:42:02 +08:00
|
|
|
|
public class SliderRepeat : OsuHitObject
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
public int RepeatIndex { get; set; }
|
|
|
|
|
public double SpanDuration { get; set; }
|
|
|
|
|
|
|
|
|
|
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
|
|
|
|
|
{
|
|
|
|
|
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
|
|
|
|
|
2018-07-30 17:51:25 +08:00
|
|
|
|
// Out preempt should be one span early to give the user ample warning.
|
|
|
|
|
TimePreempt += SpanDuration;
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
// We want to show the first RepeatPoint as the TimePreempt dictates but on short (and possibly fast) sliders
|
|
|
|
|
// we may need to cut down this time on following RepeatPoints to only show up to two RepeatPoints at any given time.
|
|
|
|
|
if (RepeatIndex > 0)
|
|
|
|
|
TimePreempt = Math.Min(SpanDuration * 2, TimePreempt);
|
|
|
|
|
}
|
2018-08-02 19:36:38 +08:00
|
|
|
|
|
2019-10-09 18:08:31 +08:00
|
|
|
|
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
2020-03-19 13:26:24 +08:00
|
|
|
|
|
2020-03-19 13:42:02 +08:00
|
|
|
|
public override Judgement CreateJudgement() => new SliderRepeatJudgement();
|
2020-03-19 13:26:24 +08:00
|
|
|
|
|
2020-03-19 13:42:02 +08:00
|
|
|
|
public class SliderRepeatJudgement : OsuJudgement
|
2020-03-19 13:26:24 +08:00
|
|
|
|
{
|
2020-09-29 13:35:43 +08:00
|
|
|
|
public override HitResult MaxResult => HitResult.LargeTickHit;
|
2020-03-19 13:26:24 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|