diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs index 29a7b03ad3..4f527e9a0f 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs @@ -168,6 +168,28 @@ namespace osu.Game.Rulesets.Catch.Tests checkHyperDash(false); } + [Test] + public void TestLastBananaShouldClearPlateOnMiss() + { + AddStep("catch fruit", () => attemptCatch(new Fruit())); + checkPlate(1); + AddStep("miss banana", () => attemptCatch(new Banana { X = 100 })); + checkPlate(1); + AddStep("miss last banana", () => attemptCatch(new Banana { LastInCombo = true, X = 100 })); + checkPlate(0); + } + + [Test] + public void TestLastBananaShouldClearPlateOnCatch() + { + AddStep("catch fruit", () => attemptCatch(new Fruit())); + checkPlate(1); + AddStep("catch banana", () => attemptCatch(new Banana())); + checkPlate(2); + AddStep("catch last banana", () => attemptCatch(new Banana { LastInCombo = true })); + checkPlate(0); + } + [Test] public void TestCatcherRandomStacking() { diff --git a/osu.Game.Rulesets.Catch/UI/Catcher.cs b/osu.Game.Rulesets.Catch/UI/Catcher.cs index 2a13190cc5..04708c8796 100644 --- a/osu.Game.Rulesets.Catch/UI/Catcher.cs +++ b/osu.Game.Rulesets.Catch/UI/Catcher.cs @@ -210,6 +210,7 @@ namespace osu.Game.Rulesets.Catch.UI catchResult.CatcherAnimationState = CurrentState; catchResult.CatcherHyperDash = HyperDashing; + // Ignore JuiceStreams and BananaShowers if (!(drawableObject is DrawablePalpableCatchHitObject palpableObject)) return; var hitObject = palpableObject.HitObject; @@ -244,6 +245,14 @@ namespace osu.Game.Rulesets.Catch.UI CurrentState = hitObject.Kiai ? CatcherAnimationState.Kiai : CatcherAnimationState.Idle; else if (!(hitObject is Banana)) CurrentState = CatcherAnimationState.Fail; + + if (palpableObject.HitObject.LastInCombo) + { + if (result.Judgement is CatchJudgement catchJudgement && catchJudgement.ShouldExplodeFor(result)) + Explode(); + else + Drop(); + } } public void OnRevertResult(DrawableCatchHitObject drawableObject, JudgementResult result) diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 604e878782..37002d1051 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -6,11 +6,9 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input.Bindings; using osu.Framework.Input.Events; -using osu.Game.Rulesets.Catch.Judgements; using osu.Game.Rulesets.Catch.Objects.Drawables; using osu.Game.Rulesets.Catch.Replays; using osu.Game.Rulesets.Judgements; -using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osuTK; @@ -72,18 +70,6 @@ namespace osu.Game.Rulesets.Catch.UI public void OnNewResult(DrawableCatchHitObject hitObject, JudgementResult result) { Catcher.OnNewResult(hitObject, result); - - if (!result.Type.IsScorable()) - return; - - if (hitObject.HitObject.LastInCombo) - { - if (result.Judgement is CatchJudgement catchJudgement && catchJudgement.ShouldExplodeFor(result)) - Catcher.Explode(); - else - Catcher.Drop(); - } - comboDisplay.OnNewResult(hitObject, result); }