/// <summary> Default constructor. </summary> internal FerngillFog(SDVTimePeriods FogPeriod) { CurrentFogType = FogType.None; BeginTime = new SDVTime(0600); ExpirTime = new SDVTime(0600); BloodMoon = false; FogTimeSpan = FogPeriod; FogElapsed = new Stopwatch(); }
/// <summary> Default constructor. </summary> internal FerngillFog(Icons Sheet, bool Verbose, IMonitor Monitor, MersenneTwister Dice, WeatherConfig config, SDVTimePeriods FogPeriod) { this.Sheet = Sheet; CurrentFogType = FogType.None; ExpirTime = null; VerboseDebug = Verbose; this.Monitor = Monitor; this.Dice = Dice; this.ModConfig = config; this.FogTimeSpan = FogPeriod; FogElapsed = new Stopwatch(); }
internal string GenerateTVForecast(WeatherConditions Current, string MoonPhase = "") { //assemble params var talkParams = new Dictionary <string, string> { { "location", GetRandomLocation() }, { "descWeather", GetWeather(Current, Game1.dayOfMonth, Game1.currentSeason) }, { "festival", SDVUtilities.GetFestivalName(SDate.Now()) }, { "festivalTomorrow", SDVUtilities.GetFestivalName(SDate.Now().AddDays(1)) }, { "fogTime", Current.GetFogTime().ToString() }, { "todayHigh", GetTemperatureString(Current.TodayHigh) }, { "todayLow", GetTemperatureString(Current.TodayLow) }, { "tomorrowWeather", GetWeather(Game1.weatherForTomorrow, Game1.dayOfMonth, Game1.currentSeason, true) }, { "tomorrowHigh", GetTemperatureString(Current.TomorrowHigh) }, { "tomorrowLow", GetTemperatureString(Current.TomorrowLow) }, { "condWarning", GetCondWarning(Current) }, { "condString", GetCondWarning(Current) }, { "eveningFog", GetEveningFog(Current) } }; //select the weather string for the TV. SDVTimePeriods CurrentPeriod = SDVTime.CurrentTimePeriod; //get the current time period int nRandom = OurDice.Next(2); //blood moon checks if ((Game1.player.spouse != null && Game1.player.isEngaged() && Game1.player.friendshipData[Game1.player.spouse].CountdownToWedding == 1) && MoonPhase == "Blood Moon") { talkParams["tomrrowWeather"] = Helper.Get($"weat-{Game1.currentSeason}.sunny.{nRandom}"); return(Helper.Get("weat-wedTomorrow.BM.0", talkParams)); } //festival tomorrow else if (SDVUtilities.GetFestivalName(SDate.Now().AddDays(1)) != "" && MoonPhase == "Blood Moon") { return(Helper.Get("weat-fesTomorrow.BM.0", talkParams)); } else if (MoonPhase == "Blood Moon") { return(Helper.Get("weat-gen.bloodmoon.0", talkParams)); } //first, check for special conditions -fog, festival, wedding else if (Current.HasWeather(CurrentWeather.Fog)) { return(Helper.Get($"weat-loc.fog.{nRandom}", talkParams)); } //festival today else if (Current.HasWeather(CurrentWeather.Festival)) { return(Helper.Get("weat-fesToday.0", talkParams)); } //festival tomorrow else if (SDVUtilities.GetFestivalName(SDate.Now().AddDays(1)) != "") { return(Helper.Get("weat-fesTomorrow.0", talkParams)); } //wedding today else if (Current.HasWeather(CurrentWeather.Wedding)) { return(Helper.Get("weat-wedToday.0", talkParams)); } //wedding tomrrow else if (Game1.player.spouse != null && Game1.player.isEngaged() && Game1.player.friendshipData[Game1.player.spouse].CountdownToWedding == 1) { talkParams["tomrrowWeather"] = Helper.Get($"weat-{Game1.currentSeason}.sunny.{nRandom}"); return(Helper.Get("weat-wedTomorrow.0", talkParams)); } if (OurDice.NextDoublePositive() > .45) { if (CurrentPeriod == SDVTimePeriods.Morning) { return(Helper.Get($"weat-morn.{nRandom}", talkParams)); } else if (CurrentPeriod == SDVTimePeriods.Afternoon) { return(Helper.Get($"weat-afternoon.{nRandom}", talkParams)); } else if (CurrentPeriod == SDVTimePeriods.Evening) { return(Helper.Get($"weat-evening.{nRandom}", talkParams)); } else if (CurrentPeriod == SDVTimePeriods.Night) { return(Helper.Get($"weat-night.{nRandom}", talkParams)); } else if (CurrentPeriod == SDVTimePeriods.Midnight) { return(Helper.Get($"weat-midnight.{nRandom}", talkParams)); } else if (CurrentPeriod == SDVTimePeriods.LateNight) { return(Helper.Get($"weat-latenight.{nRandom}", talkParams)); } } else { //ye olde generic! return(Helper.Get($"weat-loc.{nRandom}", talkParams)); } return(""); }