Decompiled source of AllOldBirdsInstantlyActivate v1.0.0

OldBirdInstantActivate.dll

Decompiled 3 months 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 OldBirdInstantActivate.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("OldBirdInstantActivate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OldBirdInstantActivate")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("bf7049ea-aa55-4629-99fe-67a4dd3f00a5")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace OldBirdInstantActivate
{
	[BepInPlugin("DavidDev.OldBirdActivation", "Old Bird Instantly Activate", "1.0.0")]
	public class OldBirdInstantActivateBase : BaseUnityPlugin
	{
		private const string modGUID = "DavidDev.OldBirdActivation";

		private const string modName = "Old Bird Instantly Activate";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("DavidDev.OldBirdActivation");

		private static OldBirdInstantActivateBase Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("DavidDev.OldBirdActivation");
			mls.LogInfo((object)"All Old Birds will now activate right at the start of the day, good luck, because you will most certainly need it.");
			harmony.PatchAll(typeof(RoundManagerPatch));
		}
	}
}
namespace OldBirdInstantActivate.Patches
{
	[HarmonyPatch(typeof(RoundManager))]
	internal class RoundManagerPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchOldBirdSpawn()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			RadMechAI[] array = Object.FindObjectsOfType<RadMechAI>();
			EnemyAINestSpawnObject[] array2 = Object.FindObjectsByType<EnemyAINestSpawnObject>((FindObjectsSortMode)0);
			for (int i = 0; i < array2.Length; i++)
			{
				if ((Object)(object)array2[i].enemyType == (Object)(object)((EnemyAI)array[i]).enemyType)
				{
					RoundManager.Instance.SpawnEnemyGameObject(RoundManager.Instance.outsideAINodes[0].transform.position, 0f, -1, ((EnemyAI)array[0]).enemyType);
					Debug.Log((object)"SPAWNED OLD BIRD!!!!!!!!!");
				}
			}
		}
	}
}