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

Merge pull request #22129 from smoogipoo/remove-mania-hp-drain

Remove mania hp drain
This commit is contained in:
Dean Herbert 2023-01-11 15:05:58 +09:00 committed by GitHub
commit 2b0aee0e3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Mania
public override ScoreProcessor CreateScoreProcessor() => new ManiaScoreProcessor();
public override HealthProcessor CreateHealthProcessor(double drainStartTime) => new ManiaHealthProcessor(drainStartTime, 0.5);
public override HealthProcessor CreateHealthProcessor(double drainStartTime) => new ManiaHealthProcessor(drainStartTime);
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new ManiaBeatmapConverter(beatmap, this);

View File

@ -11,8 +11,8 @@ namespace osu.Game.Rulesets.Mania.Scoring
public partial class ManiaHealthProcessor : DrainingHealthProcessor
{
/// <inheritdoc/>
public ManiaHealthProcessor(double drainStartTime, double drainLenience = 0)
: base(drainStartTime, drainLenience)
public ManiaHealthProcessor(double drainStartTime)
: base(drainStartTime, 1.0)
{
}

View File

@ -65,7 +65,7 @@ namespace osu.Game.Rulesets.Scoring
public DrainingHealthProcessor(double drainStartTime, double drainLenience = 0)
{
this.drainStartTime = drainStartTime;
this.drainLenience = drainLenience;
this.drainLenience = Math.Clamp(drainLenience, 0, 1);
}
protected override void Update()
@ -79,7 +79,8 @@ namespace osu.Game.Rulesets.Scoring
double lastGameplayTime = Math.Clamp(Time.Current - Time.Elapsed, drainStartTime, gameplayEndTime);
double currentGameplayTime = Math.Clamp(Time.Current, drainStartTime, gameplayEndTime);
Health.Value -= drainRate * (currentGameplayTime - lastGameplayTime);
if (drainLenience < 1)
Health.Value -= drainRate * (currentGameplayTime - lastGameplayTime);
}
public override void ApplyBeatmap(IBeatmap beatmap)