Decompiled source of MoreGnomes v0.1.0

MoreGnomes.dll

Decompiled 2 days 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 = "")]
[assembly: AssemblyCompany("LargeGnome")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LargeGnome")]
[assembly: AssemblyTitle("LargeGnome")]
[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 LargeGnome
{
	[HarmonyPatch]
	internal class GnomePatch
	{
		[HarmonyPatch(typeof(EnemyDirector), "Awake")]
		[HarmonyPrefix]
		public static void Prefix(EnemyDirector __instance)
		{
			if (Plugin.GnomePatchRan)
			{
				return;
			}
			foreach (EnemySetup item3 in __instance.enemiesDifficulty1)
			{
				Plugin.log.LogInfo((object)((Object)item3).name);
				if (((Object)item3).name == "Enemy - Gnome")
				{
					Plugin.log.LogInfo((object)"Making More Gnomes");
					GameObject item = item3.spawnObjects[1];
					for (int i = 0; i < 20; i++)
					{
						item3.spawnObjects.Add(item);
					}
				}
			}
			foreach (EnemySetup item4 in __instance.enemiesDifficulty3)
			{
				if (((Object)item4).name == "Enemy Group - 10 Gnomes")
				{
					Plugin.log.LogInfo((object)"Making Even More Gnomes");
					GameObject item2 = item4.spawnObjects[1];
					for (int j = 0; j < 39; j++)
					{
						item4.spawnObjects.Add(item2);
					}
				}
			}
			Plugin.GnomePatchRan = true;
		}
	}
	[BepInPlugin("Sai.Gnome", "Sai_Gnome", "0.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		private static Plugin _instance;

		private static Harmony _harmony;

		public static bool GnomePatchRan;

		internal static ManualLogSource log;

		private bool _initialized;

		internal static Plugin Instance
		{
			get
			{
				return _instance;
			}
			set
			{
				if ((Object)(object)_instance == (Object)null)
				{
					_instance = value;
				}
				else
				{
					Object.Destroy((Object)(object)value);
				}
			}
		}

		private void Awake()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			_instance = this;
			log = ((BaseUnityPlugin)this).Logger;
			if (_harmony == null)
			{
				_harmony = new Harmony("Sai.Gnome");
			}
			_harmony.PatchAll(typeof(GnomePatch));
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Sai_Gnome is loaded!");
			LoadAssets();
		}

		private void LoadAssets()
		{
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_ID = "Sai_Gnome";

		public const string PLUGIN_NAME = "Sai_Gnome";

		public const string PLUGIN_VERSION = "0.1.0";

		public const string PLUGIN_GUID = "Sai.Gnome";
	}
}