Decompiled source of NoShotgunMisfire v1.0.0

NoShotgunMisfire.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyCompany("NoShotgunMisfire")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyCopyright("Copyright © 2024 MegaPiggy")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+de03bd2735d14ec5e61f253b6602806c4ce89ece")]
[assembly: AssemblyProduct("NoShotgunMisfire")]
[assembly: AssemblyTitle("NoShotgunMisfire")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace NoShotgunMisfire
{
	[BepInPlugin("MegaPiggy.NoShotgunMisfire", "No Shotgun Misfire", "1.0.0")]
	public class Main : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(ShotgunItem))]
		internal static class ShotgunItemPatch
		{
			[HarmonyPatch("Update")]
			[HarmonyPrefix]
			public static void Update(ShotgunItem __instance)
			{
				__instance.hasHitGroundWithSafetyOff = true;
				__instance.misfireTimer = 6624f;
			}
		}

		public const string ModGUID = "MegaPiggy.NoShotgunMisfire";

		public const string ModName = "No Shotgun Misfire";

		public const string ModVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("MegaPiggy.NoShotgunMisfire");

		private static Main instance;

		internal static Main Instance => instance;

		internal static ManualLogSource LoggerInstance => ((BaseUnityPlugin)Instance).Logger;

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				Object.DontDestroyOnLoad((Object)(object)this);
				instance = this;
			}
			harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin No Shotgun Misfire is loaded with version 1.0.0!");
		}
	}
}