Populate `TotalScoreWithoutMods` on scores set locally

This commit is contained in:
Bartłomiej Dach 2024-04-17 08:52:47 +02:00
parent 6b0d577f0b
commit e0178802b8
No known key found for this signature in database
1 changed files with 11 additions and 1 deletions

View File

@ -56,6 +56,14 @@ public partial class ScoreProcessor : JudgementProcessor
/// </summary>
public readonly BindableLong TotalScore = new BindableLong { MinValue = 0 };
/// <summary>
/// The total number of points awarded for the score without including mod multipliers.
/// </summary>
/// <remarks>
/// The purpose of this property is to enable future lossless rebalances of mod multipliers.
/// </remarks>
public readonly BindableLong TotalScoreWithoutMods = new BindableLong { MinValue = 0 };
/// <summary>
/// The current accuracy.
/// </summary>
@ -363,7 +371,8 @@ private void updateScore()
double comboProgress = maximumComboPortion > 0 ? currentComboPortion / maximumComboPortion : 1;
double accuracyProcess = maximumAccuracyJudgementCount > 0 ? (double)currentAccuracyJudgementCount / maximumAccuracyJudgementCount : 1;
TotalScore.Value = (long)Math.Round(ComputeTotalScore(comboProgress, accuracyProcess, currentBonusPortion) * scoreMultiplier);
TotalScoreWithoutMods.Value = (long)Math.Round(ComputeTotalScore(comboProgress, accuracyProcess, currentBonusPortion));
TotalScore.Value = (long)Math.Round(TotalScoreWithoutMods.Value * scoreMultiplier);
}
private void updateRank()
@ -446,6 +455,7 @@ public virtual void PopulateScore(ScoreInfo score)
score.MaximumStatistics[result] = MaximumResultCounts.GetValueOrDefault(result);
// Populate total score after everything else.
score.TotalScoreWithoutMods = TotalScoreWithoutMods.Value;
score.TotalScore = TotalScore.Value;
}