Decompiled source of Disable Water Wear v1.1.0

DisableWaterDamage.dll

Decompiled 7 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("DisableWaterDamage")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DisableWaterDamage")]
[assembly: AssemblyTitle("DisableWaterDamage")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace DisableWaterDamage;

[BepInPlugin("com.joryjuky.disablewaterdamage", "DisableWaterDamage", "1.0.0")]
public class DisableDmg : BaseUnityPlugin
{
	private const string pluginGUID = "com.joryjuky.disablewaterdamage";

	private const string pluginName = "DisableWaterDamage";

	private const string pluginVersion = "1.0.0";

	private void Awake()
	{
		Harmony.CreateAndPatchAll(typeof(DisableDmg), (string)null);
	}

	[HarmonyPatch(typeof(WearNTear), "UpdateWear")]
	[HarmonyTranspiler]
	private static IEnumerable<CodeInstruction> WetTranspiler(IEnumerable<CodeInstruction> instructions)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Expected O, but got Unknown
		return new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[2]
		{
			new CodeMatch((OpCode?)OpCodes.Ldc_R4, (object)5f, (string)null),
			new CodeMatch((OpCode?)OpCodes.Add, (object)null, (string)null)
		}).RemoveInstructions(2).InstructionEnumeration();
	}
}
public static class PluginInfo
{
	public const string PLUGIN_GUID = "DisableWaterDamage";

	public const string PLUGIN_NAME = "DisableWaterDamage";

	public const string PLUGIN_VERSION = "1.0.0";
}