Exemple #1
0
 public string SimpleMoonPhase()
 {
     return(SDVMoon.DescribeMoonPhase(this.CurrentPhase()));
 }
Exemple #2
0
 public string GetMenuString()
 {
     return(Translations.Get("moon-desc.desc_moonphase", new { moonPhase = SDVMoon.DescribeMoonPhase(CurrentPhase(), Translations) }));
 }
 private void ShowMoonInfo(string arg1, string[] arg2)
 {
     Monitor.Log($"Moon phase according to end of night: {OurMoon.GetLunarPhaseForDay(SDate.Now())}, with coords: { Sprites.Icons.GetNightMoonSprite(OurMoon.GetLunarPhaseForDay(SDate.Now()))}. According to normal phrasing: Phase is {OurMoon.DescribeMoonPhase()}, with rise {OurMoon.GetMoonRiseTime()} and set {OurMoon.GetMoonSetTime()}", LogLevel.Info);
 }
Exemple #4
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)
        {
            if (OurMoon.GetMoonRiseTime() <= 0600 || OurMoon.GetMoonRiseTime() >= 2600 && ModConfig.ShowMoonPhase)
            {
                Game1.addHUDMessage(new HUDMessage(Helper.Translation.Get("moon-text.moonriseBefore6", new { moonPhase = OurMoon.DescribeMoonPhase(), riseTime = OurMoon.GetMoonRiseDisplayTime() })));
            }

            if (OurMoon == null)
            {
                Monitor.Log("OurMoon is null");
                return;
            }

            if (Dice.NextDouble() < ModConfig.EclipseChance && ModConfig.EclipseOn && OurMoon.CurrentPhase == MoonPhase.FullMoon &&
                SDate.Now().DaysSinceStart > 2)
            {
                IsEclipse = true;
                var n = new HUDMessage(Helper.Translation.Get("moon-text.solareclipse"))
                {
                    color    = Color.SeaGreen,
                    fadeIn   = true,
                    timeLeft = 4000,
                    noIcon   = true
                };
                Game1.addHUDMessage(n);

                Monitor.Log("There's a solar eclipse today!", LogLevel.Info);
            }

            OurMoon.OnNewDay();
            OurMoon.HandleMoonAfterWake();
        }
Exemple #5
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)
        {
            Helper.Content.InvalidateCache("LooseSprites/Cursors");
            if (OurMoon.GetMoonRiseTime() <= 0600 || OurMoon.GetMoonRiseTime() >= 2600 && ModConfig.ShowMoonPhase)
            {
                Game1.addHUDMessage(new TCHUDMessage(Helper.Translation.Get("moon-text.moonriseBefore6", new { moonPhase = OurMoon.DescribeMoonPhase(), riseTime = OurMoon.GetMoonRiseDisplayTime() }), OurMoon.CurrentPhase()));
            }

            if (OurMoon == null)
            {
                Monitor.Log("OurMoon is null");
                return;
            }

            if (queuedMsg != null)
            {
                Game1.addHUDMessage(queuedMsg);
                queuedMsg = null;
            }

            if (Context.IsMainPlayer)
            {
                if (OurMoon.MoonTracker.CurrentSeason != Game1.currentSeason)
                {
                    OurMoon.MoonTracker.CurrentSeason      = Game1.currentSeason;
                    OurMoon.MoonTracker.FullMoonThisSeason = false;
                }
            }

            if (Dice.NextDouble() < ModConfig.EclipseChance && ModConfig.EclipseOn && OurMoon.CurrentPhase() == MoonPhase.NewMoon &&
                SDate.Now().DaysSinceStart > 2 && !Utility.isFestivalDay(Game1.dayOfMonth, Game1.currentSeason))
            {
                IsEclipse = true;
                var n = new HUDMessage(Helper.Translation.Get("moon-text.solareclipse"))
                {
                    color    = Color.SeaGreen,
                    fadeIn   = true,
                    timeLeft = 4000,
                    noIcon   = true
                };
                Game1.addHUDMessage(n);
                MoonMessage message = GenerateLunarSync();
                MPHandler.SendMessage <MoonMessage>(message, "MoonMessage", new[] { "KoihimeNakamura.LunarDisturbances" });
                Monitor.Log("There's a solar eclipse today!", LogLevel.Info);
            }

            OurMoon.UpdateForBloodMoon();
            OurMoon.OnNewDay();
            OurMoon.HandleMoonAfterWake();
        }