From c0dae89844d603fb6bd486f76d3a2235bafefbe1 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 29 Mar 2017 18:16:26 +0900 Subject: [PATCH] Implement partial strong hit judgements. --- .../Judgements/TaikoJudgement.cs | 6 ++--- .../Judgements/TaikoStrongHitJudgement.cs | 25 +++++++++++++++++++ .../Objects/Drawable/DrawableStrongHit.cs | 3 +++ .../osu.Game.Modes.Taiko.csproj | 1 + 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 osu.Game.Modes.Taiko/Judgements/TaikoStrongHitJudgement.cs diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoJudgement.cs b/osu.Game.Modes.Taiko/Judgements/TaikoJudgement.cs index e50a685e24..f4745730db 100644 --- a/osu.Game.Modes.Taiko/Judgements/TaikoJudgement.cs +++ b/osu.Game.Modes.Taiko/Judgements/TaikoJudgement.cs @@ -22,7 +22,7 @@ namespace osu.Game.Modes.Taiko.Judgements /// The result value for the combo portion of the score. /// public int ResultValueForScore => NumericResultForScore(TaikoResult); - + /// /// The result value for the accuracy portion of the score. /// @@ -32,7 +32,7 @@ namespace osu.Game.Modes.Taiko.Judgements /// The maximum result value for the combo portion of the score. /// public int MaxResultValueForScore => NumericResultForScore(MAX_HIT_RESULT); - + /// /// The maximum result value for the accuracy portion of the score. /// @@ -45,7 +45,7 @@ namespace osu.Game.Modes.Taiko.Judgements /// /// Whether this Judgement has a secondary hit in the case of finishers. /// - public bool SecondHit; + public virtual bool SecondHit { get; set; } /// /// Computes the numeric result value for the combo portion of the score. diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoStrongHitJudgement.cs b/osu.Game.Modes.Taiko/Judgements/TaikoStrongHitJudgement.cs new file mode 100644 index 0000000000..ee978d0026 --- /dev/null +++ b/osu.Game.Modes.Taiko/Judgements/TaikoStrongHitJudgement.cs @@ -0,0 +1,25 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Modes.Judgements; + +namespace osu.Game.Modes.Taiko.Judgements +{ + public class TaikoStrongHitJudgement : TaikoJudgement, IPartialJudgement + { + public bool Changed { get; set; } + + public override bool SecondHit + { + get { return base.SecondHit; } + set + { + if (base.SecondHit == value) + return; + base.SecondHit = value; + + Changed = true; + } + } + } +} diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongHit.cs index a77fd1d6be..a6cb6ae7fa 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongHit.cs @@ -6,6 +6,7 @@ using System; using System.Linq; using osu.Framework.Input; using osu.Game.Modes.Objects.Drawables; +using osu.Game.Modes.Taiko.Judgements; namespace osu.Game.Modes.Taiko.Objects.Drawable { @@ -26,6 +27,8 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { } + protected override TaikoJudgement CreateJudgement() => new TaikoStrongHitJudgement(); + protected override void CheckJudgement(bool userTriggered) { if (Judgement.Result == HitResult.None) diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index 07f9a5d4e6..60fe8cb51f 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -50,6 +50,7 @@ +