Beispiel #1
0
        public void SleepCallback(Storm.StardewValley.Event.PreNewDayEvent @event)
        {
            Clear_DataLoader();
            //This will run when the character goes to sleep. It will increase their sleeping skill.
            var player = @event.Root.Player;

            BuildEndurance_data_xp_current += ModConfig.BuildEndurance_xp_sleeping;

            if (BuildEndurance_data_old_stamina == 0)
            {
                BuildEndurance_data_old_stamina = player.MaxStamina; //grab the initial stamina value
            }

            if (BuildEndurance_data_clear_mod_effects == true)
            {
                player.MaxStamina = BuildEndurance_data_old_stamina;
                BuildEndurance_data_xp_nextlvl            = ModConfig.BuildEndurance_xp_nextlvl;
                BuildEndurance_data_xp_current            = ModConfig.BuildEndurance_xp_current;
                BuildEndurance_data_stam_bonus_acumulated = 0;
                BuildEndurance_data_old_stamina           = player.MaxStamina;
                BuildEndurance_data_ini_stam_bonus        = 0;
                BuildEndurance_data_current_lvl           = 0;
                Logging.LogToFile("BuildEndurance Reset!");
            }


            if (BuildEndurance_data_clear_mod_effects == false)
            {
                if (BuildEndurance_data_current_lvl < ModConfig.BuildEndurance_max_lvl)
                {
                    while (BuildEndurance_data_xp_current >= BuildEndurance_data_xp_nextlvl)
                    {
                        BuildEndurance_data_current_lvl += 1;
                        BuildEndurance_data_xp_current   = BuildEndurance_data_xp_current - BuildEndurance_data_xp_nextlvl;
                        BuildEndurance_data_xp_nextlvl   = (ModConfig.BuildEndurance_xp_curve * BuildEndurance_data_xp_nextlvl);
                        player.MaxStamina += ModConfig.BuildEndurance_stam_increase_upon_lvl_up;
                        BuildEndurance_data_stam_bonus_acumulated += ModConfig.BuildEndurance_stam_increase_upon_lvl_up;
                    }

                    /*
                     *  if (player.MaxStamina != BuildEndurance_data_old_stamina + BuildEndurance_data_stam_bonus_acumulated + BuildEndurance_data_ini_stam_bonus)
                     * {
                     *  player.MaxStamina = BuildEndurance_data_old_stamina + BuildEndurance_data_stam_bonus_acumulated + BuildEndurance_data_ini_stam_bonus;
                     * }
                     */
                }
            }
            BuildEndurance_data_clear_mod_effects = false;

            MyWritter();
        }
        public void SleepCallback(Storm.StardewValley.Event.PreNewDayEvent @event)
        {
            Clear_DataLoader();
            //This will run when the character goes to sleep. It will increase their sleeping skill.
            var player = @event.Root.Player;

            data_xp_current += ModConfig.xp_sleeping;

            if (data_old_health == 0)
            {
                data_old_health = player.MaxHealth; //grab the initial health value
            }

            if (data_clear_mod_effects == true)
            {
                player.MaxHealth             = data_old_health;
                data_xp_nextlvl              = ModConfig.xp_nextlvl;
                data_xp_current              = ModConfig.xp_current;
                data_health_bonus_acumulated = 0;
                data_old_health              = player.MaxHealth;
                data_ini_health_bonus        = 0;
                data_current_lvl             = 0;
                Logging.LogToFile("BuildHealth Reset!");
            }


            if (data_clear_mod_effects == false)
            {
                if (data_current_lvl < ModConfig.max_lvl)
                {
                    while (data_xp_current >= data_xp_nextlvl)
                    {
                        data_current_lvl             += 1;
                        data_xp_current               = data_xp_current - data_xp_nextlvl;
                        data_xp_nextlvl               = (ModConfig.xp_curve * data_xp_nextlvl);
                        player.MaxHealth             += ModConfig.health_increase_upon_lvl_up;
                        data_health_bonus_acumulated += ModConfig.health_increase_upon_lvl_up;
                    }

                    /*
                     * if (player.MaxHealth != data_old_health + data_health_bonus_acumulated + data_ini_health_bonus)
                     * {
                     *  player.MaxHealth = data_old_health + data_health_bonus_acumulated + data_ini_health_bonus;
                     * }
                     */
                }
            }
            data_clear_mod_effects = false;

            MyWritter();
        }
Beispiel #3
0
        public void UpdateCallback(Storm.StardewValley.Event.PreNewDayEvent @event)
        {
            // Logging.LogToFile("THIS IS A SUPER LARGE TEST");
            //  Console.WriteLine(ModConfig.RainChance);
            // Console.WriteLine(ModConfig.ThunderChance);

            Random random               = new Random();
            int    randomNumber         = random.Next(0, 100); //sets ran variable to some num between 0 and 100
            Random thunder_random       = new Random();
            int    thunder_randomNumber = random.Next(0, 100);

            if (randomNumber <= ModConfig.RainChance) //if the random variable is less than or equal to the chance for rain.
            {
                @event.Root.WeatherForTomorrow = weather_rain;
                Console.WriteLine("It will rain tomorrow.");
            }
            else
            {
                @event.Root.WeatherForTomorrow = weather_sunny;
                Console.WriteLine("It will not rain tomorrow.");
            }

            if (@event.Root.WeatherForTomorrow == weather_rain)
            {
                if (randomNumber <= ModConfig.ThunderChance)            //if the random variable is less than or equal to the chance for rain.
                {
                    @event.Root.WeatherForTomorrow = weather_lightning; //sets rainy weather tomorrow
                    Console.WriteLine("It will be stormy tomorrow.");
                }
                else
                {
                    Console.WriteLine("There will be no lightning tomorrow.");
                }
            }
            Console.WriteLine("RainMod has updated.");
        }