1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 05:32:54 +08:00

Merge pull request #5546 from smoogipoo/score-mod-multipliers

Apply mod multipliers to the score
This commit is contained in:
Dean Herbert 2019-07-31 18:09:37 +09:00 committed by GitHub
commit 3a2e0fbba5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -217,9 +217,7 @@ namespace osu.Game.Rulesets.Scoring
private double baseScore;
private double bonusScore;
protected ScoreProcessor()
{
}
private double scoreMultiplier = 1;
public ScoreProcessor(DrawableRuleset<TObject> drawableRuleset)
{
@ -239,6 +237,15 @@ namespace osu.Game.Rulesets.Scoring
}
Mode.ValueChanged += _ => updateScore();
Mods.ValueChanged += mods =>
{
scoreMultiplier = 1;
foreach (var m in mods.NewValue)
scoreMultiplier *= m.ScoreMultiplier;
updateScore();
};
}
/// <summary>
@ -388,7 +395,7 @@ namespace osu.Game.Rulesets.Scoring
if (rollingMaxBaseScore != 0)
Accuracy.Value = baseScore / rollingMaxBaseScore;
TotalScore.Value = getScore(Mode.Value);
TotalScore.Value = getScore(Mode.Value) * scoreMultiplier;
}
private double getScore(ScoringMode mode)