1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 21:47:25 +08:00

Make Swells require alternating key hits.

This commit is contained in:
smoogipooo 2017-03-29 15:59:12 +09:00
parent 982fcbbf53
commit 3d2c8f19ae

View File

@ -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;
/// <summary>
/// The amount of times the user has hit this swell.
/// </summary>
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;
/// <summary>
/// The amount of times the user has hit this swell.
/// </summary>
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;