Decompiled source of ChristmasJester v1.0.2

ChristmasJester.dll

Decompiled a year ago
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 LCSoundTool;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("ChristmasJester")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ChristmasJester")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("fe94c053-1c3c-4f8b-94fe-77f086d76e81")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ChristmasJester;

[HarmonyPatch(typeof(JesterAI))]
internal class ChristmasJesterPatch
{
	[HarmonyPatch("Start")]
	[HarmonyPrefix]
	public static void ChristmasJesterPop(ref AudioClip ___screamingSFX)
	{
		___screamingSFX = ChristmasJesterBase.newSFX;
	}
}
[BepInPlugin("RaithSphere.ChristmasJester", "Christmas Jester", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class ChristmasJesterBase : BaseUnityPlugin
{
	private const string modGUID = "RaithSphere.ChristmasJester";

	private const string modName = "Christmas Jester";

	private const string modVersion = "1.0.0";

	internal ManualLogSource mls;

	internal static AudioClip newSFX;

	internal static AudioClip newSFX2;

	private readonly Harmony harmony = new Harmony("RaithSphere.ChristmasJester");

	private static ChristmasJesterBase _instance;

	private void Awake()
	{
		if ((Object)(object)_instance == (Object)null)
		{
			_instance = this;
		}
		((BaseUnityPlugin)this).Logger.Log((LogLevel)16, (object)"Defrosting");
		newSFX = SoundTool.GetAudioClip(Path.GetDirectoryName(((BaseUnityPlugin)_instance).Info.Location), "christmas.wav");
		newSFX2 = SoundTool.GetAudioClip(Path.GetDirectoryName(((BaseUnityPlugin)_instance).Info.Location), "christmas2.wav");
		harmony.PatchAll(typeof(ChristmasJesterBase));
		harmony.PatchAll(typeof(ChristmasJesterPatch));
		harmony.PatchAll(typeof(ChristmasJesterPatchWinup));
	}
}
[HarmonyPatch(typeof(JesterAI))]
internal class ChristmasJesterPatchWinup
{
	[HarmonyPatch("Start")]
	[HarmonyPrefix]
	public static void ChristmasJesterWind(ref AudioClip ___popGoesTheWeaselTheme)
	{
		___popGoesTheWeaselTheme = ChristmasJesterBase.newSFX2;
	}
}