/// <summary>Raised after the game is launched, right before the first update tick. This happens once per game session (unrelated to loading saves). All mods are loaded and initialised at this point, so this is a good time to set up mod integrations.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            //testing for ZA MOON, YOUR HIGHNESS.
            MoonAPI = SDVUtilities.GetModApi <ILunarDisturbancesAPI>(Monitor, Helper, "KoihimeNakamura.LunarDisturbances", "1.0.7", "Lunar Disturbances");

            if (MoonAPI != null)
            {
                LunarDisturbancesLoaded = true;
            }

            ClimatesAPI = SDVUtilities.GetModApi <IClimatesOfFerngillAPI>(Monitor, Helper, "KoihimeNakamura.ClimatesOfFerngill", "1.5.0-beta15", "Climates of Ferngill");

            if (ClimatesAPI != null)
            {
                ClimatesLoaded = true;
            }

            //GMCM interaction
            var GMCMapi = Helper.ModRegistry.GetApi <GenericModConfigMenuAPI>("spacechase0.GenericModConfigMenu");

            if (GMCMapi != null)
            {
                GMCMapi.RegisterModConfig(ModManifest, () => NightConfig = new DynamicNightConfig(), () => Helper.WriteConfig(NightConfig));
                GMCMapi.RegisterClampedOption(ModManifest, "Latitude", "Latitude used to generate the sunrise and sunset times", () => NightConfig.Latitude,
                                              (float val) => NightConfig.Latitude = val, -63.5f, 63.5f);
                GMCMapi.RegisterSimpleOption(ModManifest, "Sunset Times", "This option controls if you subtract a half hour from the generated time", () => NightConfig.SunsetTimesAreMinusThirty, (bool val) => NightConfig.SunsetTimesAreMinusThirty = val);
                GMCMapi.RegisterSimpleOption(ModManifest, "More Orange Sunrise", "This option controls if you want a more orange sunrise", () => NightConfig.MoreOrangeSunrise, (bool val) => NightConfig.MoreOrangeSunrise = val);
                GMCMapi.RegisterClampedOption(ModManifest, "Night Darkness Level", "Controls the options for how dark it is at night. Higher is darker.", () => NightConfig.NightDarknessLevel,
                                              (int val) => NightConfig.NightDarknessLevel = val, 1, 4);
            }
        }
        /// <summary>Raised after the game is launched, right before the first update tick. This happens once per game session (unrelated to loading saves). All mods are loaded and initialised at this point, so this is a good time to set up mod integrations.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            var modManifest = Helper.ModRegistry.Get("KoihimeNakamura.summitreborn");

            if (modManifest != null)
            {
                SummitRebornLoaded = true;
                Logger.Log("Summit Reborn loaded. Disabling summit redraw.");
            }

            //testing for ZA MOON, YOUR HIGHNESS.
            MoonAPI          = SDVUtilities.GetModApi <Integrations.ILunarDisturbancesAPI>(Monitor, Helper, "KoihimeNakamura.LunarDisturbances", "1.0", "Lunar Disturbances");
            SafeLightningAPI = SDVUtilities.GetModApi <Integrations.ISafeLightningAPI>(Monitor, Helper, "cat.safelightning", "1.0", "Safe Lightning");
            DynamicNightAPI  = SDVUtilities.GetModApi <Integrations.IDynamicNightAPI>(Monitor, Helper, "knakamura.dynamicnighttime", "1.1-rc3", "Dynamic Night Time");

            if (MoonAPI != null)
            {
                UseLunarDisturbancesApi = true;
            }

            if (SafeLightningAPI != null)
            {
                UseSafeLightningApi = true;
            }

            if (DynamicNightAPI != null)
            {
                UseDynamicNightApi = true;
            }
        }
Exemple #3
0
        /// <summary>Raised after the game is launched, right before the first update tick. This happens once per game session (unrelated to loading saves). All mods are loaded and initialised at this point, so this is a good time to set up mod integrations.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            JAAPi = SDVUtilities.GetModApi <Integrations.IJsonAssetsApi>(Monitor, Helper, "spacechase0.JsonAssets", "1.1");

            if (JAAPi != null)
            {
                UseJsonAssetsApi        = true;
                JAAPi.AddedItemsToShop += JAAPi_AddedItemsToShop;
                //Monitor.Log("JsonAssets Integration enabled", LogLevel.Info);
            }

            var api = Helper.ModRegistry.GetApi <Integrations.GenericModConfigMenuAPI>("spacechase0.GenericModConfigMenu");

            if (api != null)
            {
                api.RegisterModConfig(ModManifest, () => ModConfig = new MoonConfig(), () => Helper.WriteConfig(ModConfig));
                api.RegisterClampedOption(ModManifest, "Blood Moon Chances", "The chance for a blood moon rising. There's a bad moon on the rise.", () => (float)ModConfig.BadMoonRising, (float val) => ModConfig.BadMoonRising = val, 0f, 1f);
                api.RegisterSimpleOption(ModManifest, "Allow Eclipse", "This option controls if eclipses will happen", () => ModConfig.EclipseOn, (bool val) => ModConfig.EclipseOn = val);
                api.RegisterSimpleOption(ModManifest, "Show Moon Phase", "Show the moon phase popups on moon rise and set", () => ModConfig.ShowMoonPhase, (bool val) => ModConfig.ShowMoonPhase = val);
                api.RegisterSimpleOption(ModManifest, "Spawn Monsters", "This option controls if monsters spawn during eclipses on a wilderness farm. NOTE: They don't spawn if you've turned off monster spawns in game.", () => ModConfig.SpawnMonsters, (bool val) => ModConfig.SpawnMonsters = val);
                api.RegisterSimpleOption(ModManifest, "Hazardous Moon Events", "This controls the moon events that can hinder the player, or spawn monsters. No monsters will spawn ( the blood moon won't even happen) while this is false. This also stops the crop deadvancement on the new moon.", () => ModConfig.HazardousMoonEvents, (bool val) => ModConfig.HazardousMoonEvents = val);
                api.RegisterSimpleOption(ModManifest, "Verbose Logging", "This controls if the mod is verbose to the content.", () => ModConfig.Verbose, (bool val) => ModConfig.Verbose = val);
                api.RegisterClampedOption(ModManifest, "Eclipse Chance", "The chance for an eclipse", () => (float)ModConfig.EclipseChance, (float val) => ModConfig.EclipseChance       = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Crop Growth Chance", "The chance for crops to grow on a full moon", () => (float)ModConfig.CropGrowthChance, (float val) => ModConfig.CropGrowthChance = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Crop Halt Chance", "The chance for crops to not grow on a new moon", () => (float)ModConfig.CropHaltChance, (float val) => ModConfig.CropHaltChance    = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Beach Removal Chance", "The chance for items on the beach to be removed on a new moon", () => (float)ModConfig.BeachRemovalChance, (float val) => ModConfig.BeachRemovalChance = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Beach Spawn Chance", "The chance for items on the beach to be spawned on a full moon", () => (float)ModConfig.BeachSpawnChance, (float val) => ModConfig.BeachSpawnChance      = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Ghost Spawn Chance", "The chance for ghosts to spawn on a full moon", () => (float)ModConfig.GhostSpawnChance, (float val) => ModConfig.GhostSpawnChance = val, 0f, 1f);
            }
        }
        /// <summary>Raised after the game is launched, right before the first update tick. This happens once per game session (unrelated to loading saves). All mods are loaded and initialised at this point, so this is a good time to set up mod integrations.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            climatesAPI = SDVUtilities.GetModApi <Integrations.IClimatesOfFerngillAPI>(Monitor, Helper, "KoihimeNakamura.ClimatesOfFerngill", "1.4-beta.12");

            if (climatesAPI != null)
            {
                UseClimates = true;
            }
        }
        private void OnGameLaunched(object sender, StardewModdingAPI.Events.GameLaunchedEventArgs e)
        {
            ClimateAPI = SDVUtilities.GetModApi <Integrations.IClimatesOfFerngillAPI>(Monitor, Helper, "KoihimeNakamura.ClimatesOfFerngill", "1.5.0-beta.14");

            if (ClimateAPI is null)
            {
                Monitor.Log("This mod has encountered a error with the API being missing", LogLevel.Alert);
                DoNothing = true;
            }
        }
        /// <summary>Raised after the game is launched, right before the first update tick. This happens once per game session (unrelated to loading saves). All mods are loaded and initialised at this point, so this is a good time to set up mod integrations.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            //testing for ZA MOON, YOUR HIGHNESS.
            MoonAPI = SDVUtilities.GetModApi <ILunarDisturbancesAPI>(Monitor, Helper, "KoihimeNakamura.LunarDisturbances", "1.0.7");

            if (MoonAPI != null)
            {
                LunarDisturbancesLoaded = true;
            }
        }
Exemple #7
0
        /// <summary>Raised after the game is launched, right before the first update tick. This happens once per game session (unrelated to loading saves). All mods are loaded and initialised at this point, so this is a good time to set up mod integrations.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            JAAPi = SDVUtilities.GetModApi <Integrations.IJsonAssetsApi>(Monitor, Helper, "spacechase0.JsonAssets", "1.1");

            if (JAAPi != null)
            {
                UseJsonAssetsApi        = true;
                JAAPi.AddedItemsToShop += JAAPi_AddedItemsToShop;
                Monitor.Log("JsonAssets Integration enabled", LogLevel.Info);
            }
        }
        /// <summary>Raised after the game is launched, right before the first update tick. This happens once per game session (unrelated to loading saves). All mods are loaded and initialised at this point, so this is a good time to set up mod integrations.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            JAAPi = SDVUtilities.GetModApi <Integrations.IJsonAssetsApi>(Monitor, Helper, "spacechase0.JsonAssets", "1.1");

            if (JAAPi != null)
            {
                UseJsonAssetsApi        = true;
                JAAPi.AddedItemsToShop += JAAPi_AddedItemsToShop;
            }

            var api = Helper.ModRegistry.GetApi <Integrations.IGenericModConfigMenuAPI>("spacechase0.GenericModConfigMenu");

            if (api != null)
            {
                api.RegisterModConfig(ModManifest, () => ModConfig = new MoonConfig(), () => Helper.WriteConfig(ModConfig));
                api.RegisterClampedOption(ModManifest, "Blood Moon Chances", "The chance for a blood moon rising. There's a bad moon on the rise.", () => (float)ModConfig.BadMoonRising, (float val) => ModConfig.BadMoonRising = val, 0f, 1f);
                api.RegisterSimpleOption(ModManifest, "Allow Eclipse", "This option controls if eclipses will happen", () => ModConfig.EclipseOn, (bool val) => ModConfig.EclipseOn = val);
                api.RegisterSimpleOption(ModManifest, "Show Moon Phase", "Show the moon phase popups on moon rise and set", () => ModConfig.ShowMoonPhase, (bool val) => ModConfig.ShowMoonPhase = val);
                api.RegisterSimpleOption(ModManifest, "Spawn Monsters", "This option controls if monsters spawn during eclipses on a wilderness farm. NOTE: They don't spawn if you've turned off monster spawns in game.", () => ModConfig.SpawnMonsters, (bool val) => ModConfig.SpawnMonsters = val);
                api.RegisterSimpleOption(ModManifest, "Hazardous Moon Events", "This controls the moon events that can hinder the player, or spawn monsters. No monsters will spawn ( the blood moon won't even happen) while this is false. This also stops the crop de advancement on the new moon.", () => ModConfig.HazardousMoonEvents, (bool val) => ModConfig.HazardousMoonEvents = val);
                api.RegisterSimpleOption(ModManifest, "Verbose Logging", "This controls if the mod is verbose when logging for debug purposes", () => ModConfig.Verbose, (bool val) => ModConfig.Verbose    = val);
                api.RegisterSimpleOption(ModManifest, "Use More Monthly Cycle", "When true, the mod uses a 25-day cycle.", () => ModConfig.UseMoreMonthlyCycle, (bool val) => ModConfig.UseMoreMonthlyCycle = val);
                api.RegisterClampedOption(ModManifest, "Eclipse Chance", "The chance for an eclipse", () => (float)ModConfig.EclipseChance, (float val) => ModConfig.EclipseChance             = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Super Moon Chances", "The chance for a super moon", () => (float)ModConfig.SuperMoonChances, (float val) => ModConfig.SuperMoonChances = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Harvest Moon Double Grow Chance", "The chance for a crop double growth on a harvest moon", () => (float)ModConfig.HarvestMoonDoubleGrowChance, (float val) => ModConfig.HarvestMoonDoubleGrowChance = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Crop Growth Chance", "The chance for crops to grow on a full moon", () => (float)ModConfig.CropGrowthChance, (float val) => ModConfig.CropGrowthChance = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Crop Halt Chance", "The chance for crops to not grow on a new moon", () => (float)ModConfig.CropHaltChance, (float val) => ModConfig.CropHaltChance    = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Beach Removal Chance", "The chance for items on the beach to be removed on a new moon", () => (float)ModConfig.BeachRemovalChance, (float val) => ModConfig.BeachRemovalChance = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Beach Spawn Chance", "The chance for items on the beach to be spawned on a full moon", () => (float)ModConfig.BeachSpawnChance, (float val) => ModConfig.BeachSpawnChance      = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Ghost Spawn Chance", "The chance for ghosts to spawn on a full moon", () => (float)ModConfig.GhostSpawnChance, (float val) => ModConfig.GhostSpawnChance = val, 0f, 1f);
            }

            var cpAPI = this.Helper.ModRegistry.GetApi <IContentPatcherAPI>("Pathoschild.ContentPatcher");

            if (cpAPI != null)
            {
                cpAPI.RegisterToken(this.ModManifest, "MoonPhase", () => new[] { OurMoon.SimpleMoonPhase() });
                cpAPI.RegisterToken(this.ModManifest, "MoonRise", () => new[] { OurMoon.GetMoonRiseTime().ToString() });
                cpAPI.RegisterToken(this.ModManifest, "MoonSet", () => new[] { OurMoon.GetMoonSetTime().ToString() });
                cpAPI.RegisterToken(this.ModManifest, name: "IsEclipse", () => new[] { OurMoon.IsEclipse.ToString() });
            }
        }
Exemple #9
0
        /// <summary>Raised after the game is launched, right before the first update tick. This happens once per game session (unrelated to loading saves). All mods are loaded and initialised at this point, so this is a good time to set up mod integrations.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            climatesAPI = SDVUtilities.GetModApi <Integrations.IClimatesOfFerngillAPI>(Monitor, Helper, "KoihimeNakamura.ClimatesOfFerngill", "1.5.12", "Climates of Ferngill");

            if (climatesAPI != null)
            {
                UseClimates = true;
            }

            var api = Helper.ModRegistry.GetApi <Integrations.GenericModConfigMenuAPI>("spacechase0.GenericModConfigMenu");

            if (api != null)
            {
                api.RegisterModConfig(ModManifest, () => IllnessConfig = new IllnessConfig(), () => Helper.WriteConfig(IllnessConfig));
                api.RegisterClampedOption(ModManifest, "Stamina Drain", "The drain per 10 minute tick. I wouldn't recommend a too high value.", () => IllnessConfig.StaminaDrain, (int val) => IllnessConfig.StaminaDrain         = val, 0, 65);
                api.RegisterSimpleOption(ModManifest, "Sick More Than Once", "This option controls if you can get sick more than once a day.", () => IllnessConfig.SickMoreThanOnce, (bool val) => IllnessConfig.SickMoreThanOnce = val);
                api.RegisterSimpleOption(ModManifest, "Verbose", "This option controls verbosity in logs.", () => IllnessConfig.Verbose, (bool val) => IllnessConfig.Verbose = val);
                api.RegisterClampedOption(ModManifest, "Chance of Getting Sick", "The chance of getting sick every 10 minute tick.", () => (float)IllnessConfig.ChanceOfGettingSick, (float val) => IllnessConfig.ChanceOfGettingSick = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Percentage Outside", "How long you have to be outside every 10 minutes to be affected by the weather", () => (float)IllnessConfig.PercentageOutside, (float val) => IllnessConfig.PercentageOutside = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Too Cold Inside", "Under this temperature, you will get sick if you don't have the heat on in your house.", () => (float)IllnessConfig.TooColdInside, (float val) => IllnessConfig.TooColdInside    = val, -15f, 10f);
            }
        }
Exemple #10
0
        /// <summary>Raised after the game is launched, right before the first update tick. This happens once per game session (unrelated to loading saves). All mods are loaded and initialised at this point, so this is a good time to set up mod integrations.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            //testing for ZA MOON, YOUR HIGHNESS.
            MoonAPI          = SDVUtilities.GetModApi <Integrations.ILunarDisturbancesAPI>(Monitor, Helper, "KoihimeNakamura.LunarDisturbances", "1.0");
            SafeLightningAPI = SDVUtilities.GetModApi <Integrations.ISafeLightningAPI>(Monitor, Helper, "cat.safelightning", "1.0");
            DynamicNightAPI  = SDVUtilities.GetModApi <Integrations.IDynamicNightAPI>(Monitor, Helper, "knakamura.dynamicnighttime", "1.1-rc3");

            if (MoonAPI != null)
            {
                UseLunarDisturbancesApi = true;
            }

            if (SafeLightningAPI != null)
            {
                UseSafeLightningApi = true;
            }

            if (DynamicNightAPI != null)
            {
                UseDynamicNightApi = true;
            }
        }