Decompiled source of ConfigShovel v0.0.2

DeathShovel.dll

Decompiled 10 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LethalConfig.ConfigItems;
using LethalConfig.ConfigItems.Options;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("DeathShovel")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DeathShovel")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("ed49b4f9-dc97-411a-b2bc-ef6ec7f89bc8")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace DeathShovel
{
	[BepInPlugin("Ccode.DeathShovel", "DeathShovel", "0.0.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private const string MyGuid = "Ccode.DeathShovel";

		private const string PluginName = "DeathShovel";

		private const string VersionString = "0.0.1";

		public static ConfigEntry<int> config;

		private static readonly Harmony Harmony = new Harmony("Ccode.DeathShovel");

		public static ManualLogSource Log;

		public void Awake()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_0041: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			config = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ConfigShovel", 3, "The force value of a shovel.");
			ConfigEntry<int> obj = config;
			IntSliderOptions val = new IntSliderOptions();
			((BaseRangeOptions<int>)val).Min = 0;
			((BaseRangeOptions<int>)val).Max = 100;
			IntSliderConfigItem val2 = new IntSliderConfigItem(obj, val);
			Harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"DeathShovel 0.0.1 loaded.");
			Log = ((BaseUnityPlugin)this).Logger;
		}
	}
}
namespace DeathShovel.Patches.Items
{
	[HarmonyPatch(typeof(GrabbableObject), "Start")]
	internal class GrabbableObjectPatch
	{
		public static void Prefix(GrabbableObject __instance)
		{
			if (((object)__instance).GetType() == typeof(Shovel))
			{
				Shovel val = (Shovel)(object)((__instance is Shovel) ? __instance : null);
				val.shovelHitForce = Plugin.config.Value;
			}
		}
	}
	[HarmonyPatch(typeof(Shovel), "SwingShovel")]
	internal class ShovelPatch
	{
		public static void Prefix(Shovel __instance, bool cancel = false)
		{
			Plugin.Log.LogInfo((object)__instance.shovelHitForce);
		}
	}
}