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(); }
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); } }