Make bananas explode even on miss

This commit is contained in:
Dean Herbert 2018-06-29 16:49:01 +09:00
parent f7fbf61306
commit f1a35f77d2
6 changed files with 12 additions and 30 deletions

View File

@ -10,6 +10,8 @@ public class CatchBananaJudgement : CatchJudgement
public override bool AffectsCombo => false;
public override bool IsBonus => true;
public override bool ShouldExplode => true;
protected override int NumericResultFor(HitResult result)
{
switch (result)

View File

@ -1,21 +0,0 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Catch.Judgements
{
public class CatchBananaShowerJudgement : CatchJudgement
{
public override bool AffectsCombo => false;
public override bool IsBonus => true;
public CatchBananaShowerJudgement()
{
Result = HitResult.Perfect;
}
protected override int NumericResultFor(HitResult result) => 0;
protected override float HealthIncreaseFor(HitResult result) => 0;
}
}

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Catch.Judgements
@ -31,6 +32,12 @@ protected override int NumericResultFor(HitResult result)
/// </summary>
public float HealthIncrease => HealthIncreaseFor(Result);
/// <summary>
/// Whether fruit on the platter should explode or drop.
/// Note that this is only checked if the owning object is also <see cref="IHasComboInformation.LastInCombo" />
/// </summary>
public virtual bool ShouldExplode => IsHit;
/// <summary>
/// Convert a <see cref="HitResult"/> to a base health increase.
/// </summary>

View File

@ -5,7 +5,6 @@
using System.Linq;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Catch.Judgements;
using osu.Game.Rulesets.Objects.Drawables;
namespace osu.Game.Rulesets.Catch.Objects.Drawable
@ -27,11 +26,7 @@ public DrawableBananaShower(BananaShower s, Func<CatchHitObject, DrawableHitObje
AddNested(getVisualRepresentation?.Invoke(b));
}
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
{
if (timeOffset >= 0)
AddJudgement(new CatchBananaShowerJudgement());
}
protected override bool ProvidesJudgement => false;
protected override void AddNested(DrawableHitObject h)
{

View File

@ -47,7 +47,6 @@ protected override void SimulateAutoplay(Beatmap<CatchHitObject> beatmap)
case BananaShower shower:
foreach (var _ in shower.NestedHitObjects.Cast<CatchHitObject>())
AddJudgement(new CatchBananaJudgement { Result = HitResult.Perfect });
AddJudgement(new CatchBananaShowerJudgement());
break;
case Fruit _:
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });

View File

@ -11,6 +11,7 @@
using osu.Framework.Input.Bindings;
using osu.Framework.MathUtils;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Catch.Judgements;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.Objects.Drawable;
using osu.Game.Rulesets.Catch.Replays;
@ -78,12 +79,11 @@ void runAfterLoaded(Action action)
if (!fruit.StaysOnPlate)
runAfterLoaded(() => MovableCatcher.Explode(caughtFruit));
}
if (fruit.HitObject.LastInCombo)
{
if (judgement.IsHit)
if (((CatchJudgement)judgement).ShouldExplode)
runAfterLoaded(() => MovableCatcher.Explode());
else
MovableCatcher.Drop();