コード例 #1
0
ファイル: RoundSession.cs プロジェクト: Corbyncc/tttunturned
        public async Task Stop()
        {
            CommandWindow.Log("Stopping round");
            RoundManager.Broadcast("Round has ended.");
            RoundTime = 600;

            State = RoundState.INTERMISSION;

            await Task.Delay(6000);

            Players.ToList().ForEach(p =>
            {
                if (p.Status == PlayerStatus.ALIVE)
                {
                    p.ReviveUnsafe();
                    TTTPlayer.ClearInventoryUnsafe(PlayerTool.getSteamPlayer(p.SteamID));
                }
            });

            await Task.Delay(6000);

            State = RoundState.SETUP;

            LevelManager.ClearBarricadesUnsafe();
            C4Manager.ClearC4();
            TrackerGunManager.ClearTrackedPlayers();
        }
コード例 #2
0
ファイル: RoundSession.cs プロジェクト: Corbyncc/tttunturned
        public async Task Start()
        {
            try
            {
                CommandWindow.Log("Warmup Starting");
                RoundManager.Broadcast("Warmup Starting");
                State = RoundState.WARMUP;

                LevelManager.RespawnItems();
                Players.ToList().ForEach(p => InterfaceManager.ClearAllUI(p.SteamID));

                await Task.Delay(6000);

                Players.ToList().ForEach(p =>
                {
                    p.SetStatus(PlayerStatus.ALIVE);
                    p.TeleportToMapUnsafe();
                    TTTPlayer.ClearInventoryUnsafe(PlayerTool.getSteamPlayer(p.SteamID));
                });

                await Task.Delay(15000);

                CommandWindow.Log("Round is live");
                RoundManager.Broadcast("The round has started.");

                RoleManager.GeneratePlayerRoles();

                Players.ToList().ForEach(p =>
                {
                    if (p.GetRole() == PlayerRole.TRAITOR || p.GetRole() == PlayerRole.DETECTIVE)
                    {
                        p.SetCredits(2);
                    }
                });

                State = RoundState.LIVE;
            } catch (Exception ex)
            {
                CommandWindow.Log(ex);
            }
        }