Decompiled source of EmoCompany v1.0.0

EmoCompany.dll

Decompiled 8 hours ago
using System;
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 EmoCompany.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("EmoCompany")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EmoCompany")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e37961e3-9956-440a-a1fe-b8a082588ecf")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace EmoCompany
{
	[BepInPlugin("HulaBoop.EmoCompany", "EmoCompany", "1.0.0.0")]
	public class EmoCompanyBase : BaseUnityPlugin
	{
		private const string modGUID = "HulaBoop.EmoCompany";

		private const string modName = "EmoCompany";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("HulaBoop.EmoCompany");

		private static EmoCompanyBase Instance;

		internal ManualLogSource manualLogSource;

		internal static List<AudioClip> audioClipList;

		internal static AssetBundle Bundle;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			manualLogSource = Logger.CreateLogSource("HulaBoop.EmoCompany");
			manualLogSource.LogInfo((object)"RAWR means I love you in dinosaur =]<3. EmoCompany loaded.");
			harmony.PatchAll(typeof(StartOfRoundPatch));
			manualLogSource = ((BaseUnityPlugin)this).Logger;
			audioClipList = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("EmoCompany.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "emocompany");
			if ((Object)(object)Bundle != (Object)null)
			{
				manualLogSource.LogInfo((object)"Successfully loaded asset bundle");
				audioClipList = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				manualLogSource.LogError((object)"Failed to load asset bundle");
			}
		}
	}
}
namespace EmoCompany.Patches
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(StartOfRound __instance)
		{
			Random random = new Random();
			int index = random.Next(0, 7);
			__instance.shipIntroSpeechSFX = EmoCompanyBase.audioClipList[index];
		}
	}
}