using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using RudyFarts.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("RudyFarts")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RudyFarts")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9da3f4c9-6c38-4965-a9f0-7564bfe0953e")]
[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 RudyFarts
{
[BepInPlugin("Rudy.RudyFarts", "Rudy Farts", "1.0.0")]
public class RudyFartsBase : BaseUnityPlugin
{
private const string modGUID = "Rudy.RudyFarts";
private const string modName = "Rudy Farts";
private const string modVersion = "1.0.0";
private readonly Harmony harmony = new Harmony("Rudy.RudyFarts");
private static RudyFartsBase Instance;
internal ManualLogSource mls;
private void Awake()
{
mls = Logger.CreateLogSource("Rudy.RudyFarts");
mls.LogInfo((object)"RudyFarts has loaded.");
harmony.PatchAll(typeof(StartOfRoundPatch));
}
}
}
namespace RudyFarts.Patches
{
internal class StartOfRoundPatch
{
[HarmonyPatch(typeof(PlayerControllerB), "Jump_performed")]
[HarmonyPrefix]
private static void Prefartfix()
{
WhoopieCushionItem val = Resources.FindObjectsOfTypeAll<WhoopieCushionItem>()[0];
AudioClip[] fartAudios = val.fartAudios;
StartOfRound.Instance.playerJumpSFX = fartAudios[Random.Range(0, fartAudios.Length - 1)];
}
}
}