mirror of
https://github.com/ppy/osu
synced 2025-02-20 20:47:09 +00:00
Only drain health in non-break times
This commit is contained in:
parent
977fb3d1bf
commit
b348abcd07
@ -29,6 +29,11 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// </summary>
|
||||
public readonly BindableDouble Health = new BindableDouble(1) { MinValue = 0, MaxValue = 1 };
|
||||
|
||||
/// <summary>
|
||||
/// Whether gameplay is currently in a break.
|
||||
/// </summary>
|
||||
public readonly IBindable<bool> IsBreakTime = new Bindable<bool>();
|
||||
|
||||
/// <summary>
|
||||
/// Whether this ScoreProcessor has already triggered the failed state.
|
||||
/// </summary>
|
||||
@ -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)
|
||||
|
@ -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() =>
|
||||
|
Loading…
Reference in New Issue
Block a user