From 9a05edab7a93c5defcf5ce1a5ee47d93306ae21a Mon Sep 17 00:00:00 2001 From: Milo Date: Mon, 11 Nov 2024 18:52:30 -0400 Subject: [PATCH] implement proposed osu!mania mod, `Full Perfect` --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 +- .../Mods/ManiaModFullPerfect.cs | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModFullPerfect.cs diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index cdc7b0a951..8980670155 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -247,7 +247,7 @@ namespace osu.Game.Rulesets.Mania return new Mod[] { new ManiaModHardRock(), - new MultiMod(new ManiaModSuddenDeath(), new ManiaModPerfect()), + new MultiMod(new ManiaModSuddenDeath(), new ManiaModPerfect(), new ManiaModFullPerfect()), new MultiMod(new ManiaModDoubleTime(), new ManiaModNightcore()), new MultiMod(new ManiaModFadeIn(), new ManiaModHidden(), new ManiaModCover()), new ManiaModFlashlight(), diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModFullPerfect.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModFullPerfect.cs new file mode 100644 index 0000000000..d59ec39a89 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModFullPerfect.cs @@ -0,0 +1,40 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text.4 + +using System; +using System.Linq; +using osu.Framework.Localisation; +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Scoring; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModFullPerfect : ManiaModPerfect + { + + public override string Name => "Full Perfect"; + public override string Acronym => "FP"; + public override LocalisableString Description => @"Placeholder"; + public override double ScoreMultiplier => 1; + + public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] + { + typeof(ManiaModPerfect), + }).ToArray(); + + + protected override bool FailCondition(HealthProcessor healthProcessor, JudgementResult result) + { + if (!isRelevantResult(result.Judgement.MinResult) && !isRelevantResult(result.Judgement.MaxResult) && !isRelevantResult(result.Type)) + return false; + + if (result.Judgement.MaxResult == HitResult.Perfect) + return result.Type < HitResult.Perfect; + + return result.Type != result.Judgement.MaxResult; + } + + private bool isRelevantResult(HitResult result) => result.AffectsAccuracy() || result.AffectsCombo(); + } +}