mirror of
https://github.com/ppy/osu.git
synced 2026-05-13 19:54:15 +08:00
53f945b7ac
The "Key Count" metric in mania is very useless since you are already expected to play maps with a specific Key Count when you are queueing. This PR inserts the proportion of LNs (Long Notes) in the place of that metric since it is one of the ways players can gudge their skillsets (This idea comes from reddit) Also improved the test suite for other skillsets by making the architecture more minor ruleset friendly Addresses https://github.com/ppy/osu/discussions/37568. --------- Co-authored-by: Dan Balasescu <smoogipoo@smgi.me> Co-authored-by: Dean Herbert <pe@ppy.sh>
139 lines
5.0 KiB
C#
139 lines
5.0 KiB
C#
// 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.Linq;
|
|
using NUnit.Framework;
|
|
using osu.Framework.Extensions;
|
|
using osu.Framework.Testing;
|
|
using osu.Game.Graphics.UserInterface;
|
|
using osu.Game.Online.API;
|
|
using osu.Game.Online.Multiplayer;
|
|
using osu.Game.Online.Multiplayer.MatchTypes.RankedPlay;
|
|
using osu.Game.Online.Rooms;
|
|
using osu.Game.Rulesets.Mania;
|
|
using osu.Game.Rulesets.Osu;
|
|
using osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay;
|
|
using osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Hand;
|
|
using osuTK.Input;
|
|
|
|
namespace osu.Game.Tests.Visual.RankedPlay
|
|
{
|
|
public partial class TestScenePickScreen : RankedPlayTestScene
|
|
{
|
|
private RankedPlayScreen screen = null!;
|
|
|
|
public override void SetUpSteps()
|
|
{
|
|
base.SetUpSteps();
|
|
|
|
AddStep("join room", () => JoinRoom(CreateDefaultRoom(MatchType.RankedPlay)));
|
|
WaitForJoined();
|
|
|
|
AddStep("add other user", () => MultiplayerClient.AddUser(new MultiplayerRoomUser(2)));
|
|
|
|
AddStep("load screen", () => LoadScreen(screen = new RankedPlayScreen(MultiplayerClient.ClientRoom!)));
|
|
AddUntilStep("screen loaded", () => screen.IsLoaded);
|
|
}
|
|
|
|
[Test]
|
|
public void TestOsu()
|
|
{
|
|
BeatmapRequestHandler requestHandler = null!;
|
|
AddStep("setup ruleset", () => requestHandler = new BeatmapRequestHandler(new OsuRuleset().RulesetInfo));
|
|
|
|
AddStep("setup request handler", () => ((DummyAPIAccess)API).HandleRequest = requestHandler.HandleRequest);
|
|
|
|
AddStep("set pick state", () => MultiplayerClient.RankedPlayChangeStage(RankedPlayStage.CardPlay, state => state.ActiveUserId = API.LocalUser.Value.OnlineID).WaitSafely());
|
|
|
|
AddWaitStep("wait some", 5);
|
|
|
|
AddStep("reveal cards", () =>
|
|
{
|
|
for (int i = 0; i < 5; i++)
|
|
{
|
|
int i2 = i;
|
|
MultiplayerClient.RankedPlayRevealCard(hand => hand[i2], new MultiplayerPlaylistItem
|
|
{
|
|
ID = i2,
|
|
BeatmapID = requestHandler.Beatmaps[i2].OnlineID
|
|
}).WaitSafely();
|
|
}
|
|
});
|
|
|
|
for (int i = 0; i < 3; i++)
|
|
{
|
|
int i2 = i;
|
|
AddStep($"click card {i2}", () =>
|
|
{
|
|
InputManager.MoveMouseTo(this.ChildrenOfType<PlayerHandOfCards.PlayerHandCard>().ElementAt(i2));
|
|
InputManager.Click(MouseButton.Left);
|
|
});
|
|
}
|
|
|
|
AddWaitStep("wait", 3);
|
|
|
|
AddStep("click play button", () =>
|
|
{
|
|
var button = screen
|
|
.ChildrenOfType<PlayerHandOfCards.PlayerHandCard>()
|
|
.First(it => it.Selected)
|
|
.ChildrenOfType<ShearedButton>()
|
|
.First();
|
|
|
|
InputManager.MoveMouseTo(button);
|
|
InputManager.Click(MouseButton.Left);
|
|
});
|
|
}
|
|
|
|
[Test]
|
|
public void TestMania()
|
|
{
|
|
BeatmapRequestHandler requestHandler = null!;
|
|
AddStep("setup ruleset", () => requestHandler = new BeatmapRequestHandler(new ManiaRuleset().RulesetInfo));
|
|
|
|
AddStep("setup request handler", () => ((DummyAPIAccess)API).HandleRequest = requestHandler.HandleRequest);
|
|
|
|
AddStep("set pick state", () => MultiplayerClient.RankedPlayChangeStage(RankedPlayStage.CardPlay, state => state.ActiveUserId = API.LocalUser.Value.OnlineID).WaitSafely());
|
|
|
|
AddWaitStep("wait some", 5);
|
|
|
|
AddStep("reveal cards", () =>
|
|
{
|
|
for (int i = 0; i < 5; i++)
|
|
{
|
|
int i2 = i;
|
|
MultiplayerClient.RankedPlayRevealCard(hand => hand[i2], new MultiplayerPlaylistItem
|
|
{
|
|
ID = i2,
|
|
BeatmapID = requestHandler.Beatmaps[i2].OnlineID
|
|
}).WaitSafely();
|
|
}
|
|
});
|
|
|
|
for (int i = 0; i < 3; i++)
|
|
{
|
|
int i2 = i;
|
|
AddStep($"click card {i2}", () =>
|
|
{
|
|
InputManager.MoveMouseTo(this.ChildrenOfType<PlayerHandOfCards.PlayerHandCard>().ElementAt(i2));
|
|
InputManager.Click(MouseButton.Left);
|
|
});
|
|
}
|
|
|
|
AddWaitStep("wait", 3);
|
|
|
|
AddStep("click play button", () =>
|
|
{
|
|
var button = screen
|
|
.ChildrenOfType<PlayerHandOfCards.PlayerHandCard>()
|
|
.First(it => it.Selected)
|
|
.ChildrenOfType<ShearedButton>()
|
|
.First();
|
|
|
|
InputManager.MoveMouseTo(button);
|
|
InputManager.Click(MouseButton.Left);
|
|
});
|
|
}
|
|
}
|
|
}
|