Decompiled source of Sea Of Noodles v0.2.0

Plugins/VentureValheim.SeaOfNoodles.dll

Decompiled 5 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("VentureValheim.SeaOfNoodles")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VentureValheim.SeaOfNoodles")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1E37799B-5DC2-47AF-B54D-CB432DAECBE8")]
[assembly: AssemblyFileVersion("0.2.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.2.0.0")]
[module: UnverifiableCode]
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 VentureValheim.SeaOfNoodles
{
	[BepInPlugin("com.orianaventure.mod.SeaOfNoodles", "SeaOfNoodles", "0.2.0")]
	public class SeaOfNoodlesPlugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(SpawnSystem), "Awake")]
		public static class Patch_SpawnSystem_Awake
		{
			private static void Postfix(SpawnSystem __instance)
			{
				if (setup)
				{
					return;
				}
				foreach (SpawnSystemList spawnList in __instance.m_spawnLists)
				{
					foreach (SpawnData spawner in spawnList.m_spawners)
					{
						if ((Object)(object)spawner.m_prefab != (Object)null && ((Object)spawner.m_prefab).name == "Serpent")
						{
							SeaOfNoodlesLogger.LogDebug((object)"Rolling a Noodle to perfection.");
							spawner.m_spawnInterval = 500f;
							spawner.m_spawnChance = 10f;
							spawner.m_spawnDistance = 40f;
							spawner.m_spawnAtDay = true;
						}
					}
				}
				setup = true;
			}
		}

		[HarmonyPatch(typeof(Player), "Awake")]
		public static class Patch_Player_Awake
		{
			private static void Postfix()
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				Scene activeScene = SceneManager.GetActiveScene();
				if (!((Scene)(ref activeScene)).name.Equals("main"))
				{
					setup = false;
				}
			}
		}

		private const string ModName = "SeaOfNoodles";

		private const string ModVersion = "0.2.0";

		private const string Author = "com.orianaventure.mod";

		private const string ModGUID = "com.orianaventure.mod.SeaOfNoodles";

		private readonly Harmony HarmonyInstance = new Harmony("com.orianaventure.mod.SeaOfNoodles");

		public static readonly ManualLogSource SeaOfNoodlesLogger = Logger.CreateLogSource("SeaOfNoodles");

		private static bool setup = false;

		public void Awake()
		{
			SeaOfNoodlesLogger.LogInfo((object)"I shall call him squishy and he shall be mine and he shall be my squishy!");
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			HarmonyInstance.PatchAll(executingAssembly);
		}
	}
}