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;
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;
}
}
}
internal class CaerabioMono : MonoBehaviour
{
[HarmonyPatch]
private class CaeraBioPatches
{
[HarmonyPatch(typeof(EnemyScanner), "Setup")]
[HarmonyPostfix]
private static void Postfix(EnemyScanner __instance)
{
if ((Object)(object)__instance != (Object)null)
{
((Component)__instance).gameObject.AddComponent<CaerabioMono>();
}
}
}
private bool charging = false;
private EnemyScanner scanner = null;
private bool started = false;
private void Awake()
{
scanner = ((Component)this).GetComponent<EnemyScanner>();
if ((Object)(object)scanner != (Object)null)
{
started = true;
}
}
private void FixedUpdate()
{
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Invalid comparison between Unknown and I4
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Invalid comparison between Unknown and I4
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Invalid comparison between Unknown and I4
if ((Object)(object)scanner == (Object)null || !started || scanner.m_tagging)
{
return;
}
if (!scanner.m_recharging && charging)
{
charging = false;
}
if (!scanner.m_recharging || charging)
{
return;
}
Debug.Log(Object.op_Implicit("CaeraBio - ping"));
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)scanner).Owner).Position) < 60f)
{
ToolSyncManager.WantToTagEnemy(current3);
charging = true;
}
}
}
}
}
}
namespace BetterBioTags
{
[BepInPlugin("Caera.BetterBioTags", "BetterBioTags", "0.0.2")]
internal sealed class EntryPoint : BasePlugin
{
public const string MODNAME = "BetterBioTags";
public override void Load()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
((BasePlugin)this).Log.LogMessage((object)"Loading BetterBioTags");
new Harmony("BetterBioTags").PatchAll();
((BasePlugin)this).Log.LogMessage((object)"Loaded BetterBioTags");
}
}
}