Decompiled source of NoHornCooldown v1.0.0

NoHornCooldown.dll

Decompiled 11 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("NoHornCooldown")]
[assembly: AssemblyDescription("Removes the cooldown from the Airhorn and the Clownhorn")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NoHornCooldown")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("458b8a1e-1d13-4e93-ad3d-3b5e411f5f3e")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace NoHornCooldown
{
	[BepInPlugin("NoHornCooldown", "NoHornCooldown", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const string modGUID = "NoHornCooldown";

		private const string modName = "NoHornCooldown";

		private const string modVersion = "1.0.0";

		internal ManualLogSource mls;

		private Harmony _harmonyMain;

		private void Awake()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			mls = Logger.CreateLogSource("NoHornCooldown");
			_harmonyMain = new Harmony("NoHornCooldown");
			_harmonyMain.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"time to spam the airhorn");
		}
	}
}
namespace NoHornCooldown.Patches
{
	[HarmonyPatch]
	internal class GrabbableObjectPatch
	{
		internal static ManualLogSource mls = Logger.CreateLogSource("NoHornCooldown.GrabbableObjectPatch");

		[HarmonyPatch(typeof(GrabbableObject), "Start")]
		[HarmonyPostfix]
		public static void RemoveCooldown(GrabbableObject __instance)
		{
			Item itemProperties = __instance.itemProperties;
			if (!(((Object)itemProperties).name != "ClownHorn") || !(((Object)itemProperties).name != "Airhorn"))
			{
				__instance.useCooldown = 0f;
			}
		}
	}
}