1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-20 00:12:57 +08:00
osu-lazer/osu.Game/Rulesets/Mods/ModEasy.cs

60 lines
1.8 KiB
C#
Raw Normal View History

// 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 17:19:50 +08:00
using System;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Sprites;
2018-04-13 17:19:50 +08:00
using osu.Game.Beatmaps;
using osu.Game.Graphics;
2019-04-04 04:58:17 +08:00
using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring;
2018-04-13 17:19:50 +08:00
namespace osu.Game.Rulesets.Mods
{
public abstract class ModEasy : Mod, IApplicableToDifficulty, IApplicableFailOverride, IApplicableToScoreProcessor
2018-04-13 17:19:50 +08:00
{
public override string Name => "Easy";
public override string Acronym => "EZ";
public override IconUsage Icon => OsuIcon.ModEasy;
2018-04-13 17:19:50 +08:00
public override ModType Type => ModType.DifficultyReduction;
public override double ScoreMultiplier => 0.5;
public override bool Ranked => true;
public override Type[] IncompatibleMods => new[] { typeof(ModHardRock) };
2019-04-05 05:04:49 +08:00
private int retries = 2;
private BindableNumber<double> health;
2018-04-13 17:19:50 +08:00
public void ApplyToDifficulty(BeatmapDifficulty difficulty)
{
const float ratio = 0.5f;
difficulty.CircleSize *= ratio;
difficulty.ApproachRate *= ratio;
difficulty.DrainRate *= ratio;
difficulty.OverallDifficulty *= ratio;
}
2019-04-04 04:58:17 +08:00
public bool AllowFail
2019-04-04 04:58:17 +08:00
{
get
2019-04-04 06:20:20 +08:00
{
if (retries == 0) return true;
health.Value = health.MaxValue;
retries--;
return false;
}
2019-04-04 04:58:17 +08:00
}
public bool RestartOnFail => false;
public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
{
health = scoreProcessor.Health.GetBoundCopy();
}
public ScoreRank AdjustRank(ScoreRank rank, double accuracy) => rank;
2018-04-13 17:19:50 +08:00
}
}