2023-11-23 07:22:34 +00: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 04:22:46 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Rulesets.Catch.Objects;
|
|
|
|
using osu.Game.Rulesets.Objects;
|
2023-11-23 07:22:34 +00:00
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Catch.Scoring
|
|
|
|
{
|
2023-11-24 08:32:18 +00:00
|
|
|
public partial class CatchHealthProcessor : LegacyDrainingHealthProcessor
|
2023-11-23 07:22:34 +00:00
|
|
|
{
|
|
|
|
public CatchHealthProcessor(double drainStartTime)
|
|
|
|
: base(drainStartTime)
|
|
|
|
{
|
|
|
|
}
|
2023-11-24 04:22:46 +00:00
|
|
|
|
2023-11-24 08:32:18 +00:00
|
|
|
protected override IEnumerable<HitObject> EnumerateTopLevelHitObjects() => EnumerateHitObjects(Beatmap).Where(h => h is Fruit || h is Droplet || h is Banana);
|
2023-11-24 04:22:46 +00:00
|
|
|
|
2023-11-24 08:32:18 +00:00
|
|
|
protected override IEnumerable<HitObject> EnumerateNestedHitObjects(HitObject hitObject) => Enumerable.Empty<HitObject>();
|
2023-11-24 04:22:46 +00:00
|
|
|
|
2023-11-24 08:32:18 +00:00
|
|
|
protected override double GetHealthIncreaseFor(HitObject hitObject, HitResult result)
|
2023-11-24 04:22:46 +00:00
|
|
|
{
|
|
|
|
double increase = 0;
|
|
|
|
|
|
|
|
switch (result)
|
|
|
|
{
|
|
|
|
case HitResult.SmallTickMiss:
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case HitResult.LargeTickMiss:
|
|
|
|
case HitResult.Miss:
|
|
|
|
return IBeatmapDifficultyInfo.DifficultyRange(Beatmap.Difficulty.DrainRate, -0.03, -0.125, -0.2);
|
|
|
|
|
|
|
|
case HitResult.SmallTickHit:
|
|
|
|
increase = 0.0015;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HitResult.LargeTickHit:
|
|
|
|
increase = 0.015;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HitResult.Great:
|
|
|
|
increase = 0.03;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HitResult.LargeBonus:
|
|
|
|
increase = 0.0025;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2023-11-24 08:32:18 +00:00
|
|
|
return HpMultiplierNormal * increase;
|
2023-11-24 04:22:46 +00:00
|
|
|
}
|
2023-11-23 07:22:34 +00:00
|
|
|
}
|
|
|
|
}
|