using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using CopyrightBGonePeter.Patches;
using GameNetcodeStuff;
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("CopyrightBGone(peter)")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CopyrightBGone(peter)")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("5fa1fb20-193b-409b-bb5b-7acfc5681540")]
[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 CopyrightBGonePeter
{
[BepInPlugin("Ludumancer.CopyrightBGone.Peter", "Copyright B-Gone! (Peter)", "1.0.0.0")]
public class CRBGPeterBase : BaseUnityPlugin
{
private const string modGUID = "Ludumancer.CopyrightBGone.Peter";
private const string modName = "Copyright B-Gone! (Peter)";
private const string modVersion = "1.0.0.0";
private readonly Harmony harmony = new Harmony("Ludumancer.CopyrightBGone.Peter");
private static CRBGPeterBase Instance;
internal ManualLogSource log;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
log = Logger.CreateLogSource("Ludumancer.CopyrightBGone.Peter");
log.LogInfo((object)"Copyright B-Gone (Peter) is now active!");
harmony.PatchAll(typeof(CRBGPeterBase));
harmony.PatchAll(typeof(StartMatchLeverPatch));
}
}
}
namespace CopyrightBGonePeter.Patches
{
internal class StartMatchLeverPatch
{
private static int checkForObject;
[HarmonyPatch(typeof(StartMatchLever), "Start")]
[HarmonyPrefix]
private static void StartPrefix()
{
checkForObject = 0;
}
[HarmonyPatch(typeof(StartMatchLever), "PullLever")]
[HarmonyPrefix]
private static void BeginSearch()
{
checkForObject = 100;
}
[HarmonyPatch(typeof(PlayerControllerB), "Update")]
[HarmonyPrefix]
private static void MutePeterIntro()
{
if (checkForObject > 0)
{
checkForObject--;
GameObject val = GameObject.Find("PeterOpening");
AudioSource component = val.GetComponent<AudioSource>();
component.mute = true;
}
}
}
}