using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LCDreamMaskMod.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("LCDreamMaskMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LCDreamMaskMod")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("eaea5bc3-588e-437f-b110-3218c0c252e8")]
[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 LCDreamMaskMod
{
[BepInPlugin("Infecta.DreamMaskMod", "Dream Mask", "1.0.0")]
public class DreamMaskModBase : BaseUnityPlugin
{
private const string modGUID = "Infecta.DreamMaskMod";
private const string modName = "Dream Mask";
private const string modVersion = "1.0.0";
private readonly Harmony harmony = new Harmony("Infecta.DreamMaskMod");
internal static AudioClip[] newSFX;
private static DreamMaskModBase Instance;
internal ManualLogSource mls;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
mls = Logger.CreateLogSource("Infecta.DreamMaskMod");
AssetBundle val = AssetBundle.LoadFromFile(((BaseUnityPlugin)Instance).Info.Location.TrimEnd("LCDreamMaskMod.dll".ToCharArray()) + "dreammask");
mls.LogInfo((object)"Dream Mask has awaken");
newSFX = val.LoadAssetWithSubAssets<AudioClip>("assets/mask.mp3");
harmony.PatchAll(typeof(MaskedPlayerEnemyPatch));
harmony.PatchAll(typeof(DreamMaskModBase));
}
}
}
namespace LCDreamMaskMod.Patches
{
[HarmonyPatch(typeof(MaskedPlayerEnemy))]
[HarmonyPatch("PlayFootstepSound")]
internal class MaskedPlayerEnemyPatch
{
[HarmonyPatch("PlayFootstepSound")]
[HarmonyPrefix]
private static void dreamMaskFootstep(MaskedPlayerEnemy __instance)
{
AudioClip[] newSFX = DreamMaskModBase.newSFX;
AudioClip clip = newSFX[0];
__instance.movementAudio.clip = clip;
__instance.movementAudio.Play();
}
}
}