mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 10:23:01 +08:00
Fix incorrect accuracy calculation
This commit is contained in:
parent
12641edb4d
commit
7dd79f5a0b
@ -162,6 +162,9 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
protected int MaxHits { get; private set; }
|
protected int MaxHits { get; private set; }
|
||||||
protected int Hits { get; private set; }
|
protected int Hits { get; private set; }
|
||||||
|
|
||||||
|
private int maxAccurateHits;
|
||||||
|
private int accurateHits;
|
||||||
|
|
||||||
private double maxHighestCombo;
|
private double maxHighestCombo;
|
||||||
private double maxComboScore;
|
private double maxComboScore;
|
||||||
private double comboScore;
|
private double comboScore;
|
||||||
@ -233,8 +236,12 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
else if (judgement.IsHit)
|
else if (judgement.IsHit)
|
||||||
bonusScore += judgement.NumericResult;
|
bonusScore += judgement.NumericResult;
|
||||||
|
|
||||||
if (judgement.AffectsAccuracy && judgement.IsHit)
|
if (judgement.AffectsAccuracy)
|
||||||
|
{
|
||||||
Hits++;
|
Hits++;
|
||||||
|
if (judgement.IsHit)
|
||||||
|
accurateHits++;
|
||||||
|
}
|
||||||
|
|
||||||
switch (Mode.Value)
|
switch (Mode.Value)
|
||||||
{
|
{
|
||||||
@ -242,7 +249,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
TotalScore.Value =
|
TotalScore.Value =
|
||||||
max_score *
|
max_score *
|
||||||
(ComboPortion * (comboScore * Math.Log(HighestCombo + 1, 2)) / (maxComboScore * Math.Log(maxHighestCombo + 1, 2))
|
(ComboPortion * (comboScore * Math.Log(HighestCombo + 1, 2)) / (maxComboScore * Math.Log(maxHighestCombo + 1, 2))
|
||||||
+ AccuracyPortion * Hits / MaxHits)
|
+ AccuracyPortion * accurateHits / maxAccurateHits)
|
||||||
+ bonusScore;
|
+ bonusScore;
|
||||||
break;
|
break;
|
||||||
case ScoringMode.Exponential:
|
case ScoringMode.Exponential:
|
||||||
@ -250,21 +257,23 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Accuracy.Value = (double)Hits / MaxHits;
|
Accuracy.Value = (double)accurateHits / Hits;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Reset(bool storeResults)
|
protected override void Reset(bool storeResults)
|
||||||
{
|
{
|
||||||
if (storeResults)
|
if (storeResults)
|
||||||
{
|
{
|
||||||
|
MaxHits = Hits;
|
||||||
|
maxAccurateHits = accurateHits;
|
||||||
maxHighestCombo = HighestCombo;
|
maxHighestCombo = HighestCombo;
|
||||||
maxComboScore = comboScore;
|
maxComboScore = comboScore;
|
||||||
MaxHits = Hits;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
base.Reset(storeResults);
|
base.Reset(storeResults);
|
||||||
|
|
||||||
Hits = 0;
|
Hits = 0;
|
||||||
|
accurateHits = 0;
|
||||||
comboScore = 0;
|
comboScore = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user