Implemented the 3 lives system into the Easy Mod.

This commit is contained in:
RORIdev
2019-04-03 16:58:44 -03:00
parent caa2bdf012
commit 5825890c31

View File

@ -51,6 +51,8 @@ namespace osu.Game.Screens.Play
public int RestartCount;
public int Lives = 2;
[Resolved]
private ScoreManager scoreManager { get; set; }
@ -323,8 +325,32 @@ namespace osu.Game.Screens.Play
protected FailOverlay FailOverlay { get; private set; }
private bool onFail()
{
//issue #3372
if (Beatmap.Value.Mods.Value.Any(x => x is ModEasy))
{
if (Lives != 0)
{
Lives--;
ScoreProcessor.Health.Value = 100;
return false;
}
else
{
GameplayClockContainer.Stop();
HasFailed = true;
FailOverlay.Retries = RestartCount;
FailOverlay.Show();
return true;
}
}
if (Beatmap.Value.Mods.Value.OfType<IApplicableFailOverride>().Any(m => !m.AllowFail))
return false;
@ -332,6 +358,8 @@ namespace osu.Game.Screens.Play
HasFailed = true;
// There is a chance that we could be in a paused state as the ruleset's internal clock (see FrameStabilityContainer)
// could process an extra frame after the GameplayClock is stopped.
// In such cases we want the fail state to precede a user triggered pause.