Decompiled source of SemiHands Leech Patch v1.0.0

SemiHands_Leech_Patch.dll

Decompiled 9 hours ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using SemiHands;
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(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("RepoPatch")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RepoPatch")]
[assembly: AssemblyTitle("RepoPatch")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace RepoCompatibilityPatches;

[BepInPlugin("com.jett.repopatch.semihandsleech", "SemiHands Leech Patch", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class RepoPatchPlugin : BaseUnityPlugin
{
	internal static FieldInfo CausingHurtField;

	private void Awake()
	{
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Expected O, but got Unknown
		CausingHurtField = AccessTools.Field(typeof(HurtCollider), "playerCausingHurt");
		Harmony val = new Harmony("com.jett.repopatch.semihandsleech");
		val.PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"SemiHands Leech Compatibility Patch loaded successfully!");
	}
}
[HarmonyPatch(typeof(PlayerFightController), "SetUpHurtColliders")]
internal static class SemiHandsLeechPatch
{
	[HarmonyPostfix]
	private static void Postfix(PlayerFightController __instance)
	{
		PlayerAvatar val = ((Component)__instance).GetComponent<PlayerAvatar>() ?? ((Component)__instance).GetComponentInParent<PlayerAvatar>();
		if (!((Object)(object)val == (Object)null) && !(RepoPatchPlugin.CausingHurtField == null))
		{
			if ((Object)(object)__instance.LeftArmHurtCollider != (Object)null)
			{
				RepoPatchPlugin.CausingHurtField.SetValue(__instance.LeftArmHurtCollider, val);
			}
			if ((Object)(object)__instance.RightArmHurtCollider != (Object)null)
			{
				RepoPatchPlugin.CausingHurtField.SetValue(__instance.RightArmHurtCollider, val);
			}
		}
	}
}