mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 14:12:56 +08:00
Cleanup + renaming
This commit is contained in:
parent
2b0295ed86
commit
1b27ce6198
@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Taiko fails at the end of the map if the player has not half-filled their HP bar.
|
/// Taiko fails at the end of the map if the player has not half-filled their HP bar.
|
||||||
/// </summary>
|
/// </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 hpIncreaseTick;
|
||||||
private double hpIncreaseGreat;
|
private double hpIncreaseGreat;
|
||||||
|
@ -11,14 +11,6 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public override string ShortenedName => "PF";
|
public override string ShortenedName => "PF";
|
||||||
public override string Description => "SS or quit.";
|
public override string Description => "SS or quit.";
|
||||||
|
|
||||||
public bool OnFailCheck(ScoreProcessor scoreProcessor)
|
protected override bool FailCondition(ScoreProcessor scoreProcessor) => scoreProcessor.Accuracy.Value != 1;
|
||||||
{
|
|
||||||
return scoreProcessor.Accuracy.Value != 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
|
|
||||||
{
|
|
||||||
scoreProcessor.FailChecker += OnFailCheck;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,14 +18,11 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public override bool Ranked => true;
|
public override bool Ranked => true;
|
||||||
public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax), typeof(ModAutoplay) };
|
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)
|
protected virtual bool FailCondition(ScoreProcessor scoreProcessor) => scoreProcessor.Combo.Value != scoreProcessor.HighestCombo.Value;
|
||||||
{
|
|
||||||
scoreProcessor.FailChecker += OnFailCheck;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,9 +32,9 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
public event Action<Judgement> NewJudgement;
|
public event Action<Judgement> NewJudgement;
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public event Func<ScoreProcessor, bool> FailChecker;
|
public event Func<ScoreProcessor, bool> FailConditions;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current total score.
|
/// The current total score.
|
||||||
@ -77,9 +77,9 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
public virtual bool HasFailed { get; private set; }
|
public virtual bool HasFailed { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The conditions for failing.
|
/// The default conditions for failing.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual bool FailCondition => Health.Value == Health.MinValue;
|
protected virtual bool DefaultFailCondition => Health.Value == Health.MinValue;
|
||||||
|
|
||||||
protected ScoreProcessor()
|
protected ScoreProcessor()
|
||||||
{
|
{
|
||||||
@ -126,7 +126,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected void UpdateFailed()
|
protected void UpdateFailed()
|
||||||
{
|
{
|
||||||
if (HasFailed || !FailCondition)
|
if (HasFailed || !DefaultFailCondition)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Failed?.Invoke() != false)
|
if (Failed?.Invoke() != false)
|
||||||
@ -150,7 +150,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
if (HasFailed)
|
if (HasFailed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (FailChecker?.Invoke(this) == true)
|
if (FailConditions?.Invoke(this) == true)
|
||||||
{
|
{
|
||||||
if (Failed?.Invoke() != false)
|
if (Failed?.Invoke() != false)
|
||||||
HasFailed = true;
|
HasFailed = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user