2019-01-24 08:43:03 +00:00
|
|
|
|
// 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.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2023-12-22 07:19:36 +00:00
|
|
|
|
using osu.Game.Rulesets.Judgements;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
using osu.Game.Rulesets.Mods;
|
2023-12-22 07:19:36 +00:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Mods
|
|
|
|
|
{
|
|
|
|
|
public class ManiaModPerfect : ModPerfect
|
|
|
|
|
{
|
2023-12-22 07:19:36 +00:00
|
|
|
|
protected override bool FailCondition(HealthProcessor healthProcessor, JudgementResult result)
|
|
|
|
|
{
|
|
|
|
|
if (!isRelevantResult(result.Judgement.MinResult) && !isRelevantResult(result.Judgement.MaxResult) && !isRelevantResult(result.Type))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
// Mania allows imperfect "Great" hits without failing.
|
|
|
|
|
if (result.Judgement.MaxResult == HitResult.Perfect)
|
|
|
|
|
return result.Type < HitResult.Great;
|
|
|
|
|
|
|
|
|
|
return result.Type != result.Judgement.MaxResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool isRelevantResult(HitResult result) => result.AffectsAccuracy() || result.AffectsCombo();
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|