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.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("angryduck")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("angryduck")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("177ce422-ce2b-4a69-838c-55bec10d7e7f")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("atomiclabs.INeedMoreBulletHunter", "INeedMoreBullet Hunter", "1.0.0")]
public class INeedMoreBulletHunterMod : BaseUnityPlugin
{
public const string modGUID = "atomiclabs.INeedMoreBulletHunter";
public const string modName = "INeedMoreBullet Hunter";
public const string modVersion = "1.0.0";
public static INeedMoreBulletHunterMod instance;
internal ManualLogSource logger;
public AudioClip soundReload01;
public AudioClip soundReload02;
private AssetBundle bundle;
private void Awake()
{
logger = ((BaseUnityPlugin)this).Logger;
logger.LogInfo((object)"Loading INeedMoreBullet Hunter mod...");
if ((Object)(object)instance == (Object)null)
{
instance = this;
string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location);
bundle = AssetBundle.LoadFromFile(Path.Combine(directoryName, "ineedmorebullethunter"));
if ((Object)(object)bundle == (Object)null)
{
logger.LogError((object)"Failed to load asset bundle!");
return;
}
soundReload01 = bundle.LoadAsset<AudioClip>("reload01sound");
soundReload02 = bundle.LoadAsset<AudioClip>("reload02sound");
if ((Object)(object)soundReload01 == (Object)null || (Object)(object)soundReload02 == (Object)null)
{
logger.LogError((object)"Failed to load one or more reload sounds!");
}
else
{
logger.LogInfo((object)"Loaded reload sounds from asset bundle!");
}
}
else
{
Object.Destroy((Object)(object)this);
}
}
}
namespace INeedMoreBulletHunter.Patches;
[HarmonyPatch(typeof(EnemyHunterAnim))]
internal class EnemyHunterAnimPatch
{
[HarmonyPatch("Awake")]
[HarmonyPostfix]
private static void ReplaceAudio(EnemyHunterAnim __instance)
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Expected O, but got Unknown
if ((Object)(object)INeedMoreBulletHunterMod.instance.soundReload02 != (Object)null)
{
Sound val = new Sound();
val.Sounds = (AudioClip[])(object)new AudioClip[1] { INeedMoreBulletHunterMod.instance.soundReload02 };
__instance.soundReload02 = val;
INeedMoreBulletHunterMod.instance.logger.LogInfo((object)("[AUDIO] Reload sound 02 replaced -> " + ((Object)INeedMoreBulletHunterMod.instance.soundReload02).name));
}
else
{
INeedMoreBulletHunterMod.instance.logger.LogError((object)"[AUDIO] Failed to get soundReload02.");
}
if ((Object)(object)INeedMoreBulletHunterMod.instance.soundReload01 != (Object)null)
{
Sound val = new Sound();
val.Sounds = (AudioClip[])(object)new AudioClip[1] { INeedMoreBulletHunterMod.instance.soundReload01 };
__instance.soundReload01 = val;
INeedMoreBulletHunterMod.instance.logger.LogInfo((object)("[AUDIO] Reload sound 01 replaced -> " + ((Object)INeedMoreBulletHunterMod.instance.soundReload01).name));
}
else
{
INeedMoreBulletHunterMod.instance.logger.LogError((object)"[AUDIO] Failed to get soundReload01.");
}
}
}