1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-05 05:52:56 +08:00

Fix base score added for non-accuracy-affecting objects

This commit is contained in:
Dan Balasescu 2023-05-18 20:29:26 +09:00
parent c33e4fe75e
commit ef86be6d21

View File

@ -98,14 +98,20 @@ namespace osu.Game.Rulesets.Scoring
public long MaxTotalScore { get; private set; } public long MaxTotalScore { get; private set; }
/// <summary> /// <summary>
/// The sum of all basic judgements at the current time. /// The sum of all accuracy-affecting judgements at the current time.
/// </summary> /// </summary>
private double currentBasicScore; /// <remarks>
/// Used to compute accuracy.
/// </remarks>
private double currentBaseScore;
/// <summary> /// <summary>
/// The maximum sum of basic judgements at the current time. /// The maximum sum of accuracy-affecting judgements at the current time.
/// </summary> /// </summary>
private double currentMaxBasicScore; /// <remarks>
/// Used to compute accuracy.
/// </remarks>
private double currentMaxBaseScore;
/// <summary> /// <summary>
/// The total count of basic judgements in the beatmap. /// The total count of basic judgements in the beatmap.
@ -206,8 +212,11 @@ namespace osu.Game.Rulesets.Scoring
if (result.Type.IsBasic()) if (result.Type.IsBasic())
CurrentBasicJudgements++; CurrentBasicJudgements++;
currentMaxBasicScore += Judgement.ToNumericResult(result.Judgement.MaxResult); if (result.Type.AffectsAccuracy())
currentBasicScore += Judgement.ToNumericResult(result.Type); {
currentMaxBaseScore += Judgement.ToNumericResult(result.Judgement.MaxResult);
currentBaseScore += Judgement.ToNumericResult(result.Type);
}
AddScoreChange(result); AddScoreChange(result);
@ -241,8 +250,11 @@ namespace osu.Game.Rulesets.Scoring
if (result.Type.IsBasic()) if (result.Type.IsBasic())
CurrentBasicJudgements--; CurrentBasicJudgements--;
currentMaxBasicScore -= Judgement.ToNumericResult(result.Judgement.MaxResult); if (result.Type.AffectsAccuracy())
currentBasicScore -= Judgement.ToNumericResult(result.Type); {
currentMaxBaseScore -= Judgement.ToNumericResult(result.Judgement.MaxResult);
currentBaseScore -= Judgement.ToNumericResult(result.Type);
}
RemoveScoreChange(result); RemoveScoreChange(result);
@ -257,7 +269,8 @@ namespace osu.Game.Rulesets.Scoring
{ {
if (result.Type.IsBonus()) if (result.Type.IsBonus())
BonusPortion += Judgement.ToNumericResult(result.Type); BonusPortion += Judgement.ToNumericResult(result.Type);
else
if (result.Type.AffectsCombo())
ComboPortion += Judgement.ToNumericResult(result.Type) * (1 + result.ComboAtJudgement / 10d); ComboPortion += Judgement.ToNumericResult(result.Type) * (1 + result.ComboAtJudgement / 10d);
} }
@ -265,13 +278,14 @@ namespace osu.Game.Rulesets.Scoring
{ {
if (result.Type.IsBonus()) if (result.Type.IsBonus())
BonusPortion -= Judgement.ToNumericResult(result.Type); BonusPortion -= Judgement.ToNumericResult(result.Type);
else
if (result.Type.AffectsCombo())
ComboPortion -= Judgement.ToNumericResult(result.Type) * (1 + result.ComboAtJudgement / 10d); ComboPortion -= Judgement.ToNumericResult(result.Type) * (1 + result.ComboAtJudgement / 10d);
} }
private void updateScore() private void updateScore()
{ {
Accuracy.Value = currentMaxBasicScore > 0 ? currentBasicScore / currentMaxBasicScore : 1; Accuracy.Value = currentMaxBaseScore > 0 ? currentBaseScore / currentMaxBaseScore : 1;
TotalScore.Value = (long)Math.Round(ComputeTotalScore()); TotalScore.Value = (long)Math.Round(ComputeTotalScore());
} }
@ -301,8 +315,8 @@ namespace osu.Game.Rulesets.Scoring
scoreResultCounts.Clear(); scoreResultCounts.Clear();
currentBasicScore = 0; currentBaseScore = 0;
currentMaxBasicScore = 0; currentMaxBaseScore = 0;
CurrentBasicJudgements = 0; CurrentBasicJudgements = 0;
ComboPortion = 0; ComboPortion = 0;
BonusPortion = 0; BonusPortion = 0;
@ -314,8 +328,8 @@ namespace osu.Game.Rulesets.Scoring
Rank.Value = ScoreRank.X; Rank.Value = ScoreRank.X;
HighestCombo.Value = 0; HighestCombo.Value = 0;
currentBasicScore = 0; currentBaseScore = 0;
currentMaxBasicScore = 0; currentMaxBaseScore = 0;
} }
/// <summary> /// <summary>