Decompiled source of FallCompany v1.0.0

FallCompany.dll

Decompiled 6 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 FallCompany.Patches;
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: AssemblyTitle("FallCompany")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FallCompany")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("95383ea6-c6b2-45a3-9440-71f51a4b418d")]
[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 FallCompany
{
	[BepInPlugin("Spiders.FallCompany", "Hilarious Company", "1.0.0.0")]
	public class FallCompany : BaseUnityPlugin
	{
		private const string modGUID = "Spiders.FallCompany";

		private const string modName = "Hilarious Company";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("Spiders.FallCompany");

		private static FallCompany Instance;

		internal ManualLogSource mls;

		internal static List<AudioClip> SoundFX;

		internal static AssetBundle Bundle;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Spiders.FallCompany");
			mls.LogInfo((object)"The test mod has awaken :)");
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			SoundFX = new List<AudioClip>();
			string location2 = ((BaseUnityPlugin)Instance).Info.Location;
			location2 = location2.TrimEnd("FallCompany.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location2 + "creditsfallsounds");
			if ((Object)(object)Bundle != (Object)null)
			{
				SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"FAILED TO LOAD ASSET BUNDLE");
			}
			harmony.PatchAll(typeof(FallCompany));
			harmony.PatchAll(typeof(FallDeathSoundPatch));
		}
	}
}
namespace FallCompany.Patches
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class FallDeathSoundPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void fallDeathSoundPatch(StartOfRound __instance)
		{
			__instance.playerFallDeath = FallCompany.SoundFX[0];
		}
	}
}