using System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using LCSoundTool; 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("BarkFartLandmine")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("BarkFartLandmine")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("78c1e07a-ad83-4353-a178-0de7ffe262d6")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace BarkFartLandmine; [BepInPlugin("NinaJuchkova.BarkFartLandmine", "Bark Fart Landmine", "1.1.0")] public class BarkFartBase : BaseUnityPlugin { private const string modGUID = "NinaJuchkova.BarkFartLandmine"; private const string modName = "Bark Fart Landmine"; private const string modVersion = "1.1.0"; private static ConfigEntry volumePercent; private void Awake() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; volumePercent = ((BaseUnityPlugin)this).Config.Bind("General", "Volume", 100, new ConfigDescription("Bark Fart Volume Percentage (0% = silent, 100% = original, 300% = triple).", (AcceptableValueBase)(object)new AcceptableValueRange(0, 300), Array.Empty())); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Loading BarkFartLandmine"); string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "barkfartbundle"); AssetBundle val = AssetBundle.LoadFromFile(text); if ((Object)(object)val == (Object)null) { ((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load bundle!"); return; } AudioClip val2 = val.LoadAsset("MineTrigger"); AudioClip val3 = val.LoadAsset("MineDetonate"); AudioClip val4 = val.LoadAsset("MineDetonateFar"); if ((Object)(object)val2 == (Object)null || (Object)(object)val4 == (Object)null || (Object)(object)val3 == (Object)null) { ((BaseUnityPlugin)this).Logger.LogError((object)"Missing audio clips in bundle!"); return; } float multiplier = (float)volumePercent.Value / 100f; ApplyVolume(val2, multiplier); ApplyVolume(val3, multiplier); ApplyVolume(val4, multiplier); SoundTool.ReplaceAudioClip("MineTrigger", val2); SoundTool.ReplaceAudioClip("MineDetonate", val3); SoundTool.ReplaceAudioClip("MineDetonateFar", val4); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Bark Fart initiated."); } private static void ApplyVolume(AudioClip clip, float multiplier) { if (multiplier != 1f) { float[] array = new float[clip.samples * clip.channels]; clip.GetData(array, 0); for (int i = 0; i < array.Length; i++) { array[i] = Mathf.Clamp(array[i] * multiplier, -1f, 1f); } clip.SetData(array, 0); } } }