mirror of
https://github.com/ppy/osu
synced 2024-12-28 18:02:53 +00:00
Merge pull request #25797 from smoogipoo/osu-ruleset-lazer-hp
Make osu! ruleset once again use the lazer default HP drain
This commit is contained in:
commit
deef7dae1d
@ -10,12 +10,12 @@ using osu.Game.Rulesets.Osu.Scoring;
|
||||
namespace osu.Game.Rulesets.Osu.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestSceneOsuHealthProcessor
|
||||
public class TestSceneOsuLegacyHealthProcessor
|
||||
{
|
||||
[Test]
|
||||
public void TestNoBreak()
|
||||
{
|
||||
OsuHealthProcessor hp = new OsuHealthProcessor(-1000);
|
||||
OsuLegacyHealthProcessor hp = new OsuLegacyHealthProcessor(-1000);
|
||||
hp.ApplyBeatmap(new Beatmap<OsuHitObject>
|
||||
{
|
||||
HitObjects =
|
||||
@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
[Test]
|
||||
public void TestSingleBreak()
|
||||
{
|
||||
OsuHealthProcessor hp = new OsuHealthProcessor(-1000);
|
||||
OsuLegacyHealthProcessor hp = new OsuLegacyHealthProcessor(-1000);
|
||||
hp.ApplyBeatmap(new Beatmap<OsuHitObject>
|
||||
{
|
||||
HitObjects =
|
||||
@ -51,7 +51,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
[Test]
|
||||
public void TestOverlappingBreak()
|
||||
{
|
||||
OsuHealthProcessor hp = new OsuHealthProcessor(-1000);
|
||||
OsuLegacyHealthProcessor hp = new OsuLegacyHealthProcessor(-1000);
|
||||
hp.ApplyBeatmap(new Beatmap<OsuHitObject>
|
||||
{
|
||||
HitObjects =
|
||||
@ -72,7 +72,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
[Test]
|
||||
public void TestSequentialBreak()
|
||||
{
|
||||
OsuHealthProcessor hp = new OsuHealthProcessor(-1000);
|
||||
OsuLegacyHealthProcessor hp = new OsuLegacyHealthProcessor(-1000);
|
||||
hp.ApplyBeatmap(new Beatmap<OsuHitObject>
|
||||
{
|
||||
HitObjects =
|
@ -18,7 +18,7 @@ using osu.Game.Rulesets.UI;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public class OsuModClassic : ModClassic, IApplicableToHitObject, IApplicableToDrawableHitObject, IApplicableToDrawableRuleset<OsuHitObject>
|
||||
public class OsuModClassic : ModClassic, IApplicableToHitObject, IApplicableToDrawableHitObject, IApplicableToDrawableRuleset<OsuHitObject>, IApplicableHealthProcessor
|
||||
{
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModStrictTracking)).ToArray();
|
||||
|
||||
@ -34,6 +34,9 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
[SettingSource("Fade out hit circles earlier", "Make hit circles fade out into a miss, rather than after it.")]
|
||||
public Bindable<bool> FadeHitCircleEarly { get; } = new Bindable<bool>(true);
|
||||
|
||||
[SettingSource("Classic health", "More closely resembles the original HP drain mechanics.")]
|
||||
public Bindable<bool> ClassicHealth { get; } = new Bindable<bool>(true);
|
||||
|
||||
private bool usingHiddenFading;
|
||||
|
||||
public void ApplyToHitObject(HitObject hitObject)
|
||||
@ -115,5 +118,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public HealthProcessor? CreateHealthProcessor(double drainStartTime) => ClassicHealth.Value ? new OsuLegacyHealthProcessor(drainStartTime) : null;
|
||||
}
|
||||
}
|
||||
|
@ -48,8 +48,6 @@ namespace osu.Game.Rulesets.Osu
|
||||
|
||||
public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor();
|
||||
|
||||
public override HealthProcessor CreateHealthProcessor(double drainStartTime) => new OsuHealthProcessor(drainStartTime);
|
||||
|
||||
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new OsuBeatmapConverter(beatmap, this);
|
||||
|
||||
public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new OsuBeatmapProcessor(beatmap);
|
||||
|
@ -10,9 +10,9 @@ using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Scoring
|
||||
{
|
||||
public partial class OsuHealthProcessor : LegacyDrainingHealthProcessor
|
||||
public partial class OsuLegacyHealthProcessor : LegacyDrainingHealthProcessor
|
||||
{
|
||||
public OsuHealthProcessor(double drainStartTime)
|
||||
public OsuLegacyHealthProcessor(double drainStartTime)
|
||||
: base(drainStartTime)
|
||||
{
|
||||
}
|
18
osu.Game/Rulesets/Mods/IApplicableHealthProcessor.cs
Normal file
18
osu.Game/Rulesets/Mods/IApplicableHealthProcessor.cs
Normal file
@ -0,0 +1,18 @@
|
||||
// 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 osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for a <see cref="Mod"/> that provides its own health processor.
|
||||
/// </summary>
|
||||
public interface IApplicableHealthProcessor
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates the <see cref="HealthProcessor"/>. May be null to use the ruleset default.
|
||||
/// </summary>
|
||||
HealthProcessor? CreateHealthProcessor(double drainStartTime);
|
||||
}
|
||||
}
|
@ -227,7 +227,8 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
dependencies.CacheAs(ScoreProcessor);
|
||||
|
||||
HealthProcessor = ruleset.CreateHealthProcessor(playableBeatmap.HitObjects[0].StartTime);
|
||||
HealthProcessor = gameplayMods.OfType<IApplicableHealthProcessor>().FirstOrDefault()?.CreateHealthProcessor(playableBeatmap.HitObjects[0].StartTime);
|
||||
HealthProcessor ??= ruleset.CreateHealthProcessor(playableBeatmap.HitObjects[0].StartTime);
|
||||
HealthProcessor.ApplyBeatmap(playableBeatmap);
|
||||
|
||||
dependencies.CacheAs(HealthProcessor);
|
||||
|
Loading…
Reference in New Issue
Block a user