mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 07:22:54 +08:00
Cleanup + renaming
This commit is contained in:
parent
2b0295ed86
commit
1b27ce6198
@ -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>
|
||||
protected override bool FailCondition => Hits == MaxHits && Health.Value <= 0.5;
|
||||
protected override bool DefaultFailCondition => Hits == MaxHits && Health.Value <= 0.5;
|
||||
|
||||
private double hpIncreaseTick;
|
||||
private double hpIncreaseGreat;
|
||||
|
@ -11,14 +11,6 @@ namespace osu.Game.Rulesets.Mods
|
||||
public override string ShortenedName => "PF";
|
||||
public override string Description => "SS or quit.";
|
||||
|
||||
public bool OnFailCheck(ScoreProcessor scoreProcessor)
|
||||
{
|
||||
return scoreProcessor.Accuracy.Value != 1;
|
||||
}
|
||||
|
||||
public virtual void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
|
||||
{
|
||||
scoreProcessor.FailChecker += OnFailCheck;
|
||||
}
|
||||
protected override bool FailCondition(ScoreProcessor scoreProcessor) => scoreProcessor.Accuracy.Value != 1;
|
||||
}
|
||||
}
|
||||
|
@ -18,14 +18,11 @@ namespace osu.Game.Rulesets.Mods
|
||||
public override bool Ranked => true;
|
||||
public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax), typeof(ModAutoplay) };
|
||||
|
||||
public bool OnFailCheck(ScoreProcessor scoreProcessor)
|
||||
public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
|
||||
{
|
||||
return scoreProcessor.Combo.Value != scoreProcessor.HighestCombo.Value;
|
||||
scoreProcessor.FailConditions += FailCondition;
|
||||
}
|
||||
|
||||
public virtual void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
|
||||
{
|
||||
scoreProcessor.FailChecker += OnFailCheck;
|
||||
}
|
||||
protected virtual bool FailCondition(ScoreProcessor scoreProcessor) => scoreProcessor.Combo.Value != scoreProcessor.HighestCombo.Value;
|
||||
}
|
||||
}
|
||||
|
@ -32,9 +32,9 @@ namespace osu.Game.Rulesets.Scoring
|
||||
public event Action<Judgement> NewJudgement;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when we want to check if a failure condition has been fulfilled
|
||||
/// Additional conditions on top of <see cref="DefaultFailCondition"/> that cause a failing state.
|
||||
/// </summary>
|
||||
public event Func<ScoreProcessor, bool> FailChecker;
|
||||
public event Func<ScoreProcessor, bool> FailConditions;
|
||||
|
||||
/// <summary>
|
||||
/// The current total score.
|
||||
@ -77,9 +77,9 @@ namespace osu.Game.Rulesets.Scoring
|
||||
public virtual bool HasFailed { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The conditions for failing.
|
||||
/// The default conditions for failing.
|
||||
/// </summary>
|
||||
protected virtual bool FailCondition => Health.Value == Health.MinValue;
|
||||
protected virtual bool DefaultFailCondition => Health.Value == Health.MinValue;
|
||||
|
||||
protected ScoreProcessor()
|
||||
{
|
||||
@ -126,7 +126,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// </summary>
|
||||
protected void UpdateFailed()
|
||||
{
|
||||
if (HasFailed || !FailCondition)
|
||||
if (HasFailed || !DefaultFailCondition)
|
||||
return;
|
||||
|
||||
if (Failed?.Invoke() != false)
|
||||
@ -150,7 +150,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
if (HasFailed)
|
||||
return;
|
||||
|
||||
if (FailChecker?.Invoke(this) == true)
|
||||
if (FailConditions?.Invoke(this) == true)
|
||||
{
|
||||
if (Failed?.Invoke() != false)
|
||||
HasFailed = true;
|
||||
|
Loading…
Reference in New Issue
Block a user