public void DisplayWeather(TV tv, TemporaryAnimatedSprite sprite, Farmer who, string answer)
        {
            TemporaryAnimatedSprite BackgroundSprite = new TemporaryAnimatedSprite("LooseSprites\\Cursors", new Rectangle(497, 305, 42, 28), 9999f, 1, 999999, tv.getScreenPosition(), false, false, (float)((tv.boundingBox.Bottom - 1) / 10000.0 + 9.99999974737875E-06), 0.0f, Color.White, tv.getScreenSizeModifier(), 0.0f, 0.0f, 0.0f, false);
            TemporaryAnimatedSprite WeatherSprite    = DescriptionEngine.GetWeatherOverlay(Conditions, tv);

            string OnScreenText = "";

            if (BackgroundSprite is null)
            {
                Monitor.Log("Background Sprite is null");
            }
            if (WeatherSprite is null)
            {
                Monitor.Log("Weather Sprite is null");
            }

            string MoonPhase = "";
            bool   MoonIsUp  = false;

            if (UseLunarDisturbancesApi)
            {
                MoonPhase = MoonAPI.GetCurrentMoonPhase();
                MoonIsUp  = MoonAPI.IsMoonUp(Game1.timeOfDay);
            }

            double fog = ClimatesOfFerngill.GetClimateForDay(SDate.Now().AddDays(1)).RetrieveOdds(Dice, "fog", SDate.Now().AddDays(1).Day);

            OnScreenText += DescriptionEngine.GenerateTVForecast(Conditions, Dice, fog, MoonPhase, MoonIsUp);

            //CustomTVMod.showProgram(BackgroundSprite, OnScreenText, CustomTVMod.endProgram, WeatherSprite);
        }
Пример #2
0
        internal static void SetChillWave()
        {
            double low, high;

            low  = ClimatesOfFerngill.GetClimateForDay(SDate.Now()).RetrieveMinTemp("low", Game1.dayOfMonth) - 2;
            high = ClimatesOfFerngill.GetClimateForDay(SDate.Now()).RetrieveMinTemp("high", Game1.dayOfMonth) - 1;
            ClimatesOfFerngill.Conditions.SetTodayTemps(new RangePair(low, high, true));
            ClimatesOfFerngill.Conditions.IsAbnormalChill = true;
        }
Пример #3
0
#pragma warning disable IDE0060 // Remove unused parameter
        /// <summary>
        /// This function changes the weather (Console Command)
        /// </summary>
        /// <param name="arg1">The command used</param>
        /// <param name="arg2">The console command parameters</param>
        public static void WeatherChangeFromConsole(string arg1, string[] arg2)
#pragma warning restore IDE0060 // Remove unused parameter
        {
            if (!Context.IsMainPlayer)
            {
                return;
            }

            if (arg2.Length < 1)
            {
                return;
            }

            string ChosenWeather = arg2[0];

            switch (ChosenWeather)
            {
            case "rain":
                WeatherUtilities.SetWeatherRain();
                Game1.updateWeatherIcon();
                ClimatesOfFerngill.Logger.Log(ClimatesOfFerngill.Translator.Get("console-text.weatherset_rain"), LogLevel.Info);
                break;

            case "testing":
                WeatherUtilities.SetWeatherTesting();
                Game1.updateWeatherIcon();
                ClimatesOfFerngill.Logger.Log("HERE BE KRAKENS!", LogLevel.Info);
                break;

            case "testing2":
                WeatherUtilities.SetWeatherTesting2();
                Game1.updateWeatherIcon();
                ClimatesOfFerngill.Logger.Log("HERE BE KRAKENS, MATEY! FIRE PORT!", LogLevel.Info);
                break;

            case "testing3":
                WeatherUtilities.SetWeatherTesting3();
                Game1.updateWeatherIcon();
                ClimatesOfFerngill.Logger.Log("[The Skull Moon Hates You]", LogLevel.Info);
                break;

            case "sandstorm":
                WeatherUtilities.SetWeatherSandstorm();
                Game1.updateWeatherIcon();
                ClimatesOfFerngill.Logger.Log("Doo doo doo doo doo doo doo doo", LogLevel.Info);
                break;

            case "vrain":
                WeatherUtilities.SetWeatherRain();
                ClimatesOfFerngill.ForceVariableRain();
                Game1.updateWeatherIcon();
                ClimatesOfFerngill.Logger.Log(ClimatesOfFerngill.Translator.Get("console-text.weatherset_rain"), LogLevel.Info);
                break;

            case "storm":
                WeatherUtilities.SetWeatherStorm();
                Game1.updateWeatherIcon();
                ClimatesOfFerngill.Logger.Log(ClimatesOfFerngill.Translator.Get("console-text.weatherset_storm"), LogLevel.Info);
                break;

            case "thunderfrenzy":
                WeatherUtilities.SetWeatherStorm();
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("ThunderFrenzy").First().CreateWeather();
                Game1.updateWeatherIcon();
                ClimatesOfFerngill.Logger.Log(ClimatesOfFerngill.Translator.Get("console-text.weatherset_snow"), LogLevel.Info);
                break;

            case "snow":
                WeatherUtilities.SetWeatherSnow();
                Game1.updateWeatherIcon();
                ClimatesOfFerngill.Logger.Log(ClimatesOfFerngill.Translator.Get("console-text.weatherset_snow"), LogLevel.Info);
                break;

            case "debris":
                WeatherUtilities.SetWeatherDebris();
                Game1.updateWeatherIcon();
                ClimatesOfFerngill.Logger.Log(ClimatesOfFerngill.Translator.Get("console-text.weatherset_debris", LogLevel.Info));
                break;

            case "sunny":
                WeatherUtilities.SetWeatherSunny();
                Game1.updateWeatherIcon();
                ClimatesOfFerngill.Logger.Log(ClimatesOfFerngill.Translator.Get("console-text.weatherset_sun", LogLevel.Info));
                break;

            case "overcast":
                WeatherUtilities.SetWeatherOvercast();
                Game1.updateWeatherIcon();
                ClimatesOfFerngill.Logger.Log(ClimatesOfFerngill.Translator.Get("console-text.weatherset_overcast", LogLevel.Info));
                break;

            case "blizzard":
                WeatherUtilities.SetWeatherSnow();
                Game1.updateWeatherIcon();
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("Blizzard").First().CreateWeather();
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("WhiteOut").First().EndWeather();
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("Blizzard").First().SetWeatherBeginTime(new SDVTime(0600));
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("Blizzard").First().SetWeatherExpirationTime(new SDVTime(2800));
                ClimatesOfFerngill.Logger.Log(ClimatesOfFerngill.Translator.Get("console-text.weatherset_snow"), LogLevel.Info);
                break;

            case "fog":
                WeatherUtilities.SetWeatherSunny();
                Game1.updateWeatherIcon();
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("Blizzard").First().EndWeather();
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("WhiteOut").First().EndWeather();
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("Fog").First().CreateWeather();
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("Fog").First().SetWeatherBeginTime(new SDVTime(0600));
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("Fog").First().SetWeatherBeginTime(new SDVTime(2800));
                break;

            case "whiteout":
                WeatherUtilities.SetWeatherSnow();
                Game1.updateWeatherIcon();
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("Blizzard").First().CreateWeather();
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("WhiteOut").First().CreateWeather();
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("Blizzard").First().SetWeatherBeginTime(new SDVTime(0600));
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("WhiteOut").First().SetWeatherBeginTime(new SDVTime(0600));
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("Blizzard").First().SetWeatherExpirationTime(new SDVTime(2800));
                ClimatesOfFerngill.Conditions.GetWeatherMatchingType("WhiteOut").First().SetWeatherExpirationTime(new SDVTime(2800));
                ClimatesOfFerngill.Logger.Log(ClimatesOfFerngill.Translator.Get("console-text.weatherset_snow"), LogLevel.Info);
                break;
            }

            Game1.updateWeatherIcon();
            ClimatesOfFerngill.Conditions.SetTodayWeather();
            ClimatesOfFerngill.Conditions.GenerateWeatherSync();
        }