using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Logging;
using CreepyBrackens.Patches;
using GameNetcodeStuff;
using HarmonyLib;
using JesterOutro.Patches;
using UnityEngine;
using UnityEngine.Networking;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("JesterOutro")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("JesterOutro")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("4b0222b1-8b35-46ee-aa88-3b7444c7f778")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}
namespace CreepyBrackens.Patches
{
[HarmonyPatch(typeof(PlayerControllerB))]
internal class SwitchItemSlotPatch
{
[HarmonyPatch(typeof(PlayerControllerB), "SwitchToItemSlot")]
[HarmonyPostfix]
private static void SwitchSlotPatch(PlayerControllerB __instance)
{
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
ManualLogSource val = Logger.CreateLogSource("ColtG5.JesterOutro");
val.LogInfo((object)$"Switching to item slot {__instance.currentItemSlot}");
RoundManager instance = RoundManager.Instance;
Vector3 position = ((Component)__instance).transform.position;
position.x += 10f;
instance.SpawnEnemyGameObject(position, 0f, 7);
}
}
}
namespace JesterOutro
{
[BepInPlugin("ColtG5.JesterOutro", "JesterOutro", "1.0.0")]
public class JesterOutro : BaseUnityPlugin
{
private const string modGUID = "ColtG5.JesterOutro";
private const string modName = "JesterOutro";
private const string modVersion = "1.0.0";
private readonly Harmony harmony = new Harmony("ColtG5.JesterOutro");
private static JesterOutro Instance;
internal ManualLogSource mls;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
mls = Logger.CreateLogSource("ColtG5.JesterOutro");
harmony.PatchAll(typeof(JesterStartPatch));
harmony.PatchAll(typeof(SwitchItemSlotPatch));
mls.LogInfo((object)"Successfully patched JesterOutro into the game !!!!");
}
}
}
namespace JesterOutro.Patches
{
[HarmonyPatch(typeof(JesterAI))]
internal class JesterStartPatch
{
[HarmonyPatch("SetJesterInitialValues")]
[HarmonyPostfix]
private static async void SetJesterInitialValuesPatch(JesterAI __instance)
{
string path1 = "file://" + Paths.PluginPath + "\\ColtG5-JesterOutro\\First_part.mp3";
UnityWebRequest audioClip1 = UnityWebRequestMultimedia.GetAudioClip(path1, (AudioType)13);
audioClip1.SendWebRequest();
while (!audioClip1.isDone)
{
await Task.Delay(100);
}
AudioClip clip1 = DownloadHandlerAudioClip.GetContent(audioClip1);
string path2 = "file://" + Paths.PluginPath + "\\ColtG5-JesterOutro\\bigPART.mp3";
UnityWebRequest audioClip2 = UnityWebRequestMultimedia.GetAudioClip(path2, (AudioType)13);
audioClip2.SendWebRequest();
while (!audioClip2.isDone)
{
await Task.Delay(100);
}
AudioClip clip2 = DownloadHandlerAudioClip.GetContent(audioClip2);
__instance.popGoesTheWeaselTheme = clip1;
__instance.popUpTimer = clip1.length;
__instance.popUpSFX = clip2;
}
}
[HarmonyPatch(typeof(RoundManager))]
internal class RoundManagerStartPatch
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
private static void StartPatch(RoundManager __instance)
{
ManualLogSource val = Logger.CreateLogSource("ColtG5.JesterOutro");
val.LogInfo((object)"RoundManager.Start() called");
__instance.valueOfFoundScrapItems = 6969;
}
}
internal class TerminalPatch
{
}
}