Decompiled source of NoShockStickConsumption v1.0.0

BepInEx/plugins/NoShockStickConsumption.dll

Decompiled 7 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 NoShockStickConsumption.Patches;
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("NoShockStickConsumption")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NoShockStickConsumption")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("035570e0-d8de-4a0e-b169-e7d3c5a8c26f")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace NoShockStickConsumption
{
	[BepInPlugin("MrChicken.NoShockStickConsumption", "No Shock Stick Consumption", "1.0.0.0")]
	public class NoShockStickConsumptionBase : BaseUnityPlugin
	{
		private const string modGUID = "MrChicken.NoShockStickConsumption";

		private const string modName = "No Shock Stick Consumption";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("MrChicken.NoShockStickConsumption");

		private static NoShockStickConsumptionBase Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("MrChicken.NoShockStickConsumption");
			mls.LogInfo((object)"NoShockStickCOnsumption has awoken");
			harmony.PatchAll(typeof(NoShockStickConsumptionBase));
			harmony.PatchAll(typeof(ShockStickPatch));
		}
	}
}
namespace NoShockStickConsumption.Patches
{
	[HarmonyPatch(typeof(ShockStick))]
	internal class ShockStickPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void m_chargePatchUpdate(ref BatteryEntry ___m_batteryEntry)
		{
			___m_batteryEntry.m_charge = ___m_batteryEntry.m_maxCharge;
		}
	}
}