Decompiled source of DashGlassBreaker v1.1.0

DashGlassBreaker.dll

Decompiled 2 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
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.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("DashGlassBreaker")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DashGlassBreaker")]
[assembly: AssemblyTitle("DashGlassBreaker")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace DashGlassBreaker;

[BepInPlugin("dashglassbreaker.ultranoob.ultrakill", "DashGlassBreaker", "1.1.0")]
public class DashGlassBreaker : BaseUnityPlugin
{
	private Harmony harmony;

	private void Awake()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		harmony = new Harmony("dashglassbreaker.ultranoob.ultrakill");
		harmony.PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"DashGlassBreaker mod loaded!");
	}
}
[HarmonyPatch]
public class DashGlassPatch
{
	private static MethodBase TargetMethod()
	{
		return typeof(NewMovement).GetMethod("Dodge", BindingFlags.Instance | BindingFlags.NonPublic);
	}

	private static void Postfix(NewMovement __instance)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		Vector3 position = ((Component)__instance).transform.position;
		float num = 1f;
		Collider[] array = Physics.OverlapSphere(position, num);
		Collider[] array2 = array;
		foreach (Collider val in array2)
		{
			Glass componentInParent = ((Component)val).GetComponentInParent<Glass>();
			if ((Object)(object)componentInParent != (Object)null && !componentInParent.broken)
			{
				componentInParent.Shatter();
				Vector3 val2 = val.ClosestPoint(position);
				if ((Object)(object)MonoSingleton<PhysicsSounds>.Instance != (Object)null)
				{
					MonoSingleton<PhysicsSounds>.Instance.ImpactAt(val2, 10f, (PhysMaterial)5);
				}
			}
		}
	}
}
[HarmonyPatch(typeof(Shockwave), "OnTriggerEnter")]
public class ShockwaveGlassPatch
{
	private static void Postfix(Shockwave __instance, Collider other)
	{
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		if (!__instance.groundSlam)
		{
			return;
		}
		Glass componentInParent = ((Component)other).GetComponentInParent<Glass>();
		if ((Object)(object)componentInParent != (Object)null && !componentInParent.broken)
		{
			componentInParent.Shatter();
			Vector3 val = other.ClosestPoint(((Component)__instance).transform.position);
			if ((Object)(object)MonoSingleton<PhysicsSounds>.Instance != (Object)null)
			{
				MonoSingleton<PhysicsSounds>.Instance.ImpactAt(val, 15f, (PhysMaterial)5);
			}
		}
	}
}