Example #1
0
        protected virtual void VoteAndMoveToNextMap()
        {
            Picker.AddRecentMap(Map.MapName);
            if (RoundsLeft == 0)
            {
                return;
            }

            string map = Picker.ChooseNextLevel(this);

            if (!Running)
            {
                return;
            }

            if (map == null || map.CaselessEq(Map.MapName))
            {
                ContinueOnSameMap(); return;
            }

            AnnounceMapChange(map);
            Level lastMap = Map; LastMap = Map.MapName;

            if (!SetMap(map))
            {
                Map.Message("&WFailed to change map to " + map);
                ContinueOnSameMap();
            }
            else
            {
                TransferPlayers(lastMap);
                lastMap.Unload(true);
            }
        }
Example #2
0
        protected virtual void VoteAndMoveToNextMap()
        {
            Picker.AddRecentMap(Map.MapName);
            if (RoundsLeft == 0)
            {
                return;
            }

            string map = Picker.ChooseNextLevel(this);

            if (!Running)
            {
                return;
            }
            if (map == null)
            {
                ContinueOnSameMap(); return;
            }

            Map.Message("The next map has been chosen - &c" + map);
            Map.Message("Please wait while you are transfered.");
            Level lastMap = Map; LastMap = Map.MapName;

            if (!SetMap(map))
            {
                Map.Message("%WFailed to change map to " + map);
                ContinueOnSameMap();
            }
            else
            {
                TransferPlayers(lastMap);
                lastMap.Unload();
            }
        }
Example #3
0
        void MainLoopCore()
        {
            if (Status == ZombieGameStatus.NotStarted)
            {
                return;
            }
            while (true)
            {
                RoundInProgress = false;
                RoundsDone++;

                if (!Running)
                {
                    return;
                }
                else if (Status == ZombieGameStatus.InfiniteRounds)
                {
                    DoRound();
                    if (ZombieGameProps.ChangeLevels)
                    {
                        LevelPicker.ChooseNextLevel(this);
                    }
                }
                else if (Status == ZombieGameStatus.SingleRound)
                {
                    DoRound();
                    ResetState(); return;
                }
                else if (Status == ZombieGameStatus.VariableRounds)
                {
                    if (RoundsDone == MaxRounds)
                    {
                        ResetState(); return;
                    }
                    else
                    {
                        DoRound();
                        if (ZombieGameProps.ChangeLevels)
                        {
                            LevelPicker.ChooseNextLevel(this);
                        }
                    }
                }
                else if (Status == ZombieGameStatus.LastRound)
                {
                    ResetState(); return;
                }
            }
        }