Decompiled source of HitboxesFix v1.0.0

BepInEx/plugins/HitboxesFix.dll

Decompiled a year ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
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: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("HitboxesFix")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Fixes the hitboxes that prevent you from jumping over the mobs and avoiding them standing on bars")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("HitboxesFix")]
[assembly: AssemblyTitle("HitboxesFix")]
[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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace HitboxesFix
{
	[BepInPlugin("raydenoir.HitboxesFix", "HitboxesFix", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public static ManualLogSource Logging;

		public static ConfigEntry<bool> DisableCrawlerUpperHitbox;

		public static ConfigEntry<bool> DisableSpiderUpperHitbox;

		private void Awake()
		{
			Logging = ((BaseUnityPlugin)this).Logger;
			DisableCrawlerUpperHitbox = ((BaseUnityPlugin)this).Config.Bind<bool>("Hitboxes", "DisableCrawlerUpperHitbox", true, "true/false: If set to true, disables the hitbox that prevents you from jumping over the thumper without getting damage.");
			DisableSpiderUpperHitbox = ((BaseUnityPlugin)this).Config.Bind<bool>("Hitboxes", "DisableSpiderUpperHitbox", true, "true/false: If set to true, disables the hitbox that prevents you from jumping over the spider without getting damage.");
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin raydenoir.HitboxesFix is loaded!");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "HitboxesFix";

		public const string PLUGIN_NAME = "HitboxesFix";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace HitboxesFix.Patches
{
	[HarmonyPatch]
	public class HitboxesPatch : MonoBehaviour
	{
		public static ManualLogSource Logging = Plugin.Logging;

		[HarmonyPatch(typeof(CrawlerAI), "Start")]
		[HarmonyPostfix]
		public static void RemoveCrawlerHitbox(CrawlerAI __instance)
		{
			Logging.LogInfo((object)"AHUET crawler");
			Logging.LogError((object)"Deleting the hitbox");
			Object.Destroy((Object)(object)((Component)((Component)__instance).transform.Find("CrawlerModel").Find("NonJumpingCollider")).gameObject);
			Logging.LogError((object)"Deleted the hitbox");
		}

		[HarmonyPatch(typeof(SandSpiderAI), "Start")]
		[HarmonyPostfix]
		public static void RemoveSpiderHitbox(SandSpiderAI __instance)
		{
			Logging.LogError((object)"AHUET pavuk");
			Logging.LogError((object)"Deleting the script");
			Object.Destroy((Object)(object)((Component)((Component)__instance).transform.Find("MeshContainer").Find("NonJumpCollider")).gameObject.GetComponent<EnemyAICollisionDetect>());
			Logging.LogWarning((object)"Deleted the script");
		}
	}
}