using System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("LegoBreakingSfx")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("LegoBreakingSfx")] [assembly: AssemblyTitle("LegoBreakingSfx")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LegoBreakingSfx { public class AssetStorage : MonoBehaviour { private static AssetStorage _instance; private AssetBundle _bundle; public static AssetStorage Instance => _instance; private void Awake() { if ((Object)(object)_instance == (Object)null) { _instance = this; } string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); _bundle = AssetBundle.LoadFromFile(Path.Combine(directoryName, "legobreakingsfx")); if ((Object)(object)_bundle == (Object)null) { LegoBreakingSfx.Logger.LogError((object)"Failed to load bundle"); } } public T LoadAsset(string path) where T : Object { return _bundle.LoadAsset(path); } } [BepInPlugin("com.d4navi0.LegoBreakingSfx", "Lego Breaking SFX", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class LegoBreakingSfx : BaseUnityPlugin { internal class LegoBreakingSfxInfo { internal const string NAME = "Lego Breaking SFX"; internal const string GUID = "com.d4navi0.LegoBreakingSfx"; internal const string VERSION = "1.0.0"; } internal static ManualLogSource Logger; private readonly Harmony harmony = new Harmony("com.d4navi0.LegoBreakingSfx"); private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; Logger.LogInfo((object)"Lego breaking sfx mod loaded"); ((Component)this).gameObject.AddComponent(); harmony.PatchAll(); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "LegoBreakingSfx"; public const string PLUGIN_NAME = "LegoBreakingSfx"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace LegoBreakingSfx.patches { [HarmonyPatch] public static class CentaurDeath_Patch { [HarmonyPatch(typeof(CentaurDeath), "Start")] [HarmonyPrefix] private static void CentaurDeathStartPatch(CentaurDeath __instance) { LegoBreakingSfx.Logger.LogInfo((object)"*lego breaking sfx*"); if (!((Object)(object)__instance == (Object)null)) { AudioSource obj = ((Component)__instance).gameObject.AddComponent(); obj.playOnAwake = false; obj.clip = AssetStorage.Instance.LoadAsset("lego_breaking"); obj.bypassEffects = true; AudioSourceExtensions.PlayOneShot(obj, AssetStorage.Instance.LoadAsset("lego_breaking"), MonoSingleton.Instance.sfxVolume * 4f, true); } } } }