1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 05:22:54 +08:00

Change osu ruleset to use new HP algorithm by default

This commit is contained in:
Dan Balasescu 2023-12-17 19:33:02 +09:00
parent d7aca2f641
commit 4b9aefa6f2
No known key found for this signature in database
5 changed files with 14 additions and 11 deletions

View File

@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Osu.Tests
[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 =

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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)
{
}

View File

@ -11,8 +11,8 @@ namespace osu.Game.Rulesets.Mods
public interface IApplicableHealthProcessor
{
/// <summary>
/// Creates the <see cref="HealthProcessor"/>.
/// Creates the <see cref="HealthProcessor"/>. May be null to use the ruleset default.
/// </summary>
HealthProcessor CreateHealthProcessor(double drainStartTime);
HealthProcessor? CreateHealthProcessor(double drainStartTime);
}
}