예제 #1
0
        void DoRound()
        {
            if (!Running)
            {
                return;
            }
            List <Player> players = DoRoundCountdown();

            if (players == null)
            {
                return;
            }
            Random random = new Random();

            RoundInProgress = true;
            int    roundMins = random.Next(Map.Config.MinRoundTime, Map.Config.MaxRoundTime);
            string suffix    = roundMins == 1 ? " %Sminute!" : " %Sminutes!";

            Map.ChatLevel("This round will last for &a" + roundMins + suffix);
            RoundEnd = DateTime.UtcNow.AddMinutes(roundMins);

            Player[] online = PlayerInfo.Online.Items;
            foreach (Player p in online)
            {
                if (p.level == null || p.level != Map || p.Game.Referee)
                {
                    continue;
                }
                Alive.Add(p);
            }
            Infected.Clear();

            Player first = PickFirstZombie(random, players);

            Map.ChatLevel("&c" + first.DisplayName + " %Sstarted the infection!");
            InfectPlayer(first, null);

            DoCoreGame(random);
            if (!Running)
            {
                Status = ZombieGameStatus.LastRound; return;
            }

            EndRound();
            Picker.AddRecentMap(MapName);
        }