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
|
|
|
|
|
2018-08-15 00:12:29 +00:00
|
|
|
|
using System;
|
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;
|
|
|
|
|
using osu.Game.Rulesets.Taiko.Judgements;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Objects
|
|
|
|
|
{
|
|
|
|
|
public class Swell : TaikoHitObject, IHasEndTime
|
|
|
|
|
{
|
|
|
|
|
public double EndTime => StartTime + Duration;
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2019-02-28 04:31:40 +00:00
|
|
|
|
public override bool IsStrong
|
|
|
|
|
{
|
|
|
|
|
set => throw new NotSupportedException($"{nameof(Swell)} cannot be a strong hitobject.");
|
|
|
|
|
}
|
2018-08-15 00:12:29 +00:00
|
|
|
|
|
2018-08-03 07:35:29 +00:00
|
|
|
|
protected override void CreateNestedHitObjects()
|
|
|
|
|
{
|
|
|
|
|
base.CreateNestedHitObjects();
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < RequiredHits; i++)
|
|
|
|
|
AddNested(new SwellTick());
|
|
|
|
|
}
|
2018-12-06 08:09:42 +00:00
|
|
|
|
|
|
|
|
|
public override Judgement CreateJudgement() => new TaikoSwellJudgement();
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|