From b348abcd0779fe203e9c10dc91018ca7d54d1fc6 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 25 Dec 2019 14:49:17 +0900 Subject: [PATCH] Only drain health in non-break times --- osu.Game/Rulesets/Scoring/HealthProcessor.cs | 8 +++++++- osu.Game/Screens/Play/Player.cs | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Scoring/HealthProcessor.cs b/osu.Game/Rulesets/Scoring/HealthProcessor.cs index b9638fed15..af81f3b8b5 100644 --- a/osu.Game/Rulesets/Scoring/HealthProcessor.cs +++ b/osu.Game/Rulesets/Scoring/HealthProcessor.cs @@ -29,6 +29,11 @@ namespace osu.Game.Rulesets.Scoring /// public readonly BindableDouble Health = new BindableDouble(1) { MinValue = 0, MaxValue = 1 }; + /// + /// Whether gameplay is currently in a break. + /// + public readonly IBindable IsBreakTime = new Bindable(); + /// /// Whether this ScoreProcessor has already triggered the failed state. /// @@ -53,7 +58,8 @@ namespace osu.Game.Rulesets.Scoring { base.Update(); - Health.Value -= drainRate * Time.Elapsed; + if (!IsBreakTime.Value) + Health.Value -= drainRate * Time.Elapsed; } protected override void ApplyResultInternal(JudgementResult result) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 620a9195f7..dc0dd86c51 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -272,6 +272,8 @@ namespace osu.Game.Screens.Play DrawableRuleset.Overlays.Add(ScoreProcessor); DrawableRuleset.Overlays.Add(HealthProcessor); + + HealthProcessor.IsBreakTime.BindTo(BreakOverlay.IsBreakTime); } private void updatePauseOnFocusLostState() =>