Decompiled source of OnlyFoggyMoons v1.0.2

OnlyFoggyMoons.dll

Decompiled a year ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using OnlyFoggyMoons.Patches;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("OnlyFoggyMoons")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OnlyFoggyMoons")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("aa303269-d265-4cd8-ba93-08d806f0babc")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace OnlyFoggyMoons
{
	[BepInPlugin("Katchu.OnlyFoggyMoons", "OnlyFoggyMoons", "1.0.0")]
	public class OnlyFoggyMoonsBase : BaseUnityPlugin
	{
		private const string modID = "Katchu.OnlyFoggyMoons";

		private const string modName = "OnlyFoggyMoons";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Katchu.OnlyFoggyMoons");

		private static OnlyFoggyMoonsBase Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Katchu.OnlyFoggyMoons");
			mls.LogInfo((object)"The mod has awaken");
			harmony.PatchAll(typeof(OnlyFoggyMoonsBase));
			harmony.PatchAll(typeof(StartOfRoundPatch));
		}
	}
}
namespace OnlyFoggyMoons.Patches
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("SetPlanetsWeather")]
		private static bool MakePlanetesFoggy(SelectableLevel[] ___levels)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			foreach (SelectableLevel val in ___levels)
			{
				val.currentWeather = (LevelWeatherType)3;
			}
			return false;
		}
	}
}