mirror of
https://github.com/ppy/osu.git
synced 2026-05-22 03:31:54 +08:00
0988552567
I don't really have much to say here. Instead, I'll give a brief history rundown that lists many pages of documentation you can read, if interested. - Started off as BTMC + Happy24 (Vivi)'s ["The Vision"](https://docs.google.com/document/d/1p1IpPmd2RICp8G4OqkCSs7u8Ug8FbFv8qqP0mfSrHf0/edit?tab=t.0#heading=h.fol093d9f9xi) - Initial [designs](https://www.figma.com/design/f5qqC57t9jFlgpzhRqUNVX/The-Vision?node-id=0-1&p=f) were led by Vivi. - Designs [morphed](https://www.figma.com/design/vtFmLrXKvWNyYiRjTezFTM/Untitled--Copy-?node-id=0-1&p=f) during development into what's currently present, led by @minetoblend. - There is some more ongoing work creating a [game design document](https://docs.google.com/document/d/1iffJFCsIBfYF0D4ogItSBEj6YBmbp-rdCpItAeaJiTA/edit?tab=t.0). **tl;dr:** Create something with the mechanics of a trading card game within osu!. The name of this is "ranked play". --- To be frank, a lot of stuff is missing here. Some of it I don't want to mention, because the point of this exercise is to get the system into the hands of players, gather feedback especially around mechanics, and discuss any further direction with the team. I am expecting a blanket approval on all of the new code, with particular attention to changes in existing components that I'll point out in a self review. There is also some [ongoing work](https://github.com/smoogipoo/osu/pulls) that may arrive in this branch prior to being merged. --------- Co-authored-by: maarvin <minetoblend@gmail.com> Co-authored-by: Marvin <m.schuerz@hautzy.com> Co-authored-by: Jamie Taylor <me@nekodex.net> Co-authored-by: ArijanJ <arijanj@proton.me> Co-authored-by: Dean Herbert <pe@ppy.sh> Co-authored-by: Tim Oliver <git@tim.dev> Co-authored-by: Joseph Madamba <madamba.joehu@outlook.com> Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com> Co-authored-by: nil <25884226+voidstar0@users.noreply.github.com> Co-authored-by: Ботников Максим <mr.botnikoff@ya.ru> Co-authored-by: Denis Titovets <den232titovets@yandex.ru> Co-authored-by: Michael Middlezong <119022671+mmiddlezong@users.noreply.github.com> Co-authored-by: SupDos <6813986+SupDos@users.noreply.github.com> Co-authored-by: failaip12 <86018517+failaip12@users.noreply.github.com>
177 lines
7.1 KiB
C#
177 lines
7.1 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.API.Requests.Responses;
|
|
using osu.Game.Online.Multiplayer.MatchTypes.RankedPlay;
|
|
using osu.Game.Online.Rooms;
|
|
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 TestSceneRankedPlayScreen : RankedPlayTestScene
|
|
{
|
|
private RankedPlayScreen screen = null!;
|
|
|
|
public override void SetUpSteps()
|
|
{
|
|
base.SetUpSteps();
|
|
|
|
AddStep("join room", () => JoinRoom(CreateDefaultRoom(MatchType.RankedPlay)));
|
|
WaitForJoined();
|
|
|
|
AddStep("join other user", () => MultiplayerClient.AddUser(new APIUser { Id = 2 }));
|
|
|
|
AddStep("load screen", () => LoadScreen(screen = new RankedPlayScreen(MultiplayerClient.ClientRoom!)));
|
|
}
|
|
|
|
[Test]
|
|
public void TestIntroStage()
|
|
{
|
|
AddStep("set round warmup phase", () => MultiplayerClient.RankedPlayChangeStage(RankedPlayStage.RoundWarmup, s => s.StarRating = 6.3f).WaitSafely());
|
|
}
|
|
|
|
[Test]
|
|
public void TestDiscardCardsStage()
|
|
{
|
|
AddStep("set discard phase", () => MultiplayerClient.RankedPlayChangeStage(RankedPlayStage.CardDiscard).WaitSafely());
|
|
|
|
AddWaitStep("wait", 3);
|
|
|
|
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 discard button", () =>
|
|
{
|
|
var button = screen.ChildrenOfType<ShearedButton>().Single(it => it.Name == "Discard Button");
|
|
|
|
InputManager.MoveMouseTo(button);
|
|
InputManager.Click(MouseButton.Left);
|
|
});
|
|
|
|
AddWaitStep("wait", 13);
|
|
AddStep("set finish discard phase", () => MultiplayerClient.RankedPlayChangeStage(RankedPlayStage.FinishCardDiscard).WaitSafely());
|
|
}
|
|
|
|
[Test]
|
|
public void TestAddRemoveCards()
|
|
{
|
|
AddStep("set discard phase", () => MultiplayerClient.RankedPlayChangeStage(RankedPlayStage.CardDiscard).WaitSafely());
|
|
|
|
for (int i = 0; i < 3; i++)
|
|
AddStep("add card", () => MultiplayerClient.RankedPlayAddCards([new RankedPlayCardItem()]).WaitSafely());
|
|
|
|
for (int i = 0; i < 3; i++)
|
|
AddStep("remove card", () => MultiplayerClient.RankedPlayRemoveCards(hand => [hand[0]]).WaitSafely());
|
|
}
|
|
|
|
[Test]
|
|
public void TestRevealCards()
|
|
{
|
|
var requestHandler = new BeatmapRequestHandler();
|
|
|
|
AddStep("setup request handler", () => ((DummyAPIAccess)API).HandleRequest = requestHandler.HandleRequest);
|
|
|
|
AddStep("set discard phase", () => MultiplayerClient.RankedPlayChangeStage(RankedPlayStage.CardDiscard).WaitSafely());
|
|
|
|
for (int i = 0; i < 3; i++)
|
|
{
|
|
int i2 = i;
|
|
AddStep("reveal card", () => MultiplayerClient.RankedPlayRevealCard(hand => hand[i2], new MultiplayerPlaylistItem
|
|
{
|
|
ID = i2,
|
|
BeatmapID = requestHandler.Beatmaps[i2].OnlineID
|
|
}).WaitSafely());
|
|
}
|
|
}
|
|
|
|
[Test]
|
|
public void TestPlayCardDirect()
|
|
{
|
|
AddStep("set play phase", () => MultiplayerClient.RankedPlayChangeStage(RankedPlayStage.CardPlay, state => state.ActiveUserId = API.LocalUser.Value.OnlineID).WaitSafely());
|
|
AddWaitStep("wait", 3);
|
|
AddStep("play card", () => MultiplayerClient.PlayCard(hand => hand[0]).WaitSafely());
|
|
}
|
|
|
|
[Test]
|
|
public void TestDiscardCardsDirect()
|
|
{
|
|
AddStep("set discard phase", () => MultiplayerClient.RankedPlayChangeStage(RankedPlayStage.CardDiscard).WaitSafely());
|
|
AddWaitStep("wait", 3);
|
|
AddStep("discard cards", () => MultiplayerClient.DiscardCards(hand => hand.Take(3)).WaitSafely());
|
|
AddWaitStep("wait", 13);
|
|
AddStep("set finish discard phase", () => MultiplayerClient.RankedPlayChangeStage(RankedPlayStage.FinishCardDiscard).WaitSafely());
|
|
}
|
|
|
|
[Test]
|
|
public void TestPlayStage()
|
|
{
|
|
AddStep("set play phase", () => MultiplayerClient.RankedPlayChangeStage(RankedPlayStage.CardPlay, state => state.ActiveUserId = API.LocalUser.Value.OnlineID).WaitSafely());
|
|
AddUntilStep("wait until cards are present", () => this.ChildrenOfType<PlayerHandOfCards.PlayerHandCard>().Count() == 5);
|
|
|
|
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 TestOtherPlaysCard()
|
|
{
|
|
AddStep("set play phase", () => MultiplayerClient.RankedPlayChangeStage(RankedPlayStage.CardPlay, state => state.ActiveUserId = 2).WaitSafely());
|
|
AddWaitStep("wait", 5);
|
|
AddStep("play beatmap", () => MultiplayerClient.PlayUserCard(2, hand => hand[0]).WaitSafely());
|
|
AddStep("reveal card", () => MultiplayerClient.RankedPlayRevealUserCard(2, hand => hand[0], new MultiplayerPlaylistItem
|
|
{
|
|
ID = 0,
|
|
BeatmapID = 0
|
|
}).WaitSafely());
|
|
}
|
|
|
|
[Test]
|
|
public void TestHealthChange()
|
|
{
|
|
AddStep("set play phase", () => MultiplayerClient.RankedPlayChangeStage(RankedPlayStage.CardPlay, state => state.ActiveUserId = 2).WaitSafely());
|
|
AddWaitStep("wait", 5);
|
|
AddStep("change player 1 health", () => MultiplayerClient.RankedPlayChangeUserState(MultiplayerClient.LocalUser!.UserID, state => state.Life = 250_000).WaitSafely());
|
|
AddWaitStep("wait", 5);
|
|
AddStep("change player 2 health", () => MultiplayerClient.RankedPlayChangeUserState(2, state => state.Life = 250_000).WaitSafely());
|
|
}
|
|
}
|
|
}
|