mirror of
https://github.com/ppy/osu.git
synced 2025-02-24 20:33:32 +08:00
parent
3a73fa49bf
commit
7fd6f3f32c
@ -103,13 +103,11 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
|
||||
public bool RestartOnFail => false;
|
||||
|
||||
public bool TriggeredFail { get; set; } = false;
|
||||
|
||||
public void ApplyToHealthProcessor(HealthProcessor healthProcessor)
|
||||
{
|
||||
// Sudden death
|
||||
healthProcessor.FailConditions += (_, result)
|
||||
=> TriggeredFail = result.Type.AffectsCombo()
|
||||
=> result.Type.AffectsCombo()
|
||||
&& !result.IsHit;
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,5 @@ namespace osu.Game.Rulesets.Mods
|
||||
public bool PerformFail() => false;
|
||||
|
||||
public bool RestartOnFail => false;
|
||||
|
||||
public bool TriggeredFail => false;
|
||||
}
|
||||
}
|
||||
|
@ -35,11 +35,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
|
||||
public bool PerformFail()
|
||||
{
|
||||
if (retries == 0)
|
||||
{
|
||||
TriggeredFail = true;
|
||||
return true;
|
||||
}
|
||||
if (retries == 0) return true;
|
||||
|
||||
health.Value = health.MaxValue;
|
||||
retries--;
|
||||
@ -49,8 +45,6 @@ namespace osu.Game.Rulesets.Mods
|
||||
|
||||
public bool RestartOnFail => false;
|
||||
|
||||
public bool TriggeredFail { get; set; } = false;
|
||||
|
||||
public void ApplyToHealthProcessor(HealthProcessor healthProcessor)
|
||||
{
|
||||
health.BindTo(healthProcessor.Health);
|
||||
|
@ -20,8 +20,6 @@ namespace osu.Game.Rulesets.Mods
|
||||
|
||||
public virtual bool RestartOnFail => Restart.Value;
|
||||
|
||||
public virtual bool TriggeredFail { get; set; } = false;
|
||||
|
||||
private Action? triggerFailureDelegate;
|
||||
|
||||
public void ApplyToHealthProcessor(HealthProcessor healthProcessor)
|
||||
@ -33,11 +31,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
/// <summary>
|
||||
/// Immediately triggers a failure on the loaded <see cref="HealthProcessor"/>.
|
||||
/// </summary>
|
||||
protected void TriggerFailure()
|
||||
{
|
||||
TriggeredFail = true;
|
||||
triggerFailureDelegate?.Invoke();
|
||||
}
|
||||
protected void TriggerFailure() => triggerFailureDelegate?.Invoke();
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether <paramref name="result"/> should trigger a failure. Called every time a
|
||||
|
@ -31,8 +31,6 @@ namespace osu.Game.Rulesets.Mods
|
||||
|
||||
public bool RestartOnFail => false;
|
||||
|
||||
public bool TriggeredFail => false;
|
||||
|
||||
public void ReadFromConfig(OsuConfigManager config)
|
||||
{
|
||||
config.BindWith(OsuSetting.ShowHealthDisplayWhenCantFail, showHealthBar);
|
||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModPerfect)).ToArray();
|
||||
|
||||
protected override bool FailCondition(HealthProcessor healthProcessor, JudgementResult result)
|
||||
=> TriggeredFail = result.Type.AffectsCombo()
|
||||
=> result.Type.AffectsCombo()
|
||||
&& !result.IsHit;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user