From 3d2c8f19ae0a13c9f85c4994bf8095d52115ea3d Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 29 Mar 2017 15:59:12 +0900 Subject: [PATCH] Make Swells require alternating key hits. --- .../Objects/Drawable/DrawableSwell.cs | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs index 291e1df837..d1a9760691 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs @@ -14,6 +14,7 @@ using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; using System; +using System.Linq; namespace osu.Game.Modes.Taiko.Objects.Drawable { @@ -30,11 +31,6 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable private const float target_ring_scale = 5f; private const float inner_ring_alpha = 0.35f; - /// - /// The amount of times the user has hit this swell. - /// - private int userHits; - private readonly Swell swell; private readonly Container bodyContainer; @@ -43,6 +39,15 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable private readonly CirclePiece circlePiece; + private readonly Key[] rimKeys = { Key.D, Key.K }; + private readonly Key[] centreKeys = { Key.F, Key.J }; + private Key[] lastKeySet; + + /// + /// The amount of times the user has hit this swell. + /// + private int userHits; + private bool hasStarted; public DrawableSwell(Swell swell) @@ -206,6 +211,14 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable if (Judgement.Result.HasValue) return false; + // Find the keyset which this key corresponds to + var keySet = rimKeys.Contains(key) ? rimKeys : centreKeys; + + // Ensure alternating keysets + if (keySet == lastKeySet) + return false; + lastKeySet = keySet; + UpdateJudgement(true); return true;