using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using CruiserAudioPatch;
using CruiserAudioReplacement;
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("FireCat.CruiserAudio")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FireCat.CruiserAudio")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("324cce68-56ac-46f6-8c2d-4a7473db331c")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace CruiserAudioReplacement
{
[BepInPlugin("Firecat.CruiserAudio", "Lethal Fuzz Cruiser Audio Replacement", "0.8.1")]
public class LFCruiserAudioBase : BaseUnityPlugin
{
private const string modGUID = "Firecat.CruiserAudio";
private const string modName = "Lethal Fuzz Cruiser Audio Replacement";
private const string modVersion = "0.8.1";
private readonly Harmony harmony = new Harmony("Firecat.CruiserAudio");
private static LFCruiserAudioBase instance;
internal static AudioClip[] cruiserSFX;
internal static AudioClip[] cruiserRadioSongs;
private void Awake()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
if ((Object)instance == (Object)null)
{
instance = this;
}
string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "cruiseraudiopack");
AssetBundle val = AssetBundle.LoadFromFile(text);
cruiserSFX = val.LoadAllAssets<AudioClip>();
AudioClip[] array = cruiserSFX;
foreach (AudioClip val2 in array)
{
Debug.Log((object)("Loaded Cruiser audio file: " + ((Object)val2).name));
}
string text2 = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "cruiserradiobundle");
AssetBundle val3 = AssetBundle.LoadFromFile(text2);
cruiserRadioSongs = val3.LoadAllAssets<AudioClip>();
AudioClip[] array2 = cruiserRadioSongs;
foreach (AudioClip val4 in array2)
{
Debug.Log((object)("Loaded Cruiser audio file: " + ((Object)val4).name));
}
harmony.PatchAll(typeof(VehicleControllerPatch));
}
}
}
namespace CruiserAudioPatch
{
[HarmonyPatch(typeof(VehicleController))]
internal class VehicleControllerPatch
{
[HarmonyPatch(typeof(VehicleController), "Awake")]
[HarmonyPostfix]
private static void AudioAwakePatch(VehicleController __instance)
{
__instance.hornAudio.clip = LFCruiserAudioBase.cruiserSFX[1];
Debug.Log((object)("Cruiser horn sound replaced with " + (object)LFCruiserAudioBase.cruiserSFX[1]));
__instance.extremeStressAudio.clip = LFCruiserAudioBase.cruiserSFX[2];
Debug.Log((object)("Extreme stress sound replaced with " + (object)LFCruiserAudioBase.cruiserSFX[2]));
__instance.radioClips = LFCruiserAudioBase.cruiserRadioSongs;
}
}
}