示例#1
0
文件: WeatherSystem.cs 项目: Pircs/Yi
 private static void SetRaining(int intensity, int angel)
 {
     foreach (var player in GameWorld.Maps.Values.SelectMany(map => map.Entities.Values.OfType <Player>()))
     {
         player.Send(MsgWeather.Create(WeatherType.Rain, intensity, angel, 0));
     }
 }
示例#2
0
文件: WeatherSystem.cs 项目: Pircs/Yi
        public static void SetWeatherFor(Player player)
        {
            if (_currentWeather?.weather?.First() == null)
            {
                return;
            }

            switch (_currentWeather.weather.First().main)
            {
            case "Rain":
                player.Send(MsgWeather.Create(WeatherType.Rain, 150, (int)_currentWeather.wind.deg, 0));
                break;

            case "Snow":
                player.Send(MsgWeather.Create(WeatherType.Snow, 150, (int)_currentWeather.wind.deg, 0));
                break;

            default:
            {
                player.Send(MsgWeather.Create(WeatherType.Atoms, 150, (int)_currentWeather.wind.deg, 0));
                break;
            }
            }
            player.Send(MsgText.Create("WeatherSystem", player.Name, $"Weather set to: {_currentWeather.weather.First().main} - Intensity: {150} - Angel: {_currentWeather.wind.deg}", MsgTextType.Talk));
        }