1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:43:01 +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 baseScore;
private double bonusScore; private double bonusScore;
protected ScoreProcessor() private double scoreMultiplier = 1;
{
}
public ScoreProcessor(DrawableRuleset<TObject> drawableRuleset) public ScoreProcessor(DrawableRuleset<TObject> drawableRuleset)
{ {
@ -239,6 +237,15 @@ namespace osu.Game.Rulesets.Scoring
} }
Mode.ValueChanged += _ => updateScore(); Mode.ValueChanged += _ => updateScore();
Mods.ValueChanged += mods =>
{
scoreMultiplier = 1;
foreach (var m in mods.NewValue)
scoreMultiplier *= m.ScoreMultiplier;
updateScore();
};
} }
/// <summary> /// <summary>
@ -388,7 +395,7 @@ namespace osu.Game.Rulesets.Scoring
if (rollingMaxBaseScore != 0) if (rollingMaxBaseScore != 0)
Accuracy.Value = baseScore / rollingMaxBaseScore; Accuracy.Value = baseScore / rollingMaxBaseScore;
TotalScore.Value = getScore(Mode.Value); TotalScore.Value = getScore(Mode.Value) * scoreMultiplier;
} }
private double getScore(ScoringMode mode) private double getScore(ScoringMode mode)