diff --git a/osu.Server.Spectator.Tests/RankedPlay/Stages/RoundWarmupStageTests.cs b/osu.Server.Spectator.Tests/RankedPlay/Stages/RoundWarmupStageTests.cs index c55af2ab..ac7c8a00 100644 --- a/osu.Server.Spectator.Tests/RankedPlay/Stages/RoundWarmupStageTests.cs +++ b/osu.Server.Spectator.Tests/RankedPlay/Stages/RoundWarmupStageTests.cs @@ -69,5 +69,20 @@ public async Task RoundMultiplierAdjustment() await MatchController.GotoStage(RankedPlayStage.RoundWarmup); } } + + [Fact] + public async Task CardDrawnOnNextPlayerRound() + { + // First round for each player doesn't draw any cards. + int[] expectedCardCounts = [5, 5, 6, 6, 7, 7]; + + for (int i = 0; i < expectedCardCounts.Length; i++) + { + Assert.Equal(expectedCardCounts[i], RoomState.Users[RoomState.ActiveUserId!.Value].Hand.Count); + + // Go to the next round, for the next iteration. + await MatchController.GotoStage(RankedPlayStage.RoundWarmup); + } + } } } diff --git a/osu.Server.Spectator/Hubs/Multiplayer/Matchmaking/RankedPlay/Stages/RoundWarmupStage.cs b/osu.Server.Spectator/Hubs/Multiplayer/Matchmaking/RankedPlay/Stages/RoundWarmupStage.cs index 9c4358ac..638b36bf 100644 --- a/osu.Server.Spectator/Hubs/Multiplayer/Matchmaking/RankedPlay/Stages/RoundWarmupStage.cs +++ b/osu.Server.Spectator/Hubs/Multiplayer/Matchmaking/RankedPlay/Stages/RoundWarmupStage.cs @@ -31,9 +31,14 @@ protected override async Task Begin() State.CurrentRound++; State.DamageMultiplier = computeDamageMultiplier(State.CurrentRound); - // For the first round, the active user is set during room initialisation. - if (State.CurrentRound > 1) + // Activate the next player. + // For the first round, this is set during room initialisation. + if (State.CurrentRound >= 2) State.ActiveUserId = Controller.UserIdsByTurnOrder.Concat(Controller.UserIdsByTurnOrder).SkipWhile(u => u != State.ActiveUserId).Skip(1).First(); + + // Draw a card on the player's next (non-first) turn. + if (State.CurrentRound >= 3) + await Controller.AddCards(State.ActiveUserId!.Value, 1); } protected override async Task Finish()