From 2dff04392e96cc8ddee313d3b616f1b91dc7c51e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 3 Aug 2018 16:11:57 +0900 Subject: [PATCH] Re-implement strong judgements via hitobject --- .../Drawables/DrawableStrongHitObject.cs | 19 +++++++++++++++++++ .../Drawables/DrawableTaikoHitObject.cs | 13 +++++++++++++ osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs | 4 ++-- .../Objects/StrongHitObject.cs | 13 +++++++++++++ .../Objects/TaikoHitObject.cs | 8 ++++++++ 5 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongHitObject.cs create mode 100644 osu.Game.Rulesets.Taiko/Objects/StrongHitObject.cs diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongHitObject.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongHitObject.cs new file mode 100644 index 0000000000..e9d12e9c35 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongHitObject.cs @@ -0,0 +1,19 @@ +// 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; + +namespace osu.Game.Rulesets.Taiko.Objects.Drawables +{ + public abstract class DrawableStrongHitObject : DrawableTaikoHitObject + { + protected DrawableStrongHitObject(StrongHitObject strong) + : base(strong) + { + } + + protected override void UpdateState(ArmedState state) + { + } + } +} diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs index a6d61f1a5a..b0216768c1 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs @@ -101,6 +101,17 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables Content.Add(MainPiece = CreateMainPiece()); MainPiece.KiaiMode = HitObject.Kiai; + + var strongObject = HitObject.NestedHitObjects.OfType().FirstOrDefault(); + if (strongObject != null) + { + var vis = CreateStrongObject(strongObject); + if (vis != null) + { + AddNested(vis); + AddInternal(vis); + } + } } // Normal and clap samples are handled by the drum @@ -109,5 +120,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables protected override string SampleNamespace => "Taiko"; protected virtual TaikoPiece CreateMainPiece() => new CirclePiece(); + + protected virtual DrawableStrongHitObject CreateStrongObject(StrongHitObject hitObject) => null; } } diff --git a/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs index 4c9ec5473b..405ea85f0d 100644 --- a/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs @@ -54,12 +54,12 @@ namespace osu.Game.Rulesets.Taiko.Objects protected override void CreateNestedHitObjects() { - base.CreateNestedHitObjects(); - createTicks(); RequiredGoodHits = NestedHitObjects.Count * Math.Min(0.15, 0.05 + 0.10 / 6 * overallDifficulty); RequiredGreatHits = NestedHitObjects.Count * Math.Min(0.30, 0.10 + 0.20 / 6 * overallDifficulty); + + base.CreateNestedHitObjects(); } private void createTicks() diff --git a/osu.Game.Rulesets.Taiko/Objects/StrongHitObject.cs b/osu.Game.Rulesets.Taiko/Objects/StrongHitObject.cs new file mode 100644 index 0000000000..104d662ed8 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Objects/StrongHitObject.cs @@ -0,0 +1,13 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Taiko.Judgements; + +namespace osu.Game.Rulesets.Taiko.Objects +{ + public class StrongHitObject : TaikoHitObject + { + protected override Judgement CreateJudgement() => new TaikoStrongHitJudgement(); + } +} diff --git a/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs b/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs index f3dfb333b3..e0b229d96d 100644 --- a/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs +++ b/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs @@ -30,6 +30,14 @@ namespace osu.Game.Rulesets.Taiko.Objects /// public bool IsStrong; + protected override void CreateNestedHitObjects() + { + base.CreateNestedHitObjects(); + + if (IsStrong) + AddNested(new StrongHitObject()); + } + protected override Judgement CreateJudgement() => new TaikoJudgement(); protected override HitWindows CreateHitWindows() => new TaikoHitWindows();