/// <summary>Raised after the game state is updated (≈60 times per second).</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnUpdateTicked(object sender, UpdateTickedEventArgs e)
        {
            if (!Context.IsWorldReady)
            {
                return;
            }

            if (Context.IsMultiplayer && !Context.IsMainPlayer && Context.IsPlayerFree && !HasRequestedSync)
            {
                Monitor.Log("Requesting climate information");
                this.Helper.Multiplayer.SendMessage <long>(Game1.player.UniqueMultiplayerID, "NewFarmHandJoin", new[] { "KoihimeNakamura.ClimatesOfFerngill" });
                HasRequestedSync = true;
            }

            if (Game1.currentGameTime != null)
            {
                this.weatherX += (float)Game1.currentGameTime.ElapsedGameTime.Milliseconds * 0.03f;
            }

            // check for changes
            Conditions.MoveWeathers();

            if (UseLunarDisturbancesApi)
            {
                if (MoonAPI.GetCurrentMoonPhase() == "Blood Moon")
                {
                    IsBloodMoon = true;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// This checks for things every second.
        /// </summary>
        /// <param name="sender">Object sending</param>
        /// <param name="e">event params</param>
        private void CheckForChanges(object sender, EventArgs e)
        {
            if (!Context.IsWorldReady)
            {
                return;
            }

            if (IsEclipse && ResetTicker > 0)
            {
                Game1.globalOutdoorLighting = .5f;
                Game1.ambientLight          = nightColor;
                Game1.currentLocation.switchOutNightTiles();
                ResetTicker = 0;
            }

            Conditions.MoveWeathers();

            if (Game1.isEating)
            {
                StardewValley.Object obj = Game1.player.itemToEat as StardewValley.Object;

                if (obj.ParentSheetIndex == 351)
                {
                    StaminaMngr.ClearDrain();
                }
            }

            if (Game1.currentLocation.isOutdoors)
            {
                TicksOutside++;
            }

            TicksTotal++;
        }
Exemplo n.º 3
0
        /// <summary>Raised after the game state is updated (≈60 times per second).</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnUpdateTicked(object sender, UpdateTickedEventArgs e)
        {
            if (!Context.IsWorldReady)
            {
                return;
            }

            // check for changes
            Conditions.MoveWeathers();

            if (UseLunarDisturbancesApi)
            {
                if (MoonAPI.GetCurrentMoonPhase() == "Blood Moon")
                {
                    IsBloodMoon = true;
                }
            }
        }