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;
|
2018-12-27 21:36:57 +08:00
|
|
|
|
using osu.Game.Rulesets.Objects;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects;
|
|
|
|
|
using osu.Game.Rulesets.UI;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Scoring
|
|
|
|
|
{
|
|
|
|
|
internal class TaikoScoreProcessor : ScoreProcessor<TaikoHitObject>
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2018-12-10 12:59:35 +08:00
|
|
|
|
/// A value used for calculating <see cref="hpMultiplier"/>.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
/// </summary>
|
2018-12-10 10:04:12 +08:00
|
|
|
|
private const double object_count_factor = 3;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Taiko fails at the end of the map if the player has not half-filled their HP bar.
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected override bool DefaultFailCondition => JudgedHits == MaxHits && Health.Value <= 0.5;
|
|
|
|
|
|
2018-12-10 10:04:12 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// HP multiplier for a successful <see cref="HitResult"/>.
|
|
|
|
|
/// </summary>
|
2018-12-04 22:20:44 +08:00
|
|
|
|
private double hpMultiplier;
|
2018-12-10 10:04:12 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// HP multiplier for a <see cref="HitResult.Miss"/>.
|
|
|
|
|
/// </summary>
|
2018-12-04 22:20:44 +08:00
|
|
|
|
private double hpMissMultiplier;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-03-20 10:22:34 +08:00
|
|
|
|
public TaikoScoreProcessor(DrawableRuleset<TaikoHitObject> drawableRuleset)
|
|
|
|
|
: base(drawableRuleset)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-02 19:36:08 +08:00
|
|
|
|
protected override void ApplyBeatmap(Beatmap<TaikoHitObject> beatmap)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2018-08-02 19:36:08 +08:00
|
|
|
|
base.ApplyBeatmap(beatmap);
|
|
|
|
|
|
2018-12-10 10:04:12 +08:00
|
|
|
|
hpMultiplier = 1 / (object_count_factor * beatmap.HitObjects.FindAll(o => o is Hit).Count * BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.5, 0.75, 0.98));
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-12-04 22:20:44 +08:00
|
|
|
|
hpMissMultiplier = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.0018, 0.0075, 0.0120);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
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-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
protected override void Reset(bool storeResults)
|
|
|
|
|
{
|
|
|
|
|
base.Reset(storeResults);
|
|
|
|
|
|
|
|
|
|
Health.Value = 0;
|
|
|
|
|
}
|
2018-12-27 21:36:57 +08:00
|
|
|
|
|
2019-01-03 12:57:56 +08:00
|
|
|
|
public override HitWindows CreateHitWindows() => new TaikoHitWindows();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|