using 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 UnityEngine;
using UpscreamHawkTuah.Patches;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("UpscreamHawkTuah")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UpscreamHawkTuah")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("74509a7b-52a5-4ee7-bd97-475b469ee660")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace UpscreamHawkTuah
{
[BepInPlugin("pudack.HawkTuah", "UpscreamHawkTuah", "1.0.0")]
public class UpscreamHawkTuahBase : BaseUnityPlugin
{
private const string modGUID = "pudack.HawkTuah";
private const string modName = "UpscreamHawkTuah";
private const string modVersion = "1.0.0";
private readonly Harmony harmony = new Harmony("pudack.HawkTuah");
internal static UpscreamHawkTuahBase instance;
internal ManualLogSource mls;
internal static List<AudioClip> sounds;
internal static AssetBundle bundle;
public void Awake()
{
if (instance == null)
{
instance = this;
}
mls = Logger.CreateLogSource("pudack.HawkTuah");
mls.LogInfo((object)"Upscream is spitting on that thang");
harmony.PatchAll(typeof(UpscreamHawkTuahBase));
harmony.PatchAll(typeof(EnemyUpscreamAnimPatch));
sounds = new List<AudioClip>();
string location = ((BaseUnityPlugin)instance).Info.Location;
location = location.TrimEnd("UpscreamHawkTuah.dll".ToCharArray());
bundle = AssetBundle.LoadFromFile(location + "hawktuah");
if (bundle == null)
{
mls.LogError((object)"Failed to load audio asset!");
return;
}
sounds = bundle.LoadAllAssets<AudioClip>().ToList();
mls.LogInfo((object)"Hawk has been tuahed");
}
}
}
namespace UpscreamHawkTuah.Patches
{
[HarmonyPatch(typeof(EnemyUpscreamAnim))]
internal class EnemyUpscreamAnimPatch
{
[HarmonyPatch("Awake")]
[HarmonyPostfix]
public static void ReplaceAudio(EnemyUpscreamAnim __instance)
{
__instance.sfxAttackLocal.Sounds = UpscreamHawkTuahBase.sounds.ToArray();
__instance.sfxAttackGlobal.Sounds = UpscreamHawkTuahBase.sounds.ToArray();
}
}
}