-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25587 from smoogipoo/mania-hp-drain-v1
Add `ManiaHealthProcessor` that uses the legacy drain rate algorithm
- Loading branch information
Showing
1 changed file
with
45 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,61 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Game.Rulesets.Judgements; | ||
using System.Collections.Generic; | ||
using osu.Game.Rulesets.Mania.Objects; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Scoring; | ||
|
||
namespace osu.Game.Rulesets.Mania.Scoring | ||
{ | ||
public partial class ManiaHealthProcessor : DrainingHealthProcessor | ||
public partial class ManiaHealthProcessor : LegacyDrainingHealthProcessor | ||
{ | ||
/// <inheritdoc/> | ||
public ManiaHealthProcessor(double drainStartTime) | ||
: base(drainStartTime, 1.0) | ||
: base(drainStartTime) | ||
{ | ||
} | ||
|
||
protected override HitResult GetSimulatedHitResult(Judgement judgement) | ||
protected override IEnumerable<HitObject> EnumerateTopLevelHitObjects() => Beatmap.HitObjects; | ||
|
||
protected override IEnumerable<HitObject> EnumerateNestedHitObjects(HitObject hitObject) => hitObject.NestedHitObjects; | ||
|
||
protected override double GetHealthIncreaseFor(HitObject hitObject, HitResult result) | ||
{ | ||
// Users are not expected to attain perfect judgements for all notes due to the tighter hit window. | ||
return judgement.MaxResult == HitResult.Perfect ? HitResult.Great : judgement.MaxResult; | ||
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; | ||
} | ||
} | ||
} |