Ejemplo n.º 1
0
        /// <summary>
        /// Sets up gametime and weather status at boot time.
        /// </summary>
        public void SetWeather()
        {
            if (!WeatherData)
            {
                WeatherData = new Weather();
            }

            // TODO: Let players configure the length of day and moon cycles on their MUD.
            if (GameHour < 4)
            {
                WeatherData.Sunlight = SunType.moonset;
            }
            else if (GameHour < 6)
            {
                WeatherData.Sunlight = SunType.sunrise;
            }
            else if (GameHour < 19)
            {
                WeatherData.Sunlight = SunType.daytime;
            }
            else if (GameHour < 20)
            {
                WeatherData.Sunlight = SunType.sunset;
            }
            else if (GameHour < 23)
            {
                WeatherData.Sunlight = SunType.night;
            }
            else
            {
                WeatherData.Sunlight = SunType.moonrise;
            }

            WeatherData.Change = 0;
            WeatherData.BarometricPressure = 960;
            if (GameMonth >= 7 && GameMonth <= 12)
            {
                WeatherData.BarometricPressure += MUDMath.NumberRange(1, 50);
            }
            else
            {
                WeatherData.BarometricPressure += MUDMath.NumberRange(1, 80);
            }

            if (WeatherData.BarometricPressure <= 980)
            {
                WeatherData.Sky = SkyType.thunderstorm;
            }
            else if (WeatherData.BarometricPressure <= 1000)
            {
                WeatherData.Sky = SkyType.rain;
            }
            else if (WeatherData.BarometricPressure <= 1020)
            {
                WeatherData.Sky = SkyType.cloudy;
            }
            else
            {
                WeatherData.Sky = SkyType.clear;
            }

            WeatherData.MoonPhase = MoonPhase.new_moon;
            WeatherData.Moonday = 0;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sets up gametime and weather status at boot time.
        /// </summary>
        public void SetWeather()
        {
            if (!WeatherData)
            {
                WeatherData = new Weather();
            }

            // TODO: Let players configure the length of day and moon cycles on their MUD.
            if (GameHour < 4)
            {
                WeatherData.Sunlight = SunType.moonset;
            }
            else if (GameHour < 6)
            {
                WeatherData.Sunlight = SunType.sunrise;
            }
            else if (GameHour < 19)
            {
                WeatherData.Sunlight = SunType.daytime;
            }
            else if (GameHour < 20)
            {
                WeatherData.Sunlight = SunType.sunset;
            }
            else if (GameHour < 23)
            {
                WeatherData.Sunlight = SunType.night;
            }
            else
            {
                WeatherData.Sunlight = SunType.moonrise;
            }

            WeatherData.Change             = 0;
            WeatherData.BarometricPressure = 960;
            if (GameMonth >= 7 && GameMonth <= 12)
            {
                WeatherData.BarometricPressure += MUDMath.NumberRange(1, 50);
            }
            else
            {
                WeatherData.BarometricPressure += MUDMath.NumberRange(1, 80);
            }

            if (WeatherData.BarometricPressure <= 980)
            {
                WeatherData.Sky = SkyType.thunderstorm;
            }
            else if (WeatherData.BarometricPressure <= 1000)
            {
                WeatherData.Sky = SkyType.rain;
            }
            else if (WeatherData.BarometricPressure <= 1020)
            {
                WeatherData.Sky = SkyType.cloudy;
            }
            else
            {
                WeatherData.Sky = SkyType.clear;
            }

            WeatherData.MoonPhase = MoonPhase.new_moon;
            WeatherData.Moonday   = 0;
        }