diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs index 50b010e543..e6ef4c8a72 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs @@ -14,9 +14,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics.Shapes; -using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; -using osu.Game.Rulesets.Taiko.Judgements; namespace osu.Game.Rulesets.Taiko.Objects.Drawables { @@ -32,8 +30,7 @@ public class DrawableSwell : DrawableTaikoHitObject private const float target_ring_scale = 5f; private const float inner_ring_alpha = 0.65f; - private readonly JudgementResult result; - private readonly List intermediateResults; + private readonly List ticks = new List(); private readonly Container bodyContainer; private readonly CircularContainer targetRing; @@ -113,8 +110,14 @@ public DrawableSwell(Swell swell) MainPiece.Add(symbol = new SwellSymbolPiece()); - result = Results.Single(r => !(r.Judgement is TaikoIntermediateSwellJudgement)); - intermediateResults = Results.Where(r => r.Judgement is TaikoIntermediateSwellJudgement).ToList(); + foreach (var tick in HitObject.NestedHitObjects.OfType()) + { + var vis = new DrawableSwellTick(tick); + + ticks.Add(vis); + AddInternal(vis); + AddNested(vis); + } } [BackgroundDependencyLoader] @@ -137,12 +140,11 @@ protected override void CheckForJudgements(bool userTriggered, double timeOffset { if (userTriggered) { - var nextIntermediate = intermediateResults.FirstOrDefault(j => !j.HasResult); + var nextTick = ticks.FirstOrDefault(j => !j.IsHit); - if (nextIntermediate != null) - ApplyResult(nextIntermediate, r => r.Type = HitResult.Great); + nextTick?.TriggerResult(HitResult.Great); - var numHits = intermediateResults.Count(r => r.HasResult); + var numHits = ticks.Count(r => r.IsHit); var completion = (float)numHits / HitObject.RequiredHits; @@ -156,7 +158,7 @@ protected override void CheckForJudgements(bool userTriggered, double timeOffset expandingRing.ScaleTo(1f + Math.Min(target_ring_scale - 1f, (target_ring_scale - 1f) * completion * 1.3f), 260, Easing.OutQuint); if (numHits == HitObject.RequiredHits) - ApplyResult(result, r => r.Type = HitResult.Great); + ApplyResult(r => r.Type = HitResult.Great); } else { @@ -165,20 +167,20 @@ protected override void CheckForJudgements(bool userTriggered, double timeOffset int numHits = 0; - foreach (var intermediate in intermediateResults) + foreach (var tick in ticks) { - if (intermediate.HasResult) + if (tick.IsHit) { numHits++; continue; } - ApplyResult(intermediate, r => r.Type = HitResult.Miss); + tick.TriggerResult(HitResult.Miss); } var hitResult = numHits > HitObject.RequiredHits / 2 ? HitResult.Good : HitResult.Miss; - ApplyResult(result, r => r.Type = hitResult); + ApplyResult(r => r.Type = hitResult); } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs new file mode 100644 index 0000000000..813b6c965b --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwellTick.cs @@ -0,0 +1,28 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; + +namespace osu.Game.Rulesets.Taiko.Objects.Drawables +{ + public class DrawableSwellTick : DrawableTaikoHitObject + { + public DrawableSwellTick(TaikoHitObject hitObject) + : base(hitObject) + { + } + + public void TriggerResult(HitResult type) => ApplyResult(r => r.Type = type); + + protected override void CheckForJudgements(bool userTriggered, double timeOffset) + { + } + + protected override void UpdateState(ArmedState state) + { + } + + public override bool OnPressed(TaikoAction action) => false; + } +} diff --git a/osu.Game.Rulesets.Taiko/Objects/Swell.cs b/osu.Game.Rulesets.Taiko/Objects/Swell.cs index eb6f931af4..c3ea71af3f 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Swell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Swell.cs @@ -15,5 +15,13 @@ public class Swell : TaikoHitObject, IHasEndTime /// The number of hits required to complete the swell successfully. /// public int RequiredHits = 10; + + protected override void CreateNestedHitObjects() + { + base.CreateNestedHitObjects(); + + for (int i = 0; i < RequiredHits; i++) + AddNested(new SwellTick()); + } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/SwellTick.cs b/osu.Game.Rulesets.Taiko/Objects/SwellTick.cs new file mode 100644 index 0000000000..49eb6d2a15 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Objects/SwellTick.cs @@ -0,0 +1,9 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Taiko.Objects +{ + public class SwellTick : TaikoHitObject + { + } +} diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs b/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs index 2fa4627bde..229ab69ceb 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs @@ -100,12 +100,8 @@ protected override DrawableHitObject GetVisualRepresentation(Tai { switch (h) { - case CentreHit centreHit when h.IsStrong: - return new DrawableCentreHitStrong(centreHit); case CentreHit centreHit: return new DrawableCentreHit(centreHit); - case RimHit rimHit when h.IsStrong: - return new DrawableRimHitStrong(rimHit); case RimHit rimHit: return new DrawableRimHit(rimHit); case DrumRoll drumRoll: