Decompiled source of T1 Proxy Mine v1.0.1

T1ProxyMine/LC_ProximityMine_AA-.dll

Decompiled 10 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LC_ProximityMine_AA_.Patches;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("LC_ProximityMine_AA-")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LC_ProximityMine_AA-")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("ef77c6aa-b9f0-4de7-91ad-4de043f8b3ab")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace LC_ProximityMine_AA_
{
	[BepInPlugin("casoozh.ProxyExplode", "Proximity Explosion Mod", "1.0.0")]
	public class LC_ProximityMine : BaseUnityPlugin
	{
		private const string modGUID = "casoozh.ProxyExplode";

		private const string modName = "Proximity Explosion Mod";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("casoozh.ProxyExplode");

		private static LC_ProximityMine Instance;

		internal ManualLogSource mls;

		internal static List<AudioClip> SFX;

		internal static AssetBundle Bundle;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("casoozh.ProxyExplode");
			mls.LogInfo((object)"Mod Awake");
			harmony.PatchAll(typeof(LandminePatch));
			mls = ((BaseUnityPlugin)this).Logger;
			SFX = new List<AudioClip>();
			Bundle = AssetBundle.LoadFromFile(((BaseUnityPlugin)Instance).Info.Location.TrimEnd("LC_ProximityMine_AA-.dll".ToCharArray()) + "t1 death");
			if ((Object)(object)Bundle != (Object)null)
			{
				mls.LogInfo((object)"Asset Bundle Loade");
				SFX = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"Asset Bundle Failed to Load");
			}
		}
	}
}
namespace LC_ProximityMine_AA_.Patches
{
	[HarmonyPatch(typeof(Landmine))]
	internal class LandminePatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPrefix]
		private static void OverideAudio(Landmine __instance)
		{
			__instance.mineDetonate = LC_ProximityMine.SFX[0];
		}
	}
}