1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 02:32:59 +08:00

Decode Geki/Katu from legacy taiko scores into LargeBonus

This commit is contained in:
Dan Balasescu 2022-09-07 00:11:51 +09:00
parent 6a371eba5f
commit 7c0e99c5a8
3 changed files with 42 additions and 4 deletions

View File

@ -67,6 +67,24 @@ namespace osu.Game.Tests.Beatmaps.Formats
}
}
[Test]
public void TestDecodeTaikoReplay()
{
var decoder = new TestLegacyScoreDecoder();
using (var resourceStream = TestResources.OpenResource("Replays/taiko-replay.osr"))
{
var score = decoder.Parse(resourceStream);
Assert.AreEqual(1, score.ScoreInfo.Ruleset.OnlineID);
Assert.AreEqual(4, score.ScoreInfo.Statistics[HitResult.Great]);
Assert.AreEqual(2, score.ScoreInfo.Statistics[HitResult.LargeBonus]);
Assert.AreEqual(4, score.ScoreInfo.MaxCombo);
Assert.That(score.Replay.Frames, Is.Not.Empty);
}
}
[TestCase(3, true)]
[TestCase(6, false)]
[TestCase(LegacyBeatmapDecoder.LATEST_VERSION, false)]

Binary file not shown.

View File

@ -3,6 +3,7 @@
#nullable disable
using System.Collections.Generic;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Scoring.Legacy
@ -13,6 +14,9 @@ namespace osu.Game.Scoring.Legacy
{
switch (scoreInfo.Ruleset.OnlineID)
{
case 1:
return getCount(scoreInfo, HitResult.LargeBonus);
case 3:
return getCount(scoreInfo, HitResult.Perfect);
}
@ -24,6 +28,12 @@ namespace osu.Game.Scoring.Legacy
{
switch (scoreInfo.Ruleset.OnlineID)
{
// For legacy scores, Geki indicates hit300 + perfect strong note hit.
// Lazer only has one result for a perfect strong note hit (LargeBonus).
case 1:
scoreInfo.Statistics[HitResult.LargeBonus] = scoreInfo.Statistics.GetValueOrDefault(HitResult.LargeBonus) + value;
break;
case 3:
scoreInfo.Statistics[HitResult.Perfect] = value;
break;
@ -38,11 +48,15 @@ namespace osu.Game.Scoring.Legacy
{
switch (scoreInfo.Ruleset.OnlineID)
{
case 3:
return getCount(scoreInfo, HitResult.Good);
// For taiko, Katu is bundled into Geki.
case 1:
break;
case 2:
return getCount(scoreInfo, HitResult.SmallTickMiss);
case 3:
return getCount(scoreInfo, HitResult.Good);
}
return null;
@ -52,13 +66,19 @@ namespace osu.Game.Scoring.Legacy
{
switch (scoreInfo.Ruleset.OnlineID)
{
case 3:
scoreInfo.Statistics[HitResult.Good] = value;
// For legacy scores, Katu indicates hit100 + perfect strong note hit.
// Lazer only has one result for a perfect strong note hit (LargeBonus).
case 1:
scoreInfo.Statistics[HitResult.LargeBonus] = scoreInfo.Statistics.GetValueOrDefault(HitResult.LargeBonus) + value;
break;
case 2:
scoreInfo.Statistics[HitResult.SmallTickMiss] = value;
break;
case 3:
scoreInfo.Statistics[HitResult.Good] = value;
break;
}
}