2021-02-03 22:08:59 +08: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.
|
|
|
|
|
|
|
|
using System.Linq;
|
2021-02-05 14:23:03 +08:00
|
|
|
using osu.Framework.Bindables;
|
2021-02-03 22:08:59 +08:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
2021-02-05 14:23:03 +08:00
|
|
|
using osu.Game.Configuration;
|
2021-02-03 22:08:59 +08:00
|
|
|
using osu.Game.Rulesets.Mods;
|
|
|
|
using osu.Game.Rulesets.Objects;
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2021-02-05 14:23:03 +08:00
|
|
|
using osu.Game.Rulesets.Osu.UI;
|
|
|
|
using osu.Game.Rulesets.UI;
|
2021-02-03 22:08:59 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Mods
|
|
|
|
{
|
2021-02-05 14:23:03 +08:00
|
|
|
public class OsuModClassic : Mod, IApplicableToHitObject, IApplicableToDrawableRuleset<OsuHitObject>
|
2021-02-03 22:08:59 +08:00
|
|
|
{
|
|
|
|
public override string Name => "Classic";
|
|
|
|
|
|
|
|
public override string Acronym => "CL";
|
|
|
|
|
|
|
|
public override double ScoreMultiplier => 1;
|
|
|
|
|
|
|
|
public override IconUsage? Icon => FontAwesome.Solid.History;
|
|
|
|
|
|
|
|
public override string Description => "Feeling nostalgic?";
|
|
|
|
|
|
|
|
public override bool Ranked => false;
|
|
|
|
|
2021-02-05 14:23:03 +08:00
|
|
|
[SettingSource("Disable slider head judgement", "Scores sliders proportionally to the number of ticks hit.")]
|
|
|
|
public Bindable<bool> DisableSliderHeadJudgement { get; } = new BindableBool(true);
|
|
|
|
|
|
|
|
[SettingSource("Disable slider head tracking", "Pins slider heads at their starting position, regardless of time.")]
|
|
|
|
public Bindable<bool> DisableSliderHeadTracking { get; } = new BindableBool(true);
|
|
|
|
|
|
|
|
[SettingSource("Disable note lock lenience", "Applies note lock to the full hit window.")]
|
|
|
|
public Bindable<bool> DisableLenientNoteLock { get; } = new BindableBool(true);
|
|
|
|
|
2021-02-03 22:08:59 +08:00
|
|
|
public void ApplyToHitObject(HitObject hitObject)
|
|
|
|
{
|
|
|
|
switch (hitObject)
|
|
|
|
{
|
|
|
|
case Slider slider:
|
2021-02-05 14:23:03 +08:00
|
|
|
slider.IgnoreJudgement = !DisableSliderHeadJudgement.Value;
|
2021-02-03 22:08:59 +08:00
|
|
|
|
|
|
|
foreach (var head in slider.NestedHitObjects.OfType<SliderHeadCircle>())
|
|
|
|
{
|
2021-02-05 14:23:03 +08:00
|
|
|
head.TrackFollowCircle = !DisableSliderHeadTracking.Value;
|
|
|
|
head.JudgeAsNormalHitCircle = !DisableSliderHeadJudgement.Value;
|
2021-02-03 22:08:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2021-02-05 14:23:03 +08:00
|
|
|
|
|
|
|
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
|
|
|
|
{
|
|
|
|
var osuRuleset = (DrawableOsuRuleset)drawableRuleset;
|
|
|
|
|
|
|
|
if (!DisableLenientNoteLock.Value)
|
|
|
|
osuRuleset.Playfield.HitPolicy = new ObjectOrderedHitPolicy();
|
|
|
|
}
|
2021-02-03 22:08:59 +08:00
|
|
|
}
|
|
|
|
}
|