2019-01-24 16:43: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.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Rulesets.Judgements;
|
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Scoring
|
|
|
|
|
{
|
2019-12-11 16:25:06 +08:00
|
|
|
|
internal class ManiaScoreProcessor : ScoreProcessor
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The hit HP multiplier at OD = 0.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private const double hp_multiplier_min = 0.75;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The hit HP multiplier at OD = 0.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private const double hp_multiplier_mid = 0.85;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The hit HP multiplier at OD = 0.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private const double hp_multiplier_max = 1;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The MISS HP multiplier at OD = 0.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private const double hp_multiplier_miss_min = 0.5;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The MISS HP multiplier at OD = 5.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private const double hp_multiplier_miss_mid = 0.75;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The MISS HP multiplier at OD = 10.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private const double hp_multiplier_miss_max = 1;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The MISS HP multiplier. This is multiplied to the miss hp increase.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private double hpMissMultiplier = 1;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The HIT HP multiplier. This is multiplied to hit hp increases.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private double hpMultiplier = 1;
|
|
|
|
|
|
2019-12-11 16:25:06 +08:00
|
|
|
|
public ManiaScoreProcessor(IBeatmap beatmap)
|
|
|
|
|
: base(beatmap)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-11 16:25:06 +08:00
|
|
|
|
protected override void ApplyBeatmap(IBeatmap beatmap)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2018-08-02 19:36:54 +08:00
|
|
|
|
base.ApplyBeatmap(beatmap);
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
BeatmapDifficulty difficulty = beatmap.BeatmapInfo.BaseDifficulty;
|
|
|
|
|
hpMultiplier = BeatmapDifficulty.DifficultyRange(difficulty.DrainRate, hp_multiplier_min, hp_multiplier_mid, hp_multiplier_max);
|
|
|
|
|
hpMissMultiplier = BeatmapDifficulty.DifficultyRange(difficulty.DrainRate, hp_multiplier_miss_min, hp_multiplier_miss_mid, hp_multiplier_miss_max);
|
2018-08-02 19:36:54 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-12-11 16:25:06 +08:00
|
|
|
|
protected override void SimulateAutoplay(IBeatmap beatmap)
|
2018-08-02 19:36:54 +08:00
|
|
|
|
{
|
2018-04-13 17:19:50 +08:00
|
|
|
|
while (true)
|
|
|
|
|
{
|
2018-08-02 19:36:54 +08:00
|
|
|
|
base.SimulateAutoplay(beatmap);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
if (!HasFailed)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
hpMultiplier *= 1.01;
|
|
|
|
|
hpMissMultiplier *= 0.98;
|
|
|
|
|
|
|
|
|
|
Reset(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-22 17:08:15 +08:00
|
|
|
|
protected override double HealthAdjustmentFactorFor(JudgementResult result)
|
2019-04-22 16:51:43 +08:00
|
|
|
|
=> result.Type == HitResult.Miss ? hpMissMultiplier : hpMultiplier;
|
2018-12-27 21:36:57 +08:00
|
|
|
|
|
2019-01-03 12:57:56 +08:00
|
|
|
|
public override HitWindows CreateHitWindows() => new ManiaHitWindows();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|