Decompiled source of HardStyle v1.2.0

HardStyle/HardStyle.dll

Decompiled a month ago
using System;
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 BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using ULTRAKILL.Cheats;
using UnityEngine;
using UnityEngine.UI;

[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: IgnoresAccessChecksTo("0Harmony")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("BepInEx")]
[assembly: IgnoresAccessChecksTo("Microsoft.Win32.Primitives")]
[assembly: IgnoresAccessChecksTo("Mono.Cecil")]
[assembly: IgnoresAccessChecksTo("Mono.Cecil.Mdb")]
[assembly: IgnoresAccessChecksTo("Mono.Cecil.Pdb")]
[assembly: IgnoresAccessChecksTo("Mono.Cecil.Rocks")]
[assembly: IgnoresAccessChecksTo("MonoMod.RuntimeDetour")]
[assembly: IgnoresAccessChecksTo("MonoMod.Utils")]
[assembly: IgnoresAccessChecksTo("mscorlib")]
[assembly: IgnoresAccessChecksTo("netstandard")]
[assembly: IgnoresAccessChecksTo("System.AppContext")]
[assembly: IgnoresAccessChecksTo("System.Buffers")]
[assembly: IgnoresAccessChecksTo("System.Collections.Concurrent")]
[assembly: IgnoresAccessChecksTo("System.Collections")]
[assembly: IgnoresAccessChecksTo("System.Collections.NonGeneric")]
[assembly: IgnoresAccessChecksTo("System.Collections.Specialized")]
[assembly: IgnoresAccessChecksTo("System.ComponentModel.Composition")]
[assembly: IgnoresAccessChecksTo("System.ComponentModel")]
[assembly: IgnoresAccessChecksTo("System.ComponentModel.EventBasedAsync")]
[assembly: IgnoresAccessChecksTo("System.ComponentModel.Primitives")]
[assembly: IgnoresAccessChecksTo("System.ComponentModel.TypeConverter")]
[assembly: IgnoresAccessChecksTo("System.Console")]
[assembly: IgnoresAccessChecksTo("System.Core")]
[assembly: IgnoresAccessChecksTo("System.Data.Common")]
[assembly: IgnoresAccessChecksTo("System.Data")]
[assembly: IgnoresAccessChecksTo("System.Diagnostics.Contracts")]
[assembly: IgnoresAccessChecksTo("System.Diagnostics.Debug")]
[assembly: IgnoresAccessChecksTo("System.Diagnostics.FileVersionInfo")]
[assembly: IgnoresAccessChecksTo("System.Diagnostics.Process")]
[assembly: IgnoresAccessChecksTo("System.Diagnostics.StackTrace")]
[assembly: IgnoresAccessChecksTo("System.Diagnostics.TextWriterTraceListener")]
[assembly: IgnoresAccessChecksTo("System.Diagnostics.Tools")]
[assembly: IgnoresAccessChecksTo("System.Diagnostics.TraceSource")]
[assembly: IgnoresAccessChecksTo("System.Diagnostics.Tracing")]
[assembly: IgnoresAccessChecksTo("System")]
[assembly: IgnoresAccessChecksTo("System.Drawing")]
[assembly: IgnoresAccessChecksTo("System.Drawing.Primitives")]
[assembly: IgnoresAccessChecksTo("System.Dynamic.Runtime")]
[assembly: IgnoresAccessChecksTo("System.Globalization.Calendars")]
[assembly: IgnoresAccessChecksTo("System.Globalization")]
[assembly: IgnoresAccessChecksTo("System.Globalization.Extensions")]
[assembly: IgnoresAccessChecksTo("System.IO.Compression")]
[assembly: IgnoresAccessChecksTo("System.IO.Compression.FileSystem")]
[assembly: IgnoresAccessChecksTo("System.IO.Compression.ZipFile")]
[assembly: IgnoresAccessChecksTo("System.IO")]
[assembly: IgnoresAccessChecksTo("System.IO.FileSystem")]
[assembly: IgnoresAccessChecksTo("System.IO.FileSystem.DriveInfo")]
[assembly: IgnoresAccessChecksTo("System.IO.FileSystem.Primitives")]
[assembly: IgnoresAccessChecksTo("System.IO.FileSystem.Watcher")]
[assembly: IgnoresAccessChecksTo("System.IO.IsolatedStorage")]
[assembly: IgnoresAccessChecksTo("System.IO.MemoryMappedFiles")]
[assembly: IgnoresAccessChecksTo("System.IO.Pipes")]
[assembly: IgnoresAccessChecksTo("System.IO.UnmanagedMemoryStream")]
[assembly: IgnoresAccessChecksTo("System.Linq")]
[assembly: IgnoresAccessChecksTo("System.Linq.Expressions")]
[assembly: IgnoresAccessChecksTo("System.Linq.Parallel")]
[assembly: IgnoresAccessChecksTo("System.Linq.Queryable")]
[assembly: IgnoresAccessChecksTo("System.Memory")]
[assembly: IgnoresAccessChecksTo("System.Net")]
[assembly: IgnoresAccessChecksTo("System.Net.Http")]
[assembly: IgnoresAccessChecksTo("System.Net.NameResolution")]
[assembly: IgnoresAccessChecksTo("System.Net.NetworkInformation")]
[assembly: IgnoresAccessChecksTo("System.Net.Ping")]
[assembly: IgnoresAccessChecksTo("System.Net.Primitives")]
[assembly: IgnoresAccessChecksTo("System.Net.Requests")]
[assembly: IgnoresAccessChecksTo("System.Net.Security")]
[assembly: IgnoresAccessChecksTo("System.Net.Sockets")]
[assembly: IgnoresAccessChecksTo("System.Net.WebHeaderCollection")]
[assembly: IgnoresAccessChecksTo("System.Net.WebSockets.Client")]
[assembly: IgnoresAccessChecksTo("System.Net.WebSockets")]
[assembly: IgnoresAccessChecksTo("System.Numerics")]
[assembly: IgnoresAccessChecksTo("System.Numerics.Vectors")]
[assembly: IgnoresAccessChecksTo("System.ObjectModel")]
[assembly: IgnoresAccessChecksTo("System.Reflection.DispatchProxy")]
[assembly: IgnoresAccessChecksTo("System.Reflection")]
[assembly: IgnoresAccessChecksTo("System.Reflection.Emit")]
[assembly: IgnoresAccessChecksTo("System.Reflection.Emit.ILGeneration")]
[assembly: IgnoresAccessChecksTo("System.Reflection.Emit.Lightweight")]
[assembly: IgnoresAccessChecksTo("System.Reflection.Extensions")]
[assembly: IgnoresAccessChecksTo("System.Reflection.Primitives")]
[assembly: IgnoresAccessChecksTo("System.Reflection.TypeExtensions")]
[assembly: IgnoresAccessChecksTo("System.Resources.Reader")]
[assembly: IgnoresAccessChecksTo("System.Resources.ResourceManager")]
[assembly: IgnoresAccessChecksTo("System.Resources.Writer")]
[assembly: IgnoresAccessChecksTo("System.Runtime.CompilerServices.VisualC")]
[assembly: IgnoresAccessChecksTo("System.Runtime")]
[assembly: IgnoresAccessChecksTo("System.Runtime.Extensions")]
[assembly: IgnoresAccessChecksTo("System.Runtime.Handles")]
[assembly: IgnoresAccessChecksTo("System.Runtime.InteropServices")]
[assembly: IgnoresAccessChecksTo("System.Runtime.InteropServices.RuntimeInformation")]
[assembly: IgnoresAccessChecksTo("System.Runtime.Numerics")]
[assembly: IgnoresAccessChecksTo("System.Runtime.Serialization")]
[assembly: IgnoresAccessChecksTo("System.Runtime.Serialization.Formatters")]
[assembly: IgnoresAccessChecksTo("System.Runtime.Serialization.Json")]
[assembly: IgnoresAccessChecksTo("System.Runtime.Serialization.Primitives")]
[assembly: IgnoresAccessChecksTo("System.Runtime.Serialization.Xml")]
[assembly: IgnoresAccessChecksTo("System.Security.Claims")]
[assembly: IgnoresAccessChecksTo("System.Security.Cryptography.Algorithms")]
[assembly: IgnoresAccessChecksTo("System.Security.Cryptography.Csp")]
[assembly: IgnoresAccessChecksTo("System.Security.Cryptography.Encoding")]
[assembly: IgnoresAccessChecksTo("System.Security.Cryptography.Primitives")]
[assembly: IgnoresAccessChecksTo("System.Security.Cryptography.X509Certificates")]
[assembly: IgnoresAccessChecksTo("System.Security.Principal")]
[assembly: IgnoresAccessChecksTo("System.Security.SecureString")]
[assembly: IgnoresAccessChecksTo("System.ServiceModel.Web")]
[assembly: IgnoresAccessChecksTo("System.Text.Encoding")]
[assembly: IgnoresAccessChecksTo("System.Text.Encoding.Extensions")]
[assembly: IgnoresAccessChecksTo("System.Text.RegularExpressions")]
[assembly: IgnoresAccessChecksTo("System.Threading")]
[assembly: IgnoresAccessChecksTo("System.Threading.Overlapped")]
[assembly: IgnoresAccessChecksTo("System.Threading.Tasks")]
[assembly: IgnoresAccessChecksTo("System.Threading.Tasks.Extensions")]
[assembly: IgnoresAccessChecksTo("System.Threading.Tasks.Parallel")]
[assembly: IgnoresAccessChecksTo("System.Threading.Thread")]
[assembly: IgnoresAccessChecksTo("System.Threading.ThreadPool")]
[assembly: IgnoresAccessChecksTo("System.Threading.Timer")]
[assembly: IgnoresAccessChecksTo("System.Transactions")]
[assembly: IgnoresAccessChecksTo("System.ValueTuple")]
[assembly: IgnoresAccessChecksTo("System.Web")]
[assembly: IgnoresAccessChecksTo("System.Windows")]
[assembly: IgnoresAccessChecksTo("System.Xml")]
[assembly: IgnoresAccessChecksTo("System.Xml.Linq")]
[assembly: IgnoresAccessChecksTo("System.Xml.ReaderWriter")]
[assembly: IgnoresAccessChecksTo("System.Xml.Serialization")]
[assembly: IgnoresAccessChecksTo("System.Xml.XDocument")]
[assembly: IgnoresAccessChecksTo("System.Xml.XmlDocument")]
[assembly: IgnoresAccessChecksTo("System.Xml.XmlSerializer")]
[assembly: IgnoresAccessChecksTo("System.Xml.XPath")]
[assembly: IgnoresAccessChecksTo("System.Xml.XPath.XDocument")]
[assembly: IgnoresAccessChecksTo("Unity.Addressables")]
[assembly: IgnoresAccessChecksTo("UnityEngine.AccessibilityModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.AIModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.AndroidJNIModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.AnimationModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.AssetBundleModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.AudioModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ClothModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ClusterInputModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ClusterRendererModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ContentLoadModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.CoreModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.CrashReportingModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.DirectorModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine")]
[assembly: IgnoresAccessChecksTo("UnityEngine.DSPGraphModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.GameCenterModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.GIModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.GridModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.HotReloadModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ImageConversionModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.IMGUIModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.InputLegacyModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.InputModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.JSONSerializeModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.LocalizationModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ParticleSystemModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.PerformanceReportingModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.Physics2DModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.PhysicsModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ProfilerModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.PropertiesModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ScreenCaptureModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.SharedInternalsModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.SpriteMaskModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.SpriteShapeModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.StreamingModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.SubstanceModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.SubsystemsModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.TerrainModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.TerrainPhysicsModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.TextCoreFontEngineModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.TextCoreTextEngineModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.TextRenderingModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.TilemapModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.TLSModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UIElementsModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UIModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UmbraModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UnityAnalyticsCommonModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UnityAnalyticsModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UnityConnectModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UnityCurlModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UnityTestProtocolModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UnityWebRequestModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.VehiclesModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.VFXModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.VideoModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.VirtualTexturingModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.VRModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.WindModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.XRModule")]
[assembly: AssemblyCompany("HardStyle")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+8f7e940514b1b811858a3ac78728e519b5f81873")]
[assembly: AssemblyProduct("HardStyle")]
[assembly: AssemblyTitle("HardStyle")]
[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.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = 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;
		}
	}
}
namespace HardStyle
{
	internal static class PluginInfo
	{
		public const string PLUGIN_GUID = "com.blaixenu.hardstyle";

		public const string PLUGIN_NAME = "HardStyle";

		public const string PLUGIN_VERSION = "1.2.0";
	}
	[HarmonyPatch]
	[BepInPlugin("com.blaixenu.hardstyle", "HardStyle", "1.2.0")]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Logger { get; private set; }

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"Plugin com.blaixenu.hardstyle loaded! Yippee!!!");
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)4;
			DoPatching();
		}

		private static void DoPatching()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("com.blaixenu.hardstyle");
			val.PatchAll();
		}

		[HarmonyPostfix]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		private static void ScoresSubmission(ref bool __result)
		{
			__result = false;
		}
	}
	[HarmonyPatch]
	public class Debug
	{
		public static bool DEBUG_MODE;

		[HarmonyPrefix]
		[HarmonyPatch(typeof(BloodsplatterManager), "GetGore", new Type[]
		{
			typeof(GoreType),
			typeof(bool),
			typeof(bool),
			typeof(bool),
			typeof(EnemyIdentifier),
			typeof(bool)
		})]
		private static void GetGoreDebugger(ref EnemyIdentifier eid)
		{
			if (DEBUG_MODE)
			{
				Plugin.Logger.LogInfo((object)"BloodsplatterManager.GetGore() called.");
				if ((Object)(object)eid != (Object)null)
				{
					Plugin.Logger.LogInfo((object)$"EnemyIdentifier value non-null, value: {eid}");
				}
			}
		}
	}
	[HarmonyPatch]
	public class HardDamagePatches
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(NewMovement), "GetHurt")]
		private static void GetHurtPatch(ref float hardDamageMultiplier)
		{
			hardDamageMultiplier = 0f;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(NewMovement), "ForceAntiHP")]
		private static bool ForceAntiHPPatch()
		{
			return false;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(HealthBar), "Start")]
		private static void HealthBarStartPatch(ref HealthBar __instance)
		{
			Slider val;
			if ((Object)(object)__instance.antiHpSlider != (Object)null)
			{
				val = __instance.antiHpSlider;
			}
			else
			{
				if (!Object.op_Implicit((Object)(object)((Component)__instance).gameObject.transform.Find("AntiHealth Slider")))
				{
					return;
				}
				val = ((Component)((Component)__instance).gameObject.transform.Find("AntiHealth Slider")).GetComponent<Slider>();
			}
			((Component)val).gameObject.SetActive(false);
			__instance.antiHpSlider = null;
		}
	}
	[HarmonyPatch]
	public class HealingPatches
	{
		private static float healStep = 1f / 30f;

		private static List<float> healMultipliers = new List<float>(8)
		{
			0.1f,
			0.1f + healStep,
			0.1f + 2f * healStep,
			0.1f + 3f * healStep,
			0.1f + 4f * healStep,
			0.1f + 5f * healStep,
			0.3f,
			1f
		};

		private static float HealFactor => healMultipliers[MonoSingleton<StyleHUD>.Instance.rankIndex];

		[HarmonyPrefix]
		[HarmonyPatch(typeof(Bloodsplatter), "Collide")]
		private static void BloodHealPrefix(ref Bloodsplatter __instance, ref int __state)
		{
			__state = __instance.hpAmount;
			Object val = Object.FindObjectFromInstanceID(__instance.eidID);
			if (val == (Object)null)
			{
				if (Debug.DEBUG_MODE)
				{
					if (val == null)
					{
						Plugin.Logger.LogInfo((object)"Bloodsplatter.eid is null.");
					}
					else
					{
						Plugin.Logger.LogInfo((object)"Bloodsplatter.eid is destroyed.");
					}
				}
				return;
			}
			if (Debug.DEBUG_MODE)
			{
				Plugin.Logger.LogInfo((object)("Bloodsplatter.eid object name: " + val.name));
			}
			EnemyIdentifier val2 = (EnemyIdentifier)(object)((val is EnemyIdentifier) ? val : null);
			string text = val2?.hitter;
			string text2 = text;
			if (text2 == "drill")
			{
				__instance.hpAmount = Mathf.RoundToInt((float)__instance.hpAmount * 0.5f);
			}
			else
			{
				__instance.hpAmount = Mathf.RoundToInt((float)__instance.hpAmount * HealFactor);
			}
			if (Debug.DEBUG_MODE)
			{
				Plugin.Logger.LogInfo((object)$"Enemy hit, EnemyIdentifier found ({val2}), emit blood for {__instance.hpAmount} HP");
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Bloodsplatter), "Collide")]
		private static void BloodHealPostfix(ref Bloodsplatter __instance, ref int __state)
		{
			__instance.hpAmount = __state;
		}

		[HarmonyTranspiler]
		[HarmonyPatch(typeof(NewMovement), "Parry")]
		private static IEnumerable<CodeInstruction> ParryPatch(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Expected O, but got Unknown
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			CodeMatcher val = new CodeMatcher(instructions, generator);
			val.Start().MatchForward(true, (CodeMatch[])(object)new CodeMatch[2]
			{
				new CodeMatch((OpCode?)OpCodes.Stfld, (object)AccessTools.Field(typeof(NewMovement), "exploded"), (string)null),
				new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null)
			}).SetAndAdvance(OpCodes.Nop, (object)null)
				.SetAndAdvance(OpCodes.Nop, (object)null)
				.SetAndAdvance(OpCodes.Nop, (object)null)
				.SetAndAdvance(OpCodes.Nop, (object)null)
				.SetAndAdvance(OpCodes.Nop, (object)null)
				.Set(OpCodes.Nop, (object)null);
			return val.InstructionEnumeration();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(NewMovement), "Parry")]
		private static void ParryPostfix(ref NewMovement __instance)
		{
			float num = (float)(100 - __instance.hp) * HealFactor;
			__instance.GetHealth(Mathf.RoundToInt(num), false, false, true);
		}
	}
	[HarmonyPatch]
	public class MiscPatches
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(SpiderBody), "GetHurt")]
		private static bool MalfaceFix(ref SpiderBody __instance, ref GameObject target, ref Vector3 force, ref Vector3 hitPoint, ref float multiplier, ref GameObject sourceWeapon)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_044b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0450: Unknown result type (might be due to invalid IL or missing references)
			//IL_0525: Unknown result type (might be due to invalid IL or missing references)
			//IL_0713: Unknown result type (might be due to invalid IL or missing references)
			//IL_0657: Unknown result type (might be due to invalid IL or missing references)
			//IL_065c: Unknown result type (might be due to invalid IL or missing references)
			if (MonoSingleton<NewMovement>.Instance.hp < 50)
			{
				return true;
			}
			BloodsplatterManager instance = MonoSingleton<BloodsplatterManager>.Instance;
			bool flag = false;
			float health = __instance.health;
			bool flag2 = true;
			if (hitPoint == Vector3.zero)
			{
				hitPoint = target.transform.position;
			}
			flag2 = instance.goreOn;
			if ((Object)(object)__instance.eid == (Object)null)
			{
				__instance.eid = ((Component)__instance).GetComponent<EnemyIdentifier>();
			}
			if (__instance.eid.hitter != "fire")
			{
				GameObject gore = instance.GetGore((GoreType)3, __instance.eid, false);
				if (Object.op_Implicit((Object)(object)gore))
				{
					gore.transform.position = hitPoint;
					gore.transform.rotation = Quaternion.identity;
				}
				if (!__instance.eid.sandified && !__instance.eid.blessed)
				{
					if (Object.op_Implicit((Object)(object)gore))
					{
						Bloodsplatter component = gore.GetComponent<Bloodsplatter>();
						gore.transform.SetParent(__instance.gz.goreZone, true);
						if (__instance.eid.hitter == "drill")
						{
							Transform transform = gore.transform;
							transform.localScale *= 2f;
						}
						if (__instance.health > 0f)
						{
							component.GetReady();
						}
						if (__instance.eid.hitter == "nail")
						{
							component.hpAmount = 3;
							AudioSource component2 = ((Component)component).GetComponent<AudioSource>();
							component2.volume *= 0.8f;
						}
						else if (multiplier >= 1f)
						{
							component.hpAmount = 30;
						}
						if (flag2)
						{
							gore.GetComponent<ParticleSystem>().Play();
						}
					}
					if (__instance.eid.hitter != "shotgun" && __instance.eid.hitter != "drill" && ((Component)__instance).gameObject.activeInHierarchy)
					{
						if ((Object)(object)__instance.dripBlood != (Object)null)
						{
							__instance.currentDrip = Object.Instantiate<GameObject>(__instance.dripBlood, hitPoint, Quaternion.identity);
						}
						if (Object.op_Implicit((Object)(object)__instance.currentDrip))
						{
							__instance.currentDrip.transform.parent = ((Component)__instance).transform;
							__instance.currentDrip.transform.LookAt(((Component)__instance).transform);
							__instance.currentDrip.transform.Rotate(180f, 180f, 180f);
							if (flag2)
							{
								__instance.currentDrip.GetComponent<ParticleSystem>().Play();
							}
						}
					}
				}
			}
			if (!__instance.eid.dead)
			{
				if (!__instance.eid.blessed && !InvincibleEnemies.Enabled)
				{
					SpiderBody obj = __instance;
					obj.health -= 1f * multiplier;
				}
				if ((Object)(object)__instance.scalc == (Object)null)
				{
					__instance.scalc = MonoSingleton<StyleCalculator>.Instance;
				}
				if (__instance.health <= 0f)
				{
					flag = true;
				}
				if (((__instance.eid.hitter == "shotgunzone" || __instance.eid.hitter == "hammerzone") && __instance.parryable) || __instance.eid.hitter == "punch")
				{
					if (__instance.parryable)
					{
						__instance.parryable = false;
						MonoSingleton<FistControl>.Instance.currentPunch.Parry(false, __instance.eid, "");
						__instance.currentExplosion = Object.Instantiate<GameObject>(AddressablesExtensions.ToAsset(__instance.beamExplosion), ((Component)__instance).transform.position, Quaternion.identity);
						if (!InvincibleEnemies.Enabled && !__instance.eid.blessed)
						{
							SpiderBody obj2 = __instance;
							obj2.health -= (float)((__instance.parryFramesLeft > 0) ? 4 : 5) / __instance.eid.totalHealthModifier;
						}
						Explosion[] componentsInChildren = __instance.currentExplosion.GetComponentsInChildren<Explosion>();
						Explosion[] array = componentsInChildren;
						foreach (Explosion val in array)
						{
							val.speed *= __instance.eid.totalDamageModifier;
							val.maxSize *= 1.75f * __instance.eid.totalDamageModifier;
							val.damage = Mathf.RoundToInt(50f * __instance.eid.totalDamageModifier);
							val.canHit = (AffectedSubjects)2;
							val.friendlyFire = true;
						}
						if ((Object)(object)__instance.currentEnrageEffect == (Object)null)
						{
							((MonoBehaviour)__instance).CancelInvoke("BeamFire");
							((MonoBehaviour)__instance).Invoke("StopWaiting", 1f);
							Object.Destroy((Object)(object)__instance.currentCE);
						}
						__instance.parryFramesLeft = 0;
					}
					else
					{
						__instance.parryFramesLeft = MonoSingleton<FistControl>.Instance.currentPunch.activeFrames;
					}
				}
				if (multiplier != 0f)
				{
					__instance.scalc.HitCalculator(__instance.eid.hitter, "spider", "", flag, __instance.eid, sourceWeapon);
				}
				if (health >= __instance.maxHealth / 2f && __instance.health < __instance.maxHealth / 2f)
				{
					if (__instance.ensims == null || __instance.ensims.Length == 0)
					{
						__instance.ensims = ((Component)__instance).GetComponentsInChildren<EnemySimplifier>();
					}
					Object.Instantiate<GameObject>(__instance.woundedParticle, ((Component)__instance).transform.position, Quaternion.identity);
					if (!__instance.eid.puppet)
					{
						EnemySimplifier[] ensims = __instance.ensims;
						EnemySimplifier[] array2 = ensims;
						foreach (EnemySimplifier val2 in array2)
						{
							if (!val2.ignoreCustomColor)
							{
								val2.ChangeMaterialNew((MaterialState)0, __instance.woundedMaterial);
								val2.ChangeMaterialNew((MaterialState)2, __instance.woundedEnrageMaterial);
							}
						}
					}
				}
				if (Object.op_Implicit((Object)(object)__instance.hurtSound) && health > 0f)
				{
					OneShotAudioExtension.PlayClipAtPoint(__instance.hurtSound, MonoSingleton<AudioMixerController>.Instance.goreGroup, ((Component)__instance).transform.position, 12, 1f, 0.75f, Random.Range(0.85f, 1.35f), (AudioRolloffMode)1, 1f, 100f);
				}
				if (__instance.health <= 0f && !__instance.eid.dead)
				{
					__instance.Die();
				}
			}
			else if (__instance.eid.hitter == "ground slam")
			{
				__instance.BreakCorpse();
			}
			return false;
		}
	}
	internal static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "com.blaixenu.hardstyle";

		public const string PLUGIN_NAME = "HardStyle";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		internal IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}