2023-11-10 15:35:03 +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 16:32:18 +08:00
|
|
|
using System.Collections.Generic;
|
2023-11-10 15:35:03 +08:00
|
|
|
using System.Linq;
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Rulesets.Objects;
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Scoring
|
|
|
|
{
|
2023-12-17 18:33:02 +08:00
|
|
|
public partial class OsuLegacyHealthProcessor : LegacyDrainingHealthProcessor
|
2023-11-10 15:35:03 +08:00
|
|
|
{
|
2023-12-17 18:33:02 +08:00
|
|
|
public OsuLegacyHealthProcessor(double drainStartTime)
|
2023-11-10 15:35:03 +08:00
|
|
|
: base(drainStartTime)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-11-24 16:32:18 +08:00
|
|
|
protected override IEnumerable<HitObject> EnumerateTopLevelHitObjects() => Beatmap.HitObjects;
|
2023-11-10 15:35:03 +08:00
|
|
|
|
2023-11-24 16:32:18 +08:00
|
|
|
protected override IEnumerable<HitObject> EnumerateNestedHitObjects(HitObject hitObject)
|
2023-11-10 15:35:03 +08:00
|
|
|
{
|
2023-11-24 16:32:18 +08:00
|
|
|
switch (hitObject)
|
2023-11-10 15:35:03 +08:00
|
|
|
{
|
2023-11-24 16:32:18 +08:00
|
|
|
case Slider slider:
|
|
|
|
foreach (var nested in slider.NestedHitObjects)
|
|
|
|
yield return nested;
|
2023-11-10 15:35:03 +08:00
|
|
|
|
2023-11-24 16:32:18 +08:00
|
|
|
break;
|
2023-11-10 15:35:03 +08:00
|
|
|
|
2023-11-24 16:32:18 +08:00
|
|
|
case Spinner spinner:
|
|
|
|
foreach (var nested in spinner.NestedHitObjects.Where(t => t is not SpinnerBonusTick))
|
|
|
|
yield return nested;
|
|
|
|
|
|
|
|
break;
|
2023-11-10 15:35:03 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-24 16:32:18 +08:00
|
|
|
protected override double GetHealthIncreaseFor(HitObject hitObject, HitResult result)
|
2023-11-10 15:35:03 +08:00
|
|
|
{
|
2023-11-17 17:41:54 +08:00
|
|
|
double increase = 0;
|
2023-11-10 15:35:03 +08:00
|
|
|
|
|
|
|
switch (result)
|
|
|
|
{
|
|
|
|
case HitResult.SmallTickMiss:
|
|
|
|
return IBeatmapDifficultyInfo.DifficultyRange(Beatmap.Difficulty.DrainRate, -0.02, -0.075, -0.14);
|
|
|
|
|
|
|
|
case HitResult.LargeTickMiss:
|
|
|
|
return IBeatmapDifficultyInfo.DifficultyRange(Beatmap.Difficulty.DrainRate, -0.02, -0.075, -0.14);
|
|
|
|
|
|
|
|
case HitResult.Miss:
|
|
|
|
return IBeatmapDifficultyInfo.DifficultyRange(Beatmap.Difficulty.DrainRate, -0.03, -0.125, -0.2);
|
|
|
|
|
|
|
|
case HitResult.SmallTickHit:
|
2023-11-13 13:06:34 +08:00
|
|
|
// This result always comes from the slider tail, which is judged the same as a repeat.
|
2023-11-10 15:35:03 +08:00
|
|
|
increase = 0.02;
|
|
|
|
break;
|
|
|
|
|
2023-12-30 09:24:59 +08:00
|
|
|
case HitResult.SliderTailHit:
|
2023-11-10 15:35:03 +08:00
|
|
|
case HitResult.LargeTickHit:
|
2023-11-13 13:06:34 +08:00
|
|
|
// This result comes from either a slider tick or repeat.
|
2023-11-10 15:35:03 +08:00
|
|
|
increase = hitObject is SliderTick ? 0.015 : 0.02;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HitResult.Meh:
|
|
|
|
increase = 0.002;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HitResult.Ok:
|
|
|
|
increase = 0.011;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HitResult.Great:
|
|
|
|
increase = 0.03;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HitResult.SmallBonus:
|
|
|
|
increase = 0.0085;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HitResult.LargeBonus:
|
|
|
|
increase = 0.01;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2023-11-24 16:32:18 +08:00
|
|
|
return HpMultiplierNormal * increase;
|
2023-11-10 15:35:03 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|