2019-01-24 08:43:03 +00: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 09:19:50 +00:00
|
|
|
|
|
2020-05-15 09:07:41 +00:00
|
|
|
|
using System.Threading;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
using osu.Game.Rulesets.Objects.Types;
|
2018-11-29 15:05:13 +00:00
|
|
|
|
using osu.Game.Rulesets.Judgements;
|
2019-09-06 06:24:00 +00:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
2018-11-29 15:05:13 +00:00
|
|
|
|
using osu.Game.Rulesets.Taiko.Judgements;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Objects
|
|
|
|
|
{
|
2020-05-27 03:38:39 +00:00
|
|
|
|
public class Swell : TaikoHitObject, IHasDuration
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2020-02-05 08:12:26 +00:00
|
|
|
|
public double EndTime
|
|
|
|
|
{
|
|
|
|
|
get => StartTime + Duration;
|
|
|
|
|
set => Duration = value - StartTime;
|
|
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2020-10-09 08:12:01 +00:00
|
|
|
|
public override bool CanBeStrong => false;
|
|
|
|
|
|
2018-04-13 09:19:50 +00:00
|
|
|
|
public double Duration { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The number of hits required to complete the swell successfully.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int RequiredHits = 10;
|
2018-08-03 07:35:29 +00:00
|
|
|
|
|
2020-05-15 09:07:41 +00:00
|
|
|
|
protected override void CreateNestedHitObjects(CancellationToken cancellationToken)
|
2018-08-03 07:35:29 +00:00
|
|
|
|
{
|
2020-05-15 09:07:41 +00:00
|
|
|
|
base.CreateNestedHitObjects(cancellationToken);
|
2018-08-03 07:35:29 +00:00
|
|
|
|
|
|
|
|
|
for (int i = 0; i < RequiredHits; i++)
|
2020-05-15 10:25:14 +00:00
|
|
|
|
{
|
|
|
|
|
cancellationToken.ThrowIfCancellationRequested();
|
2018-08-03 07:35:29 +00:00
|
|
|
|
AddNested(new SwellTick());
|
2020-05-15 10:25:14 +00:00
|
|
|
|
}
|
2018-08-03 07:35:29 +00:00
|
|
|
|
}
|
2018-12-06 08:09:42 +00:00
|
|
|
|
|
|
|
|
|
public override Judgement CreateJudgement() => new TaikoSwellJudgement();
|
2019-09-02 07:10:30 +00:00
|
|
|
|
|
2019-10-09 10:08:31 +00:00
|
|
|
|
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|