Decompiled source of TheGameSFX v1.0.0

TheGame.dll

Decompiled a year 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 TheGame.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("TheGame")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TheGame")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("37cd7158-0e93-4137-a578-2c29ab1951c4")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace TheGame
{
	[BepInPlugin("Ex.TheGameSFXMod", "Ex The Game SFX Mod", "1.0.0")]
	public class TheGameBase : BaseUnityPlugin
	{
		private const string modGUID = "Ex.TheGameSFXMod";

		private const string modName = "Ex The Game SFX Mod";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Ex.TheGameSFXMod");

		private static TheGameBase Instance;

		internal ManualLogSource mls;

		internal static AudioClip newShipAlarmSFX;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Ex.TheGameSFXMod");
			mls.LogInfo((object)"The Game SFX mod has initiated");
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			string text = "TheGame.dll";
			string text2 = location.TrimEnd(text.ToCharArray());
			string text3 = text2 + "TheGameSFX";
			AssetBundle val = AssetBundle.LoadFromFile(text3);
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load audio assets!");
				return;
			}
			newShipAlarmSFX = val.LoadAsset<AudioClip>("Assets/TheGame.mp3");
			harmony.PatchAll(typeof(TheGameBase));
			harmony.PatchAll(typeof(TheGamePatch));
			mls.LogInfo((object)"You have lost The Game.");
		}
	}
}
namespace TheGame.Patches
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class TheGamePatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void TheGameSFXPatch(StartOfRound __instance, ref AudioClip ___alarmSFX)
		{
			___alarmSFX = TheGameBase.newShipAlarmSFX;
			__instance.shipDoorAudioSource.volume = 1f;
		}
	}
}