diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 613765aca9a0..5d49d67325b3 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -170,32 +170,41 @@ private void setNextMode() if (CurrentMatch.Value?.Round.Value == null) return; + // just for now + int totalProtectsRequired = 2; + int totalBansRequired = CurrentMatch.Value.Round.Value.BanCount.Value * 2; TeamColour lastPickColour = CurrentMatch.Value.PicksBans.LastOrDefault()?.Team ?? TeamColour.Red; TeamColour nextColour; - //bool hasAllProtected = CurrentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Protected) >= 2; + bool hasAllProtected = CurrentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Protected) >= totalProtectsRequired; bool hasAllBans = CurrentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Ban) >= totalBansRequired; - if (!hasAllBans) + if (!hasAllProtected) { - // Ban phase: switch teams every second ban. + // Protect phase: ?. nextColour = CurrentMatch.Value.PicksBans.Count % 2 == 1 ? getOppositeTeamColour(lastPickColour) : lastPickColour; } - else + else if (!hasAllBans) { - // Pick phase : switch teams every pick, except for the first pick which generally goes to the team that placed the last ban. - nextColour = pickType == ChoiceType.Pick + // Ban phase: switch teams every second ban. + nextColour = CurrentMatch.Value.PicksBans.Count % 2 == 1 ? getOppositeTeamColour(lastPickColour) : lastPickColour; } + else + { + // Pick phase : switch teams every pick, except for the first pick which generally goes to the team that placed the last ban (not for MCNC). + nextColour = getOppositeTeamColour(lastPickColour); + } - ChoiceType nextMode = !hasAllBans ? ChoiceType.Ban : ChoiceType.Pick; + ChoiceType nextMode = !hasAllProtected ? ChoiceType.Protected + : !hasAllBans ? ChoiceType.Ban : ChoiceType.Pick; setMode(nextColour, nextMode); @@ -213,7 +222,7 @@ protected override bool OnMouseDown(MouseDownEvent e) addForBeatmap(map.Beatmap.OnlineID); else { - var existing = CurrentMatch.Value?.PicksBans.FirstOrDefault(p => p.BeatmapID == map.Beatmap?.OnlineID); + var existing = CurrentMatch.Value?.PicksBans.LastOrDefault(p => p.BeatmapID == map.Beatmap?.OnlineID); if (existing != null) {