Decompiled source of KnotBugFixes v1.0.2

KnotBugFixes.dll

Decompiled 3 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
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: AssemblyTitle("KnotTraining")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("KnotTraining")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("88F9C74C-FD33-4630-AED1-0D8357C98ACF")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[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;
		}
	}
}
[HarmonyPatch(typeof(Attack), "OnAttackTrigger")]
public class Attack_OnAttackTrigger : MonoBehaviour
{
	public static bool Prefix(Attack __instance)
	{
		if (Object.op_Implicit((Object)(object)__instance.m_character) && !((Character)__instance.m_character).IsPlayer() && ((Character)__instance.m_character).IsStaggering())
		{
			return false;
		}
		return true;
	}
}
namespace KnotBugFixes
{
	[BepInPlugin("knot.bugfixes", "KnotBugFixes", "1.0.2")]
	public class Main : BaseUnityPlugin
	{
		private const string pluginGUID = "knot.bugfixes";

		private const string pluginName = "KnotBugFixes";

		private const string pluginVersion = "1.0.2";

		private static GameObject? bugfixes = null;

		private readonly Harmony HarmonyInstance = new Harmony("knot.bugfixes");

		public static ManualLogSource logger = Logger.CreateLogSource("KnotBugFixes");

		public static string Tag = "knot.bugfixes.KnotBugFixes";

		public static bool Enabled => Object.op_Implicit((Object)(object)bugfixes);

		public void Awake()
		{
			logger.LogInfo((object)"KnotBugFixes 1.0.2 mod loaded");
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			HarmonyInstance.PatchAll(executingAssembly);
		}

		public static void Remove()
		{
			if (Object.op_Implicit((Object)(object)bugfixes))
			{
				Object.Destroy((Object)(object)bugfixes);
			}
			bugfixes = null;
		}
	}
}