Decompiled source of BettterBioTags v0.0.1

plugins/BettterBioTags.dll

Decompiled 2 years ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using Agents;
using BepInEx;
using BepInEx.Unity.IL2CPP;
using Enemies;
using Gear;
using HarmonyLib;
using Il2CppSystem.Collections.Generic;
using LevelGeneration;
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(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("BettterBioTags")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BettterBioTags")]
[assembly: AssemblyTitle("BettterBioTags")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.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 SuperBio
{
	[BepInPlugin("Caera.BettterBioTags", "BettterBioTags", "1.0.0")]
	public class Plugin : BasePlugin
	{
		[HarmonyPatch]
		private class CaeraBioPatches
		{
			[HarmonyPatch(typeof(EnemyScanner), "UpdateTagProgress")]
			[HarmonyPrefix]
			private static void Prefix(EnemyScanner __instance)
			{
				//IL_009e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a4: Invalid comparison between Unknown and I4
				//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b3: Invalid comparison between Unknown and I4
				//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c2: Invalid comparison between Unknown and I4
				if (!__instance.m_tagging || __instance.m_recharging || !(Clock.Time > __instance.m_tagStartTime + EnemyScanner.TagDuration))
				{
					return;
				}
				Enumerator<LG_Zone> enumerator = Builder.CurrentFloor.allZones.GetEnumerator();
				while (enumerator.MoveNext())
				{
					LG_Zone current = enumerator.Current;
					Enumerator<LG_Area> enumerator2 = current.m_areas.GetEnumerator();
					while (enumerator2.MoveNext())
					{
						LG_Area current2 = enumerator2.Current;
						Enumerator<EnemyAgent> enumerator3 = current2.m_courseNode.m_enemiesInNode.GetEnumerator();
						while (enumerator3.MoveNext())
						{
							EnemyAgent current3 = enumerator3.Current;
							if (((int)((AgentAI)current3.AI).Mode == 1 || (int)((AgentAI)current3.AI).Mode == 2 || (int)((AgentAI)current3.AI).Mode == 3) && Vector3.Distance(current3.Position, ((Agent)((Item)__instance).Owner).Position) < 40f)
							{
								ToolSyncManager.WantToTagEnemy(current3);
							}
						}
					}
				}
			}
		}

		public const string MODNAME = "BettterBioTags";

		public override void Load()
		{
			//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("BettterBioTags");
			val.PatchAll();
		}
	}
}