mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Only drain health in non-break times
This commit is contained in:
@ -29,6 +29,11 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly BindableDouble Health = new BindableDouble(1) { MinValue = 0, MaxValue = 1 };
|
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>
|
/// <summary>
|
||||||
/// Whether this ScoreProcessor has already triggered the failed state.
|
/// Whether this ScoreProcessor has already triggered the failed state.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -53,7 +58,8 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
Health.Value -= drainRate * Time.Elapsed;
|
if (!IsBreakTime.Value)
|
||||||
|
Health.Value -= drainRate * Time.Elapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void ApplyResultInternal(JudgementResult result)
|
protected override void ApplyResultInternal(JudgementResult result)
|
||||||
|
@ -272,6 +272,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
DrawableRuleset.Overlays.Add(ScoreProcessor);
|
DrawableRuleset.Overlays.Add(ScoreProcessor);
|
||||||
DrawableRuleset.Overlays.Add(HealthProcessor);
|
DrawableRuleset.Overlays.Add(HealthProcessor);
|
||||||
|
|
||||||
|
HealthProcessor.IsBreakTime.BindTo(BreakOverlay.IsBreakTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updatePauseOnFocusLostState() =>
|
private void updatePauseOnFocusLostState() =>
|
||||||
|
Reference in New Issue
Block a user