Decompiled source of FruitBoulders v1.0.3

Mods/FruitBoulders.dll

Decompiled 16 hours ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using FruitBoulders;
using HarmonyLib;
using Il2CppRUMBLE.MoveSystem;
using MelonLoader;
using RumbleModdingAPI.RMAPI;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Class1), "FruitBoulders", "1.0.3", "SpooderCode", null)]
[assembly: MelonGame(null, null)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("FruitBoulders")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("FruitBoulders")]
[assembly: AssemblyTitle("FruitBoulders")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace FruitBoulders;

public class Class1 : MelonMod
{
	[HarmonyPatch(typeof(Structure), "OnFetchFromPool")]
	public static class setMesh
	{
		public static void Postfix(Structure __instance)
		{
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			if (((Object)((Component)__instance).gameObject).name == "Ball")
			{
				if (((Component)__instance).transform.childCount < 2)
				{
					GameObject val = new GameObject();
					val.AddComponent<MeshFilter>().mesh = fruitmesh;
					((Renderer)val.AddComponent<MeshRenderer>()).material = fruitmat;
					val.transform.SetParent(((Component)__instance).gameObject.transform, false);
					val.transform.localPosition = new Vector3(0.03f, 0f, 0f);
					val.transform.eulerAngles = new Vector3(Random.Range(-180f, 180f), Random.Range(-180f, 180f), Random.Range(-180f, 180f));
					val.transform.localScale = Vector3.one * 1.4f;
					((Renderer)((Component)((Component)__instance).gameObject.transform.GetChild(0)).GetComponent<MeshRenderer>()).enabled = false;
				}
				else
				{
					((Component)__instance).transform.GetChild(1).localPosition = new Vector3(0.03f, 0f, 0f);
				}
			}
		}
	}

	public static Mesh fruitmesh;

	public static Material fruitmat;

	public override void OnLateInitializeMelon()
	{
		Actions.onMapInitialized += fruitify;
	}

	public void fruitify(string e)
	{
		GameObject gameObject = PoolFruitRUMBLEEnvironmentFruit.GetGameObject();
		fruitmesh = ((Component)gameObject.transform.GetChild(0)).GetComponent<MeshFilter>().mesh;
		fruitmat = ((Renderer)((Component)gameObject.transform.GetChild(0)).GetComponent<MeshRenderer>()).material;
	}
}