2019-01-24 08:43:03 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
2017-04-21 08:33:20 +00:00
|
|
|
using System;
|
2023-12-20 05:50:21 +00:00
|
|
|
using osu.Framework.Bindables;
|
2019-03-27 10:29:27 +00:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
2022-08-10 19:54:48 +00:00
|
|
|
using osu.Framework.Localisation;
|
2023-12-20 05:50:21 +00:00
|
|
|
using osu.Game.Configuration;
|
2017-04-21 08:33:20 +00:00
|
|
|
using osu.Game.Graphics;
|
2023-12-20 05:50:21 +00:00
|
|
|
using osu.Game.Screens.Play;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
2017-04-21 08:33:20 +00:00
|
|
|
namespace osu.Game.Rulesets.Mods
|
|
|
|
{
|
2023-12-20 05:50:21 +00:00
|
|
|
public abstract class ModNoFail : Mod, IApplicableFailOverride, IApplicableToHUD, IReadFromConfig
|
2017-04-21 08:33:20 +00:00
|
|
|
{
|
2018-03-14 03:07:03 +00:00
|
|
|
public override string Name => "No Fail";
|
2018-11-30 08:16:00 +00:00
|
|
|
public override string Acronym => "NF";
|
2021-12-10 05:15:00 +00:00
|
|
|
public override IconUsage? Icon => OsuIcon.ModNoFail;
|
2017-05-02 18:36:55 +00:00
|
|
|
public override ModType Type => ModType.DifficultyReduction;
|
2022-08-10 19:54:48 +00:00
|
|
|
public override LocalisableString Description => "You can't fail, no matter what.";
|
2017-04-21 08:33:20 +00:00
|
|
|
public override double ScoreMultiplier => 0.5;
|
2023-12-23 14:10:31 +00:00
|
|
|
public override Type[] IncompatibleMods => new[] { typeof(ModFailCondition), typeof(ModCinema) };
|
2024-01-31 13:59:35 +00:00
|
|
|
public override bool Ranked => UsesDefaultConfiguration;
|
2023-12-20 05:50:21 +00:00
|
|
|
|
|
|
|
private readonly Bindable<bool> showHealthBar = new Bindable<bool>();
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// We never fail, 'yo.
|
|
|
|
/// </summary>
|
|
|
|
public bool PerformFail() => false;
|
|
|
|
|
|
|
|
public bool RestartOnFail => false;
|
|
|
|
|
|
|
|
public void ReadFromConfig(OsuConfigManager config)
|
|
|
|
{
|
|
|
|
config.BindWith(OsuSetting.ShowHealthDisplayWhenCantFail, showHealthBar);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void ApplyToHUD(HUDOverlay overlay)
|
|
|
|
{
|
|
|
|
overlay.ShowHealthBar.BindTo(showHealthBar);
|
|
|
|
}
|
2017-04-21 08:33:20 +00:00
|
|
|
}
|
2017-12-30 19:10:25 +00:00
|
|
|
}
|