Decompiled source of DeadeyeInstinct v1.2.6

Deadeye Instinct.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using PerfectRandom.Sulfur.Core;
using PerfectRandom.Sulfur.Core.Input;
using PerfectRandom.Sulfur.Core.Movement;
using PerfectRandom.Sulfur.Core.Stats;
using PerfectRandom.Sulfur.Core.Units;
using PerfectRandom.Sulfur.Core.Weapons;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("apex Assist")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("apex Assist")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e948ced9-9b4f-4fd1-a781-9bcbf7a5538f")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Ryuka.Sulfur.DeadeyeInstinct;

internal enum AssistMode
{
	Magnet,
	Natural,
	HardLock
}
internal enum AssistPreset
{
	Low,
	Medium,
	High,
	Custom
}
internal enum HardLockTargetPriority
{
	Nearest,
	LowestHealth,
	WeakspotThenDistance,
	ThreatWeighted
}
[BepInPlugin("ryuka.sulfur.deadeyeinstinct", "Deadeye Instinct", "1.2.5")]
public sealed class DeadeyeInstinctPlugin : BaseUnityPlugin
{
	private const string PluginGuid = "ryuka.sulfur.deadeyeinstinct";

	private const string PluginName = "Deadeye Instinct";

	private const string PluginVersion = "1.2.5";

	internal static ManualLogSource Log;

	private Harmony harmony;

	private GameObject weakspotDebugOverlayObject;

	internal static ConfigEntry<bool> EnableMod;

	internal static ConfigEntry<bool> DebugLogging;

	internal static ConfigEntry<AssistMode> Mode;

	internal static ConfigEntry<AssistPreset> MagnetPreset;

	internal static ConfigEntry<AssistPreset> NaturalPreset;

	internal static ConfigEntry<bool> EnableMouseConsumesRotationPullDelta;

	internal static ConfigEntry<bool> EnableContinuousRotationalAssist;

	internal static ConfigEntry<bool> RequirePlayerInput;

	internal static ConfigEntry<bool> CountLookInput;

	internal static ConfigEntry<bool> CountMoveInput;

	internal static ConfigEntry<float> LookInputThreshold;

	internal static ConfigEntry<float> MoveInputThreshold;

	internal static ConfigEntry<float> AssistCoefficient;

	internal static ConfigEntry<float> RotationDeltaPerSecond;

	internal static ConfigEntry<float> MaxRotationDeltaPerFrame;

	internal static ConfigEntry<float> MagnetCenterBias;

	internal static ConfigEntry<float> MagnetMovementOnlyScale;

	internal static ConfigEntry<float> MagnetSmoothing;

	internal static ConfigEntry<float> MagnetReleaseSmoothing;

	internal static ConfigEntry<bool> MagnetPreferWeakspot;

	internal static ConfigEntry<float> MagnetWeakspotBias;

	internal static ConfigEntry<bool> MagnetWeakspotOverrideOfficialPull;

	internal static ConfigEntry<float> MagnetEdgeSofteningPower;

	internal static ConfigEntry<float> MagnetOuterEdgeStrength;

	internal static ConfigEntry<float> MagnetSnapBackAnglePadding;

	internal static ConfigEntry<bool> MagnetAllowLookAwayEscape;

	internal static ConfigEntry<float> MagnetLookAwayThreshold;

	internal static ConfigEntry<float> MagnetLookAwayMinScale;

	internal static ConfigEntry<float> MagnetLookAwayCurvePower;

	internal static ConfigEntry<float> MagnetLookAwayMovementScale;

	internal static ConfigEntry<float> TargetSwitchFadeSeconds;

	internal static ConfigEntry<float> TargetSwitchMinScale;

	internal static ConfigEntry<float> OuterBubbleAngleDegrees;

	internal static ConfigEntry<float> InnerBubbleAngleDegrees;

	internal static ConfigEntry<float> BubbleCurvePower;

	internal static ConfigEntry<float> DistanceFalloffPower;

	internal static ConfigEntry<float> NaturalTowardAssist;

	internal static ConfigEntry<float> NaturalSideAssist;

	internal static ConfigEntry<float> NaturalAwayDamping;

	internal static ConfigEntry<float> NaturalMovementOnlyScale;

	internal static ConfigEntry<float> NaturalMaxInputFraction;

	internal static ConfigEntry<float> NaturalMinDeltaPerFrame;

	internal static ConfigEntry<float> NaturalSmoothing;

	internal static ConfigEntry<float> NaturalReleaseSmoothing;

	internal static ConfigEntry<float> NaturalDirectionSmoothing;

	internal static ConfigEntry<float> NaturalMinLookInput;

	internal static ConfigEntry<bool> NaturalKeepOfficialGamepadPull;

	internal static ConfigEntry<float> NaturalReleaseCurvePower;

	internal static ConfigEntry<float> NaturalOuterEdgeStrength;

	internal static ConfigEntry<bool> OverrideOfficialScanner;

	internal static ConfigEntry<float> OfficialMaxAssistDistance;

	internal static ConfigEntry<float> OfficialScanConeDegrees;

	internal static ConfigEntry<float> OfficialScoreThreshold;

	internal static ConfigEntry<float> OfficialDistanceVsDotBlend;

	internal static ConfigEntry<int> OfficialScanIntervalFrames;

	internal static ConfigEntry<float> ScannerKeepAliveStrength;

	internal static ConfigEntry<bool> InvertX;

	internal static ConfigEntry<bool> InvertY;

	internal static ConfigEntry<bool> EnableWeakspotDebugOverlay;

	internal static ConfigEntry<bool> WeakspotDebugOnlyTrackedTarget;

	internal static ConfigEntry<bool> WeakspotDebugShowAllPositiveShapes;

	internal static ConfigEntry<float> WeakspotDebugMinimumMultiplier;

	internal static ConfigEntry<float> WeakspotDebugLineWidth;

	internal static ConfigEntry<float> WeakspotDebugDepthOffset;

	internal static ConfigEntry<bool> EnableAimbot;

	internal static ConfigEntry<KeyCode> HoldDisableKey;

	internal static ConfigEntry<float> HardLockMaxDistance;

	internal static ConfigEntry<float> HardLockMaxDistanceCap;

	internal static ConfigEntry<bool> HardLockPreferWeakspot;

	internal static ConfigEntry<float> HardLockWeakspotBias;

	internal static ConfigEntry<float> HardLockRotationSpeed;

	internal static ConfigEntry<float> HardLockRotationGain;

	internal static ConfigEntry<float> HardLockMaxDeltaPerFrame;

	internal static ConfigEntry<bool> HardLockRecoilCompensation;

	internal static ConfigEntry<bool> HardLockRequireLineOfSight;

	internal static ConfigEntry<bool> HardLockRequireVisibleTarget;

	internal static ConfigEntry<HardLockTargetPriority> HardLockTargetPriorityMode;

	internal static ConfigEntry<float> HardLockDistanceWeight;

	internal static ConfigEntry<float> HardLockLowHealthWeight;

	internal static ConfigEntry<float> HardLockWeakspotWeight;

	internal static ConfigEntry<float> HardLockStickyTargetBonus;

	internal static ConfigEntry<bool> EnableAutoFire;

	internal static ConfigEntry<bool> AutoFireOnlyInHardLock;

	internal static ConfigEntry<bool> AutoFireRequireAligned;

	internal static ConfigEntry<float> AutoFireMaxAngleDegrees;

	internal static ConfigEntry<bool> AutoFireRequireWeaponReady;

	internal static ConfigEntry<bool> AutoFireRespectSemiAuto;

	internal static ConfigEntry<float> AutoFirePulseSeconds;

	internal static ConfigEntry<float> AutoFireReleaseSeconds;

	private void Awake()
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Expected O, but got Unknown
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Expected O, but got Unknown
		//IL_0081: Expected O, but got Unknown
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Expected O, but got Unknown
		//IL_0107: Expected O, but got Unknown
		//IL_016b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Expected O, but got Unknown
		//IL_01de: Unknown result type (might be due to invalid IL or missing references)
		//IL_01eb: Expected O, but got Unknown
		Log = ((BaseUnityPlugin)this).Logger;
		BindConfig();
		harmony = new Harmony("ryuka.sulfur.deadeyeinstinct");
		MethodInfo methodInfo = AccessTools.Method(typeof(AimAssist), "LateUpdate", (Type[])null, (Type[])null);
		if (methodInfo != null)
		{
			harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(AimAssistLateUpdatePatch), "Prefix", (Type[])null), new HarmonyMethod(typeof(AimAssistLateUpdatePatch), "Postfix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Patched AimAssist.LateUpdate().");
		}
		else
		{
			((BaseUnityPlugin)this).Logger.LogError((object)"Could not find AimAssist.LateUpdate().");
		}
		MethodInfo methodInfo2 = AccessTools.Method(typeof(InputReader), "Update", (Type[])null, (Type[])null);
		if (methodInfo2 != null)
		{
			harmony.Patch((MethodBase)methodInfo2, new HarmonyMethod(typeof(InputReaderUpdatePatch), "Prefix", (Type[])null), (HarmonyMethod)null, new HarmonyMethod(typeof(InputReaderUpdatePatch), "Transpiler", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Patched InputReader.Update().");
		}
		else
		{
			((BaseUnityPlugin)this).Logger.LogError((object)"Could not find InputReader.Update().");
		}
		MethodInfo methodInfo3 = AccessTools.Method(typeof(Weapon), "LateUpdate", (Type[])null, (Type[])null);
		if (methodInfo3 != null)
		{
			harmony.Patch((MethodBase)methodInfo3, new HarmonyMethod(typeof(WeaponLateUpdatePatch), "Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Patched Weapon.LateUpdate().");
		}
		else
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)"Could not find Weapon.LateUpdate(). AutoFire will be unavailable.");
		}
		MethodInfo methodInfo4 = AccessTools.Method(typeof(CameraRecoil), "LateUpdate", (Type[])null, (Type[])null);
		if (methodInfo4 != null)
		{
			harmony.Patch((MethodBase)methodInfo4, (HarmonyMethod)null, new HarmonyMethod(typeof(CameraRecoilLateUpdatePatch), "Postfix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Patched CameraRecoil.LateUpdate().");
		}
		else
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)"Could not find CameraRecoil.LateUpdate(). HardLock recoil compensation will be unavailable.");
		}
		CreateWeakspotDebugOverlay();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Deadeye Instinct 1.2.5 loaded.");
	}

	internal static AssistMode ActiveMode()
	{
		return (Mode != null) ? Mode.Value : AssistMode.Magnet;
	}

	internal static AssistPreset ActivePreset()
	{
		if (ActiveMode() == AssistMode.Natural)
		{
			return (NaturalPreset == null) ? AssistPreset.Medium : NaturalPreset.Value;
		}
		return (MagnetPreset != null) ? MagnetPreset.Value : AssistPreset.High;
	}

	internal static bool UsingCustomPreset()
	{
		return ActivePreset() == AssistPreset.Custom;
	}

	internal static float EffectiveAssistCoefficient()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(AssistCoefficient, 1.4f);
		}
		if (ActiveMode() == AssistMode.Natural)
		{
			return ActivePreset() switch
			{
				AssistPreset.Low => 0.8f, 
				AssistPreset.High => 2f, 
				_ => 1.4f, 
			};
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 0.65f, 
			AssistPreset.Medium => 0.95f, 
			_ => 1.4f, 
		};
	}

	internal static float EffectiveRotationDeltaPerSecond()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(RotationDeltaPerSecond, 10f);
		}
		if (ActiveMode() == AssistMode.Natural)
		{
			return ActivePreset() switch
			{
				AssistPreset.Low => 6f, 
				AssistPreset.High => 14f, 
				_ => 10f, 
			};
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 4.5f, 
			AssistPreset.Medium => 7f, 
			_ => 10f, 
		};
	}

	internal static float EffectiveMaxRotationDeltaPerFrame()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(MaxRotationDeltaPerFrame, 0.9f);
		}
		if (ActiveMode() == AssistMode.Natural)
		{
			return ActivePreset() switch
			{
				AssistPreset.Low => 0.45f, 
				AssistPreset.High => 1.4f, 
				_ => 0.9f, 
			};
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 0.35f, 
			AssistPreset.Medium => 0.55f, 
			_ => 0.9f, 
		};
	}

	internal static float EffectiveOuterBubbleAngleDegrees()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(OuterBubbleAngleDegrees, 34f);
		}
		if (ActiveMode() == AssistMode.Natural)
		{
			return ActivePreset() switch
			{
				AssistPreset.Low => 26f, 
				AssistPreset.High => 42f, 
				_ => 34f, 
			};
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 24f, 
			AssistPreset.Medium => 28f, 
			_ => 34f, 
		};
	}

	internal static float EffectiveInnerBubbleAngleDegrees()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(InnerBubbleAngleDegrees, 8f);
		}
		if (ActiveMode() == AssistMode.Natural)
		{
			return ActivePreset() switch
			{
				AssistPreset.Low => 6f, 
				AssistPreset.High => 10f, 
				_ => 8f, 
			};
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 5f, 
			AssistPreset.Medium => 6f, 
			_ => 8f, 
		};
	}

	internal static float EffectiveBubbleCurvePower()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(BubbleCurvePower, 0.65f);
		}
		if (ActiveMode() == AssistMode.Natural)
		{
			return ActivePreset() switch
			{
				AssistPreset.Low => 0.9f, 
				AssistPreset.High => 0.5f, 
				_ => 0.65f, 
			};
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 1.1f, 
			AssistPreset.Medium => 0.9f, 
			_ => 0.65f, 
		};
	}

	internal static float EffectiveDistanceFalloffPower()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(DistanceFalloffPower, 0.35f);
		}
		if (ActiveMode() == AssistMode.Natural)
		{
			return ActivePreset() switch
			{
				AssistPreset.Low => 0.55f, 
				AssistPreset.High => 0.2f, 
				_ => 0.35f, 
			};
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 0.7f, 
			AssistPreset.Medium => 0.55f, 
			_ => 0.35f, 
		};
	}

	internal static bool EffectiveMagnetPreferWeakspot()
	{
		return !UsingCustomPreset() || SafeBool(MagnetPreferWeakspot, fallback: true);
	}

	internal static bool EffectiveMagnetWeakspotOverrideOfficialPull()
	{
		return !UsingCustomPreset() || SafeBool(MagnetWeakspotOverrideOfficialPull, fallback: true);
	}

	internal static bool EffectiveMagnetAllowLookAwayEscape()
	{
		return !UsingCustomPreset() || SafeBool(MagnetAllowLookAwayEscape, fallback: true);
	}

	internal static float EffectiveMagnetWeakspotBias()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(MagnetWeakspotBias, 0.85f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 0.55f, 
			AssistPreset.Medium => 0.7f, 
			_ => 0.85f, 
		};
	}

	internal static float EffectiveMagnetCenterBias()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(MagnetCenterBias, 0.15f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 0.05f, 
			AssistPreset.Medium => 0.1f, 
			_ => 0.15f, 
		};
	}

	internal static float EffectiveMagnetMovementOnlyScale()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(MagnetMovementOnlyScale, 0.35f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 0.2f, 
			AssistPreset.Medium => 0.28f, 
			_ => 0.35f, 
		};
	}

	internal static float EffectiveMagnetSmoothing()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(MagnetSmoothing, 22f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 16f, 
			AssistPreset.Medium => 19f, 
			_ => 22f, 
		};
	}

	internal static float EffectiveMagnetReleaseSmoothing()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(MagnetReleaseSmoothing, 12f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 8f, 
			AssistPreset.Medium => 10f, 
			_ => 12f, 
		};
	}

	internal static float EffectiveMagnetEdgeSofteningPower()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(MagnetEdgeSofteningPower, 2.2f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 3f, 
			AssistPreset.Medium => 2.6f, 
			_ => 2.2f, 
		};
	}

	internal static float EffectiveMagnetOuterEdgeStrength()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(MagnetOuterEdgeStrength, 0.08f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 0.03f, 
			AssistPreset.Medium => 0.05f, 
			_ => 0.08f, 
		};
	}

	internal static float EffectiveMagnetSnapBackAnglePadding()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(MagnetSnapBackAnglePadding, 4f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 6f, 
			AssistPreset.Medium => 5f, 
			_ => 4f, 
		};
	}

	internal static float EffectiveMagnetLookAwayThreshold()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(MagnetLookAwayThreshold, 0.1f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 0.05f, 
			AssistPreset.Medium => 0.08f, 
			_ => 0.1f, 
		};
	}

	internal static float EffectiveMagnetLookAwayMinScale()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(MagnetLookAwayMinScale, 0.08f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 0.02f, 
			AssistPreset.Medium => 0.05f, 
			_ => 0.08f, 
		};
	}

	internal static float EffectiveMagnetLookAwayCurvePower()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(MagnetLookAwayCurvePower, 1.2f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 1f, 
			AssistPreset.Medium => 1.1f, 
			_ => 1.2f, 
		};
	}

	internal static float EffectiveMagnetLookAwayMovementScale()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(MagnetLookAwayMovementScale, 0.45f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 0.35f, 
			AssistPreset.Medium => 0.4f, 
			_ => 0.45f, 
		};
	}

	internal static bool EffectiveNaturalKeepOfficialGamepadPull()
	{
		return !UsingCustomPreset() || SafeBool(NaturalKeepOfficialGamepadPull, fallback: true);
	}

	internal static float EffectiveNaturalTowardAssist()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(NaturalTowardAssist, 0.12f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 0.05f, 
			AssistPreset.High => 0.2f, 
			_ => 0.12f, 
		};
	}

	internal static float EffectiveNaturalSideAssist()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(NaturalSideAssist, 0.55f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 0.28f, 
			AssistPreset.High => 0.85f, 
			_ => 0.55f, 
		};
	}

	internal static float EffectiveNaturalAwayDamping()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(NaturalAwayDamping, 1.45f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 0.75f, 
			AssistPreset.High => 2.2f, 
			_ => 1.45f, 
		};
	}

	internal static float EffectiveNaturalMovementOnlyScale()
	{
		return UsingCustomPreset() ? SafeFloat(NaturalMovementOnlyScale, 0f) : 0f;
	}

	internal static float EffectiveNaturalMaxInputFraction()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(NaturalMaxInputFraction, 0.85f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 0.55f, 
			AssistPreset.High => 1.2f, 
			_ => 0.85f, 
		};
	}

	internal static float EffectiveNaturalMinDeltaPerFrame()
	{
		return UsingCustomPreset() ? SafeFloat(NaturalMinDeltaPerFrame, 0.003f) : 0.003f;
	}

	internal static float EffectiveNaturalSmoothing()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(NaturalSmoothing, 30f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 24f, 
			AssistPreset.High => 38f, 
			_ => 30f, 
		};
	}

	internal static float EffectiveNaturalReleaseSmoothing()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(NaturalReleaseSmoothing, 10f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 8f, 
			AssistPreset.High => 14f, 
			_ => 10f, 
		};
	}

	internal static float EffectiveNaturalDirectionSmoothing()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(NaturalDirectionSmoothing, 18f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 14f, 
			AssistPreset.High => 24f, 
			_ => 18f, 
		};
	}

	internal static float EffectiveNaturalMinLookInput()
	{
		return UsingCustomPreset() ? SafeFloat(NaturalMinLookInput, 0.001f) : 0.001f;
	}

	internal static float EffectiveNaturalReleaseCurvePower()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(NaturalReleaseCurvePower, 2.4f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 2.8f, 
			AssistPreset.High => 2f, 
			_ => 2.4f, 
		};
	}

	internal static float EffectiveNaturalOuterEdgeStrength()
	{
		if (UsingCustomPreset())
		{
			return SafeFloat(NaturalOuterEdgeStrength, 0.02f);
		}
		return ActivePreset() switch
		{
			AssistPreset.Low => 0.01f, 
			AssistPreset.High => 0.04f, 
			_ => 0.02f, 
		};
	}

	internal static float SafeFloat(ConfigEntry<float> entry, float fallback)
	{
		return entry?.Value ?? fallback;
	}

	internal static bool SafeBool(ConfigEntry<bool> entry, bool fallback)
	{
		return entry?.Value ?? fallback;
	}

	internal static bool IsAimbotRuntimeEnabled()
	{
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		if (EnableMod == null || !EnableMod.Value)
		{
			return false;
		}
		if (EnableAimbot != null && !EnableAimbot.Value)
		{
			return false;
		}
		KeyCode keyCode = (KeyCode)((HoldDisableKey == null) ? 308 : ((int)HoldDisableKey.Value));
		if (IsHoldDisableKeyPressed(keyCode))
		{
			return false;
		}
		return true;
	}

	private static bool IsHoldDisableKeyPressed(KeyCode keyCode)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Invalid comparison between Unknown and I4
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		if ((int)keyCode == 0)
		{
			return false;
		}
		Keyboard current = Keyboard.current;
		if (current == null)
		{
			return false;
		}
		if (!TryConvertUnityKeyCode(keyCode, out var key))
		{
			return false;
		}
		try
		{
			return ((ButtonControl)current[key]).isPressed;
		}
		catch
		{
			return false;
		}
	}

	private static bool TryConvertUnityKeyCode(KeyCode keyCode, out Key key)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0004: 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)
		//IL_0008: Invalid comparison between Unknown and I4
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Invalid comparison between Unknown and I4
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Invalid comparison between Unknown and I4
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Invalid comparison between Unknown and I4
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Invalid comparison between Unknown and I4
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Invalid comparison between Unknown and I4
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Invalid comparison between Unknown and I4
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Expected I4, but got Unknown
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Expected I4, but got Unknown
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Invalid comparison between Unknown and I4
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Invalid comparison between Unknown and I4
		//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e3: Expected I4, but got Unknown
		if ((int)keyCode <= 27)
		{
			if ((int)keyCode <= 9)
			{
				if ((int)keyCode == 8)
				{
					key = (Key)65;
					return true;
				}
				if ((int)keyCode == 9)
				{
					key = (Key)3;
					return true;
				}
			}
			else
			{
				if ((int)keyCode == 13)
				{
					key = (Key)2;
					return true;
				}
				if ((int)keyCode == 27)
				{
					key = (Key)60;
					return true;
				}
			}
		}
		else if ((int)keyCode <= 57)
		{
			if ((int)keyCode == 32)
			{
				key = (Key)1;
				return true;
			}
			switch (keyCode - 48)
			{
			case 0:
				key = (Key)50;
				return true;
			case 1:
				key = (Key)41;
				return true;
			case 2:
				key = (Key)42;
				return true;
			case 3:
				key = (Key)43;
				return true;
			case 4:
				key = (Key)44;
				return true;
			case 5:
				key = (Key)45;
				return true;
			case 6:
				key = (Key)46;
				return true;
			case 7:
				key = (Key)47;
				return true;
			case 8:
				key = (Key)48;
				return true;
			case 9:
				key = (Key)49;
				return true;
			}
		}
		else
		{
			if ((int)keyCode == 127)
			{
				key = (Key)71;
				return true;
			}
			switch (keyCode - 273)
			{
			case 35:
				key = (Key)53;
				return true;
			case 34:
				key = (Key)54;
				return true;
			case 33:
				key = (Key)55;
				return true;
			case 32:
				key = (Key)56;
				return true;
			case 31:
				key = (Key)51;
				return true;
			case 30:
				key = (Key)52;
				return true;
			case 4:
				key = (Key)70;
				return true;
			case 5:
				key = (Key)68;
				return true;
			case 6:
				key = (Key)69;
				return true;
			case 7:
				key = (Key)67;
				return true;
			case 8:
				key = (Key)66;
				return true;
			case 0:
				key = (Key)63;
				return true;
			case 1:
				key = (Key)64;
				return true;
			case 3:
				key = (Key)61;
				return true;
			case 2:
				key = (Key)62;
				return true;
			case 9:
				key = (Key)94;
				return true;
			case 10:
				key = (Key)95;
				return true;
			case 11:
				key = (Key)96;
				return true;
			case 12:
				key = (Key)97;
				return true;
			case 13:
				key = (Key)98;
				return true;
			case 14:
				key = (Key)99;
				return true;
			case 15:
				key = (Key)100;
				return true;
			case 16:
				key = (Key)101;
				return true;
			case 17:
				key = (Key)102;
				return true;
			case 18:
				key = (Key)103;
				return true;
			case 19:
				key = (Key)104;
				return true;
			case 20:
				key = (Key)105;
				return true;
			}
		}
		int num = (int)keyCode;
		if (num >= 97 && num <= 122)
		{
			key = (Key)(15 + (num - 97));
			return true;
		}
		key = (Key)0;
		return false;
	}

	internal static bool IsHardLockModeActive()
	{
		return IsAimbotRuntimeEnabled() && ActiveMode() == AssistMode.HardLock;
	}

	private void CreateWeakspotDebugOverlay()
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Expected O, but got Unknown
		if (!((Object)(object)weakspotDebugOverlayObject != (Object)null))
		{
			weakspotDebugOverlayObject = new GameObject("Ryuka.WeakspotDebugOverlay");
			((Object)weakspotDebugOverlayObject).hideFlags = (HideFlags)61;
			Object.DontDestroyOnLoad((Object)(object)weakspotDebugOverlayObject);
			weakspotDebugOverlayObject.AddComponent<WeakspotDebugOverlayController>();
		}
	}

	private void OnDestroy()
	{
		Harmony obj = harmony;
		if (obj != null)
		{
			obj.UnpatchSelf();
		}
		if ((Object)(object)weakspotDebugOverlayObject != (Object)null)
		{
			Object.Destroy((Object)(object)weakspotDebugOverlayObject);
			weakspotDebugOverlayObject = null;
		}
	}

	private void BindConfig()
	{
		//IL_016f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Expected O, but got Unknown
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b6: Expected O, but got Unknown
		//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Expected O, but got Unknown
		//IL_0226: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Expected O, but got Unknown
		//IL_0263: Unknown result type (might be due to invalid IL or missing references)
		//IL_026d: Expected O, but got Unknown
		//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02aa: Expected O, but got Unknown
		//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e7: Expected O, but got Unknown
		//IL_031a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0324: Expected O, but got Unknown
		//IL_0357: Unknown result type (might be due to invalid IL or missing references)
		//IL_0361: Expected O, but got Unknown
		//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03be: Expected O, but got Unknown
		//IL_0411: Unknown result type (might be due to invalid IL or missing references)
		//IL_041b: Expected O, but got Unknown
		//IL_044e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0458: Expected O, but got Unknown
		//IL_048b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0495: Expected O, but got Unknown
		//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f2: Expected O, but got Unknown
		//IL_0525: Unknown result type (might be due to invalid IL or missing references)
		//IL_052f: Expected O, but got Unknown
		//IL_0562: Unknown result type (might be due to invalid IL or missing references)
		//IL_056c: Expected O, but got Unknown
		//IL_059f: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a9: Expected O, but got Unknown
		//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e6: Expected O, but got Unknown
		//IL_0619: Unknown result type (might be due to invalid IL or missing references)
		//IL_0623: Expected O, but got Unknown
		//IL_0656: Unknown result type (might be due to invalid IL or missing references)
		//IL_0660: Expected O, but got Unknown
		//IL_0693: Unknown result type (might be due to invalid IL or missing references)
		//IL_069d: Expected O, but got Unknown
		//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_06da: Expected O, but got Unknown
		//IL_070d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0717: Expected O, but got Unknown
		//IL_074a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0754: Expected O, but got Unknown
		//IL_0787: Unknown result type (might be due to invalid IL or missing references)
		//IL_0791: Expected O, but got Unknown
		//IL_07c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ce: Expected O, but got Unknown
		//IL_0801: Unknown result type (might be due to invalid IL or missing references)
		//IL_080b: Expected O, but got Unknown
		//IL_083e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0848: Expected O, but got Unknown
		//IL_087b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0885: Expected O, but got Unknown
		//IL_08b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_08c2: Expected O, but got Unknown
		//IL_08f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_08ff: Expected O, but got Unknown
		//IL_0932: Unknown result type (might be due to invalid IL or missing references)
		//IL_093c: Expected O, but got Unknown
		//IL_096f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0979: Expected O, but got Unknown
		//IL_09cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d6: Expected O, but got Unknown
		//IL_0a09: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a13: Expected O, but got Unknown
		//IL_0a66: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a70: Expected O, but got Unknown
		//IL_0aa3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aad: Expected O, but got Unknown
		//IL_0ae0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aea: Expected O, but got Unknown
		//IL_0b1d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b27: Expected O, but got Unknown
		//IL_0b4f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b59: Expected O, but got Unknown
		//IL_0b8c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b96: Expected O, but got Unknown
		//IL_0c69: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c73: Expected O, but got Unknown
		//IL_0ca6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cb0: Expected O, but got Unknown
		//IL_0ce3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ced: Expected O, but got Unknown
		//IL_0d64: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d6e: Expected O, but got Unknown
		//IL_0da1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dab: Expected O, but got Unknown
		//IL_0dfe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e08: Expected O, but got Unknown
		//IL_0e3b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e45: Expected O, but got Unknown
		//IL_0e78: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e82: Expected O, but got Unknown
		//IL_0eb5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ebf: Expected O, but got Unknown
		//IL_0f72: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f7c: Expected O, but got Unknown
		//IL_0faf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fb9: Expected O, but got Unknown
		//IL_0fec: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ff6: Expected O, but got Unknown
		//IL_1029: Unknown result type (might be due to invalid IL or missing references)
		//IL_1033: Expected O, but got Unknown
		//IL_10c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_10d0: Expected O, but got Unknown
		//IL_1143: Unknown result type (might be due to invalid IL or missing references)
		//IL_114d: Expected O, but got Unknown
		//IL_1180: Unknown result type (might be due to invalid IL or missing references)
		//IL_118a: Expected O, but got Unknown
		EnableMod = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "EnableMod", true, "Enable this mod.");
		DebugLogging = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "DebugLogging", false, "Print aim assist debug logs.");
		Mode = ((BaseUnityPlugin)this).Config.Bind<AssistMode>("Assist Mode", "Mode", AssistMode.Magnet, "Magnet = magnetic pull. Natural = input-shaped sticky assist.");
		MagnetPreset = ((BaseUnityPlugin)this).Config.Bind<AssistPreset>("Preset", "MagnetPreset", AssistPreset.High, "Low / Medium / High / Custom for Magnet mode. Current tested Magnet settings are defined as High.");
		NaturalPreset = ((BaseUnityPlugin)this).Config.Bind<AssistPreset>("Preset", "NaturalPreset", AssistPreset.Medium, "Low / Medium / High / Custom for Natural mode. Current tested Natural settings are defined as Medium.");
		EnableMouseConsumesRotationPullDelta = ((BaseUnityPlugin)this).Config.Bind<bool>("Official Pipeline", "EnableMouseConsumesRotationPullDelta", true, "Allow mouse input to consume AimAssist.rotationPullDelta inside InputReader.Update().");
		EnableContinuousRotationalAssist = ((BaseUnityPlugin)this).Config.Bind<bool>("Official Pipeline", "EnableContinuousRotationalAssist", true, "Append continuous rotational assist to official AimAssist.rotationPullDelta.");
		RequirePlayerInput = ((BaseUnityPlugin)this).Config.Bind<bool>("Input", "RequirePlayerInput", true, "Only assist while player has movement or look input.");
		CountLookInput = ((BaseUnityPlugin)this).Config.Bind<bool>("Input", "CountLookInput", true, "Look input counts as active player input.");
		CountMoveInput = ((BaseUnityPlugin)this).Config.Bind<bool>("Input", "CountMoveInput", true, "Movement input counts as active player input.");
		LookInputThreshold = ((BaseUnityPlugin)this).Config.Bind<float>("Input", "LookInputThreshold", 0.001f, new ConfigDescription("Threshold for effective look input after sensitivity.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), Array.Empty<object>()));
		MoveInputThreshold = ((BaseUnityPlugin)this).Config.Bind<float>("Input", "MoveInputThreshold", 0.05f, new ConfigDescription("Threshold for movement input.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		AssistCoefficient = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Common", "AssistCoefficient", 1.4f, new ConfigDescription("Overall assist strength. 0.6 strong, 1.0 very strong, 2.0 extreme.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>()));
		RotationDeltaPerSecond = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Common", "RotationDeltaPerSecond", 10f, new ConfigDescription("Base rotationPullDelta per second before AssistCoefficient scaling.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>()));
		MaxRotationDeltaPerFrame = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Common", "MaxRotationDeltaPerFrame", 0.9f, new ConfigDescription("Hard cap for added rotationPullDelta per frame.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.001f, 10f), Array.Empty<object>()));
		MagnetCenterBias = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Magnet", "MagnetCenterBias", 0.15f, new ConfigDescription("For Magnet mode only when weakspot targeting is not available. 0 = official target point, 1 = collider center. Keep low to avoid center locking.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		MagnetMovementOnlyScale = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Magnet", "MagnetMovementOnlyScale", 0.35f, new ConfigDescription("For Magnet mode only. Strength scale when player is moving but not moving aim.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		MagnetSmoothing = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Magnet", "MagnetSmoothing", 22f, new ConfigDescription("For Magnet mode only. Active pull smoothing speed. Higher = more responsive.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 80f), Array.Empty<object>()));
		MagnetReleaseSmoothing = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Magnet", "MagnetReleaseSmoothing", 12f, new ConfigDescription("For Magnet mode only. Release smoothing speed. Lower = softer release.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 80f), Array.Empty<object>()));
		MagnetPreferWeakspot = ((BaseUnityPlugin)this).Config.Bind<bool>("Custom Magnet", "MagnetPreferWeakspot", true, "For Magnet mode only. Prefer the highest base Hitmesh.Data.GetShapeMultiplier() part when available.");
		MagnetWeakspotBias = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Magnet", "MagnetWeakspotBias", 0.85f, new ConfigDescription("For MagnetPreferWeakspot. 0 = normal Magnet target, 1 = weakspot point.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		MagnetWeakspotOverrideOfficialPull = ((BaseUnityPlugin)this).Config.Bind<bool>("Custom Magnet", "MagnetWeakspotOverrideOfficialPull", true, "When Magnet weakspot targeting succeeds, clear the official center pull before adding the weakspot pull.");
		MagnetEdgeSofteningPower = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Magnet", "MagnetEdgeSofteningPower", 2.2f, new ConfigDescription("For Magnet mode only. Extra falloff near the outer assist bubble edge. Higher = softer near edge.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 8f), Array.Empty<object>()));
		MagnetOuterEdgeStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Magnet", "MagnetOuterEdgeStrength", 0.08f, new ConfigDescription("For Magnet mode only. Minimum pull strength near the outer edge. Lower reduces snap-back jitter.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.5f), Array.Empty<object>()));
		MagnetSnapBackAnglePadding = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Magnet", "MagnetSnapBackAnglePadding", 4f, new ConfigDescription("For Magnet mode only. Softly scales down pull during the last N degrees before leaving the bubble.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 30f), Array.Empty<object>()));
		MagnetAllowLookAwayEscape = ((BaseUnityPlugin)this).Config.Bind<bool>("Custom Magnet", "MagnetAllowLookAwayEscape", true, "For Magnet mode only. Reduce pull when player look input is clearly moving away from the target.");
		MagnetLookAwayThreshold = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Magnet", "MagnetLookAwayThreshold", 0.1f, new ConfigDescription("For Magnet escape. Dot threshold for detecting look-away input. 0.10 means only clear away input reduces pull.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		MagnetLookAwayMinScale = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Magnet", "MagnetLookAwayMinScale", 0.08f, new ConfigDescription("For Magnet escape. Minimum pull scale when player strongly looks away. Lower makes controller escape easier.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		MagnetLookAwayCurvePower = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Magnet", "MagnetLookAwayCurvePower", 1.2f, new ConfigDescription("For Magnet escape. Higher makes pull reduction happen later; lower makes it more sensitive.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 5f), Array.Empty<object>()));
		MagnetLookAwayMovementScale = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Magnet", "MagnetLookAwayMovementScale", 0.45f, new ConfigDescription("For Magnet escape. Extra scale when movement input is also active. Higher preserves sticky aim while strafing.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		TargetSwitchFadeSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Target Stability", "TargetSwitchFadeSeconds", 0.12f, new ConfigDescription("Fade-in time after the official tracked target changes.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		TargetSwitchMinScale = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Target Stability", "TargetSwitchMinScale", 0.25f, new ConfigDescription("Minimum assist scale immediately after target switch. 0 = fully fade from zero, 1 = no switch fade.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		OuterBubbleAngleDegrees = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Common", "OuterBubbleAngleDegrees", 30f, new ConfigDescription("Target must be inside this angle from crosshair.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 89f), Array.Empty<object>()));
		InnerBubbleAngleDegrees = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Common", "InnerBubbleAngleDegrees", 7f, new ConfigDescription("Inside this angle, assist reaches full strength.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 60f), Array.Empty<object>()));
		BubbleCurvePower = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Common", "BubbleCurvePower", 0.8f, new ConfigDescription("Higher values make assist weaker near the edge.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 5f), Array.Empty<object>()));
		DistanceFalloffPower = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Common", "DistanceFalloffPower", 0.5f, new ConfigDescription("Higher values make far targets weaker.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>()));
		NaturalTowardAssist = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Natural", "NaturalTowardAssist", 0.12f, new ConfigDescription("Extra assist when player is already moving aim toward the target. Default 0 means no boost toward target.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>()));
		NaturalSideAssist = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Natural", "NaturalSideAssist", 0.55f, new ConfigDescription("Small assist when player aim input is mostly perpendicular to target direction.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>()));
		NaturalAwayDamping = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Natural", "NaturalAwayDamping", 1.45f, new ConfigDescription("Damping force when player aim input moves away from target.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>()));
		NaturalMovementOnlyScale = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Natural", "NaturalMovementOnlyScale", 0f, new ConfigDescription("Assist when only movement input exists and no look input exists. Default 0 disables hands-free pull.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		NaturalMaxInputFraction = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Natural", "NaturalMaxInputFraction", 0.85f, new ConfigDescription("Natural assist cap as a fraction of current player look input.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 2f), Array.Empty<object>()));
		NaturalMinDeltaPerFrame = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Natural", "NaturalMinDeltaPerFrame", 0.003f, new ConfigDescription("Minimum allowed natural delta cap per frame.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		NaturalSmoothing = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Natural", "NaturalSmoothing", 30f, new ConfigDescription("Smoothing speed for natural assist output. Higher is more responsive.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 60f), Array.Empty<object>()));
		NaturalReleaseSmoothing = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Natural", "NaturalReleaseSmoothing", 10f, new ConfigDescription("Smoothing speed when Natural assist is releasing. Lower = softer release.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 60f), Array.Empty<object>()));
		NaturalDirectionSmoothing = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Natural", "NaturalDirectionSmoothing", 18f, new ConfigDescription("Smoothing speed for target direction in Natural mode. Lower reduces jitter from target point changes.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 60f), Array.Empty<object>()));
		NaturalMinLookInput = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Natural", "NaturalMinLookInput", 0.001f, new ConfigDescription("Minimum look input magnitude before natural aim shaping uses look direction.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), Array.Empty<object>()));
		NaturalKeepOfficialGamepadPull = ((BaseUnityPlugin)this).Config.Bind<bool>("Custom Natural", "NaturalKeepOfficialGamepadPull", true, "In Natural mode, keep the game's original controller ADS pull. Mouse official ADS pull is still removed.");
		NaturalReleaseCurvePower = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Natural", "NaturalReleaseCurvePower", 2.4f, new ConfigDescription("Extra falloff used only by Natural mode. Higher values make assist release more smoothly near the edge of the bubble.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 8f), Array.Empty<object>()));
		NaturalOuterEdgeStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Custom Natural", "NaturalOuterEdgeStrength", 0.02f, new ConfigDescription("Minimum Natural strength near the outer bubble edge. Keep low to avoid a sudden breakaway feeling.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.5f), Array.Empty<object>()));
		OverrideOfficialScanner = ((BaseUnityPlugin)this).Config.Bind<bool>("System - Official Scanner", "OverrideOfficialScanner", true, "Tune official AimAssist scanner fields.");
		OfficialMaxAssistDistance = ((BaseUnityPlugin)this).Config.Bind<float>("System - Official Scanner", "OfficialMaxAssistDistance", 100f, new ConfigDescription("Official scanner max distance.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 250f), Array.Empty<object>()));
		OfficialScanConeDegrees = ((BaseUnityPlugin)this).Config.Bind<float>("System - Official Scanner", "OfficialScanConeDegrees", 75f, new ConfigDescription("Official scanner cone. Should be wider than OuterBubbleAngleDegrees.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 89f), Array.Empty<object>()));
		OfficialScoreThreshold = ((BaseUnityPlugin)this).Config.Bind<float>("System - Official Scanner", "OfficialScoreThreshold", 0f, new ConfigDescription("Official scanner score threshold.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		OfficialDistanceVsDotBlend = ((BaseUnityPlugin)this).Config.Bind<float>("System - Official Scanner", "OfficialDistanceVsDotBlend", 0.03f, new ConfigDescription("Official scanner scoring mix. 0 = aim angle, 1 = distance.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		OfficialScanIntervalFrames = ((BaseUnityPlugin)this).Config.Bind<int>("System - Official Scanner", "OfficialScanIntervalFrames", 1, new ConfigDescription("Frames between official target scans.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 30), Array.Empty<object>()));
		ScannerKeepAliveStrength = ((BaseUnityPlugin)this).Config.Bind<float>("System - Official Scanner", "ScannerKeepAliveStrength", 0.001f, new ConfigDescription("Tiny internal friction strength to keep official scanner active when all official assist sliders are zero.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.5f), Array.Empty<object>()));
		InvertX = ((BaseUnityPlugin)this).Config.Bind<bool>("Troubleshooting", "InvertX", false, "Invert horizontal assist direction if it moves away from target.");
		InvertY = ((BaseUnityPlugin)this).Config.Bind<bool>("Troubleshooting", "InvertY", false, "Invert vertical assist direction if it moves away from target.");
		EnableWeakspotDebugOverlay = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug - Weakspot Overlay", "EnableWeakspotDebugOverlay", false, "Enable a runtime overlay that draws actual weakspot polygons from Hitmesh / HitboxColliders data.");
		WeakspotDebugOnlyTrackedTarget = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug - Weakspot Overlay", "WeakspotDebugOnlyTrackedTarget", true, "Only draw weakspot polygons for the current AimAssist tracked target.");
		WeakspotDebugShowAllPositiveShapes = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug - Weakspot Overlay", "WeakspotDebugShowAllPositiveShapes", false, "Draw every non-invulnerable positive-multiplier shape. If false, only draw the highest-multiplier shape(s) per target.");
		WeakspotDebugMinimumMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Debug - Weakspot Overlay", "WeakspotDebugMinimumMultiplier", 0.75f, new ConfigDescription("Minimum base GetShapeMultiplier() required for overlay drawing when WeakspotDebugShowAllPositiveShapes is true.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>()));
		WeakspotDebugLineWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Debug - Weakspot Overlay", "WeakspotDebugLineWidth", 0.025f, new ConfigDescription("World-space line width for the weakspot overlay.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.001f, 0.2f), Array.Empty<object>()));
		WeakspotDebugDepthOffset = ((BaseUnityPlugin)this).Config.Bind<float>("Debug - Weakspot Overlay", "WeakspotDebugDepthOffset", 0.03f, new ConfigDescription("Move overlay vertices slightly toward the player camera to reduce z-fighting.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.25f), Array.Empty<object>()));
		EnableAimbot = ((BaseUnityPlugin)this).Config.Bind<bool>("Master Switch", "EnableAimbot", true, "Master switch for Deadeye Instinct aim assist and HardLock AutoFire.");
		HoldDisableKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Master Switch", "HoldDisableKey", (KeyCode)308, "Hold this key to temporarily disable aim assist and release AutoFire trigger. Use None to disable this keybind.");
		HardLockMaxDistance = ((BaseUnityPlugin)this).Config.Bind<float>("HardLock", "HardLockMaxDistance", 90f, new ConfigDescription("Maximum configured distance for HardLock target search.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 1000f), Array.Empty<object>()));
		HardLockMaxDistanceCap = ((BaseUnityPlugin)this).Config.Bind<float>("HardLock", "HardLockMaxDistanceCap", 90f, new ConfigDescription("Safety cap applied on top of HardLockMaxDistance. This keeps old configs with very large distances from locking enemies too far away. Set to 0 to disable the cap.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1000f), Array.Empty<object>()));
		HardLockPreferWeakspot = ((BaseUnityPlugin)this).Config.Bind<bool>("HardLock", "HardLockPreferWeakspot", true, "HardLock aims at the best weakspot center when available.");
		HardLockWeakspotBias = ((BaseUnityPlugin)this).Config.Bind<float>("HardLock", "HardLockWeakspotBias", 1f, new ConfigDescription("0 = target body point, 1 = weakspot center.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
		HardLockRotationSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("HardLock", "HardLockRotationSpeed", 420f, new ConfigDescription("Maximum HardLock correction speed per second. High values create near-instant lock.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 5000f), Array.Empty<object>()));
		HardLockRotationGain = ((BaseUnityPlugin)this).Config.Bind<float>("HardLock", "HardLockRotationGain", 0.18f, new ConfigDescription("Scales angular error into camera rotation delta. Higher values are more aggressive.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 10f), Array.Empty<object>()));
		HardLockMaxDeltaPerFrame = ((BaseUnityPlugin)this).Config.Bind<float>("HardLock", "HardLockMaxDeltaPerFrame", 12f, new ConfigDescription("Hard cap for HardLock rotation delta per frame.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 100f), Array.Empty<object>()));
		HardLockRecoilCompensation = ((BaseUnityPlugin)this).Config.Bind<bool>("HardLock", "HardLockRecoilCompensation", true, "Apply an extra HardLock correction after CameraRecoil.LateUpdate().");
		HardLockRequireLineOfSight = ((BaseUnityPlugin)this).Config.Bind<bool>("HardLock", "HardLockRequireLineOfSight", true, "Legacy line-of-sight switch. Kept for compatibility. HardLockRequireVisibleTarget is the safer release switch.");
		HardLockRequireVisibleTarget = ((BaseUnityPlugin)this).Config.Bind<bool>("HardLock", "HardLockRequireVisibleTarget", true, "Require official geometry-layer visibility before selecting a HardLock target. This prevents locking enemies behind walls or before the player can see them.");
		HardLockTargetPriorityMode = ((BaseUnityPlugin)this).Config.Bind<HardLockTargetPriority>("HardLock Target Priority", "HardLockTargetPriority", HardLockTargetPriority.ThreatWeighted, "Nearest / LowestHealth / WeakspotThenDistance / ThreatWeighted.");
		HardLockDistanceWeight = ((BaseUnityPlugin)this).Config.Bind<float>("HardLock Target Priority", "DistanceWeight", 0.75f, new ConfigDescription("ThreatWeighted score weight for nearby enemies. Default is 50% higher than v1.2.4.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>()));
		HardLockLowHealthWeight = ((BaseUnityPlugin)this).Config.Bind<float>("HardLock Target Priority", "LowHealthWeight", 0.25f, new ConfigDescription("ThreatWeighted score weight for low health enemies.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>()));
		HardLockWeakspotWeight = ((BaseUnityPlugin)this).Config.Bind<float>("HardLock Target Priority", "WeakspotWeight", 0.15f, new ConfigDescription("ThreatWeighted score weight for high-multiplier weakspots.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>()));
		HardLockStickyTargetBonus = ((BaseUnityPlugin)this).Config.Bind<float>("HardLock Target Priority", "StickyTargetBonus", 0.2f, new ConfigDescription("Extra score for the current HardLock target to prevent rapid target switching.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>()));
		EnableAutoFire = ((BaseUnityPlugin)this).Config.Bind<bool>("Auto Fire", "EnableAutoFire", false, "Automatically holds or pulses the weapon trigger when HardLock is aligned.");
		AutoFireOnlyInHardLock = ((BaseUnityPlugin)this).Config.Bind<bool>("Auto Fire", "AutoFireOnlyInHardLock", true, "Only allow AutoFire while Mode = HardLock.");
		AutoFireRequireAligned = ((BaseUnityPlugin)this).Config.Bind<bool>("Auto Fire", "AutoFireRequireAligned", true, "Only fire when HardLock target angle is within AutoFireMaxAngleDegrees.");
		AutoFireMaxAngleDegrees = ((BaseUnityPlugin)this).Config.Bind<float>("Auto Fire", "AutoFireMaxAngleDegrees", 1f, new ConfigDescription("Maximum angle error for AutoFire alignment.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 30f), Array.Empty<object>()));
		AutoFireRequireWeaponReady = ((BaseUnityPlugin)this).Config.Bind<bool>("Auto Fire", "AutoFireRequireWeaponReady", true, "Check ammo / reload / cooldown fields before pressing the trigger when available.");
		AutoFireRespectSemiAuto = ((BaseUnityPlugin)this).Config.Bind<bool>("Auto Fire", "AutoFireRespectSemiAuto", true, "Pulse semi-auto weapons instead of holding the trigger down.");
		AutoFirePulseSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Auto Fire", "AutoFirePulseSeconds", 0.04f, new ConfigDescription("Trigger-down duration for semi-auto AutoFire pulses.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.005f, 0.5f), Array.Empty<object>()));
		AutoFireReleaseSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Auto Fire", "AutoFireReleaseSeconds", 0.04f, new ConfigDescription("Trigger-up duration between semi-auto AutoFire pulses.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.005f, 0.5f), Array.Empty<object>()));
	}
}
internal static class InputReaderUpdatePatch
{
	internal struct InputSnapshot
	{
		public bool PlayerInputActive;

		public bool LookInputActive;

		public bool MoveInputActive;

		public Vector2 EffectiveLookInput;

		public bool GamepadUsed;
	}

	private static readonly FieldInfo FieldLookDelta = AccessTools.Field(typeof(InputReader), "lookDelta");

	private static readonly FieldInfo FieldLookDeltaGamepad = AccessTools.Field(typeof(InputReader), "lookDeltaGamepad");

	private static readonly MethodInfo GamepadUsedGetter = AccessTools.PropertyGetter(typeof(InputReader), "GamepadUsed");

	private static readonly FieldInfo AimAssistField = AccessTools.Field(typeof(InputReader), "aimAssist");

	private static readonly FieldInfo RotationPullDeltaField = AccessTools.Field(typeof(AimAssist), "rotationPullDelta");

	internal static bool LastPlayerInputActive;

	internal static bool LastLookInputActive;

	internal static bool LastMoveInputActive;

	internal static Vector2 LastEffectiveLookInput;

	internal static bool LastGamepadUsed;

	private static readonly Dictionary<AimAssist, InputSnapshot> SnapshotsByAimAssist = new Dictionary<AimAssist, InputSnapshot>();

	public static void Prefix(InputReader __instance)
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		LastPlayerInputActive = false;
		LastLookInputActive = false;
		LastMoveInputActive = false;
		LastEffectiveLookInput = Vector2.zero;
		LastGamepadUsed = false;
		if (!DeadeyeInstinctPlugin.EnableMod.Value || (Object)(object)__instance == (Object)null)
		{
			return;
		}
		Vector2 vector = GetVector2(FieldLookDelta, __instance);
		Vector2 vector2 = GetVector2(FieldLookDeltaGamepad, __instance);
		LastGamepadUsed = __instance.GamepadUsed;
		LastEffectiveLookInput = (__instance.GamepadUsed ? (vector2 * Time.unscaledDeltaTime) : vector);
		bool flag = DeadeyeInstinctPlugin.CountLookInput.Value && ((Vector2)(ref LastEffectiveLookInput)).magnitude >= DeadeyeInstinctPlugin.LookInputThreshold.Value;
		bool flag2 = false;
		if (DeadeyeInstinctPlugin.CountMoveInput.Value)
		{
			try
			{
				Vector2 rawMovementInput = __instance.GetRawMovementInput();
				flag2 = ((Vector2)(ref rawMovementInput)).magnitude >= DeadeyeInstinctPlugin.MoveInputThreshold.Value;
			}
			catch
			{
				flag2 = false;
			}
		}
		LastLookInputActive = flag;
		LastMoveInputActive = flag2;
		LastPlayerInputActive = flag || flag2;
		if ((Object)(object)__instance.aimAssist != (Object)null)
		{
			SnapshotsByAimAssist[__instance.aimAssist] = new InputSnapshot
			{
				PlayerInputActive = LastPlayerInputActive,
				LookInputActive = LastLookInputActive,
				MoveInputActive = LastMoveInputActive,
				EffectiveLookInput = LastEffectiveLookInput,
				GamepadUsed = LastGamepadUsed
			};
		}
	}

	public static bool TryGetSnapshot(AimAssist aimAssist, out InputSnapshot snapshot)
	{
		//IL_0051: 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)
		if ((Object)(object)aimAssist != (Object)null && SnapshotsByAimAssist.TryGetValue(aimAssist, out snapshot))
		{
			return true;
		}
		snapshot = new InputSnapshot
		{
			PlayerInputActive = LastPlayerInputActive,
			LookInputActive = LastLookInputActive,
			MoveInputActive = LastMoveInputActive,
			EffectiveLookInput = LastEffectiveLookInput,
			GamepadUsed = LastGamepadUsed
		};
		return false;
	}

	public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
	{
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Expected O, but got Unknown
		List<CodeInstruction> list = new List<CodeInstruction>(instructions);
		MethodInfo methodInfo = AccessTools.Method(typeof(InputReaderUpdatePatch), "ShouldConsumeRotationPullDelta", (Type[])null, (Type[])null);
		int num = 0;
		for (int i = 0; i < list.Count; i++)
		{
			CodeInstruction val = list[i];
			if (CodeInstructionExtensions.Calls(val, GamepadUsedGetter) && IsRotationPullDeltaBranch(list, i))
			{
				list[i] = new CodeInstruction(OpCodes.Call, (object)methodInfo);
				num++;
			}
		}
		ManualLogSource log = DeadeyeInstinctPlugin.Log;
		if (log != null)
		{
			log.LogInfo((object)$"InputReader.Update transpiler patched rotationPullDelta branch count={num}.");
		}
		return list;
	}

	private static bool IsRotationPullDeltaBranch(List<CodeInstruction> codes, int index)
	{
		int num = Mathf.Min(codes.Count, index + 24);
		for (int i = index + 1; i < num; i++)
		{
			if (!(codes[i].opcode == OpCodes.Ldfld) || !(codes[i].operand is FieldInfo fieldInfo))
			{
				continue;
			}
			if (fieldInfo == AimAssistField)
			{
				for (int j = i + 1; j < num; j++)
				{
					if (codes[j].opcode == OpCodes.Ldfld && codes[j].operand is FieldInfo fieldInfo2 && fieldInfo2 == RotationPullDeltaField)
					{
						return true;
					}
				}
			}
			if (fieldInfo == RotationPullDeltaField)
			{
				return true;
			}
		}
		return false;
	}

	public static bool ShouldConsumeRotationPullDelta(InputReader reader)
	{
		if ((Object)(object)reader == (Object)null)
		{
			return false;
		}
		if (reader.GamepadUsed)
		{
			return true;
		}
		return DeadeyeInstinctPlugin.EnableMod.Value && DeadeyeInstinctPlugin.EnableMouseConsumesRotationPullDelta.Value;
	}

	private static Vector2 GetVector2(FieldInfo field, object target)
	{
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		if (field == null || target == null)
		{
			return Vector2.zero;
		}
		try
		{
			return (field.GetValue(target) is Vector2 val) ? val : Vector2.zero;
		}
		catch
		{
			return Vector2.zero;
		}
	}
}
internal static class AimAssistLateUpdatePatch
{
	private static readonly FieldInfo FieldScanIntervalFrames = AccessTools.Field(typeof(AimAssist), "scanIntervalFrames");

	private static readonly FieldInfo FieldMaxAssistDistance = AccessTools.Field(typeof(AimAssist), "maxAssistDistance");

	private static readonly FieldInfo FieldMinAimDot = AccessTools.Field(typeof(AimAssist), "minAimDot");

	private static readonly FieldInfo FieldDistanceVsDotBlend = AccessTools.Field(typeof(AimAssist), "distanceVsDotBlend");

	private static readonly FieldInfo FieldScoreThreshold = AccessTools.Field(typeof(AimAssist), "scoreThreshold");

	private static readonly FieldInfo FieldAdsDistanceMultiplier = AccessTools.Field(typeof(AimAssist), "adsDistanceMultiplier");

	private static readonly FieldInfo FieldFrictionStrength = AccessTools.Field(typeof(AimAssist), "frictionStrength");

	private static readonly FieldInfo FieldPlayerCamera = AccessTools.Field(typeof(AimAssist), "playerCamera");

	private static readonly FieldInfo FieldTrackedTarget = AccessTools.Field(typeof(AimAssist), "trackedTarget");

	private static readonly FieldInfo FieldTrackedTargetPoint = AccessTools.Field(typeof(AimAssist), "trackedTargetPoint");

	private static Vector2 smoothedNaturalDelta;

	private static Vector2 smoothedNaturalDirection;

	private static Vector2 smoothedMagnetDelta;

	private static Unit lastAssistTarget;

	private static float targetSwitchTimer;

	private static float nextDebugLogTime;

	internal static Unit CurrentTrackedTargetForDebug;

	internal static Camera CurrentPlayerCameraForDebug;

	public static void Prefix(AimAssist __instance)
	{
		if (DeadeyeInstinctPlugin.EnableMod.Value && !((Object)(object)__instance == (Object)null))
		{
			if (DeadeyeInstinctPlugin.OverrideOfficialScanner.Value)
			{
				Set(FieldScanIntervalFrames, __instance, DeadeyeInstinctPlugin.OfficialScanIntervalFrames.Value);
				Set(FieldMaxAssistDistance, __instance, DeadeyeInstinctPlugin.OfficialMaxAssistDistance.Value);
				float num = Mathf.Clamp(DeadeyeInstinctPlugin.OfficialScanConeDegrees.Value, 1f, 89f);
				Set(FieldMinAimDot, __instance, Mathf.Cos(num * ((float)Math.PI / 180f)));
				Set(FieldDistanceVsDotBlend, __instance, DeadeyeInstinctPlugin.OfficialDistanceVsDotBlend.Value);
				Set(FieldScoreThreshold, __instance, DeadeyeInstinctPlugin.OfficialScoreThreshold.Value);
				Set(FieldAdsDistanceMultiplier, __instance, 1f);
			}
			float num2 = Mathf.Clamp(DeadeyeInstinctPlugin.ScannerKeepAliveStrength.Value, 0f, 0.5f);
			float num4 = ((Get(FieldFrictionStrength, __instance) is float num3) ? num3 : 0f);
			if (num4 < num2)
			{
				Set(FieldFrictionStrength, __instance, num2);
			}
		}
	}

	public static void Postfix(AimAssist __instance)
	{
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: 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_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0265: Unknown result type (might be due to invalid IL or missing references)
		//IL_0267: Unknown result type (might be due to invalid IL or missing references)
		//IL_026c: Unknown result type (might be due to invalid IL or missing references)
		//IL_026e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0238: Unknown result type (might be due to invalid IL or missing references)
		//IL_023c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0241: Unknown result type (might be due to invalid IL or missing references)
		//IL_0293: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0257: Unknown result type (might be due to invalid IL or missing references)
		//IL_025c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0318: Unknown result type (might be due to invalid IL or missing references)
		//IL_0321: Unknown result type (might be due to invalid IL or missing references)
		//IL_0326: Unknown result type (might be due to invalid IL or missing references)
		//IL_032b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0354: Unknown result type (might be due to invalid IL or missing references)
		//IL_0358: Unknown result type (might be due to invalid IL or missing references)
		//IL_035d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0366: Unknown result type (might be due to invalid IL or missing references)
		//IL_036b: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04da: Unknown result type (might be due to invalid IL or missing references)
		//IL_0501: Unknown result type (might be due to invalid IL or missing references)
		//IL_0506: Unknown result type (might be due to invalid IL or missing references)
		//IL_0508: Unknown result type (might be due to invalid IL or missing references)
		//IL_050d: Unknown result type (might be due to invalid IL or missing references)
		//IL_058d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0598: Unknown result type (might be due to invalid IL or missing references)
		if (!DeadeyeInstinctPlugin.EnableMod.Value || (Object)(object)__instance == (Object)null)
		{
			return;
		}
		bool flag = DeadeyeInstinctPlugin.ActiveMode() == AssistMode.Natural;
		InputReaderUpdatePatch.InputSnapshot snapshot;
		bool flag2 = InputReaderUpdatePatch.TryGetSnapshot(__instance, out snapshot);
		if (!DeadeyeInstinctPlugin.IsAimbotRuntimeEnabled())
		{
			__instance.rotationPullDelta = Vector2.zero;
			CurrentTrackedTargetForDebug = null;
			HardLockController.ClearRuntimeTarget();
			DecayNaturalDelta();
			return;
		}
		if (DeadeyeInstinctPlugin.ActiveMode() == AssistMode.HardLock)
		{
			object obj = Get(FieldPlayerCamera, __instance);
			Camera camera = (CurrentPlayerCameraForDebug = (Camera)((obj is Camera) ? obj : null));
			__instance.rotationPullDelta = Vector2.zero;
			if (HardLockController.TryUpdateFromCamera(camera, out var target, out var _))
			{
				CurrentTrackedTargetForDebug = target;
				UpdateTargetSwitchState(target);
			}
			else
			{
				CurrentTrackedTargetForDebug = null;
				ClearTargetState();
			}
			DecayNaturalDelta();
			return;
		}
		if (flag && (!snapshot.GamepadUsed || !DeadeyeInstinctPlugin.EffectiveNaturalKeepOfficialGamepadPull()))
		{
			__instance.rotationPullDelta = Vector2.zero;
		}
		if (!DeadeyeInstinctPlugin.EnableContinuousRotationalAssist.Value)
		{
			DecayNaturalDelta();
			return;
		}
		if (DeadeyeInstinctPlugin.RequirePlayerInput.Value && !snapshot.PlayerInputActive)
		{
			DecayNaturalDelta();
			return;
		}
		object obj2 = Get(FieldTrackedTarget, __instance);
		Unit val = (Unit)((obj2 is Unit) ? obj2 : null);
		if ((Object)(object)val == (Object)null || (int)val.UnitState == 0 || (Object)(object)val.mainCollider == (Object)null)
		{
			CurrentTrackedTargetForDebug = null;
			ClearTargetState();
			DecayNaturalDelta();
			return;
		}
		UpdateTargetSwitchState(val);
		if (!(Get(FieldTrackedTargetPoint, __instance) is Vector3 magnetTargetPoint) || 1 == 0)
		{
			DecayNaturalDelta();
			return;
		}
		object obj3 = Get(FieldPlayerCamera, __instance);
		Camera val2 = (Camera)((obj3 is Camera) ? obj3 : null);
		if ((Object)(object)val2 == (Object)null)
		{
			CurrentPlayerCameraForDebug = null;
			CurrentTrackedTargetForDebug = val;
			DecayNaturalDelta();
			return;
		}
		CurrentPlayerCameraForDebug = val2;
		CurrentTrackedTargetForDebug = val;
		bool weakspotTargetUsed = false;
		if (DeadeyeInstinctPlugin.ActiveMode() == AssistMode.Magnet)
		{
			magnetTargetPoint = GetMagnetTargetPoint(val, magnetTargetPoint, out weakspotTargetUsed);
			if (weakspotTargetUsed && DeadeyeInstinctPlugin.EffectiveMagnetWeakspotOverrideOfficialPull())
			{
				__instance.rotationPullDelta = Vector2.zero;
			}
		}
		Vector3 val3 = val2.WorldToViewportPoint(magnetTargetPoint);
		if (val3.z <= 0f)
		{
			DecayNaturalDelta();
			return;
		}
		Vector2 val4 = default(Vector2);
		((Vector2)(ref val4))..ctor(val3.x - 0.5f, 0f - (val3.y - 0.5f));
		if (DeadeyeInstinctPlugin.InvertX.Value)
		{
			val4.x = 0f - val4.x;
		}
		if (DeadeyeInstinctPlugin.InvertY.Value)
		{
			val4.y = 0f - val4.y;
		}
		if (((Vector2)(ref val4)).sqrMagnitude <= 1E-06f)
		{
			DecayNaturalDelta();
			return;
		}
		Vector3 val5 = magnetTargetPoint - ((Component)val2).transform.position;
		float magnitude = ((Vector3)(ref val5)).magnitude;
		if (magnitude <= 0.001f)
		{
			DecayNaturalDelta();
			return;
		}
		Vector3 val6 = val5 / magnitude;
		float num = Mathf.Clamp(Vector3.Dot(((Component)val2).transform.forward, val6), -1f, 1f);
		float num2 = Mathf.Acos(num) * 57.29578f;
		float num3 = Mathf.Clamp(DeadeyeInstinctPlugin.EffectiveOuterBubbleAngleDegrees(), 0.1f, 89f);
		float num4 = Mathf.Clamp(DeadeyeInstinctPlugin.EffectiveInnerBubbleAngleDegrees(), 0.05f, num3);
		if (num2 > num3)
		{
			DecayNaturalDelta();
			return;
		}
		float num5 = Mathf.InverseLerp(num3, num4, num2);
		num5 = Mathf.Clamp01(num5);
		num5 = Mathf.Pow(num5, Mathf.Max(0.01f, DeadeyeInstinctPlugin.EffectiveBubbleCurvePower()));
		float num6 = Mathf.Max(1f, DeadeyeInstinctPlugin.OfficialMaxAssistDistance.Value);
		float num7 = 1f - Mathf.Clamp01(magnitude / num6);
		num7 = Mathf.Pow(num7, Mathf.Max(0.01f, DeadeyeInstinctPlugin.EffectiveDistanceFalloffPower()));
		float num8 = Mathf.Max(0f, DeadeyeInstinctPlugin.EffectiveRotationDeltaPerSecond()) * Mathf.Max(0f, DeadeyeInstinctPlugin.EffectiveAssistCoefficient()) * num5 * num7 * Time.deltaTime;
		num8 *= GetTargetSwitchScale();
		if (DeadeyeInstinctPlugin.ActiveMode() == AssistMode.Magnet)
		{
			num8 *= GetMagnetEdgeScale(num2, num3, num5);
		}
		num8 = Mathf.Min(num8, Mathf.Max(0.001f, DeadeyeInstinctPlugin.EffectiveMaxRotationDeltaPerFrame()));
		if (num8 <= 1E-06f)
		{
			DecayNaturalDelta();
			return;
		}
		Vector2 val7 = ComputeAssistDelta(val4, num8, num5, snapshot);
		if (((Vector2)(ref val7)).sqrMagnitude <= 1E-07f)
		{
			DecayNaturalDelta();
			return;
		}
		__instance.rotationPullDelta += val7;
		if (DeadeyeInstinctPlugin.DebugLogging.Value && Time.unscaledTime >= nextDebugLogTime)
		{
			nextDebugLogTime = Time.unscaledTime + 0.5f;
			DeadeyeInstinctPlugin.Log.LogInfo((object)$"Mode={DeadeyeInstinctPlugin.ActiveMode()}, target={((Object)val).name}, angle={num2:F2}, bubble={num5:F3}, dist={num7:F3}, add={val7}, final={__instance.rotationPullDelta}");
		}
	}

	private static Vector2 ComputeAssistDelta(Vector2 offset, float amount, float bubble, InputReaderUpdatePatch.InputSnapshot inputSnapshot)
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: 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)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		if (((Vector2)(ref offset)).sqrMagnitude <= 1E-06f || amount <= 1E-06f)
		{
			return Vector2.zero;
		}
		Vector2 normalized = ((Vector2)(ref offset)).normalized;
		return (Vector2)(DeadeyeInstinctPlugin.ActiveMode() switch
		{
			AssistMode.Magnet => ComputeMagnetDelta(normalized, amount, inputSnapshot), 
			AssistMode.Natural => ComputeNaturalDelta(normalized, amount, bubble, inputSnapshot), 
			_ => normalized * amount, 
		});
	}

	private static Vector3 GetMagnetTargetPoint(Unit target, Vector3 officialTargetPoint, out bool weakspotTargetUsed)
	{
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		weakspotTargetUsed = false;
		if ((Object)(object)target == (Object)null)
		{
			return officialTargetPoint;
		}
		if (DeadeyeInstinctPlugin.EffectiveMagnetPreferWeakspot())
		{
			try
			{
				if (TryGetBestWeakspotPoint(target, officialTargetPoint, out var point, out var _))
				{
					weakspotTargetUsed = true;
					float num = Mathf.Clamp01(DeadeyeInstinctPlugin.EffectiveMagnetWeakspotBias());
					return Vector3.Lerp(officialTargetPoint, point, num);
				}
			}
			catch
			{
			}
		}
		try
		{
			Collider mainCollider = target.mainCollider;
			if ((Object)(object)mainCollider != (Object)null)
			{
				Bounds bounds = mainCollider.bounds;
				float num2 = Mathf.Clamp01(DeadeyeInstinctPlugin.EffectiveMagnetCenterBias());
				return Vector3.Lerp(officialTargetPoint, ((Bounds)(ref bounds)).center, num2);
			}
		}
		catch
		{
		}
		return officialTargetPoint;
	}

	private static bool TryGetBestWeakspotPoint(Unit target, Vector3 referenceWorldPoint, out Vector3 point, out float multiplier)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0208: Unknown result type (might be due to invalid IL or missing references)
		//IL_0209: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: 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_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01be: Unknown result type (might be due to invalid IL or missing references)
		point = Vector3.zero;
		multiplier = 0f;
		if ((Object)(object)target == (Object)null)
		{
			return false;
		}
		Hitmesh[] array = null;
		try
		{
			array = ((Component)target).GetComponentsInChildren<Hitmesh>(true);
		}
		catch
		{
			return false;
		}
		if (array == null || array.Length == 0)
		{
			return false;
		}
		bool flag = false;
		Vector3 val = Vector3.zero;
		float num = 0f;
		float num2 = float.MaxValue;
		int num3 = -1;
		foreach (Hitmesh val2 in array)
		{
			if ((Object)(object)val2 == (Object)null || val2.hitShapes == null || val2.hitShapes.Length == 0 || ((Object)(object)val2.owner != (Object)null && (Object)(object)val2.owner != (Object)(object)target))
			{
				continue;
			}
			for (int j = 0; j < val2.hitShapes.Length; j++)
			{
				Data val3 = val2.hitShapes[j];
				if (((Data)(ref val3)).isInvulnerable)
				{
					continue;
				}
				float shapeMultiplier = ((Data)(ref val3)).GetShapeMultiplier();
				if (!(shapeMultiplier <= 0f) && TryGetShapeAimPoint(val2, val3.shapeId, referenceWorldPoint, out var point2, out var distanceSqr))
				{
					int partPriority = GetPartPriority(((ShapeId)(ref val3.shapeId)).part);
					if (!flag || shapeMultiplier > num + 0.0001f || (Mathf.Abs(shapeMultiplier - num) <= 0.0001f && partPriority > num3) || (Mathf.Abs(shapeMultiplier - num) <= 0.0001f && partPriority == num3 && distanceSqr < num2))
					{
						flag = true;
						num = shapeMultiplier;
						num3 = partPriority;
						num2 = distanceSqr;
						val = point2;
						multiplier = shapeMultiplier;
					}
				}
			}
		}
		if (!flag)
		{
			return false;
		}
		point = val;
		return true;
	}

	private static int GetPartPriority(Parts part)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Invalid comparison between Unknown and I4
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Invalid comparison between Unknown and I4
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Invalid comparison between Unknown and I4
		if ((int)part == 2)
		{
			return 30;
		}
		if ((int)part == 4)
		{
			return 20;
		}
		if ((int)part == 3)
		{
			return 10;
		}
		return 0;
	}

	private static bool TryGetShapeAimPoint(Hitmesh hitmesh, ShapeId shapeId, Vector3 referenceWorldPoint, out Vector3 point, out float distanceSqr)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Invalid comparison between Unknown and I4
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		point = Vector3.zero;
		distanceSqr = float.MaxValue;
		if ((Object)(object)hitmesh == (Object)null || (int)((ShapeId)(ref shapeId)).part == 0)
		{
			return false;
		}
		try
		{
			HitboxColliders loadedHitboxColliders = StaticInstance<AsyncAssetLoading>.Instance.loadedHitboxColliders;
			if ((Object)(object)loadedHitboxColliders == (Object)null || !loadedHitboxColliders.runtimeHitmeshData.IsCreated || !loadedHitboxColliders.runtimeVertexData.IsCreated)
			{
				return false;
			}
			int hitboxFrameIndex = hitmesh.hitboxFrameIndex;
			if (hitboxFrameIndex < 0 || hitboxFrameIndex >= loadedHitboxColliders.runtimeHitmeshData.Length)
			{
				return false;
			}
			RuntimeHitboxData val = loadedHitboxColliders.runtimeHitmeshData[hitboxFrameIndex];
			Vector3 val2 = ((Component)hitmesh).transform.InverseTransformPoint(referenceWorldPoint);
			Vector2 val3 = default(Vector2);
			((Vector2)(ref val3))..ctor(val2.x, val2.y);
			for (int i = 0; i < val.shapes.Length; i++)
			{
				ShapeData val4 = val.shapes[i];
				if (val4.shapeId != shapeId)
				{
					continue;
				}
				int length = val4.length;
				if (length <= 1)
				{
					return false;
				}
				Vector2[] array = (Vector2[])(object)new Vector2[length];
				for (int j = 0; j < length; j++)
				{
					int num = val4.index + j;
					if (num < 0 || num >= loadedHitboxColliders.runtimeVertexData.Length)
					{
						return false;
					}
					float2 val5 = loadedHitboxColliders.runtimeVertexData[num];
					array[j] = new Vector2(val5.x, val5.y);
				}
				Vector2 val6;
				if (IsPointInsidePolygon(val3, array))
				{
					val6 = val3;
					distanceSqr = 0f;
				}
				else
				{
					val6 = GetClosestPointOnPolygon(val3, array, out distanceSqr);
				}
				point = ((Component)hitmesh).transform.TransformPoint(new Vector3(val6.x, val6.y, val2.z));
				return true;
			}
		}
		catch
		{
			return false;
		}
		return false;
	}

	private static bool IsPointInsidePolygon(Vector2 point, Vector2[] polygon)
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		if (polygon == null || polygon.Length < 3)
		{
			return false;
		}
		bool flag = false;
		int num = polygon.Length - 1;
		for (int i = 0; i < polygon.Length; i++)
		{
			Vector2 val = polygon[i];
			Vector2 val2 = polygon[num];
			if (val.y > point.y != val2.y > point.y && point.x < (val2.x - val.x) * (point.y - val.y) / Mathf.Max(1E-06f, val2.y - val.y) + val.x)
			{
				flag = !flag;
			}
			num = i;
		}
		return flag;
	}

	private static Vector2 GetClosestPointOnPolygon(Vector2 point, Vector2[] polygon, out float bestDistanceSqr)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		bestDistanceSqr = float.MaxValue;
		Vector2 result = point;
		if (polygon == null || polygon.Length == 0)
		{
			return result;
		}
		for (int i = 0; i < polygon.Length; i++)
		{
			Vector2 a = polygon[i];
			Vector2 b = polygon[(i + 1) % polygon.Length];
			Vector2 val = ProjectPointOnSegment(point, a, b);
			Vector2 val2 = val - point;
			float sqrMagnitude = ((Vector2)(ref val2)).sqrMagnitude;
			if (sqrMagnitude < bestDistanceSqr)
			{
				bestDistanceSqr = sqrMagnitude;
				result = val;
			}
		}
		return result;
	}

	private static Vector2 ProjectPointOnSegment(Vector2 point, Vector2 a, Vector2 b)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		Vector2 val = b - a;
		float num = Vector2.Dot(val, val);
		if (num <= 1E-06f)
		{
			return a;
		}
		float num2 = Vector2.Dot(point - a, val) / num;
		num2 = Mathf.Clamp01(num2);
		return a + val * num2;
	}

	private static Vector2 ComputeMagnetDelta(Vector2 targetDirection, float amount, InputReaderUpdatePatch.InputSnapshot inputSnapshot)
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		float num = 1f;
		if (!inputSnapshot.LookInputActive && inputSnapshot.MoveInputActive)
		{
			num *= Mathf.Clamp01(DeadeyeInstinctPlugin.EffectiveMagnetMovementOnlyScale());
		}
		num *= GetMagnetLookAwayEscapeScale(targetDirection, inputSnapshot);
		Vector2 val = targetDirection * amount * num;
		smoothedMagnetDelta = Vector2.Lerp(smoothedMagnetDelta, val, GetMagnetSmoothingT());
		return smoothedMagnetDelta;
	}

	private static float GetMagnetLookAwayEscapeScale(Vector2 targetDirection, InputReaderUpdatePatch.InputSnapshot inputSnapshot)
	{
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		if (!DeadeyeInstinctPlugin.EffectiveMagnetAllowLookAwayEscape())
		{
			return 1f;
		}
		if (!inputSnapshot.LookInputActive)
		{
			return 1f;
		}
		Vector2 effectiveLookInput = inputSnapshot.EffectiveLookInput;
		float magnitude = ((Vector2)(ref effectiveLookInput)).magnitude;
		if (magnitude <= 1E-06f || ((Vector2)(ref targetDirection)).sqrMagnitude <= 1E-06f)
		{
			return 1f;
		}
		Vector2 val = effectiveLookInput / magnitude;
		float num = Vector2.Dot(val, targetDirection);
		float num2 = Mathf.Clamp01(DeadeyeInstinctPlugin.EffectiveMagnetLookAwayThreshold());
		if (num >= 0f - num2)
		{
			return 1f;
		}
		float num3 = Mathf.InverseLerp(num2, 1f, 0f - num);
		num3 = Mathf.Clamp01(num3);
		num3 = Mathf.Pow(num3, Mathf.Max(0.01f, DeadeyeInstinctPlugin.EffectiveMagnetLookAwayCurvePower()));
		float num4 = Mathf.Clamp01(DeadeyeInstinctPlugin.EffectiveMagnetLookAwayMinScale());
		float num5 = Mathf.Lerp(1f, num4, num3);
		if (inputSnapshot.MoveInputActive)
		{
			float num6 = Mathf.Clamp01(DeadeyeInstinctPlugin.EffectiveMagnetLookAwayMovementScale());
			num5 = Mathf.Lerp(num5, 1f, num6);
		}
		return Mathf.Clamp01(num5);
	}

	private static Vector2 ComputeNaturalDelta(Vector2 targetDirection, float amount, float bubble, InputReaderUpdatePatch.InputSnapshot inputSnapshot)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or mis