Decompiled source of DisableStormyWeather v1.0.0

DisableStormyWeather.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("DisableStormyWeather")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DisableStormyWeather")]
[assembly: AssemblyTitle("DisableStormyWeather")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace DisableStormyWeather
{
	public static class PluginInfo
	{
		public const string modGUID = "Ozzymops.DisableStormyWeather";

		public const string modName = "DisableStormyWeather";

		public const string modVersion = "1.0.0.0";
	}
	[BepInPlugin("Ozzymops.DisableStormyWeather", "DisableStormyWeather", "1.0.0.0")]
	internal class Plugin : BaseUnityPlugin
	{
		private static ManualLogSource MLS = Logger.CreateLogSource("Ozzymops.DisableStormyWeather");

		public void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("Ozzymops.DisableStormyWeather");
			val.PatchAll();
			MLS.LogInfo((object)"DisableStormyWeather loaded. The skies will no longer reign.");
		}
	}
}
namespace DisableStormyWeather.Patches
{
	[HarmonyPatch(typeof(StartOfRound))]
	public class StartOfRoundPatch
	{
		private static ManualLogSource MLS = Logger.CreateLogSource("Ozzymops.DisableStormyWeather");

		[HarmonyPostfix]
		[HarmonyPatch("SetPlanetsWeather")]
		public static void RerollStormy(SelectableLevel[] ___levels)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Invalid comparison between Unknown and I4
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Invalid comparison between Unknown and I4
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Invalid comparison between Unknown and I4
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			foreach (SelectableLevel val in ___levels)
			{
				if ((int)val.currentWeather == 2)
				{
					LevelWeatherType val2 = val.currentWeather;
					while ((int)val2 == 2 || (int)val2 == 0)
					{
						val2 = (LevelWeatherType)Random.Range(-1, 5);
					}
					val.currentWeather = val2;
					MLS.LogWarning((object)$"Rerolled level {((Object)val).name} to from Stormy to {val2}");
				}
			}
		}
	}
}