using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
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("Bouncing BingBong")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Bouncing BingBong")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("ae0c5bee-54bc-4201-aa75-59af517a459a")]
[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 BouncingBingBong;
[BepInPlugin("andrewfenton.Bouncing_Bingbong", "Bouncing BingBong", "1.0.0")]
public class BouncingBingBongPlugin : BaseUnityPlugin
{
public const string PluginGUID = "andrewfenton.Bouncing_Bingbong";
public const string PluginName = "Bouncing BingBong";
public const string PluginVersion = "1.0.0";
private void Awake()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Bouncing BingBong is loaded!");
Harmony val = new Harmony("andrewfenton.Bouncing_Bingbong");
val.PatchAll();
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Bouncing BingBong patched successfully!");
}
}
public class BouncyBingBong : MonoBehaviour
{
private Item item;
private Rigidbody rigidbody;
private const float bounceMultiplier = 0.9f;
private const float minVelocityThreshold = 2f;
private float lastBounceTime = 0f;
private const float bounceCooldown = 0.3f;
private void Start()
{
item = ((Component)this).GetComponent<Item>();
rigidbody = ((Component)this).GetComponent<Rigidbody>();
}
public void OnCollisionEnter(Collision collision)
{
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)rigidbody != (Object)null) || Object.op_Implicit((Object)(object)collision.gameObject.GetComponent<Character>()) || Time.time - lastBounceTime < 0.3f)
{
return;
}
Vector3 linearVelocity = rigidbody.linearVelocity;
if (((Vector3)(ref linearVelocity)).magnitude > 2f)
{
lastBounceTime = Time.time;
Vector3 normal = ((ContactPoint)(ref collision.contacts[0])).normal;
Vector3 val = Vector3.Reflect(linearVelocity, normal);
Vector3 val2 = val * 0.9f;
if (Vector3.Dot(normal, Vector3.up) > 0.5f && val2.y < 10f)
{
val2.y = 10f;
}
rigidbody.linearVelocity = val2;
}
}
}
[HarmonyPatch]
public class BingBongPatch
{
[HarmonyPostfix]
[HarmonyPatch(typeof(Item), "Start")]
private static void Postfix(Item __instance)
{
if (((Object)((Component)__instance).gameObject).name.Contains("BingBong") && (Object)(object)((Component)__instance).GetComponent<BouncyBingBong>() == (Object)null)
{
((Component)__instance).gameObject.AddComponent<BouncyBingBong>();
Debug.Log((object)("Added BouncyBingBong component to " + ((Object)((Component)__instance).gameObject).name));
}
}
}