1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 05:02:56 +08:00
osu-lazer/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModDoubleTime.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

76 lines
2.7 KiB
C#
Raw Normal View History

2023-08-29 02:46:11 +08:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using NUnit.Framework;
2023-12-20 18:57:42 +08:00
using osu.Framework.Utils;
2023-08-29 02:46:11 +08:00
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mania.Mods;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mania.Replays;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Replays;
using osu.Game.Tests.Visual;
namespace osu.Game.Rulesets.Mania.Tests.Mods
{
public partial class TestSceneManiaModDoubleTime : ModTestScene
{
private const double offset = 18;
2023-10-16 13:01:47 +08:00
protected override bool AllowFail => true;
2023-08-29 02:46:11 +08:00
protected override Ruleset CreatePlayerRuleset() => new ManiaRuleset();
[Test]
public void TestHitWindowWithoutDoubleTime() => CreateModTest(new ModTestData
{
2023-10-16 15:06:34 +08:00
PassCondition = () => Player.ScoreProcessor.JudgedHits > 0
2023-12-20 18:57:42 +08:00
&& Precision.AlmostEquals(Player.ScoreProcessor.Accuracy.Value, 0.9836, 0.01)
&& Player.ScoreProcessor.TotalScore.Value == 946_049,
2023-08-29 02:46:11 +08:00
Autoplay = false,
Beatmap = new Beatmap
{
BeatmapInfo = { Ruleset = new ManiaRuleset().RulesetInfo },
Difficulty = { OverallDifficulty = 10 },
HitObjects = new List<HitObject>
{
new Note { StartTime = 1000 }
},
},
ReplayFrames = new List<ReplayFrame>
{
new ManiaReplayFrame(1000 + offset, ManiaAction.Key1)
}
});
[Test]
2023-10-16 13:01:47 +08:00
public void TestHitWindowWithDoubleTime()
2023-08-29 02:46:11 +08:00
{
2023-10-16 13:01:47 +08:00
var doubleTime = new ManiaModDoubleTime();
CreateModTest(new ModTestData
2023-08-29 02:46:11 +08:00
{
2023-10-16 13:01:47 +08:00
Mod = doubleTime,
2023-10-16 15:06:34 +08:00
PassCondition = () => Player.ScoreProcessor.JudgedHits > 0
&& Player.ScoreProcessor.Accuracy.Value == 1
2023-12-20 18:57:42 +08:00
&& Player.ScoreProcessor.TotalScore.Value == (long)(1_000_000 * doubleTime.ScoreMultiplier),
2023-10-16 13:01:47 +08:00
Autoplay = false,
Beatmap = new Beatmap
2023-08-29 02:46:11 +08:00
{
2023-10-16 13:01:47 +08:00
BeatmapInfo = { Ruleset = new ManiaRuleset().RulesetInfo },
Difficulty = { OverallDifficulty = 10 },
HitObjects = new List<HitObject>
{
new Note { StartTime = 1000 }
},
2023-08-29 02:46:11 +08:00
},
2023-10-16 13:01:47 +08:00
ReplayFrames = new List<ReplayFrame>
{
new ManiaReplayFrame(1000 + offset, ManiaAction.Key1)
}
});
}
2023-08-29 02:46:11 +08:00
}
}