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 HarmonyLib;
using MyChemicalCompany.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("MyChemicalCompany")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MyChemicalCompany")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("334d9b4a-6a98-450a-9c85-8d02f27db3bd")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace MyChemicalCompany
{
[BepInPlugin("HulaBoop.MyChemicalCompany", "MyChemicalCompany", "1.0.0.3")]
public class MyChemicalCompanyBase : BaseUnityPlugin
{
private const string modGUID = "HulaBoop.MyChemicalCompany";
private const string modName = "MyChemicalCompany";
private const string modVersion = "1.0.0.3";
private readonly Harmony harmony = new Harmony("HulaBoop.MyChemicalCompany");
private static MyChemicalCompanyBase 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.MyChemicalCompany");
manualLogSource.LogInfo((object)"It's not a phase, mom.");
harmony.PatchAll(typeof(StartOfRoundPatch));
manualLogSource = ((BaseUnityPlugin)this).Logger;
audioClipList = new List<AudioClip>();
string location = ((BaseUnityPlugin)Instance).Info.Location;
location = location.TrimEnd("MyChemicalCompany.dll".ToCharArray());
Bundle = AssetBundle.LoadFromFile(location + "mychemicalromance");
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 MyChemicalCompany.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 = MyChemicalCompanyBase.audioClipList[index];
}
}
}