Please disclose if your mod was created primarily 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 NeedMoreBullets v1.0.2
NeedMoreBullets.dll
Decompiled 9 months agousing 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 NeedMoreBullets.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("NeedMoreBullets")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("NeedMoreBullets")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("da41e8b8-9e23-4fdf-b281-a25ac4662271")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace NeedMoreBullets { [BepInPlugin("ta-xao.needmorebullets", "NeedMoreBullets", "1.0.2")] public class NeedMoreBullets : BaseUnityPlugin { private const string modGUID = "ta-xao.needmorebullets"; private const string modName = "NeedMoreBullets"; private const string modVersion = "1.0.2"; private readonly Harmony harmony = new Harmony("ta-xao.needmorebullets"); private static NeedMoreBullets Instance; internal ManualLogSource mls; internal static List<AudioClip> SoundFX; internal static AssetBundle Bundle; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("ta-xao.needmorebullets"); mls.LogInfo((object)"[NeedMoreBullets] 1.0.2 is loaded!"); harmony.PatchAll(typeof(TurretPatch)); mls = ((BaseUnityPlugin)this).Logger; SoundFX = new List<AudioClip>(); string location = ((BaseUnityPlugin)Instance).Info.Location; location = location.TrimEnd("NeedMoreBullets.dll".ToCharArray()); mls.LogInfo((object)("[NeedMoreBullets] Trying to load " + location + "needmorebulletsassetbundle.")); Bundle = AssetBundle.LoadFromFile(location + "needmorebulletsassetbundle"); if ((Object)(object)Bundle != (Object)null) { mls.LogInfo((object)"[NeedMoreBullets] Asset bundle loaded successfully."); SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList(); } else { mls.LogError((object)"[NeedMoreBullets] Failed to load asset bundle."); } } } } namespace NeedMoreBullets.Patches { [HarmonyPatch(typeof(Turret))] internal class TurretPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void OverrideAudio(Turret __instance) { __instance.berserkAudio.clip = NeedMoreBullets.SoundFX[0]; __instance.firingSFX = NeedMoreBullets.SoundFX[1]; __instance.firingFarSFX = NeedMoreBullets.SoundFX[2]; __instance.detectPlayerSFX = NeedMoreBullets.SoundFX[3]; } } }