2022-01-12 17:29:23 +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.
|
|
|
|
|
|
2023-11-24 17:04:57 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using osu.Game.Rulesets.Mania.Objects;
|
|
|
|
|
using osu.Game.Rulesets.Objects;
|
2022-01-12 17:29:23 +08:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Scoring
|
|
|
|
|
{
|
2023-11-24 17:04:57 +08:00
|
|
|
|
public partial class ManiaHealthProcessor : LegacyDrainingHealthProcessor
|
2022-01-12 17:29:23 +08:00
|
|
|
|
{
|
2023-01-11 12:01:18 +08:00
|
|
|
|
public ManiaHealthProcessor(double drainStartTime)
|
2023-11-24 17:04:57 +08:00
|
|
|
|
: base(drainStartTime)
|
2022-01-12 17:29:23 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-03 00:45:15 +08:00
|
|
|
|
protected override double ComputeDrainRate()
|
|
|
|
|
{
|
2023-12-04 05:08:31 +08:00
|
|
|
|
// Base call is run only to compute HP recovery (namely, `HpMultiplierNormal`).
|
|
|
|
|
// This closely mirrors (broken) behaviour of stable and as such is preserved unchanged.
|
2023-12-03 00:45:15 +08:00
|
|
|
|
base.ComputeDrainRate();
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-24 17:04:57 +08:00
|
|
|
|
protected override IEnumerable<HitObject> EnumerateTopLevelHitObjects() => Beatmap.HitObjects;
|
|
|
|
|
|
|
|
|
|
protected override IEnumerable<HitObject> EnumerateNestedHitObjects(HitObject hitObject) => hitObject.NestedHitObjects;
|
|
|
|
|
|
|
|
|
|
protected override double GetHealthIncreaseFor(HitObject hitObject, HitResult result)
|
2022-01-12 17:29:23 +08:00
|
|
|
|
{
|
2023-11-24 17:04:57 +08:00
|
|
|
|
double increase = 0;
|
|
|
|
|
|
|
|
|
|
switch (result)
|
|
|
|
|
{
|
|
|
|
|
case HitResult.Miss:
|
|
|
|
|
switch (hitObject)
|
|
|
|
|
{
|
|
|
|
|
case HeadNote:
|
|
|
|
|
case TailNote:
|
|
|
|
|
return -(Beatmap.Difficulty.DrainRate + 1) * 0.00375;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
return -(Beatmap.Difficulty.DrainRate + 1) * 0.0075;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case HitResult.Meh:
|
|
|
|
|
return -(Beatmap.Difficulty.DrainRate + 1) * 0.0016;
|
|
|
|
|
|
|
|
|
|
case HitResult.Ok:
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case HitResult.Good:
|
|
|
|
|
increase = 0.004 - Beatmap.Difficulty.DrainRate * 0.0004;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case HitResult.Great:
|
|
|
|
|
increase = 0.005 - Beatmap.Difficulty.DrainRate * 0.0005;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case HitResult.Perfect:
|
|
|
|
|
increase = 0.0055 - Beatmap.Difficulty.DrainRate * 0.0005;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return HpMultiplierNormal * increase;
|
2022-01-12 17:29:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|