Decompiled source of SO NoEnemyVision v1.0.0

SONoEnemyVision.dll

Decompiled 3 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("SO-NoEnemyVision")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SO-NoEnemyVision")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b558f9f7-611b-4743-84c1-b97fd161911d")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SO_NoEnemyVision;

[BepInPlugin("SoloOne.NoEnemyVision", "SO No Enemy Vision", "1.0.0")]
public class NoVision : BaseUnityPlugin
{
	private const string modguid = "SoloOne.NoEnemyVision";

	private const string modname = "SO No Enemy Vision";

	private const string modversion = "1.0.0";

	private readonly Harmony harmony = new Harmony("SoloOne.NoEnemyVision");

	private void Awake()
	{
		harmony.PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"[SO No Enemy Vision] Successfully cut enemies' eyes out");
	}
}
[HarmonyPatch(typeof(EnemyDirector), "Awake")]
public class NVpatch
{
	private static void Postfix(EnemyDirector __instance)
	{
		FieldInfo field = typeof(EnemyDirector).GetField("debugNoVision", BindingFlags.Instance | BindingFlags.NonPublic);
		if (field != null)
		{
			bool flag = (bool)field.GetValue(__instance);
			field.SetValue(__instance, !flag);
		}
	}
}