mirror of
https://github.com/ppy/osu.git
synced 2025-02-07 11:32:54 +08:00
fixed for taiko and mania too
This commit is contained in:
parent
a5c9fb8b22
commit
7fb8985398
@ -42,5 +42,7 @@ namespace osu.Game.Rulesets.Mania.Scoring
|
||||
r.Min * multiplier,
|
||||
r.Average * multiplier,
|
||||
r.Max * multiplier)).ToArray();
|
||||
|
||||
public override double GetHitWindowForResult(double difficulty, DifficultyRange range) => base.GetHitWindowForResult(difficulty, range) + 1;
|
||||
}
|
||||
}
|
||||
|
@ -28,5 +28,11 @@ namespace osu.Game.Rulesets.Taiko.Scoring
|
||||
}
|
||||
|
||||
protected override DifficultyRange[] GetRanges() => TAIKO_RANGES;
|
||||
|
||||
public override double GetHitWindowForResult(double difficulty, DifficultyRange range)
|
||||
{
|
||||
double value = base.GetHitWindowForResult(difficulty, range);
|
||||
return range.Result == HitResult.Miss ? value + 1 : value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -78,6 +78,19 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// <returns>Whether the <see cref="HitResult"/> can be achieved.</returns>
|
||||
public virtual bool IsHitResultAllowed(HitResult result) => true;
|
||||
|
||||
/// <summary>
|
||||
/// Calculates ruleset-specific HitWindow timing value for given result, using difficulty and rage.
|
||||
/// </summary>
|
||||
/// <param name="difficulty">Accuracy difficulty parameter<./param>
|
||||
/// <param name="range">Difficulty Range for HitWindow.</param>
|
||||
/// <returns>HitWindow timing value.</returns>
|
||||
public virtual double GetHitWindowForResult(double difficulty, DifficultyRange range)
|
||||
{
|
||||
double value = IBeatmapDifficultyInfo.DifficultyRange(difficulty, (range.Min, range.Average, range.Max));
|
||||
value = Math.Floor(value) - 0.5;
|
||||
return value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets hit windows with values that correspond to a difficulty parameter.
|
||||
/// </summary>
|
||||
@ -86,8 +99,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
{
|
||||
foreach (var range in GetRanges())
|
||||
{
|
||||
double value = IBeatmapDifficultyInfo.DifficultyRange(difficulty, (range.Min, range.Average, range.Max));
|
||||
value = Math.Floor(value) - 0.5;
|
||||
double value = GetHitWindowForResult(difficulty, range);
|
||||
|
||||
switch (range.Result)
|
||||
{
|
||||
@ -129,7 +141,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
|
||||
for (var result = HitResult.Perfect; result >= HitResult.Miss; --result)
|
||||
{
|
||||
if (IsHitResultAllowed(result) && timeOffset < WindowFor(result))
|
||||
if (IsHitResultAllowed(result) && timeOffset <= WindowFor(result))
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user