Beispiel #1
0
        /// <summary>Raised before the game begins writes data to the save file (except the initial save creation).</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnSaving(object sender, SavingEventArgs e)
        {
            if (!Context.IsMainPlayer)
            {
                return;
            }

            //cleanup any spawned monsters
            foreach (GameLocation l in Game1.locations)
            {
                for (int index = l.characters.Count - 1; index >= 0; --index)
                {
                    if (l.characters[index] is Monster && !(l.characters[index] is GreenSlime))
                    {
                        l.characters.RemoveAt(index);
                    }
                }
            }

            if (IsEclipse)
            {
                IsEclipse = false;
            }

            //moon works after frost does
            OurMoon.HandleMoonAtSleep(Game1.getFarm());
        }
Beispiel #2
0
        private void GameLoop_DayEnding(object sender, DayEndingEventArgs e)
        {
            int cropCount = OurMoon.HandleMoonAtSleep(Game1.getFarm(), Monitor);

            if (cropCount != 0)
            {
                if (OurMoon.CurrentPhase() == MoonPhase.NewMoon)
                {
                    queuedMsg = new TCHUDMessage(Helper.Translation.Get("moon-text.newmoon_eff", new { cropsAffected = cropCount }), OurMoon.CurrentPhase());
                }
                if (OurMoon.CurrentPhase() == MoonPhase.FullMoon)
                {
                    queuedMsg = new TCHUDMessage(Helper.Translation.Get("moon-text.fullmoon_eff", new { cropsAffected = cropCount }), OurMoon.CurrentPhase());
                }
            }
        }