Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of TsundereBracken v1.1.0
LC_TsundereBracken.dll
Decompiled 2 months agousing System.Collections.Generic; using System.Diagnostics; using System.IO; 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 UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("LC_TsundereBracken")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LC_TsundereBracken")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("c4fccb21-8a64-4521-a634-6841d9680f4b")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace LC_MyEnemySound; [HarmonyPatch(typeof(FlowermanAI))] internal class FlowermanAIPatch { private static readonly HashSet<int> logged = new HashSet<int>(); private static float _nextPlayTime = 0f; [HarmonyPrefix] [HarmonyPatch("Update")] [HarmonyPatch("KillEnemy")] private static void Update_Prefix(FlowermanAI __instance) { List<AudioClip> soundFX = Plugin.SoundFX; if (soundFX != null && soundFX.Count != 0) { __instance.creatureAngerVoice.clip = Plugin.SoundFX[5]; int index = Random.Range(0, soundFX.Count - 1); __instance.crackNeckSFX = soundFX[index]; int instanceID = ((Object)__instance).GetInstanceID(); if (!logged.Contains(instanceID)) { logged.Add(instanceID); Plugin.Log.LogInfo((object)"Bracken anger about to play. Assigned clip"); } } } [HarmonyPrefix] [HarmonyPatch("LookAtFlowermanTrigger")] public static void LookAtFlowermanTrigger_Prefix(FlowermanAI __instance) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _nextPlayTime) { return; } _nextPlayTime = Time.time + 10f; List<AudioClip> soundFX = Plugin.SoundFX; if (soundFX != null && soundFX.Count != 0) { int index = Random.Range(0, soundFX.Count - 1); AudioClip val = soundFX[index]; Vector3 position = ((Component)__instance).transform.position; if (!((Object)(object)val == (Object)null)) { AudioSource.PlayClipAtPoint(val, ((Component)__instance).transform.position); PlayClipAtPointPitch(val, ((Component)__instance).transform.position, Random.Range(0.9f, 1.3f)); } } } public static void PlayClipAtPointPitch(AudioClip clip, Vector3 pos, float pitch) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("OneShotAudio"); val.transform.position = pos; AudioSource val2 = val.AddComponent<AudioSource>(); val2.clip = clip; val2.pitch = pitch; val2.spatialBlend = 1f; val2.Play(); Object.Destroy((Object)(object)val, clip.length / pitch); } } [BepInPlugin("REV310.TsundereBraken", "TsundereBraken", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string ModGuid = "REV310.TsundereBraken"; public const string ModName = "TsundereBraken"; public const string ModVersion = "1.0.0"; internal static ManualLogSource Log; internal static List<AudioClip> SoundFX = new List<AudioClip>(); internal static AssetBundle Bundle; private void Awake() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"Loading TsundereBraken..."); string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); string text = Path.Combine(directoryName, "tsunderesounds"); Bundle = AssetBundle.LoadFromFile(text); if ((Object)(object)Bundle == (Object)null) { Log.LogError((object)("Failed to load AssetBundle: " + text)); return; } SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList(); Log.LogInfo((object)$"Loaded AssetBundle. Audio clips found: {SoundFX.Count}"); new Harmony("REV310.TsundereBraken").PatchAll(); Log.LogInfo((object)"Patches applied."); } }