/// <summary>Raised after the game begins a new day (including when the player loads a save).</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void OnDayStarted(object sender, DayStartedEventArgs e) { Conditions.OnNewDay(); IsBloodMoon = false; Conditions.SetTodayWeather(); //run this automatically if (!Context.IsMainPlayer) { return; } CropList.Clear(); //clear the crop list UpdateWeatherOnNewDay(); SetTommorowWeather(); ExpireTime = 0; }
private void HandleNewDay(object sender, EventArgs e) { if (CropList == null) { Monitor.Log("CropList is null!"); } if (DebugOutput == null) { Monitor.Log("DebugOutput is null!"); } if (OurMoon == null) { Monitor.Log("OurMoon is null"); } if (Conditions == null) { Monitor.Log("CurrentWeather is null"); } if (StaminaMngr == null) { Monitor.Log("StaminaMngr is null"); } if (GameClimate is null) { Monitor.Log("GameClimate is null"); } if (Dice.NextDouble() < WeatherOpt.EclipseChance && WeatherOpt.EclipseOn && OurMoon.CurrentPhase == MoonPhase.FullMoon && SDate.Now().DaysSinceStart > 2) { IsEclipse = true; Game1.addHUDMessage(new HUDMessage("It looks like a rare solar eclipse will darken the sky all day!")); Conditions.BlockFog = true; } SeedsForDialogue[0] = Dice.Next(); SeedsForDialogue[1] = Dice.Next(); CropList.Clear(); //clear the crop list DebugOutput.Clear(); Conditions.OnNewDay(); UpdateWeatherOnNewDay(); SetTommorowWeather(); OurMoon.HandleMoonAfterWake(Helper.Translation); StaminaMngr.OnNewDay(); TicksOutside = 0; ExpireTime = 0; TicksTotal = 0; }
/// <summary>Raised after the game begins a new day (including when the player loads a save).</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void OnDayStarted(object sender, DayStartedEventArgs e) { Conditions.OnNewDay(); IsBloodMoon = false; if (!Context.IsMainPlayer) { return; } WeatherProcessing.OnNewDay(); UpdateWeatherOnNewDay(); SetTomorrowWeather(); WeatherSync message = Conditions.GenerateWeatherSyncMessage(); MPHandler.SendMessage(message, "WeatherSync", modIDs: new[] { ModManifest.UniqueID }); }