Implements virtual Failcondition in scoreprocessor and enforces nofail in UpdateFailed

This commit is contained in:
Jacob Odgård Tørring 2017-10-22 20:32:59 +02:00
parent f86a13ef61
commit 9b54e834d9
2 changed files with 8 additions and 3 deletions

View File

@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring
/// <summary>
/// Taiko fails at the end of the map if the player has not half-filled their HP bar.
/// </summary>
public override bool HasFailed => Hits == MaxHits && Health.Value <= 0.5;
protected override bool FailCondition => Hits == MaxHits && Health.Value <= 0.5;
private double hpIncreaseTick;
private double hpIncreaseGreat;

View File

@ -69,7 +69,12 @@ namespace osu.Game.Rulesets.Scoring
/// <summary>
/// Whether the score is in a failed state.
/// </summary>
public virtual bool HasFailed => Health.Value == Health.MinValue;
public virtual bool HasFailed => alreadyFailed;
/// <summary>
/// The conditions for failing
/// </summary>
protected virtual bool FailCondition => Health.Value == Health.MinValue;
/// <summary>
/// Whether this ScoreProcessor has already triggered the failed state.
@ -121,7 +126,7 @@ namespace osu.Game.Rulesets.Scoring
/// </summary>
protected void UpdateFailed()
{
if (alreadyFailed || !HasFailed)
if (alreadyFailed || !FailCondition)
return;
if (Failed?.Invoke() != false)