Decompiled source of Freyr Weather v1.0.0

FreyrWeather.dll

Decompiled 4 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Jotunn.Utils;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("FreyrWeather")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FreyrWeather")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("f174882e-6dc7-496d-8b73-81eabdda9e6c")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace FreyrWeather;

[BepInPlugin("elric.FreyrWeather", "Freyr Weather", "1.0.0")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
internal class FeyrWeather : BaseUnityPlugin
{
	[HarmonyPatch(typeof(EnvMan), "InitializeBiomeEnvSetup")]
	private class Weather
	{
		private static void Postfix(BiomeEnvSetup biome)
		{
			foreach (EnvEntry environment in biome.m_environments)
			{
				if (environment.m_environment.Contains("Rain"))
				{
					environment.m_weight /= 2f;
				}
				if (environment.m_environment.Contains("Storm") & (biome.m_name != "Ocean"))
				{
					environment.m_weight /= 2f;
				}
				if (environment.m_environment == "Misty")
				{
					environment.m_weight /= 2f;
				}
			}
		}
	}

	public const string PluginGUID = "elric.FreyrWeather";

	public const string PluginName = "Freyr Weather";

	public const string PluginVersion = "1.0.0";

	public static bool isModded = true;

	private void Awake()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("elric.FreyrWeather").PatchAll();
	}
}