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
|
|
|
|
|
|
|
using System;
|
2019-03-27 10:29:27 +00:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
2018-04-13 09:19:50 +00:00
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Graphics;
|
2019-04-03 20:58:17 +00:00
|
|
|
using osu.Game.Rulesets.Scoring;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mods
|
|
|
|
{
|
2019-04-03 20:58:17 +00:00
|
|
|
public abstract class ModEasy : Mod, IApplicableToDifficulty, IApplicableToScoreProcessor
|
2018-04-13 09:19:50 +00:00
|
|
|
{
|
2019-04-03 23:22:48 +00:00
|
|
|
public static int Lives;
|
2018-04-13 09:19:50 +00:00
|
|
|
public override string Name => "Easy";
|
2018-11-30 08:16:00 +00:00
|
|
|
public override string Acronym => "EZ";
|
2019-03-27 10:29:27 +00:00
|
|
|
public override IconUsage Icon => OsuIcon.ModEasy;
|
2018-04-13 09:19:50 +00: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) };
|
|
|
|
|
|
|
|
public void ApplyToDifficulty(BeatmapDifficulty difficulty)
|
|
|
|
{
|
|
|
|
const float ratio = 0.5f;
|
|
|
|
difficulty.CircleSize *= ratio;
|
|
|
|
difficulty.ApproachRate *= ratio;
|
|
|
|
difficulty.DrainRate *= ratio;
|
|
|
|
difficulty.OverallDifficulty *= ratio;
|
|
|
|
}
|
2019-04-03 20:58:17 +00:00
|
|
|
|
|
|
|
public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
|
|
|
|
{
|
2019-04-03 23:22:48 +00:00
|
|
|
Lives = 2;
|
2019-04-03 22:20:20 +00:00
|
|
|
scoreProcessor.Health.ValueChanged += valueChanged =>
|
|
|
|
{
|
2019-04-03 20:58:17 +00:00
|
|
|
if (scoreProcessor.Health.Value == 0)
|
|
|
|
{
|
|
|
|
if (Lives != 0)
|
|
|
|
{
|
|
|
|
Lives--;
|
|
|
|
scoreProcessor.Health.Value = 100;
|
|
|
|
}
|
|
|
|
}
|
2019-04-03 21:05:47 +00:00
|
|
|
};
|
2019-04-03 20:58:17 +00:00
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
}
|
|
|
|
}
|