mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 20:07:25 +08:00
2c0a5b7ef5
Stable does this:
46cd3a10af/osu
!/GameplayElements/HitObjectManagerFruits.cs#L98-L102
I'd rather not say what I think about it doing that, since it's likely
to be unpublishable, but to approximate that, just make it so that
only the "default fail condition" is beholden to the weird ebbs
and flows of what the ruleset wants. This appears to fix the problem
case and I'm hoping it doesn't break something else but I'm like 50/50
on it happening anyway at this point. Just gotta add tests add nauseam.
35 lines
1.2 KiB
C#
35 lines
1.2 KiB
C#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
using osu.Game.Rulesets.Judgements;
|
|
|
|
namespace osu.Game.Rulesets.Scoring
|
|
{
|
|
/// <summary>
|
|
/// A <see cref="HealthProcessor"/> that accumulates health and causes a fail if the final health
|
|
/// is less than a value required to pass the beatmap.
|
|
/// </summary>
|
|
public partial class AccumulatingHealthProcessor : HealthProcessor
|
|
{
|
|
protected override bool CheckDefaultFailCondition(JudgementResult _) => JudgedHits == MaxHits && Health.Value < requiredHealth;
|
|
|
|
private readonly double requiredHealth;
|
|
|
|
/// <summary>
|
|
/// Creates a new <see cref="AccumulatingHealthProcessor"/>.
|
|
/// </summary>
|
|
/// <param name="requiredHealth">The minimum amount of health required to beatmap.</param>
|
|
public AccumulatingHealthProcessor(double requiredHealth)
|
|
{
|
|
this.requiredHealth = requiredHealth;
|
|
}
|
|
|
|
protected override void Reset(bool storeResults)
|
|
{
|
|
base.Reset(storeResults);
|
|
|
|
Health.Value = 0;
|
|
}
|
|
}
|
|
}
|