Decompiled source of LCSteelSting v1.0.2

LCSteelSting.dll

Decompiled 11 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LCSoundTool;
using LCSteelSting.Patches;
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("LCSteelSting")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LCSteelSting")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("791c51a2-dec5-46cb-8518-418e29d80035")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace LCSteelSting
{
	public static class PluginInfo
	{
		public const string modGUID = "LCSteelSting";

		public const string modName = "Steel Sting";

		public const string modVersion = "1.0.2";
	}
	[BepInPlugin("LCSteelSting", "Steel Sting", "1.0.2")]
	public class LCSteelStingBase : BaseUnityPlugin
	{
		private readonly Harmony harmony = new Harmony("LCSteelSting");

		public static LCSteelStingBase Instance;

		public ManualLogSource mls;

		public AudioClip funnySound;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("LCSteelSting");
			mls.LogInfo((object)"Steel Sting has awaken");
			funnySound = SoundTool.GetAudioClip("ZetaArcade-LCSteelSting", "SteelSting.mp3");
			mls.LogInfo((object)("Loaded sound file: " + ((Object)funnySound).name));
			harmony.PatchAll(typeof(LCSteelStingBase));
			harmony.PatchAll(typeof(StartOfRoundPatch));
			mls.LogInfo((object)"Steel Sting loaded");
		}
	}
}
namespace LCSteelSting.Patches
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPatch("ShipLeaveAutomatically")]
		[HarmonyPostfix]
		private static void ShipLeaveAutomatically(ref bool ___allPlayersDead)
		{
			if (___allPlayersDead)
			{
				LCSteelStingBase.Instance.mls.LogInfo((object)"Trying to play sound");
				HUDManager.Instance.UIAudio.PlayOneShot(LCSteelStingBase.Instance.funnySound);
			}
		}
	}
}