Decompiled source of NoEitr v1.0.1

NoEitr.dll

Decompiled 7 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
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("NoEtir")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NoEtir")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("6CA79053-144A-4F9E-B038-B209AED26332")]
[assembly: AssemblyFileVersion("1.0.1")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.1.0")]
[module: UnverifiableCode]
namespace NoEitr;

[BepInPlugin("org.ssmvc.noeitr", "NoEitr", "1.0.1")]
public class NoEitr : BaseUnityPlugin
{
	[HarmonyPatch(typeof(Humanoid), "GetCurrentWeapon")]
	private static class GetCurrentWeaponPatch
	{
		public static void Postfix(Character __instance, ref ItemData __result)
		{
			if (__instance.IsPlayer() && __result != null)
			{
				if (__result.m_shared.m_attack.m_reloadEitrDrain > 0f)
				{
					__result.m_shared.m_attack.m_reloadEitrDrain = 0f;
				}
				if (__result.m_shared.m_attack.m_attackEitr > 0f)
				{
					__result.m_shared.m_attack.m_attackEitr = 0f;
				}
			}
		}
	}

	public const string PluginGUID = "org.ssmvc.noeitr";

	public const string PluginName = "NoEitr";

	public const string PluginVersion = "1.0.1";

	private Harmony _harmony;

	private void Awake()
	{
		_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "org.ssmvc.noeitr");
	}

	private void OnDestroy()
	{
		Harmony harmony = _harmony;
		if (harmony != null)
		{
			harmony.UnpatchSelf();
		}
	}
}