From fc37c5e4c2bb4daa7a61714555a68b43930fc211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 16 Jan 2024 20:18:32 +0100 Subject: [PATCH] Fix taiko maps containing only drum rolls / swells not being passable without mods Closes https://github.com/ppy/osu/issues/26370. As was noted in the issue thread stable does not attempt to account for such maps, and the maps are impassable in stable without No Fail. Nevertheless that seems like a pretty anti-player behaviour and I honestly believe that it is fine to change this in lazer. --- .../Scoring/TaikoHealthProcessor.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoHealthProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoHealthProcessor.cs index d75906f3aa..dfca4ac8c7 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoHealthProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoHealthProcessor.cs @@ -31,11 +31,39 @@ public partial class TaikoHealthProcessor : AccumulatingHealthProcessor /// private double hpMissMultiplier; + /// + /// Sum of all achievable health increases throughout the map. + /// Used to determine if there are any objects that give health. + /// If there are none, health will be forcibly pulled up to 1 to avoid cases of impassable maps. + /// + private double sumOfMaxHealthIncreases; + public TaikoHealthProcessor() : base(0.5) { } + protected override void ApplyResultInternal(JudgementResult result) + { + base.ApplyResultInternal(result); + sumOfMaxHealthIncreases += result.Judgement.MaxHealthIncrease; + } + + protected override void RevertResultInternal(JudgementResult result) + { + base.RevertResultInternal(result); + sumOfMaxHealthIncreases -= result.Judgement.MaxHealthIncrease; + } + + protected override void Reset(bool storeResults) + { + base.Reset(storeResults); + + if (storeResults && sumOfMaxHealthIncreases == 0) + Health.Value = 1; + sumOfMaxHealthIncreases = 0; + } + public override void ApplyBeatmap(IBeatmap beatmap) { base.ApplyBeatmap(beatmap);