From f47b74a93882444db536c2764bd531a6a712d820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 24 Jun 2022 13:00:12 +0200 Subject: [PATCH] Move `OkResult` from drawable swell to judgement --- .../Judgements/TaikoSwellJudgement.cs | 5 +++++ osu.Game.Rulesets.Taiko/Mods/TaikoModClassic.cs | 4 ++-- .../Objects/Drawables/DrawableSwell.cs | 9 ++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs index b2ac0b7f03..90ba7e276c 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoSwellJudgement.cs @@ -9,6 +9,11 @@ namespace osu.Game.Rulesets.Taiko.Judgements { public class TaikoSwellJudgement : TaikoJudgement { + /// + /// The to grant when the player has hit more than half of swell ticks. + /// + public virtual HitResult OkResult => HitResult.Ok; + protected override double HealthIncreaseFor(HitResult result) { switch (result) diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModClassic.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModClassic.cs index f5541f5191..9100c0b4be 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModClassic.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModClassic.cs @@ -137,6 +137,8 @@ namespace osu.Game.Rulesets.Taiko.Mods private class TaikoClassicSwellJudgement : TaikoSwellJudgement { public override HitResult MaxResult => HitResult.LargeBonus; + + public override HitResult OkResult => HitResult.SmallBonus; } private class ClassicSwell : Swell @@ -156,8 +158,6 @@ namespace osu.Game.Rulesets.Taiko.Mods private class ClassicDrawableSwell : DrawableSwell { public override bool DisplayResult => false; - - protected override HitResult OkResult => HitResult.SmallBonus; } #endregion diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs index 5b70c59376..cb0f59a9fb 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs @@ -16,7 +16,7 @@ using osuTK.Graphics; using osu.Framework.Graphics.Shapes; using osu.Framework.Input.Events; using osu.Game.Rulesets.Objects; -using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.Taiko.Judgements; using osu.Game.Rulesets.Taiko.Skinning.Default; using osu.Game.Skinning; @@ -34,7 +34,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables /// private const double ring_appear_offset = 100; - protected virtual HitResult OkResult => HitResult.Ok; private readonly Container ticks; private readonly Container bodyContainer; private readonly CircularContainer targetRing; @@ -223,7 +222,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables tick.TriggerResult(false); } - ApplyResult(r => r.Type = numHits > HitObject.RequiredHits / 2 ? OkResult : r.Judgement.MinResult); + ApplyResult(r => + { + var swellJudgement = (TaikoSwellJudgement)r.Judgement; + r.Type = numHits > HitObject.RequiredHits / 2 ? swellJudgement.OkResult : swellJudgement.MinResult; + }); } }