mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 15:53:19 +08:00
Merge pull request #25740 from smoogipoo/fix-ignoremiss-accuracy-update
Fix IgnoreMiss judgements not updating accuracy
This commit is contained in:
commit
aa4faf5e8e
@ -356,6 +356,27 @@ namespace osu.Game.Tests.Rulesets.Scoring
|
|||||||
Assert.That(actual, Is.EqualTo(expected).Within(Precision.FLOAT_EPSILON));
|
Assert.That(actual, Is.EqualTo(expected).Within(Precision.FLOAT_EPSILON));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestCase(HitResult.Great)]
|
||||||
|
[TestCase(HitResult.LargeTickHit)]
|
||||||
|
public void TestAccuracyUpdateFromIgnoreMiss(HitResult maxResult)
|
||||||
|
{
|
||||||
|
scoreProcessor.ApplyBeatmap(new Beatmap
|
||||||
|
{
|
||||||
|
HitObjects =
|
||||||
|
{
|
||||||
|
new TestHitObject(maxResult, HitResult.IgnoreMiss)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var judgementResult = new JudgementResult(beatmap.HitObjects.Single(), new TestJudgement(maxResult, HitResult.IgnoreMiss))
|
||||||
|
{
|
||||||
|
Type = HitResult.IgnoreMiss
|
||||||
|
};
|
||||||
|
scoreProcessor.ApplyResult(judgementResult);
|
||||||
|
|
||||||
|
Assert.That(scoreProcessor.Accuracy.Value, Is.Not.EqualTo(1));
|
||||||
|
}
|
||||||
|
|
||||||
private class TestJudgement : Judgement
|
private class TestJudgement : Judgement
|
||||||
{
|
{
|
||||||
public override HitResult MaxResult { get; }
|
public override HitResult MaxResult { get; }
|
||||||
|
@ -218,9 +218,6 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
|
|
||||||
scoreResultCounts[result.Type] = scoreResultCounts.GetValueOrDefault(result.Type) + 1;
|
scoreResultCounts[result.Type] = scoreResultCounts.GetValueOrDefault(result.Type) + 1;
|
||||||
|
|
||||||
if (!result.Type.IsScorable())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (result.Type.IncreasesCombo())
|
if (result.Type.IncreasesCombo())
|
||||||
Combo.Value++;
|
Combo.Value++;
|
||||||
else if (result.Type.BreaksCombo())
|
else if (result.Type.BreaksCombo())
|
||||||
@ -228,16 +225,18 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
|
|
||||||
result.ComboAfterJudgement = Combo.Value;
|
result.ComboAfterJudgement = Combo.Value;
|
||||||
|
|
||||||
if (result.Type.AffectsAccuracy())
|
if (result.Judgement.MaxResult.AffectsAccuracy())
|
||||||
{
|
{
|
||||||
currentMaximumBaseScore += Judgement.ToNumericResult(result.Judgement.MaxResult);
|
currentMaximumBaseScore += Judgement.ToNumericResult(result.Judgement.MaxResult);
|
||||||
currentBaseScore += Judgement.ToNumericResult(result.Type);
|
|
||||||
currentAccuracyJudgementCount++;
|
currentAccuracyJudgementCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result.Type.AffectsAccuracy())
|
||||||
|
currentBaseScore += Judgement.ToNumericResult(result.Type);
|
||||||
|
|
||||||
if (result.Type.IsBonus())
|
if (result.Type.IsBonus())
|
||||||
currentBonusPortion += GetBonusScoreChange(result);
|
currentBonusPortion += GetBonusScoreChange(result);
|
||||||
else
|
else if (result.Type.IsScorable())
|
||||||
currentComboPortion += GetComboScoreChange(result);
|
currentComboPortion += GetComboScoreChange(result);
|
||||||
|
|
||||||
ApplyScoreChange(result);
|
ApplyScoreChange(result);
|
||||||
@ -275,19 +274,18 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
|
|
||||||
scoreResultCounts[result.Type] = scoreResultCounts.GetValueOrDefault(result.Type) - 1;
|
scoreResultCounts[result.Type] = scoreResultCounts.GetValueOrDefault(result.Type) - 1;
|
||||||
|
|
||||||
if (!result.Type.IsScorable())
|
if (result.Judgement.MaxResult.AffectsAccuracy())
|
||||||
return;
|
|
||||||
|
|
||||||
if (result.Type.AffectsAccuracy())
|
|
||||||
{
|
{
|
||||||
currentMaximumBaseScore -= Judgement.ToNumericResult(result.Judgement.MaxResult);
|
currentMaximumBaseScore -= Judgement.ToNumericResult(result.Judgement.MaxResult);
|
||||||
currentBaseScore -= Judgement.ToNumericResult(result.Type);
|
|
||||||
currentAccuracyJudgementCount--;
|
currentAccuracyJudgementCount--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result.Type.AffectsAccuracy())
|
||||||
|
currentBaseScore -= Judgement.ToNumericResult(result.Type);
|
||||||
|
|
||||||
if (result.Type.IsBonus())
|
if (result.Type.IsBonus())
|
||||||
currentBonusPortion -= GetBonusScoreChange(result);
|
currentBonusPortion -= GetBonusScoreChange(result);
|
||||||
else
|
else if (result.Type.IsScorable())
|
||||||
currentComboPortion -= GetComboScoreChange(result);
|
currentComboPortion -= GetComboScoreChange(result);
|
||||||
|
|
||||||
RemoveScoreChange(result);
|
RemoveScoreChange(result);
|
||||||
|
@ -23,11 +23,11 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
AccuracyDisplay.BindValueChanged(mod =>
|
AccuracyDisplay.BindValueChanged(mode =>
|
||||||
{
|
{
|
||||||
Current.UnbindBindings();
|
Current.UnbindBindings();
|
||||||
|
|
||||||
switch (mod.NewValue)
|
switch (mode.NewValue)
|
||||||
{
|
{
|
||||||
case AccuracyDisplayMode.Standard:
|
case AccuracyDisplayMode.Standard:
|
||||||
Current.BindTo(scoreProcessor.Accuracy);
|
Current.BindTo(scoreProcessor.Accuracy);
|
||||||
|
Loading…
Reference in New Issue
Block a user