SuccessfulHitWindow->SuccessfulHitResult

This commit is contained in:
Ivan Pavluk 2018-12-10 09:04:12 +07:00
parent 77a544e475
commit 8457324044
3 changed files with 14 additions and 7 deletions

View File

@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
{ HitResult.Miss, (270, 190, 140) },
};
protected override double SuccessfulHitWindow => Good;
protected override HitResult SuccessfulHitResult => HitResult.Good;
public override bool IsHitResultAllowed(HitResult result)
{

View File

@ -12,16 +12,23 @@ namespace osu.Game.Rulesets.Taiko.Scoring
internal class TaikoScoreProcessor : ScoreProcessor<TaikoHitObject>
{
/// <summary>
/// The HP awarded by a <see cref="HitResult.Great"/> hit.
/// A value used in calculating <see cref="hpMultiplier"/>.
/// </summary>
private const double hp_hit_great = 0.03;
private const double object_count_factor = 3;
/// <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;
/// <summary>
/// HP multiplier for a successful <see cref="HitResult"/>.
/// </summary>
private double hpMultiplier;
/// <summary>
/// HP multiplier for a <see cref="HitResult.Miss"/>.
/// </summary>
private double hpMissMultiplier;
public TaikoScoreProcessor(RulesetContainer<TaikoHitObject> rulesetContainer)
@ -33,7 +40,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring
{
base.ApplyBeatmap(beatmap);
hpMultiplier = 0.01 / (hp_hit_great * beatmap.HitObjects.FindAll(o => o is Hit).Count * BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.5, 0.75, 0.98));
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));
hpMissMultiplier = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.0018, 0.0075, 0.0120);
}

View File

@ -51,9 +51,9 @@ namespace osu.Game.Rulesets.Objects
public double Miss { get; protected set; }
/// <summary>
/// Hit window for a non-<see cref="HitResult.Miss"/> result.
/// The <see cref="HitResult"/> with the largest hit window that produces a successful hit.
/// </summary>
protected virtual double SuccessfulHitWindow => Meh;
protected virtual HitResult SuccessfulHitResult => HitResult.Meh;
/// <summary>
/// Whether it's possible to achieve this <see cref="HitResult"/>.
@ -136,6 +136,6 @@ namespace osu.Game.Rulesets.Objects
/// </summary>
/// <param name="timeOffset">The time offset.</param>
/// <returns>Whether the <see cref="HitObject"/> can be hit at any point in the future from this time offset.</returns>
public bool CanBeHit(double timeOffset) => timeOffset <= SuccessfulHitWindow / 2;
public bool CanBeHit(double timeOffset) => timeOffset <= HalfWindowFor(SuccessfulHitResult);
}
}